# Permissions not returned as part of a token when Org ID is set in Auth0Provider

**URL:** <https://community.auth0.com/t/permissions-not-returned-as-part-of-a-token-when-org-id-is-set-in-auth0provider/78510>\
**Category:** Get Help\
**Created:** [February 17, 2022, 8:25pm UTC](https://community.auth0.com/t/permissions-not-returned-as-part-of-a-token-when-org-id-is-set-in-auth0provider/78510 "2022-02-17T20:25:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![srinivas1](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/srinivas1/32/33891_2.png) [@srinivas1](https://community.auth0.com/u/srinivas1)\
**Post date:** [February 17, 2022, 8:25pm UTC](https://community.auth0.com/t/permissions-not-returned-as-part-of-a-token-when-org-id-is-set-in-auth0provider/78510/1 "2022-02-17T20:25:22Z")

</div>

- **Which SDK this is regarding:** e.g. auth0-react
- **SDK Version:** e.g. 1.9.0
- **Platform Version:** e.g. Node ^17

This has worked very randomly a couple of times but in general (98% of the time) I don’t get the permissions in the token.

My Auth0Provider looks like the following

Auth0Provider  
domain={process.env.REACT\_APP\_AUTH0\_DOMAIN}  
clientId={process.env.REACT\_APP\_AUTH0\_CLIENT\_ID}  
redirectUri={process.env.REACT\_APP\_AUTH0\_REDIRECT\_URL}  
organization={organization}  
scope=“create:folder”  
audience={process.env.REACT\_APP\_AUTH0\_DOCS\_API\_AUDIENCE}

1. The scope exists for the API specified in the audience
2. The API uses RBAC
3. The user’s role has the permission for that API added to it
4. The role has been assigned to the user
5. The token is issued for that audience for that client  
but the token does not have that permission. THis has worked exactly two times, what am I missing?

Token  
{  
“iss”: “–Domain–”,  
“sub”: “auth0|5cf4616ed9a6e70f3ad8bbb9”,  
“aud”: [  
“–Correct audience–”,  
“–Domain/userinfo”  
],  
“iat”: 1645128472,  
“exp”: 1645214872,  
“azp”: “XXXXXXXXXXX”,  
“scope”: “openid profile email”,  
“org\_id”: “org\_XXXXXXX”,  
“permissions”:   
}

**UPDATE: This only works if I don’t sent an Organization in the Auth0Provider config. Why is that???**

Srini

---

<div class="post-metadata">

**Author:** ![srinivas1](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/srinivas1/32/33891_2.png) [@srinivas1](https://community.auth0.com/u/srinivas1)\
**Post date:** [February 17, 2022, 9:57pm UTC](https://community.auth0.com/t/permissions-not-returned-as-part-of-a-token-when-org-id-is-set-in-auth0provider/78510/2 "2022-02-17T21:57:41Z")

</div>

Adding a response here in case the next person who makes the same mistake comes looking.

Assigning a role to a user isn’t sufficient. **The role has to be assigned to that user for that specific organization**. To do this, I had to go to Organizations in the left nav → Members tab in the Organizations page → Select a particular member → Assign roles to that member in **that specific organization**.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [February 18, 2022, 10:31am UTC](https://community.auth0.com/t/permissions-not-returned-as-part-of-a-token-when-org-id-is-set-in-auth0provider/78510/3 "2022-02-18T10:31:44Z")

</div>

Perfect! Thanks for sharing it with the rest of community!

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [February 22, 2022, 2:23pm UTC](https://community.auth0.com/t/permissions-not-returned-as-part-of-a-token-when-org-id-is-set-in-auth0provider/78510/4 "2022-02-22T14:23:12Z")

</div>


