Many modern SAAS products employ a global account system where an email is unique throughout the entire platform. Tenants invite users via their email, and once authenticated, users can select which tenant they wish to access.
For instance, in Notion, I can switch between three different workspaces (or tenants) that I either own or have been invited to. This allows me to access tenant-specific data.
Here's how another SAAS product does it, when I login I need to select which account (tenant) I want to access
By default, it seems aspnetzero doesn't support this feature. Has any client managed to implement a similar system using the platform?
In essence, the modification should be straightforward. We'd need to update the TenantId in the AbpUsers table to accommodate a list of TenantIds or introduce a new table capturing which tenants a user can access. The login process would then display available tenants for users to choose from. Upon selection, users are directed to the respective tenant's subdomain or provided with a tenant-specific cookie header.
5 Answer(s)
-
0
Hi,
AspNet Zero has a linked accounts feature, see https://docs.aspnetzero.com/en/aspnet-core-angular/latest/Features-Angular-User-Menu#linked-accounts.
A User can link another user account to his/her account and login via linked account. So, maybe you can automatically create linked accounts via invitation and use this feature. Does that work for you ?
-
0
Yeah this could work but will be a bit janky, the ideal setup would be for a user to just have one email & password and to login to the app and be able to switch between tenants.
-
0
Hi @harley.mcphee,
You can create a custom controller and update your user tenantId and it will change the user's tenant. And you could unique the email.
-
0
m.aliozkaya, the issue is the user needs to be associated with many tenants, not just one.
-
0