Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/ Check the samples, to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, please use the search on the homepage.
- ABP Framework version: v4.0.2
- UI type: Angular
- DB provider: EF Core
- Tiered (MVC) or Identity Server Seperated (Angular): Identity Server Seperated
- Exception message and stack trace: -
- Steps to reproduce the issue:
Used separate identityserver4 and angular version. My question is it possible to change the tenant after login? In one application have multiple tenants. There is two or more users. All of them have same username, mail address, other infos, but have different tenantId. Is it possible to change the tenant after login? if the abp not support yet, please let me know how can i do it, give me some guides
9 Answer(s)
-
0
Hi,
ABP allows you to switch current tenants within the scope: https://docs.abp.io/en/abp/latest/Multi-Tenancy#change-the-current-tenant.
-
0
yes, I know, it is temporary. I want to permanent in all scope. Also the angular side and current auth cookie/token must change
-
0
Hi,
Unfortunately, it is currently not possible. The tenant must be determined before logging in.
-
0
Okey, currently it is not possible. My question is how can i develop it? Where and how should I extend
-
0
Hi,
May be you can get the new token on the server side and replace the token in the browser local storage.
-
0
Sorry but your support is so basic.
-
0
Hi,
This is a big question, it takes a lot of effort to do this.
Here are some of my suggestions(just an idea):
- JWT cannot be changed, it is designed to be immutable.
- When you change the tenant, the current user must also change
- You can provide a Http API and use code to get Token.
- Replace token in local storage in angular code.
- Refresh the page to get the application configuration
-
0
okey thanks. I will try then i will write the result
-
0
@shobhit, you might be going on the wrong direction. there shouldn't be requirement to change tenant like that. You can redesign it with a different solution. because it breaks major framework rules.