Learn how to use AuthKit with your Supabase application.
This guide outlines the steps to use WorkOS as a Supabase third-party auth provider. This will allow you to authenticate users with AuthKit and use AuthKit access tokens to access Supabase’s REST and GraphQL APIs in your app.
Supabase RLS policies expect a role
claim in the access token that corresponds to a database role. WorkOS already adds a role
claim corresponding to the user’s role in an organization. Set up a JWT template in the WorkOS dashboard (Authentication → Sessions) so that the role works with Supabase:
We add a user_role
claim so that your application can still determine the role assigned to that user.