4 ms·
Is there/will there be multi-tenant support for auth in Supabase?
by tjchear 6y ago
Is there/will there be multi-tenant support for auth in Supabase?
- kiwicopple 6y agoI may have misunderstood the question so feel free to push back if this doesn't make sense - We use Postgres Row Level (RLS) security, so you can do some very advanced rules. For example, one of our team built a social network with PG and RLS: https://github.com/steve-chavez/socnet/blob/f1abaadaaedb7c8e9a9a57fbe3a555fb767a5266/security/posts.sql#L67-L82 https://github.com/steve-chavez/socnet/blob/f1abaadaaedb7c8e... RLS is flexible enough to cover multi-tenant scenarios, though it's up to you how you structure your schema to make it work.
- tjchear 6y agoAre there plans to introduce an API similar to this then? https://cloud.google.com/identity-platform/docs/multi-tenancy-authentication https://cloud.google.com/identity-platform/docs/multi-tenanc...
- kiwicopple 6y agoInteresting, I will have to investigate how this propagates through to their underlying database. I'm guessing this just changes where the data is being written inside a Firebase project? There are several strategies for multi-tenancy in postgres. You can create a completely new database, a schema, or a have the tenancy as rules/logic in the same schema. I'd prefer the latter right now since RLS enables it so easily and it's more flexible - you can create the policies for your own tenancy structure.