# Access Token scope issue

**URL:** <https://community.auth0.com/t/access-token-scope-issue/9107>\
**Category:** Get Help\
**Tags:** scope, audience, access-token\
**Created:** [January 2, 2018, 10:54am UTC](https://community.auth0.com/t/access-token-scope-issue/9107 "2018-01-02T10:54:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mdka.dasd](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/mdka.dasd/32/7550_2.png) [@mdka.dasd](https://community.auth0.com/u/mdka.dasd)\
**Post date:** [January 2, 2018, 10:54am UTC](https://community.auth0.com/t/access-token-scope-issue/9107/1 "2018-01-02T10:54:06Z")

</div>

I’ve been struggling with auth-js bundle trying to get an access token with the following scopes: `read:users`and `read:user_idp_tokens` as mentioned on [this answer](http://community.auth0.com/questions/12517/user-info-does-not-return-identities#answer-12526) and using audience: `YOUR_AUTH0_DOMAIN/userinfo` as documented [here](https://auth0.com/docs/tokens/access-token#access-token-format).

The thing is, regardless of the scopes I include, the obtained token will never include any of them, and I just checked that by copying the token and testing it [here](https://auth0.com/docs/api/management/v2).

Am I missing something?

---

<div class="post-metadata">

**Author:** ![jmangelo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmangelo/32/7923_2.png) [@jmangelo](https://community.auth0.com/u/jmangelo)\
**Post date:** [January 2, 2018, 5:07pm UTC](https://community.auth0.com/t/access-token-scope-issue/9107/2 "2018-01-02T17:07:28Z")

</div>

The answer you linked to mentions that you need to request those scopes when performing a **client credentials grant** ; to my knowledge Auth0.js does not have a method for that as that library is mostly for browser-based usage and those application would be unable to maintain the client secret required for that grant secret.

If you check [this section](https://github.com/auth0/node-auth0#management-api-client) of the `node-auth0` library you’ll see an example to obtain a Management API token through that grant.

---

<div class="post-metadata">

**Author:** ![mdka.dasd](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/mdka.dasd/32/7550_2.png) [@mdka.dasd](https://community.auth0.com/u/mdka.dasd)\
**Post date:** [January 2, 2018, 9:23pm UTC](https://community.auth0.com/t/access-token-scope-issue/9107/3 "2018-01-02T21:23:56Z")

</div>

So, are you trying to say that client library (auth0-js) does not support all the scopes? Because that’s my problem, I need those scopes (`read:users read:user_idp_tokens`).

---

<div class="post-metadata">

**Author:** ![mdka.dasd](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/mdka.dasd/32/7550_2.png) [@mdka.dasd](https://community.auth0.com/u/mdka.dasd)\
**Post date:** [January 2, 2018, 11:49pm UTC](https://community.auth0.com/t/access-token-scope-issue/9107/4 "2018-01-02T23:49:48Z")

</div>

I solved this using a custom API for the configured audience, so by using `YOUR_AUTH0_DOMAIN/userinfo` as audience this will not work (can’t tell why), so I configured the api to _Allow Skipping User Consent_, if this option is not enabled, for some unknown reason I will get an error callback: `...#error=access_denied&error_description=User%20is%20not%20authorized`.

---

<div class="post-metadata">

**Author:** ![jmangelo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmangelo/32/7923_2.png) [@jmangelo](https://community.auth0.com/u/jmangelo)\
**Post date:** [January 3, 2018, 9:14pm UTC](https://community.auth0.com/t/access-token-scope-issue/9107/5 "2018-01-03T21:14:47Z")

</div>

It’s not the library; certain Management API scopes are only available when using the client credentials grant and Auth0.js is mostly to perform end-user based grants. So if you perform an end-user based flow/grant through Auth0.js targeting the Management API you won’t get those scopes; blame the grant not the library.

---

<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:** [August 27, 2019, 10:14am UTC](https://community.auth0.com/t/access-token-scope-issue/9107/6 "2019-08-27T10:14:07Z")

</div>


