Supported Providers
| Provider | Initiation Endpoint | Callback Endpoint |
|---|---|---|
GET /api/auth/oauth/google | GET /api/auth/callback/google | |
| Apple | GET /api/auth/oauth/apple | GET /api/auth/callback/apple |
| Meta | GET /api/auth/oauth/meta | GET /api/auth/callback/meta |
OAuth Flow
OAuth authentication follows the standard flow:1
Initiate OAuth
Redirect the user to the OAuth initiation endpoint:
2
User Authenticates
User authenticates with the OAuth provider (Google, Apple, or Meta)
3
Callback
Provider redirects back to FoN’s callback endpoint with authorization code
4
Session Created
FoN creates a session and redirects to the application with authentication cookie set
Implementation
Web Applications
For web applications, simply link to the OAuth endpoint:Single Page Applications
For SPAs, open a popup or redirect:Mobile Applications
For mobile apps, use a webview or in-app browser:After OAuth
After successful OAuth authentication:- A session is created on FoN
- An
auth-tokencookie is set - The user is redirected to your application
Notes
- OAuth creates or links to a FoN account
- If the OAuth email matches an existing account, it’s linked
- Users can have multiple OAuth providers linked to one account
- MFA can still be enabled alongside OAuth