# Auth0 v9 get user roles and permissions

**URL:** <https://community.auth0.com/t/auth0-v9-get-user-roles-and-permissions/104164>\
**Category:** Get Help\
**Tags:** user-profile, user-management\
**Created:** [April 5, 2023, 11:13am UTC](https://community.auth0.com/t/auth0-v9-get-user-roles-and-permissions/104164 "2023-04-05T11:13:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![riunge](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/riunge/32/46093_2.png) [@riunge](https://community.auth0.com/u/riunge)\
**Post date:** [April 5, 2023, 11:13am UTC](https://community.auth0.com/t/auth0-v9-get-user-roles-and-permissions/104164/1 "2023-04-05T11:13:41Z")

</div>

I am trying to get the permissions and roles associated with a specific user and for some reason Auth0 does not include those in the token. Could anyone help with what I may be doing wrong?  
here is how I instantiate auth0; PS: I am using [Auth0.js v9 Reference](https://auth0.com/docs/libraries/auth0js)

```js
const webAuth = new auth0.WebAuth({
  domain: process.env.REACT_APP_AUTH0_DOMAIN || '',
  clientID: process.env.REACT_APP_AUTH0_CLIENT_ID || '',
  responseType: 'token id_token',
  scope: 'openid profile email roles',
  audience: 'ternwheel',
  redirectUri: window.location.origin,
})

```

Here is how I call the auth with password and an email

```js
    webAuth.login(
      {
        realm: 'Username-Password-Authentication',
        responseType: 'token id_token',
        redirectUri: window.location.origin,
        email,
        password,
      },
      e => console.log(e)
    )

```

finally auth0 sends me this token that does not include the permissions or roles  
`eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Ik8wY0oyY05FRTJvQW43aTYtVG5nUiJ9.eyJpc3MiOiJodHRwczovL2Rldi15YjQ3MWR1c2JvdmsyMXV1LnVzLmF1dGgwLmNvbS8iLCJzdWIiOiJhdXRoMHw2NDJhOTViYWNmZjY2ZmRjZGM4OTczYzYiLCJhdWQiOlsidGVybndoZWVsIiwiaHR0cHM6Ly9kZXYteWI0NzFkdXNib3ZrMjF1dS51cy5hdXRoMC5jb20vdXNlcmluZm8iXSwiaWF0IjoxNjgwNjkyOTk2LCJleHAiOjE2ODA3MDAxOTYsImF6cCI6Im5xZWVZd1AyQ0ZUR1lyNnMzMnJkRlNKcG1QZ3ZOaEQ1Iiwic2NvcGUiOiJvcGVuaWQgcHJvZmlsZSBlbWFpbCIsInBlcm1pc3Npb25zIjpbInVzZXI6bWFuYWdlciJdfQ.2xcr90GoYynvoWWOL-ur2ELiWY9Fwjy_bZFnlFwAMjtl3LhE9nFYYwbR3709o1E4SzxzMxSz3pWJ92_PuaG3qssVD6To9PchzE8Xz8xO2p-8vGFKo6950aDmYHzF-V_n-bhzPvgeErhI1jPYNc0JZ7Ak1X-oVE-forQLVecfXPXcw9O82abKRJjA9WxsUS2doS5O6TA1msn-flplFCjunRwqdqy8D-A3L1H5E2y7beRXtli9EYMYeNJH_5cjb36VYZP8M_z-tPE3w1y_Z94jvlJS9mkkhU5M1_pBcoegiCcINrXvAuxmYSHzl04lzuMUZD5LBT7sdTI1M8zgvMDYxQ`

I have also turned on RBAC for my api.

 ![Screenshot 2023-04-05 at 14.13.06](https://global.discourse-cdn.com/auth0/original/3X/0/b/0b20becd08cf0335be1509dbc9d8269de5bed695.png)

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [April 6, 2023, 8:11pm UTC](https://community.auth0.com/t/auth0-v9-get-user-roles-and-permissions/104164/3 "2023-04-06T20:11:52Z")

</div>

Hi @riunge,

Welcome to the Auth0 Community!

I understand you would like to add roles and permissions to the access token.

The token you posted appears to include _some_ permissions, that is good. Is there some missing from that array?

 ![Screenshot 2023-04-06 at 4.11.10 PM](https://global.discourse-cdn.com/auth0/original/3X/a/a/aa9f850cd6d7a29228de52387525034238559f89.png)

As for adding the roles to the token. That can be done in an Action. Here is an FAQ on the subject:

[https://community.auth0.com/t/how-to-add-roles-and-permissions-to-the-id-token-using-actions/84506](https://community.auth0.com/t/how-to-add-roles-and-permissions-to-the-id-token-using-actions/84506)

Let me know if you have any questions!

---

<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:** [April 20, 2023, 8:12pm UTC](https://community.auth0.com/t/auth0-v9-get-user-roles-and-permissions/104164/4 "2023-04-20T20:12:29Z")

</div>

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