Starts in:
3 DAYS
0 HR
8 MIN
38 SEC
Starts in:
3 D
0 H
8 M
38 S
Open Closed

Questions multi tenancy feature #5511


User avatar
0
datdv1 created

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)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    You should configure the full URL address

  • User Avatar
    0
    datdv1 created

    Hi liangshiwei! How to configure when resolver Host tenant in angular project and public website project? Can you help me?

  • User Avatar
    0
    datdv1 created

    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!
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    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

  • User Avatar
    0
    datdv1 created

    Hi liangshiwei! Thanks guide for me. I have one more question. The configure subdomain for tenant in angular application required to domain 2nd level?

  • User Avatar
    0
    datdv1 created

    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?

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    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 expects https://testing-api.{0}.com

  • User Avatar
    0
    datdv1 created

    Oh! I will try it.

  • User Avatar
    0
    datdv1 created

    Hi liangshiwei! I can configure multiple suffix and how to implement?

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    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#environmentservice

    I'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.

  • User Avatar
    0
    datdv1 created

    Thank liangshiwei!

  • User Avatar
    0
    datdv1 created

    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?

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    OK. Angualr Team will help you.

  • User Avatar
    0
    datdv1 created

    Thanks liangshiwei!

Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06