Azure AD v2 - roles not included in Access Token

Mohamed Abdul Khader 0 Reputation points
2024-02-07T16:36:41.95+00:00

hi Team,
following the same issue already asked in stack overflow( https://stackoverflow.com/q/66348270).
i have tried the solution but it is not working for me. ( https://stackoverflow.com/a/66348704 ).

Roles are not part of access token/ ID token
Frontend Client is built using Angular.
Backend using NodeJS.
followed the tutorial and cloned official github projects.

i have registered both applications and configured them correctly.
i am using external

Added Scopes for my node app
Screenshot 2024-02-07 at 9.44.10 PM

Added Role for my node app
Screenshot 2024-02-07 at 9.41.15 PM

**Assigned role to user
**
Screenshot 2024-02-07 at 9.55.42 PM

{
        endpoint: `http://localhost:5000/api/
        scopes: {
            write: [ "api://[node-application-Id]/TimeSheetTemplate.ReadWrite" ]
        }
    },

Request URL:
https://login.microsoftonline.com/common/oauth2/v2.0/token
Request Method:
POST
Status Code:
200 OK
Remote Address:
40.126.18.33:443
Referrer Policy:
strict-origin-when-cross-origin

Payload


Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
18,564 questions
{count} votes