Learn how to use WorkOS with your existing Supabase applications.
This guide outlines the steps to make WorkOS SSO connections available to your Supabase application. It will require a few changes to your existing Supabase application code.
Supabase uses the WorkOS Client ID and API Key to initiate the authentication flow and to return the SSO user profile. The first step is finding the Client ID and the API Key in the WorkOS dashboard.
In the WorkOS dashboard, go to Configuration and under the "Settings" tab and copy the Client ID.
Select API Keys on the left-side navigation bar and either copy an existing API Key or create a new API Key and copy it.
Sign in to Supabase and then go to your Supabase Project Dashboard. Navigate to Authentication → Explore Auth.
Select the Providers tab and scroll down to WorkOS and enter the WorkOS URL as https://api.workos.com. Then enter the Client ID and API Key copied from the WorkOS Dashboard, toggle to enable WorkOS as a provider and click Save.
Copy the Redirect URL from the WorkOS provider section. In the WorkOS dashboard navigate to Configuration → Settings → Redirect URIs and click Edit Redirect URIs to input the copied Redirect URL.
When a user signs in, call signInWithOAuth with workos as the provider. Pass in a Connection ID, Organization ID, or provider type (for OAuth) under queryParams.