Overview
FoN uses three distinct authentication mechanisms, depending on the endpoint you’re calling. Most endpoints rely on a session cookie, a small set of token-management endpoints accept a JWT Bearer token, and uploads via the v1 API accept a long-lived API token.Authentication Methods
Session Cookies
When you log in (or complete an OAuth flow), the API sets a secure HTTP-only cookie namedauth-token containing a JWT, valid for 24 hours. This cookie is automatically sent by browsers with subsequent requests, and is what the vast majority of endpoints check via getCookie(event, 'auth-token').
Session cookies are automatically managed by the browser. For non-browser clients (scripts, curl, etc.), you can authenticate the same way by sending the JWT from the login response as a cookie:
Cookie: auth-token=YOUR_JWT_TOKEN.Log In
Use the Session Cookie
Send thetoken value from the login response as the auth-token cookie on subsequent requests to session-based endpoints:
JWT Bearer Tokens
The same JWT returned from login can also be passed as a Bearer token, but only for the token-management endpoints (/api/auth/tokens, /api/auth/tokens/generate, and /api/auth/tokens/{id}). These endpoints are how you generate and manage long-lived API tokens.
API Tokens
API tokens are long-lived, raw 64-character hex strings designed for programmatic access. They’re ideal for scripts, bots, and integrations, and are accepted only by/api/v1/upload.
Generate a Token
Use the Token
Revoke a Token
OAuth
FoN supports OAuth authentication with:- Apple
- Meta (Facebook)
Multi-Factor Authentication (MFA)
For enhanced security, enable MFA on your account.Setup MFA
1
Scan QR Code
Use an authenticator app (Google Authenticator, Authy, etc.) to scan the QR code
2
Verify Setup
Enter a code from your authenticator to verify setup:
3
Save Backup Codes
Store your 10 backup codes securely. Each can be used once if you lose access to your authenticator.
Login with MFA
When MFA is enabled, include the code in your login request:Password Management
Change Password
This endpoint authenticates via theauth-token session cookie:
Reset Password
Request a password reset email:The
mfaCode field is only required if MFA is enabled on the account.Security Best Practices
Use API tokens for automation
Use API tokens for automation
API tokens are designed for programmatic access and can be revoked individually without affecting your main account.
Enable MFA
Enable MFA
Multi-factor authentication adds an extra layer of security to your account.
Rotate tokens regularly
Rotate tokens regularly
Periodically generate new API tokens and revoke old ones.
Never commit tokens to version control
Never commit tokens to version control
Use environment variables or secret management tools to store tokens.