Authentication
Callback
Complete OAuth authorization flow.
Validates the state token, exchanges the authorization code for tokens, and creates or updates the user record. Returns JWT tokens.
Flow:
- Validate state token and check expiration
- Resolve provider configuration
- Exchange code for tokens via provider handler
- Fetch user info via provider handler
- Link to existing user or create new user/account
- Generate JWT tokens and return response
POST
Callback
Path Parameters
Body
application/json
Response
Successful Response
Response for successful OAuth callback authentication.
JWT access token
JWT refresh token
Access token expiration time in seconds
Account information
User information
Whether a new user was created
Whether a new account was created
Previous
SsoInitiate SAML Single Sign-On flow.
Redirects the user to the Identity Provider's SSO URL with a SAML AuthnRequest.
Args:
request: FastAPI request object.
account: Account identifier (slug or ID).
provider: Optional provider name to use (e.g., 'okta', 'azure_ad').
If not specified, uses the configured provider for the account.
relay_state: Optional state to return after successful authentication.
session: Database session.
Returns:
RedirectResponse to the IdP.
Next
Callback