- ABP Framework version: v4.3.2
- UI type: Angular
- DB provider: EF Core
- Tiered (MVC) or Identity Server Separated (Angular): no
- Exception message and stack trace:
- Steps to reproduce the issue:"
I added the follwing line on my **HttpApiHostModule class:
options.AddDomainTenantResolver("https://{0}:44348");
I then edited Default.cshtml file about keep seing the switch tenant box.
When I run my solution in local and go to my login page, I have the tenant localhost preseleted which is good.
My issue here is that if I try to change the tenant, once I click save, nothing happens, it keep localhost tenant. It goes through the method as I have the message "Given tenant is not available:..."
I added this lines in **HttpApiHostModule file but it remain the same
options.TenantResolvers.Add(new QueryStringTenantResolveContributor());
options.TenantResolvers.Add(new RouteTenantResolveContributor());
options.TenantResolvers.Add(new HeaderTenantResolveContributor());
options.TenantResolvers.Add(new CookieTenantResolveContributor());
Is AddDomainTenantResolver supposed to change the behave of tenant resolve and not let use cookies anymore?
4 Answer(s)
-
0
Hi,
Because the domain resolver has a higher priority than the cookie resolver.
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Thanks for the quick reply.
So there is no way to change the tenant if it is auto selected by the domain? Can not change priority or anything?
I wanted to let the user change it, specially in case the tenant with a given domain do not exists. I changed the TenantResolver.ResolveTenantIdOrNameAsync method to not throw an error, then I wanted let them select another one
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
I wanted to let the user change it, specially in case the tenant with a given domain do not exists
Of course the user can change it when given domain do not exists. ABP will call the tenant resolver according to the priority until the resolution is successful.
Can not change priority or anything?
Yes you can :
Configure<AbpTenantResolveOptions>(option => { option.TenantResolvers.Insert(1, new CookieTenantResolveContributor()); });Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Thanks, it works well now
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

