Finbuckle / Finbuckle.MultiTenant

Finbuckle.MultiTenant is an open-source multitenancy middleware library for .NET. It enables tenant resolution, per-tenant app behavior, and per-tenant data isolation.
https://www.finbuckle.com/multitenant
Apache License 2.0
1.33k stars 265 forks source link

Best practices on multitenancy #606

Open dalton5 opened 2 years ago

dalton5 commented 2 years ago

Hi,

I wonder how the multitenancy works when I am with the super admin that will manage the tenants.

How can I setup this part? The tenant info will be null?

Thanks

AndrewTriesToCode commented 2 years ago

Hi, I've helped a few projects with this, but can tell me what sorts of activities specifically the super admin will do managing tenants? Also how are you currently doing authentication?

dalton5 commented 2 years ago

My saas will provide some features to my users. But I would like to also have an admin to manage tenants, users globally and also add some other features that users can't access. I plan to use policies, etc ... But on a multitenantstandpint, should I create a tenant admin?

For example if I have: customer1.exemple.com, customer2.example.com my admin should be: admin.example.com?

Or may I use example.com/admin?

YesI am doing authentication.

What are the best practices?

Thanks,

ZedZipDev commented 1 year ago

This is useful article and code https://medium.com/@zahidcakici/multitenancy-and-finbukcle-in-net-f1d5e7e5f1bf

AndrewTriesToCode commented 1 year ago

That's a good article linked above. I'll add that a "root" or "super" admin is a common request and seems to work well. There isn't built in support for this, but it can be achieved by use of IgnoreQueryFilter in when using the dbcontext as the super tenant to return all results.

Some other thoughts: