Base solution for your next web application
Open Closed

Angular2 Subdomain Tenant Detection #2595


User avatar
0
paradoxit created

Currently I have two domains

Angular2 -> {tenant}.domainA.com API -> {tenant}.api.domainA.com

It appears the the sub-domain determines the tenant on the API side, however is it possible to have the API hosted at api.domainA.com and determine the tenant based on the domain the request came from (similar to the allow on the CORS).

Otherwise I need to purchase two * SSL certificates.

Any advice on how to achieve this would be much appreciated.

Thanks, David Hawkins


1 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    When tenant is determined on client side, it can be sent to server usin cookie. We already have a function for that

    abp.multiTenancy.setTenantIdCookie(tenantId);
    

    .

    When you set this value on client side, it will be sent to server automatically and server will decide to tenant according to this value, not according to requested server api url.

    But currently there is some buggy/not tested parts of this approach. We will test it in the beginning of this week and if there are any problems, we will fix them. I suggest you to wait until than, if you are not in a hurry.

    Thanks.