Prerequisites
If you haven’t done so already:- Complete the steps in the OAuth configuration guide
- Enable the Frontend SDKs in your Stytch Dashboard and enable Create Organizations under “Enabled Methods.”
Add OAuth providers to your UI config
To surface the OAuth providers you wish to support in the UI, add them to the UI config for your authentication flow.You can add multiple OAuth providers by including additional provider objects in the
providers array. See the OAuth providers guide for more information on configuring specific providers.Render the UI component
Render the Stytch UI component on the Redirect URL(s) that you specified in the Stytch Dashboard during the configuration steps. When rendered, the UI component will automatically:- Handle the OAuth redirect from Stytch based on the
stytch_token_type - For Discovery flows, prompt the user with their discovered organizations and handle their selection
- For Organization-specific flows, log the user in directly
Test your integration
Start your application and test the OAuth flow:- Navigate to your login page
- Click on an OAuth provider button (e.g., “Continue with Google”)
- Complete the OAuth flow with the provider
- Verify that you’re redirected back to your application and authenticated