Use supabase as an OIDC provider #42685
Replies: 1 comment 2 replies
|
This is a structural limitation of Supabase’s current design, not “missing docs”. Supabase has a hard separation between:
Every Supabase “project” is effectively its own isolated deployment boundary (kong, auth, rest, postgres, storage, edge-functions, etc.). Because of that, “Project A is the OIDC provider for Project B” isn’t just enabling OIDC — it’s asking for federation between two independent data-plane stacks. Even if Project B can verify an external JWT (stateless), you still hit two practical issues:
How we solved it (control-plane user -> project-scoped access without duplicating users)We built a small “platform gateway” that bridges control plane identities into each project without registering the same user in every project. High-level idea:
Concretely we implemented:
This gives us:
Minimal “simple solution” for the OP (actionable)If you want the simplest workable approach today, do this: A) Put a gateway in front of tenant projects (Next.js API routes, Edge Functions, or any API)
Client usage becomes: const supabase = createClient( Now supabase.auth.getUser(), supabase.auth.getSession(), and supabase.from(...).select(...) work, This is not “native Supabase federation”, but it is a clean, minimal pattern that works with |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I want to use a separate suupabase project as my OIDC provider from a separate supabase project, how can I do this without hacky workarounds?
All reactions