Open Closed

Forward __tenant as query string to Authentication Server #9140


User avatar
0
JimmyLiew created

Hi,
I have implemented subdomain tenant resolver in angular frontend by adding {0} placeholder to determine current tenant.
image.png

Noticed that, when angular redirect to auth-server, __tenant custom header does not forward due to the redirect with 302 status code behavior. (Please correct me if I'm wrong.)
https://stackoverflow.com/questions/46133557/why-is-my-header-not-being-set-on-redirect

Workaround Solution - Pass __tenant as query string instead of request header.

Question: As per abp documentation, abp backend already built-in QueryStringTenantResolveContributor to resolve the tenant by trying to find current tenant id from query string parameters. May i know how to implement QueryStringTenantResolveContributorin frontend so that "__tenant" will append as query string in URL and forwards to authentication server and trigger QueryStringTenantResolveContributor to resolve tenant seamlessly?

For example:
Angular : https://tenant1.app.example.com
AuthServer: https://auth-server.example.com?__tenant=tenant1

Thanks.


No answer yet!
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.0.0-preview. Updated on July 14, 2025, 11:57