# Add List user's organizations id and roles to the token

**URL:** <https://community.auth0.com/t/add-list-users-organizations-id-and-roles-to-the-token/83921>\
**Category:** Get Help\
**Created:** [May 23, 2022, 9:06am UTC](https://community.auth0.com/t/add-list-users-organizations-id-and-roles-to-the-token/83921 "2022-05-23T09:06:41Z")\
**Posts on this page:** 1\
**Showing post:** 3

<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 23, 2022, 11:26pm UTC](https://community.auth0.com/t/add-list-users-organizations-id-and-roles-to-the-token/83921/3 "2022-05-23T23:26:52Z")

</div>

Hello there @agustin.soler !

Assuming a user is authorizing through an organization, the org\_id should be present in the ID/Access token(s) returned - Please see [this article](https://auth0.com/docs/manage-users/organizations/using-tokens) for more details.

Regarding roles specifically, we recommend setting up an [Action](https://auth0.com/docs/customize/actions#:~:text=Actions%20are%20secure%2C%20tenant%2Dspecific,Auth0's%20capabilities%20with%20custom%20logic.) to add these as a custom claim to tokens:

> [@Setting a user role in an action will not update the permissions in the access token](https://community.auth0.com/t/setting-a-user-role-in-an-action-will-not-update-the-permissions-in-the-access-token/70867/2):
>
> Hi @kl.auth Welcome to Auth0 Community !!! Don’t use Management API call for this. You can add a custom roles claim in a [post-login action](https://auth0.com/docs/actions/triggers/post-login) like this: /\*\* \* @param {Event} event - Details about the user and the context in which they are logging in. \* @param {PostLoginAPI} api - Interface whose methods can be used to change the behavior of the login. \*/ exports.onExecutePostLogin = async (event, api) =\> { const namespace = 'https://my-app.example.com'; if (event.authorization) { api…

Hope this helps!

---

_[View the full topic](https://community.auth0.com/t/add-list-users-organizations-id-and-roles-to-the-token/83921)._
