Hello,
We are trying to setup tenant selection by subdomain as mentioned in documenation https://docs.aspnetzero.com/en/aspnet-core-angular/latest/Overview-Angular#multi-tenancy .
appconfig.json in angular looks like - "remoteServiceBaseUrl": "https://api-dev.domain.org", "appBaseUrl": "https://{TENANCY_NAME}.dev.domain.org",
And in api project appsettings.json is "ServerRootAddress": "https://api-dev.domain.org", "ClientRootAddress": "https://{TENANCY_NAME}.dev.domain.org", "CorsOrigins": "https://.dev.domain.org,https://.domain.org",
Api and angular are setup as separate applications in iis, and I have verified that the wildcard binding is working as expected. After setting this up, When I go to tenant specific url I dont see any cookie getting set with tenantid. I have checked AppPreBootstrap.ts file in angular, and I dont see any code that is setting cookie when using subdomain for tenant selection.
Please advise.
Thank you,
4 Answer(s)
-
0
hi
Why the
ServerRootAddress
andremoteServiceBaseUrl
don't have the{TENANCY_NAME}
?The API application will also get tenant by the subdomain.
-
0
Thank you responding. I got the angular app to select tenant by updating remoteserviceBaseUrl and ServerRootAddress to have {TENANCY_NAME}.
How do I go to tenant login page now, I would also like to have the ability to be able to set tenant by coming to a host url.
-
0
Hi @dev_frontrush
You can go to tenant login page
https://tenant1.dev.domain.org
. If user is not logged in, user will be redirected to login page. If you visit host page (https://dev.domain.org), by default, AspNet Zero doesn't show tenant selection box. If you want it to act like that, you need to change the source code of login page. -
0
thank you! all working now.