Aspnetboilerplate: Fully Qualified Domain Name for each Tenant instead of domain name.

Created on 31 May 2016  路  3Comments  路  Source: aspnetboilerplate/aspnetboilerplate

Is there a way we can have our clients use a fully qualified domain name for their tenant instead of a subdomain? For example phonebook.clientdomain.com

question

Most helpful comment

As you know ABP gets TenantId from AbpSession (http://www.aspnetboilerplate.com/Pages/Documents/Abp-Session). If you use module-zero AbpSession gets it from cookie. And if you use our startup template, it sets cookie on login (https://github.com/aspnetboilerplate/module-zero-template/blob/master/src/AbpCompanyName.AbpProjectName.WebSpaAngular/Controllers/AccountController.cs#L123).
So, for example, you can set this cookie by using the domain...

If I would do it, I would create a mapping table (domain to tenancyName/tenantId). Then I would hide tenancy name input on login form. Then in the login method (https://github.com/aspnetboilerplate/module-zero-template/blob/master/src/AbpCompanyName.AbpProjectName.WebSpaAngular/Controllers/AccountController.cs#L77) I would find and set tenancyName automatically, instead of getting it from user. And everything will work as expected if you do that.

All 3 comments

Hi,

This is out of scope of this framework. You can determine current tenant in any way. For example, redirect this domain to your server, check domain name and set tenantid.

Okay so I know how I can redirect this to the server but where would I make the change to set the tenant I'd and redirect to that tenant??

As you know ABP gets TenantId from AbpSession (http://www.aspnetboilerplate.com/Pages/Documents/Abp-Session). If you use module-zero AbpSession gets it from cookie. And if you use our startup template, it sets cookie on login (https://github.com/aspnetboilerplate/module-zero-template/blob/master/src/AbpCompanyName.AbpProjectName.WebSpaAngular/Controllers/AccountController.cs#L123).
So, for example, you can set this cookie by using the domain...

If I would do it, I would create a mapping table (domain to tenancyName/tenantId). Then I would hide tenancy name input on login form. Then in the login method (https://github.com/aspnetboilerplate/module-zero-template/blob/master/src/AbpCompanyName.AbpProjectName.WebSpaAngular/Controllers/AccountController.cs#L77) I would find and set tenancyName automatically, instead of getting it from user. And everything will work as expected if you do that.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wocar picture wocar  路  3Comments

jzhouw picture jzhouw  路  3Comments

RiaanvE picture RiaanvE  路  3Comments

sylfree9999 picture sylfree9999  路  3Comments

AlexGeller picture AlexGeller  路  3Comments