Authentication flow
Prerequisites
If you haven’t done so already:- If you’d like to have a provider to test with, complete the steps in the SSO Provider Setup guide for an Organization that you’re a Member of.
- Enable the Frontend SDKs in your Stytch Dashboard.
Add SSO to your UI config
To surface SSO in the UI, includeB2BProducts.sso in the products array of your configuration.
SSO can be used in both Discovery and Organization-specific flows. Use Discovery if you need to determine the user’s Organization before completing authentication.
Render the UI component
Render the Stytch UI component on the Redirect URL(s) that you specified in the Stytch Dashboard during setup. When rendered, the UI component will automatically:- Handle the SSO redirect based on the
stytch_token_type - For Discovery flows, prompt the user to select an Organization and finish authentication
- For Organization-specific flows, complete authentication directly
Test your integration
First, ensure the Organization you will log into has an sso provider configured. Then, start your application and test the SSO flow:- Navigate to your login page
- Click the SSO button
- Complete the SSO flow with your IdP
- Verify that you’re redirected back to your application and authenticated