# Is there a way to map roles with their corresponding scopes in a single claim in keycloak OAuth token

**URL:** <https://forum.keycloak.org/t/is-there-a-way-to-map-roles-with-their-corresponding-scopes-in-a-single-claim-in-keycloak-oauth-token/7426>\
**Category:** Getting advice\
**Tags:** authentication, oidc\
**Created:** [February 17, 2021, 5:47am UTC](https://forum.keycloak.org/t/is-there-a-way-to-map-roles-with-their-corresponding-scopes-in-a-single-claim-in-keycloak-oauth-token/7426 "2021-02-17T05:47:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![prashanth](https://avatars.discourse-cdn.com/v4/letter/p/439d5e/32.png) [@prashanth](https://forum.keycloak.org/u/prashanth)\
**Post date:** [February 17, 2021, 5:47am UTC](https://forum.keycloak.org/t/is-there-a-way-to-map-roles-with-their-corresponding-scopes-in-a-single-claim-in-keycloak-oauth-token/7426/1 "2021-02-17T05:47:16Z")

</div>

Since a few days, I was trying to see if there is a way to club roles with its corresponding scopes in a single claim in the token. But I didn’t find anything. Now, I’m thinking is it actually possible as I didn’t find anything on it. My present token with roles looks like this

```
    "scope": "UPDATE DELETE READ",
    "roles": [
        "Asset Admin",
        "Asset Manager"
    ],
    "groups": [
       "Admins",
       "Managers"
    ]

```

I’m looking for something like

```
        "roles": [
			    {
				"role": "Asset Admin",
				"scopes": [UPDATE DELETE READ]
			    },
			   {
				"role": "Asset Manager",
				"scopes": [READ]
			   },
            
        ],
        "groups": [
           "Admins",
           "Managers"
        ]
```

---

<div class="post-metadata">

**Author:** ![harshith.da](https://avatars.discourse-cdn.com/v4/letter/h/c57346/32.png) [@harshith.da](https://forum.keycloak.org/u/harshith.da)\
**Post date:** [July 15, 2021, 2:25pm UTC](https://forum.keycloak.org/t/is-there-a-way-to-map-roles-with-their-corresponding-scopes-in-a-single-claim-in-keycloak-oauth-token/7426/2 "2021-07-15T14:25:42Z")

</div>

Even i’m looking for the same setup, i saw this post and there are no suggestion or responses. But i have posted an email to KeyCloak Users mailing list.

[https://groups.google.com/g/keycloak-user/c/kQ\_9Vl22HZU](https://groups.google.com/g/keycloak-user/c/kQ_9Vl22HZU)

Hope to get some responses or suggestions for this query. Thanks
