© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•14mo ago•
51 replies
dachsteinhustler

Supabase Python Understanding Struggles - how to do OAuth for multiple users and which token to stor

Initially I got supabase auth working fine with my python project for both email + password as well as Google OAuth.

Then I realized I use a single supabase client for all users, which meant that all users shared the same user profile lol.

I'm handling all the supabase auth stuff in my python backend fyi, i.e. redirection, exchange code for session etc.

Now I'm trying to figure out:

A) Which token do I need to store as a cookie to persist sessions? I.e. when a user logs in from the same browser but with a different tab, the user should be logged in automatically

B) How to pass the token from the cookie to the supabase client to retrieve the correct session?

C) Google OAuth: when using the global supabase instance, I can login with google. In my tests however I always fetched a new supabase instance on each page load. Afterwards I get redirected from google with the
code=
code=
in the header. But now I get the classic
oth auth code and code verifier should be non-empty
oth auth code and code verifier should be non-empty
error. This makes me think: can't I use separate supabase clients for OAuth?

My main source of knowledge are the docs: https://supabase.com/docs/reference/python/auth-setsession , happy about any other resources.
Python: Set the session data | Supabase Docs
Supabase API reference for Python: Set the session data
Python: Set the session data | Supabase Docs
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements
Next page

Similar Threads

How do you create multiple users for Supabase Studio?
SupabaseSSupabase / help-and-questions
6mo ago
Access Token from Google OAuth to supabase?
SupabaseSSupabase / help-and-questions
3y ago
How to use token in URL for Supabase Storage?
SupabaseSSupabase / help-and-questions
3y ago
how to order by multiple columns in supabase-python?
SupabaseSSupabase / help-and-questions
3y ago