How to use st.login in combination with supabase RLS

Hi there,

Currently I have a custom login logic that uses Supabase for authentication using the st_supabase_connection module. Although it’s working it’s a bit buggy.

I would love to switch to the new st.login feature with OIDC login. From what I understand Supabase is not an OIDC provider. However; I’m happy if only Microsoft users can login so I can use Microsoft for this; which is working.

Accessing the Supabase database with RLS however I need to authenticate the user who logged in with Microsoft there.

Any ideas on how to achieve this in the best way?

I could login with an ID token in Supabase but I’m not getting this back the way st.login handles the login. I could create a fake user in supabase and then login with this one but this feels hacky.

Hope somebody can help how to best achieve this.

Thanks,
Bart

1 Like