Overview
The<SSOCallback /> component handles OAuth and SSO authentication callbacks from external providers. It processes the authentication response, completes the sign-in flow, and manages various callback scenarios including success, error, and completion requirements.
Basic Usage
Props
Callback function called when authentication succeeds. Receives the session object and optional redirect URI.
Callback function called when authentication fails. Receives the error object.
Callback function called when the sign-up attempt requires additional information. Receives the signup attempt and session objects.
Whether to automatically redirect after successful authentication.
Custom message displayed while processing the callback.
Message displayed after successful authentication.
Message displayed when authentication fails.
Whether to show the profile completion form when additional information is required.
What it includes
The component handles the complete OAuth/SSO callback flow:Callback Processing
- Extracts OAuth authorization code from URL parameters
- Validates state parameter for security
- Exchanges authorization code for access token
- Retrieves user information from provider
Session Management
- Creates authenticated session
- Sets secure authentication cookies
- Updates user profile with provider data
- Links social accounts to existing users
Completion Handling
- Checks if profile completion is required
- Shows completion form if additional info needed
- Handles successful authentication
- Manages error scenarios
Supported Providers
- Google, GitHub, Microsoft, Facebook, Discord, LinkedIn, Twitter, Slack
- SAML 2.0 and OpenID Connect providers
- Custom enterprise SSO providers
Related Components
<SignInForm />- Main authentication form<SignUpForm />- User registration form<UserButton />- User profile dropdown
