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).

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
Do you need assistance from an ABP expert?
Schedule a Meeting
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v9.2.0-preview. Updated on March 25, 2025, 11:10