Open Closed

Login one user for multi tenancy #7036


User avatar
0
FPT_TuyenDN1 created
  • ABP Framework version: v8.1.0
  • UI Type: Angular
  • Database System: EF Core PostgreSQL
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace:
  • Steps to reproduce the issue:

Hi team! I want to enable one user to log in and join multiple tenancies.

Step 1: At the login screen, I don't select a tenant when logging in with my Microsoft account.

Step 2: The system will redirect to a page in authServer where the system will display a list of tenants that the user has been assigned to. user can choose from the tenants assigned to them.!

Step 3: Select the tenant that the user wants to switch to, then press save. The system will redirect to the Angular page with the chosen tenant.

In current tenant implementation, if a user belongs to many tenant, he/she needs to register many account. Guide me to create flow for the above descriptions?


3 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    You need to replace the built-in Login page and add your step2 choose tenant page.

    The system will redirect to a page in authServer where the system will display a list of tenants that the user has been assigned to. user can choose from the tenants assigned to them.!

    The redirect code exists on OnGetExternalLoginCallbackAsync method of Volo.Abp.Account.Pro.Public.Web/Pages/Account/Login.cshtml.cs.

    so you redirect the user to your custom page on the OnGetExternalLoginCallbackAsync method. then show the tenant list and set the new tenant for a new user.

    You better download the source code of account pro to check the code.

  • User Avatar
    0
    FPT_TuyenDN1 created

    hi

    You need to replace the built-in Login page and add your step2 choose tenant page.

    The system will redirect to a page in authServer where the system will display a list of tenants that the user has been assigned to. user can choose from the tenants assigned to them.!

    The redirect code exists on OnGetExternalLoginCallbackAsync method of Volo.Abp.Account.Pro.Public.Web/Pages/Account/Login.cshtml.cs.

    so you redirect the user to your custom page on the OnGetExternalLoginCallbackAsync method. then show the tenant list and set the new tenant for a new user.

    You better download the source code of account pro to check the code.

    thank you. it's work. How about local login?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    You can also override the source code. It up to you.

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11