Open Closed

Get current user roles and organizations id #6941


User avatar
0
imranStem created

I am using the Microservice template. I want to get the current user's roles id and organization id in my product microservice.

  • ABP Framework version: v7.4.2
  • UI Type: Angular
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace:
  • Steps to reproduce the issue:

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

    hi

    You can add the role id and organization id to principal

    https://docs.abp.io/en/abp/latest/Authorization#claims-principal-factory

  • User Avatar
    0
    imranStem created

    That is the question, how can I get the Role id and organization id of user?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Add your ClaimsPrincipalContributor to the AuthServer project.

    In the AuthServer project, you can get the IdentityUser entity(UserManager).

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