Attribute mapped as a role

Hello! Greetings from Argentina.

At my Keycloak instance, i have federation with On Premise AD. I’ve already mapped AD Groups as Keycloak Roles, and also, mapped differents attributes as name, last name, full name, nickname, title, among others.

In the process of authenticating and getting a token, i get the following:


“realm_access”: {
“roles”: [
“AD_GROUP_1”,
“AD_GROUP_2”,
“AD_GROUP_ETC”
]
},
“name”: “John Doe”,
“nickname”: “johndoe”,
“preferred_username”: “john.doe@enterprise.com”,
“title”: “Developer”,

What i need now (For business purposes) is to map one of those attributes (“title”) as a role, as the following:


“realm_access”: {
“roles”: [
“AD_GROUP_1”,
“AD_GROUP_2”,
“AD_GROUP_ETC”
“Developer”
]
},
“name”: “John Doe”,
“nickname”: “johndoe”,
“preferred_username”: “john.doe@enterprise.com

Does anybody know how to do this? I’ve checked on Realm Clients, Realm Clients Scopes, inside the Front-end Client configuration, but couldn’t make it work.

Any help would be appreciated.