# Empty access token payload when using PKCE

**URL:** <https://community.auth0.com/t/empty-access-token-payload-when-using-pkce/78581>\
**Category:** Get Help\
**Tags:** pkce, access-token\
**Created:** [February 18, 2022, 9:24pm UTC](https://community.auth0.com/t/empty-access-token-payload-when-using-pkce/78581 "2022-02-18T21:24:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![chris36](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/chris36/32/33792_2.png) [@chris36](https://community.auth0.com/u/chris36)\
**Post date:** [February 18, 2022, 9:24pm UTC](https://community.auth0.com/t/empty-access-token-payload-when-using-pkce/78581/1 "2022-02-18T21:24:10Z")

</div>

I’ve been trying to setup a SPA which sends an auth token to my APIs whose endpoints are secured but no matter what I do I can’t get an auth token with a payload to send to the APIs even when using Postman to do the PKCE authentication - although Implicit flow does return a valid auth token when using Postman. I’ve been sure to set an audience in Postman and my SPA.

The PKCE flow works both in my SPA and in Postman in that I can do the code exchange to get the id\_token which contains the user email, name etc so all that seems fine. I’ve inspected the generated Auth Token in [JWT.io](http://JWT.io) and while the headers are OK the payload is always empty.

If I use [https://dashboard-v1.whatabyte.app/](https://dashboard-v1.whatabyte.app/) then I do get a populated payload so clearly it’s something I’m doing wrong. This has been driving me nuts for the last few days!

**Application Type** - Native (I’ve tried different combinations)  
**Grant Types** - Implicit , Authorization Code, Refresh Token

---

<div class="post-metadata">

**Author:** ![chris36](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/chris36/32/33792_2.png) [@chris36](https://community.auth0.com/u/chris36)\
**Post date:** [February 19, 2022, 6:14pm UTC](https://community.auth0.com/t/empty-access-token-payload-when-using-pkce/78581/2 "2022-02-19T18:14:52Z")

</div>

Hopefully this will help others, what was happening is that even though the audience was set in Postman it wasn’t actually sending it in the request so what was coming back was a JWE, not a JWT (similar to [Auth0 access token is missing the JWS payload](https://community.auth0.com/t/auth0-access-token-is-missing-the-jws-payload/71674))

The audience had been set in Postman but it doesn’t seem to actually send it so I had to include the audience in the query string e.g. https://{TENANT}[auth0.com/authorize?audience=https://{MYAPI}](http://auth0.com/authorize?audience=https://%7BMYAPI%7D), there’s more info on the Postman issue here:  
[Feature Request: specify audience when getting OAUTH2 token · Issue #2934 · postmanlabs/postman-app-support · GitHub](https://github.com/postmanlabs/postman-app-support/issues/2934)

---

<div class="post-metadata">

**Author:** ![SaqibHussain](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/saqibhussain/32/42924_2.png) [@SaqibHussain](https://community.auth0.com/u/SaqibHussain)\
**Post date:** [February 20, 2022, 9:02am UTC](https://community.auth0.com/t/empty-access-token-payload-when-using-pkce/78581/3 "2022-02-20T09:02:52Z")

</div>

Hi @chris36

Welcome to Auth0 Community, it’s great to have you on board.

Well done for figuring this out 👍

I must admit, I’ve had issues with postman previously so I tend to use curl, this way the calls to the Auth0 service work as documented.

Let us know if you have any other issues with this.  
Warm regards.

---

<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:38pm UTC](https://community.auth0.com/t/empty-access-token-payload-when-using-pkce/78581/4 "2022-02-22T14:38:49Z")

</div>


