Base solution for your next web application
Open Closed

Detect and set tenantId dynamically by requested URL #4834


User avatar
0
bolenton created

Hi,

I am using wildcard sub-domain for my multi-tenant application. Can we set the tenantId (Abp session) globally for the requested url?

I found some discussion on the forum : #2310@6e258722-a095-43e8-accf-7aa230655e10

But, this is not working for me. :(

I want to detect the tenancy name from the subdomain, check it is existing or not. If it is existing, then set the abp tenantId globally so that I will not have to put the tenancy name explicitly .

Thanks.


1 Answer(s)
  • User Avatar
    0
    bbakermmc created

    Did you configure your appsetting to look for {TenancyName} in the URL per the development documentation.

    There seems to be issues with checking if the tenant is valid, seems to always return the host.

    See: <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero-core/issues/873">https://github.com/aspnetzero/aspnet-ze ... issues/873</a>