Open Closed

JWT authentication WithMultinancy #2010


User avatar
0
takahiro created
  • ABP Framework version: v4.4.2
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes / no
  • Exception message and stack trace:
  • Steps to reproduce the issue:

im created a multitenancy-multidatabase application, and i have a cookie-based authentication, im want to how if is possible to kepping the multi-tenancy and use the JWT application,and how to authentication per tenant works than,?


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

    hi

    JWT has nothing to do with multi-tenancy. The framework will automatically handled If you use the IdentityServer

    If you manually write code to implement JWT, you need to add the TenantId of the current user to the claims.

    https://github.com/abpframework/abp/blob/dev/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/AbpUserClaimsPrincipalFactory.cs#L43

Made with ❤️ on ABP v9.1.0-preview. Updated on November 18, 2024, 05:54