# Auth0 JWT doesn't have requested API Scopes

**URL:** <https://community.auth0.com/t/auth0-jwt-doesnt-have-requested-api-scopes/68046>\
**Category:** Get Help\
**Tags:** jwt, scopes\
**Created:** [August 17, 2021, 6:05am UTC](https://community.auth0.com/t/auth0-jwt-doesnt-have-requested-api-scopes/68046 "2021-08-17T06:05:02Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![vinayvinay](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/vinayvinay/32/12799_2.png) [@vinayvinay](https://community.auth0.com/u/vinayvinay)\
**Post date:** [August 17, 2021, 6:05am UTC](https://community.auth0.com/t/auth0-jwt-doesnt-have-requested-api-scopes/68046/1 "2021-08-17T06:05:02Z")

</div>

Hello, I’m trying to use scopes for my APIs and the JWT returned by Auth0 doesn’t seem to have the requested scopes. I searched around a whole bunch but couldn’t find an answer. I did the following:

1. Created a new API, adding a few different permissions and enabled RBAC and “Add Permissions in Access Token” in Settings.
2. Created a couple roles, added the relevant permissions and users.
3. Opened the Authentication API debugger extension and entered my scope (global\_admin:write) and selected “id\_token” for response type

The resulting JWT doesn’t have the scope I requested for, which seems to suggest that the user doesn’t have the right permissions. But I have confirmed that this user is present in the role I created in (2). What gives? Would appreciate any help or pointers in figuring this out. Thanks!

---

<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:** [August 18, 2021, 9:47pm UTC](https://community.auth0.com/t/auth0-jwt-doesnt-have-requested-api-scopes/68046/3 "2021-08-18T21:47:13Z")

</div>

Hi @vinayvinay,

Welcome to the Auth0 Community!

It sounds like this should be working according to your description. Will you please DM me the name of the tenant so I can double check your configuration?

---

<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:** [August 19, 2021, 4:37pm UTC](https://community.auth0.com/t/auth0-jwt-doesnt-have-requested-api-scopes/68046/4 "2021-08-19T16:37:54Z")

</div>

Everything looks okay in your config. I can’t see if you have the RBAC and Add Permissions settings enabled, but it should be fairly obvious. Can you please post a code snippet of the request you are making?

---

<div class="post-metadata">

**Author:** ![vinayvinay](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/vinayvinay/32/12799_2.png) [@vinayvinay](https://community.auth0.com/u/vinayvinay)\
**Post date:** [August 19, 2021, 5:25pm UTC](https://community.auth0.com/t/auth0-jwt-doesnt-have-requested-api-scopes/68046/5 "2021-08-19T17:25:20Z")

</div>

Both RBAC and Add Permissions are enabled in my API settings. I’m making a request from the  
Auth0 Authentication API Debugger to reduce the number of variables (i.e. there is no code from my end involved). I’ve entered the following info:

1. Username: (this email has been added to the right role with admin privileges on the API)
2. Response Type: id\_token
3. Scope: openid email global\_admin:write
4. Nonce: foo

I then click OAUTH / OIDC login. The JWT I get back has my email and email\_verified but doesn’t have anything for the global\_admin:write scope I requested. Please let me know if I should be doing something else.

---

<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:** [August 19, 2021, 5:57pm UTC](https://community.auth0.com/t/auth0-jwt-doesnt-have-requested-api-scopes/68046/6 "2021-08-19T17:57:33Z")

</div>

It looks like you might be missing the audience param. This param tells Auth0 which API the user is requesting access to.

---

<div class="post-metadata">

**Author:** ![vinayvinay](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/vinayvinay/32/12799_2.png) [@vinayvinay](https://community.auth0.com/u/vinayvinay)\
**Post date:** [August 19, 2021, 7:25pm UTC](https://community.auth0.com/t/auth0-jwt-doesnt-have-requested-api-scopes/68046/7 "2021-08-19T19:25:47Z")

</div>

Great catch. I thought this was it, but specifying the audience parameter still doesn’t solve my problem ☹

The JWT is still missing scope permissions.

---

<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:** [August 19, 2021, 8:08pm UTC](https://community.auth0.com/t/auth0-jwt-doesnt-have-requested-api-scopes/68046/8 "2021-08-19T20:08:32Z")

</div>

Are you looking for them in the ID token?

---

<div class="post-metadata">

**Author:** ![vinayvinay](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/vinayvinay/32/12799_2.png) [@vinayvinay](https://community.auth0.com/u/vinayvinay)\
**Post date:** [August 20, 2021, 6:20am UTC](https://community.auth0.com/t/auth0-jwt-doesnt-have-requested-api-scopes/68046/9 "2021-08-20T06:20:33Z")

</div>

Yes, I’m looking for it in the id\_token. I DMed you a sample JWT I received. One thing I noticed is that regardless of whether I put something in the “Audience” field I see the same “aud” value in the JWT returned by Auth0. Is there something special I need to do get the Audience to take effect?

---

<div class="post-metadata">

**Author:** ![vinayvinay](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/vinayvinay/32/12799_2.png) [@vinayvinay](https://community.auth0.com/u/vinayvinay)\
**Post date:** [August 20, 2021, 6:00pm UTC](https://community.auth0.com/t/auth0-jwt-doesnt-have-requested-api-scopes/68046/10 "2021-08-20T18:00:42Z")

</div>

Using “token” instead of “id\_token” fixed my problem!! Thank you to Dan for the suggestion. Appreciate the time and help very much.

---

<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:** [August 20, 2021, 8:52pm UTC](https://community.auth0.com/t/auth0-jwt-doesnt-have-requested-api-scopes/68046/11 "2021-08-20T20:52:20Z")

</div>

Glad we could get it figured out!

---

<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:** [September 4, 2021, 8:52pm UTC](https://community.auth0.com/t/auth0-jwt-doesnt-have-requested-api-scopes/68046/12 "2021-09-04T20:52:32Z")

</div>

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