How to get app role claims (Roles) in access token to protected API when using Javascript client app with MSAL.js

Anand Palanidurai 6 Reputation points
2021-02-07T07:56:10.58+00:00

I have two applications. One client app and protected api. I want to pass app roles as claim to protected api on behalf of signed in user from client app. I have added app roles (admin_user_access,normal_user_access) to both client app and api . Also assigned users for those app roles through Enterprise applications section. Also enabled User assignment required? option for both applications. Now when I get token from azure AD I cannot get roles in claim. I able to get scope only that I expose in api. Kindly help me to resolve the issue. Thanks in advance.

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,559 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anand Palanidurai 6 Reputation points
    2021-02-07T16:01:49.01+00:00

    I manage to fix the issue . Need to use tenant id in authority instead of common. The actual solution is posted here. Thank you.

    https://stackoverflow.com/questions/59081088/guest-users-role-not-visible-in-azure-active-directory-auth-token-claims/66089930#66089930

    1 person found this answer helpful.