I have two registered applications in Azure AD B2C: azure functions application and frontend spa application. I call azure functions from frontend app and use implicit authorization flow. I use MSAL npm package to request access token.
I followed this article to setup roles for users: https://learn.microsoft.com/en-us/azure/active-directory/develop/howto-add-app-roles-in-azure-ad-apps
But access_token I receive in Frontend app is missing "roles" claim, as well as id_token. Here is access token I receive:
{
"typ": "JWT",
"alg": "RS256",
"kid": "X5eXk4xyojNFum1kl2Ytv8dlNP4-c57dO6QGTVBwaNk"
}.{
"iss": "https://<tenant_name>.b2clogin.com/<id>/v2.0/",
"exp": 1595333452,
"nbf": 1595329852,
"aud": "3d6123b2-b436-46c0-bcde-e0b61b0ad827",
"oid": "e98c46c4-f13d-428e-9b7d-28ba3abeb060",
"sub": "e98c46c4-f13d-428e-9b7d-28ba3abeb060",
"name": "Basic User",
"emails": [
"[email protected]"
],
"tfp": "B2C_1_signin_v2",
"nonce": "a70eece3-31d2-4cc3-8abb-0a56a95d4ba1",
"scp": "demo.read",
"azp": "d7787de1-6642-409f-b0b9-2f5608476367",
"ver": "1.0",
"iat": 1595329852
}.[Signature]
Why there are no roles in it?