# Access token payload is empty. i want the user permissions and roles to show in payload fields

**URL:** <https://community.auth0.com/t/access-token-payload-is-empty-i-want-the-user-permissions-and-roles-to-show-in-payload-fields/119365>\
**Category:** Get Help\
**Tags:** apis, application\
**Created:** [October 25, 2023, 12:59pm UTC](https://community.auth0.com/t/access-token-payload-is-empty-i-want-the-user-permissions-and-roles-to-show-in-payload-fields/119365 "2023-10-25T12:59:01Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![varunvihar.boddula](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@varunvihar.boddula](https://community.auth0.com/u/varunvihar.boddula)\
**Post date:** [October 25, 2023, 12:59pm UTC](https://community.auth0.com/t/access-token-payload-is-empty-i-want-the-user-permissions-and-roles-to-show-in-payload-fields/119365/1 "2023-10-25T12:59:01Z")

</div>

Hi Team,

Please find the below issue i am facing and provide the support for the same.

1.i created a spa and api. For api , i added permissions and 2 roles(with added permissions). assigned those roles to a particular user in dashboard. when user logs in, i get access token but the access token does not contain any payload information(paylaod is empty).

i am expecting the login user role(has permissions) permissions should appear in payload field claims/custom claims/permissions.  
also which filed in payload provides the roles assigned to login user.

ex: claims: read:timesheets, write:timesheets

sample access token currently i am getting:  
“xxx”

Thanks.  
Varuvihar

---

<div class="post-metadata">

**Author:** ![marcelina.barycka](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/marcelina.barycka/32/56162_2.png) [@marcelina.barycka](https://community.auth0.com/u/marcelina.barycka)\
**Post date:** [October 25, 2023, 2:59pm UTC](https://community.auth0.com/t/access-token-payload-is-empty-i-want-the-user-permissions-and-roles-to-show-in-payload-fields/119365/2 "2023-10-25T14:59:20Z")

</div>

Hey there @varunvihar.boddula !

Can you please double check if the [/authorize](https://auth0.com/docs/api/authentication#database-ad-ldap-passive-) request you send contains a relevant scope of your API? It influences the access token received.

---

<div class="post-metadata">

**Author:** ![varunvihar.boddula](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@varunvihar.boddula](https://community.auth0.com/u/varunvihar.boddula)\
**Post date:** [October 25, 2023, 3:24pm UTC](https://community.auth0.com/t/access-token-payload-is-empty-i-want-the-user-permissions-and-roles-to-show-in-payload-fields/119365/3 "2023-10-25T15:24:53Z")

</div>

@marcelina.barycka

i am using universal login in angular spa app. when login happens it is calling the url:[https://vannaauth0-dev.us.auth0.com/oauth/token](https://vannaauth0-dev.us.auth0.com/oauth/token) with post with form data:  
client\_id: NJFOoL71k2BrzdbNanIl4Iulr1vKtuGJ  
code\_verifier: c\_tYiYPdVxByxhT-QUNwDvGtnLkE0Qns5uBWfbhrr4C  
grant\_type: authorization\_code  
code: oVjmsy8PIdourziPwF3dqlw688fU29z\_DS0q1HZZugrCP  
redirect\_uri: [http://localhost:4200](http://localhost:4200)

and response is this:

{  
“access\_token”: “xxx”,  
“id\_token”: “xxxx”,  
“scope”: “openid profile email”,  
“expires\_in”: 86400,  
“token\_type”: “Bearer”  
}

and i am not making any calls to /authorize endpoint or my backend API i created.

---

<div class="post-metadata">

**Author:** ![marcelina.barycka](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/marcelina.barycka/32/56162_2.png) [@marcelina.barycka](https://community.auth0.com/u/marcelina.barycka)\
**Post date:** [October 25, 2023, 4:14pm UTC](https://community.auth0.com/t/access-token-payload-is-empty-i-want-the-user-permissions-and-roles-to-show-in-payload-fields/119365/4 "2023-10-25T16:14:41Z")

</div>

Thanks for sharing! Do you define the scopes for your API (that you have set in your Auth0 dashboard) in you app as well?

[SPA Angular 2 Implementation (SPAs + API)](https://auth0.com/docs/get-started/architecture-scenarios/spa-api/spa-implementation-angular2#create-an-authorization-service) - this step shows where to set scopes. By default, the scopes added to the access token are the one you can see in the response you’ve shared. You would also need to add the identifier of your won API there as well.

---

<div class="post-metadata">

**Author:** ![marcelina.barycka](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/marcelina.barycka/32/56162_2.png) [@marcelina.barycka](https://community.auth0.com/u/marcelina.barycka)\
**Post date:** [October 26, 2023, 7:54am UTC](https://community.auth0.com/t/access-token-payload-is-empty-i-want-the-user-permissions-and-roles-to-show-in-payload-fields/119365/5 "2023-10-26T07:54:22Z")

</div>

Just to be more specific on my last replay - if you tried to decode the access token via [jwt.io](https://jwt.io/) and got an empty payload, it may be that you receive an opaque token instead of jwt token. Here you can find explanation for it - [Why is my access token not a JWT? (Opaque Token)](https://community.auth0.com/t/why-is-my-access-token-not-a-jwt-opaque-token/31028)

So I was actually referring to the “audience” parameter that needs to be set to receive a jwt token. With angular sdk, it would go there:

 ![image](https://global.discourse-cdn.com/auth0/original/3X/1/f/1f8d72955736c7cba567e974f34fe9608dde2a89.png)

Also, this topic refers to adding user roles to the access token - [Adding user roles to access token - #4 by chris.tice](https://community.auth0.com/t/adding-user-roles-to-access-token/97373/4)

Hope this helps!

---

<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:** [November 9, 2023, 7:55am UTC](https://community.auth0.com/t/access-token-payload-is-empty-i-want-the-user-permissions-and-roles-to-show-in-payload-fields/119365/6 "2023-11-09T07:55:08Z")

</div>

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