Multi-tenant app where each tenant can have user login
Hi all,
Just wondering if anyone has done this before or has some thoughts on how to approach it.
I have a need to facilitate users being able to log in across multiple tenants, ideally with independent login credentials, where they will have different permissions in each tenant. For example, User A is an admin of Tenant A but is only a user of Tenant B. The ideal scenario would be that User A is never made aware of the fact that Tenant A and Tenant B run on the same platform.
Is it possible to do this with Supabase auth or would I need to roll my own auth solution? As far as I understand it, I would not be able to segregate
auth.users
auth.users
by tenant by adding a unique
tenant_id - email
tenant_id - email
constraint instead of just
email
email
being unique, but please correct me if that assumption is wrong
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.