In the manifest file for your application you need to update the claims.
If adding roles under custom claim does not work directly, consider creating a policy using Azure AD B2C (if you are using it). Policies allow more granular control over token issuance.
Refer to the official Azure AD B2C documentation for creating and managing custom policies:
For your requirements, the manifest update should look something like this:
{
"optionalClaims": {
"idToken": [
{
"name": "roles",
"source": null,
"essential": false,
"additionalProperties": [
{
"source": "group",
"value": "http://schemas.microsoft.com/ws/2008/06/identity/claims/role"
}
]
},
{
"name": "given_name",
"source": null,
"essential": false,
"additionalProperties": [
{
"value": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname"
}
]
},
{
"name": "surname",
"source": null,
"essential": false,
"additionalProperties": [
{
"value": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname"
}
]
}
]
}
}