Clerk Auth with Supabase Edge
Hey everyone! How do you guys go about RLS policies when using the Clerk Authentication? I notice that Clerk users dont show up on Supabase User list and the JWTs dont get passed accordingly.
Im using Expo - Supabase - Clerk as my stack atm
3 Replies
https://supabase.com/docs/guides/auth/third-party/clerk#using-rls-policies
You are not using Supabase auth schema or server at all so no users will show up in the authenticated section.
RLS and processing the JWT is independent of the auth system.
Right now I am disabling the flag for
verify_jwt
and within the edge running the checks manually on whether a user can call the function
so wanted to clarify if that is how its supposed to be done in terms of standardsIf you just pass the user JWT on in your authorization header for SB calls RLS will be checked as if it where a Supabase JWT but with different claims. So auth.jwt() works.
Here is a user decoding to verify the Clerk JWT... https://github.com/orgs/supabase/discussions/34988#discussioncomment-12862256
And another:
https://github.com/orgs/supabase/discussions/34988#discussioncomment-14293910