# Empty payload in access\_token

**URL:** <https://community.auth0.com/t/empty-payload-in-access-token/75952>\
**Category:** Get Help\
**Created:** [January 6, 2022, 10:17pm UTC](https://community.auth0.com/t/empty-payload-in-access-token/75952 "2022-01-06T22:17:16Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Blissitte](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/blissitte/32/34247_2.png) [@Blissitte](https://community.auth0.com/u/Blissitte)\
**Post date:** [January 6, 2022, 10:17pm UTC](https://community.auth0.com/t/empty-payload-in-access-token/75952/1 "2022-01-06T22:17:16Z")

</div>

I created a new Application and API while following Auth0 tutorials and tokens requested from my Angular web application come with no payload in the access\_token portion of the response.

 ![image](https://global.discourse-cdn.com/auth0/original/3X/6/8/68e987b206e700fe4cf6526eb1d0845339efdad9.png)

id\_token has a payload. Are there settings necessary to add roles, permissions, claims to the payload or enable the payload too be added to the JWT on an application (NOT on an API).

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [January 6, 2022, 11:59pm UTC](https://community.auth0.com/t/empty-payload-in-access-token/75952/3 "2022-01-06T23:59:15Z")

</div>

Hi @Blissitte,

Welcome to the Auth0 Community!

I understand that you have encountered issues getting a working access token.

Before we continue, could you please clarify the `/authorize` and `/oauth/token` requests that you made?

For example:

```auto
https://YOUR_DOMAIN/authorize?
    response_type=code&
    client_id=YOUR_CLIENT_ID&
    redirect_uri=https://YOUR_APP/callback&
    scope=SCOPE&
    audience=API_AUDIENCE&
    state=STATE

```

and

```auto
curl --request POST \
  --url 'https://YOUR_DOMAIN/oauth/token' \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data grant_type=authorization_code \
  --data 'client_id=YOUR_CLIENT_ID' \
  --data client_secret=YOUR_CLIENT_SECRET \
  --data code=YOUR_AUTHORIZATION_CODE \
  --data 'redirect_uri=https://YOUR_APP/callback'

```

[https://auth0.com/docs/get-started/authentication-and-authorization-flow/call-your-api-using-the-authorization-code-flow](https://auth0.com/docs/get-started/authentication-and-authorization-flow/call-your-api-using-the-authorization-code-flow)

Looking forward to your response.

Thanks.

---

<div class="post-metadata">

**Author:** ![Blissitte](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/blissitte/32/34247_2.png) [@Blissitte](https://community.auth0.com/u/Blissitte)\
**Post date:** [January 7, 2022, 12:28am UTC](https://community.auth0.com/t/empty-payload-in-access-token/75952/4 "2022-01-07T00:28:00Z")

</div>

Certainly, I am using the auth0-angular package so our authorize request looks like so:

> [https://dev-u3c56kd8.us.auth0.com/authorize?redirect\_uri=http://localhost:4200](https://dev-u3c56kd8.us.auth0.com/authorize?redirect_uri=http://localhost:4200)  
> &client\_id=AS5QbWyBNqbk1cvLgf1AWfsVd1xfDCK9  
> &scope=openid profile email  
> &response\_type=code  
> &response\_mode=web\_message  
> &state=WTlXQ1Boa3VzR3M0NGJfT1Z1WUxybm42Z095YVRWfml5WThjWjZqU3hNbw==  
> &nonce=UzdpaVNjMDRiTVZubzJGdjd0d1dvSmE1eXNmV0VfUTFVUURoZGs2Mm82bw==  
> &code\_challenge=DYoEA7GWQ9djGq8qgYWnUMY1MDlomdwTBTwUFjfnfbM  
> &code\_challenge\_method=S256  
> &prompt=none  
> &auth0Client=eyJuYW1lIjoiQGF1dGgwL2F1dGgwLWFuZ3VsYXIiLCJ2ZXJzaW9uIjoiMS44LjEifQ==

And the token request looks like so:

> curl “[https://dev-u3c56kd8.us.auth0.com/oauth/token](https://dev-u3c56kd8.us.auth0.com/oauth/token)” ^  
> -H “authority: [dev-u3c56kd8.us.auth0.com](http://dev-u3c56kd8.us.auth0.com)” ^  
> -H “auth0-client: eyJuYW1lIjoiQGF1dGgwL2F1dGgwLWFuZ3VsYXIiLCJ2ZXJzaW9uIjoiMS44LjEifQ==” ^  
> -H “user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36” ^  
> -H “content-type: application/json” ^  
> -H “accept: _/_” ^  
> -H “sec-gpc: 1” ^  
> -H “origin: [http://localhost:4200](http://localhost:4200)” ^  
> -H “sec-fetch-site: cross-site” ^  
> -H “sec-fetch-mode: cors” ^  
> -H “sec-fetch-dest: empty” ^  
> -H “referer: [http://localhost:4200/](http://localhost:4200/)” ^  
> -H “accept-language: en-US,en;q=0.9” ^  
> –data-raw “^{^^“client\_id^^”:^^“AS5QbWyBNqbk1cvLgf1AWfsVd1xfDCK9^^”,^^“code\_verifier^^”:^^“T\_CVy623KIsyjzS6BBzG8FzcNbnACsZwjcHtRa6lfoK^^”,^^“grant\_type^^”:^^“authorization\_code^^”,^^“code^^”:^^“FZzN9ZXgAPSPYOGuWyy5rDQ0mJHyT1bkYFYbEMzp-m8Pe^^”,^^“redirect\_uri^^”:^^“http://localhost:4200^^”^}” ^  
> –compressed

---

<div class="post-metadata">

**Author:** ![Blissitte](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/blissitte/32/34247_2.png) [@Blissitte](https://community.auth0.com/u/Blissitte)\
**Post date:** [January 7, 2022, 6:18pm UTC](https://community.auth0.com/t/empty-payload-in-access-token/75952/5 "2022-01-07T18:18:30Z")

</div>

I just realized that the data section does not have a very good representation of that payload for the token request.

![image](https://global.discourse-cdn.com/auth0/original/3X/3/7/379b1f861bf78cda76b860f7a54b58ca48383b22.png)

---

<div class="post-metadata">

**Author:** ![Blissitte](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/blissitte/32/34247_2.png) [@Blissitte](https://community.auth0.com/u/Blissitte)\
**Post date:** [January 7, 2022, 9:49pm UTC](https://community.auth0.com/t/empty-payload-in-access-token/75952/6 "2022-01-07T21:49:59Z")

</div>

Figured out the problem. I did not have the audience property in my auth object! For future developers, you have to specify the APIs that you want to get tokens to authorize your user for. In this case I am in an Angular web application, my auth details are in my environment.ts file and are passed to the AuthModule.forRoot() call in my app.module.ts.

Exerpt from app.module.ts

> AuthModule.forRoot({  
> …environment.auth,  
> httpInterceptor: {  
> allowedList:[  
> ‘[https://localhost:8443/](https://localhost:8443/)\*’  
> ]  
> }  
> })

environment.ts

> export const environment = {  
> production: false,  
> baseApiUrl: “/api”,  
> auth: {  
> domain: ‘https://{myAuthDomain}.us.auth0.com’,  
> clientId: ‘{My Client Id}’,  
> redirectUri: window.location.origin,  
> audience: “{The API Audience that I am going to call}”, //This was missing  
> }  
> };

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [January 7, 2022, 11:17pm UTC](https://community.auth0.com/t/empty-payload-in-access-token/75952/7 "2022-01-07T23:17:27Z")

</div>

Hi @Blissitte,

Thank you for your responses and for sharing your solution with the Community!

I’m glad that everything is working now.

Please don’t hesitate to reach out if you have any further questions.

Have a good rest of your day!

Thank you.

---

<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:** [January 22, 2022, 11:17pm UTC](https://community.auth0.com/t/empty-payload-in-access-token/75952/8 "2022-01-22T23:17:28Z")

</div>

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