Supabase Auth session works, but RLS treats the request as unauthenticated in Flask
What I’m trying to do
I’m building a Flask backend that calls Supabase via the async Python client. The user successfully signs in and auth.get_user() returns the expected profile, but any subsequent SELECT on the users table returns zero rows. RLS seems to think the request is anonymous.
Environment
- OS: MacOS Sequoia 15.5
- Supabase client: supabase>=2.16.0
- Python: 3.13.5
- Flask: 3.1.1
Client setup
Sign-in
Read all users
Read users route
RLS policy
What’s going wrong
Even though the session is live and the JWT is attached, Postgres behaves as if the role is anon instead of authenticated, so the SELECT is filtered out by RLS.
What I’m looking for
- An explanation of what exactly causes this problem.
- Any pointers on which extra header / cookie / claim Supabase expects when using the async Python client in Flask.
- Known gotchas when combining Flask session storage with the supabase library.
- A minimal working example (with SUPABASE_ANON_KEY) that proves RLS + Supabase Auth with Python works on the server side.