Setting resource_access.my_client_name.roles as the Token Claim Name results in the other roles for other clients being overwritten - it would be good to have an option to merge the objects rather than overwrite.
As an example, here is the JWT without the external-claim-mapper plugin, you can see there are roles for the account client...
{
// ... start of token
"resource_access": {
"account": {
"roles": [
"manage-account",
"manage-account-links",
"view-profile"
]
}
},
// ... rest of token
}
After enabling external-claim-mapper with Token Claim Name set to resource_access.my_client_name.roles you can see that the roles for account are overwritten and so lost.
{
// ... start of token
"resource_access": {
"my_client_name": {
"roles": [
"admin:1"
]
}
},
// ... rest of token
}
There might be a use case for completely overwriting the roles so this might not be default behaviour but it should probably be an option?
Setting
resource_access.my_client_name.rolesas the Token Claim Name results in the other roles for other clients being overwritten - it would be good to have an option to merge the objects rather than overwrite.As an example, here is the JWT without the
external-claim-mapperplugin, you can see there are roles for theaccountclient...After enabling
external-claim-mapperwith Token Claim Name set toresource_access.my_client_name.rolesyou can see that the roles foraccountare overwritten and so lost.There might be a use case for completely overwriting the roles so this might not be default behaviour but it should probably be an option?