# Roles and permissions not added by default

**URL:** <https://community.auth0.com/t/roles-and-permissions-not-added-by-default/106663>\
**Category:** Get Help\
**Tags:** configuration, application\
**Created:** [May 10, 2023, 7:43pm UTC](https://community.auth0.com/t/roles-and-permissions-not-added-by-default/106663 "2023-05-10T19:43:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![milan.milojic](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/milan.milojic/32/46649_2.png) [@milan.milojic](https://community.auth0.com/u/milan.milojic)\
**Post date:** [May 10, 2023, 7:43pm UTC](https://community.auth0.com/t/roles-and-permissions-not-added-by-default/106663/1 "2023-05-10T19:43:16Z")

</div>

Continuing the discussion from [How can I add the permissions claim in my Access Token with Rules?](https://community.auth0.com/t/how-can-i-add-the-permissions-claim-in-my-access-token-with-rules/87156):

## Problem statement

- I have enabled the RBAC as per instructions and want to have both roles and permissions in my token. Currently we use custom claims to add scopes using rules

## Symptoms

- Roles and permissions aren’t added to the token by default, as expected. Token doesn’t contain any of the information assigned to the user through users management page in the dashboard (user definitely has a role assigned, and role has permissions). If I however do add a custom action to post-login flow (that runs after those existing custom scope-assigning rules), same as suggested [here](https://community.auth0.com/t/how-can-i-add-the-permissions-claim-in-my-access-token-with-rules/87156) I can see the roles in my token, but I cannot add individual permissions as they’re not available through action trigger even object.

Can you please help? I would like this to be as seamless as possible and avoid any custom rules and overrides. Thank you  
Milan

---

<div class="post-metadata">

**Author:** ![milan.milojic](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/milan.milojic/32/46649_2.png) [@milan.milojic](https://community.auth0.com/u/milan.milojic)\
**Post date:** [May 10, 2023, 9:06pm UTC](https://community.auth0.com/t/roles-and-permissions-not-added-by-default/106663/3 "2023-05-10T21:06:36Z")

</div>

If everything is working automatically do roles and permissions end up in app\_metadata?  
because I have that as empty  
app\_metadata": {  
“authorization”: {  
“groups”: ,  
“roles”: ,  
“permissions”:   
}

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [May 10, 2023, 11:00pm UTC](https://community.auth0.com/t/roles-and-permissions-not-added-by-default/106663/4 "2023-05-10T23:00:06Z")

</div>

Hi there @milan.milojic !

Thanks for the detailed description of the issue, very helpful!

Assuming you have roles w/ permissions [assigned directly to a user](https://auth0.com/docs/manage-users/access-control/configure-core-rbac/rbac-users/assign-roles-to-users#assign-roles-in-user-profile) AND are including the audience param (API identifier) for an API that has RBAC + “add permissions in the Access Token” enabled then the resulting access token should have a permissions claim with the relevant permissions added:

 ![Screenshot 2023-05-10 at 3.52.17 PM](https://global.discourse-cdn.com/auth0/original/3X/5/7/57b911c1546a5eb6d002c8dbdb153f094a081343.png)

Access Token:

 ![Screenshot 2023-05-10 at 3.55.13 PM](https://global.discourse-cdn.com/auth0/original/3X/d/2/d246d4379660a1c9f95a7cda96cb7d999c80aa1c.png)

Roles themselves will need to be added as a custom claim to access tokens - I will note that it is common practice to infer roles from permissions so the extra step to add the actual roles as custom claims by way of a rule/action is not necessarily required.

Are you able to confirm you have RBAC as well as the option to add permissions to access tokens enabled for the API which you are using as your audience?

Keep us posted!

---

<div class="post-metadata">

**Author:** ![milan.milojic](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/milan.milojic/32/46649_2.png) [@milan.milojic](https://community.auth0.com/u/milan.milojic)\
**Post date:** [May 17, 2023, 3:20pm UTC](https://community.auth0.com/t/roles-and-permissions-not-added-by-default/106663/5 "2023-05-17T15:20:56Z")

</div>

Hi @ty.frith ,

Apologies for the late reply. We have everything sorted out now.  
I was expecting permissions to be included in both id token and access token (but I realize they don’t belong in the id token at all). And thank you for pointing out the audience config, that was also an issue with some of the testing.  
All is good now.

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [May 17, 2023, 6:18pm UTC](https://community.auth0.com/t/roles-and-permissions-not-added-by-default/106663/6 "2023-05-17T18:18:35Z")

</div>

That’s great to hear! Thanks for following up with the community 🙂

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [May 31, 2023, 6:19pm UTC](https://community.auth0.com/t/roles-and-permissions-not-added-by-default/106663/7 "2023-05-31T18:19:10Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
