# How to get directly assigned permissions in access token?

**URL:** <https://community.auth0.com/t/how-to-get-directly-assigned-permissions-in-access-token/86550>\
**Category:** Get Help\
**Tags:** jwt, permissions, access-token\
**Created:** [July 6, 2022, 8:46pm UTC](https://community.auth0.com/t/how-to-get-directly-assigned-permissions-in-access-token/86550 "2022-07-06T20:46:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rjoshi\_auth0](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rjoshi_auth0/32/33305_2.png) [@rjoshi\_auth0](https://community.auth0.com/u/rjoshi_auth0)\
**Post date:** [July 6, 2022, 8:46pm UTC](https://community.auth0.com/t/how-to-get-directly-assigned-permissions-in-access-token/86550/1 "2022-07-06T20:46:08Z")

</div>

With RBAC enabled and turning ‘Add Permissions in the Access Token’ On, I can get permissions that are applied via roles. But I have added some permissions that are directly assigned to user without any roles. Can’t those in access token. Anybody has any idea or guidance about this.

---

<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:** [July 6, 2022, 11:15pm UTC](https://community.auth0.com/t/how-to-get-directly-assigned-permissions-in-access-token/86550/3 "2022-07-06T23:15:32Z")

</div>

Hello there @rjoshi_auth0 !

> [@rjoshi\_auth0](#):
>
> But I have added some permissions that are directly assigned to user without any roles. Can’t those in access token. Anybody has any idea or guidance about this.

Unfortunately, this is a bit of a tricky situation for which there is to my knowledge no elegant solution. This is a common question as you can see in the following topics/solutions:

Specific to adding permissions via a Rule:

> [@Accessing the permissions array in the access token](https://community.auth0.com/t/accessing-the-permissions-array-in-the-access-token/27559/10):
>
> Alright thanks @mathiasconradt I’m finally cooking with butter over here… I’m pasting my rule that augments the idToken with user permissions here for others: function (user, context, callback) { var map = require('array-map'); var ManagementClient = require('auth0@2.17.0').ManagementClient; var management = new ManagementClient({ token: auth0.accessToken, domain: auth0.domain }); var params = { id: user.user\_id, page: 0, per\_page: 50, include\_totals: true }; management.ge…

And Action:

> [@Actions to get permissions](https://community.auth0.com/t/actions-to-get-permissions/66159):
>
> hi everyone. I have the following piece of code in an Action that is triggered during post-login: exports.onExecutePostLogin = async (event, api) =\> { var map = require('array-map'); var ManagementClient = require('auth0').ManagementClient; var management = new ManagementClient({ domain: event.secrets.domain, clientId: event.secrets.clientId, clientSecret: event.secrets.clientSecret }); var params = { id: event.user.user\_id, page: 0, per\_page: 50, include\_totals: …

The primary reason this isn’t really a viable solution is that Management API [limits](https://auth0.com/docs/troubleshoot/customer-support/operational-policies/rate-limit-policy/management-api-endpoint-rate-limits) are rather low.

This could be a good candidate for a [feedback](https://community.auth0.com/c/feedback/95) request as I’m not seeing anything related to this after some quick searching.

Hope this helps at least to give you a better idea of what this looks like currently!

---

<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:** [July 21, 2022, 11:15pm UTC](https://community.auth0.com/t/how-to-get-directly-assigned-permissions-in-access-token/86550/4 "2022-07-21T23:15:49Z")

</div>

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