Hi ABP support team We a using abp commercial
- UI framework: angular
- ABP Version: 7.2.3
- Data access: MongoDB This solution deployed to AKS and running Currently, we want to enable and implement multitenancy feature on this solution. With each tenant is initialized , I need each tenant to have its own database , logo and branch name
64 Answer(s)
-
0
-
0
Hi liangshiwei! How to configure when resolver Host tenant in angular project and public website project? Can you help me?
-
0
Hi, As instructed in your documentation, we can determine current tenant either by subdomain (like mytenant1.mydomain.com) or by the whole domain (like mytenant.com). But there’s no example of determining current tenant by the whole domain. It’s highly appreciated if you coud help me configure the AbpTenantResolveOptions to determining current tenant by his whole domain. For example, we have the following domains: -) For Host side:
- Public website: logiplat.net
- Angular app: app.logiplat.net;
- API server: api.logiplat.net
- Authenticate server: auth.logiplat.net
-) For Tenant 1:
- Public website: ticogroup.com
- Angular app: app.ticogroup.com;
- API server: api.ticogroup.com
- Authenticate server: auth.ticogroup.com
-) For Tennant 2
- Public website: everwin.com
- Angular app: app.everwin.com;
- API server: api.everwin.com
- Authenticate server: auth.everwin.com Please, guide me how to configure the AbpTenantResolveOptions in order to determine current tenant by the whole domain. Thank you in advance!
-
0
Hi,
Your use case is a corner case, ABP only supports out-of-the-box subdomain tenants. so you need more custom work.
Angular applications only support determining the current tenant from subdomains
This is the source code of Angular multi-tenant. https://github.com/abpframework/abp/blob/dev/npm/ng-packs/packages/core/src/lib/utils/multi-tenancy-utils.ts
Here is how the code basically works:
Here, the environment service is used to set the API and AuthServer server URL.
You can create your own help class to resolve the tenant, set the current tenant and replace the URL.
https://docs.abp.io/en/abp/latest/UI/Angular/Environment#environmentservice
For public website, You can use
AbpRemoteServiceOptions
to change the URL of the API.https://docs.abp.io/en/abp/latest/API/Dynamic-CSharp-API-Clients#abpremoteserviceoptions
-
0
Hi liangshiwei! Thanks guide for me. I have one more question. The configure subdomain for tenant in angular application required to domain 2nd level?
-
0
Hi liangshiwei! I need this problem urgently, I create a new ticket. Can you follow new ticket and guide for me step by step implemented custom this?
-
0
I have one more question. The configure subdomain for tenant in the angular application required to domain 2nd level
Sorry, I made a mistake, angular supports domain resolver. but it requires the same domain name suffix., all are
.net
or.com
This is because when Angular replaces the URL, it will only replace the tenant and will not change the domain name suffix.
That's why
https://testing-api.{0}
doesn't work, it expectshttps://testing-api.{0}.com
-
0
Oh! I will try it.
-
0
Hi liangshiwei! I can configure multiple suffix and how to implement?
-
0
Hi,
ABP Angular UI does not support configuring multiple suffixes,
But ABP provides
EnvironmentService
, and you can use it to modify the domain name suffix of the API. https://docs.abp.io/en/abp/latest/UI/Angular/Environment#environmentserviceI'm not an Angular expert, so I can't provide the exact code.
If you need the help of the Angular team, you can create a new question, and I will assign it to the Angular team.
-
0
Thank liangshiwei!
-
0
Hi liangshiwei I created new question: https://support.abp.io/QA/Questions/5650/How-to-configure-tenant-resolver-in-order-to-determine-current-tenant-by-the-whole-domain
Can you help me on new question?
-
0
OK. Angualr Team will help you.
-
0
Thanks liangshiwei!