9 Answer(s)
-
0
Hi,
This is possible but it will cause some problems. Can you explain your use-case a litttle bit more so we can have a better idea ?
Thanks.
-
0
Currently, there are two ways of logging into the system for the multi tenant applications.
- Use subdomain routing to identify the tenant.
- If we do not use subdomains for routing, then the user has to provide the tenancy name on the login screen to identify the tenant.
We want to be able to login to the application from the same login screen. Since the user is tied to a tenant, it should be possible to set the tenant after authenticating the user. Is that right?
We don't plan on using separate databases for the tenants.
-
0
Hi,
In your project you can override LoginManager's LoginAsyncInternal method and set tenant after finding user. See <a class="postlink" href="https://github.com/aspnetboilerplate/module-zero/blob/master/src/Abp.Zero/Authorization/AbpLoginManager.cs#L73">https://github.com/aspnetboilerplate/mo ... ger.cs#L73</a>
-
0
Thank you. I'll take a look at it.
You mentioned before that there might be some issues when we set the tenantid after completing the authentication. Can you tell me what they are?
-
0
Hi,
It was related to DB per tenant, as you can guess it is not a problem in your case.
-
0
I'm looking at it now. But I'm not sure how to query across the tenants. Do you have documentation on that?
-
0
Hi,
You can disable the tenancy filter and query all users, see <a class="postlink" href="https://aspnetboilerplate.com/Pages/Documents/Data-Filters#DocDisableFilters">https://aspnetboilerplate.com/Pages/Doc ... bleFilters</a>.
Thanks.
-
0
Thank you that worked.
-
0
Great :).