# Empty payload in accessToken is not valid

**URL:** <https://community.auth0.com/t/empty-payload-in-accesstoken-is-not-valid/95678>\
**Category:** Get Help\
**Tags:** clients, management-api\
**Created:** [December 5, 2022, 2:13pm UTC](https://community.auth0.com/t/empty-payload-in-accesstoken-is-not-valid/95678 "2022-12-05T14:13:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![BennyBe](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/bennybe/32/34077_2.png) [@BennyBe](https://community.auth0.com/u/BennyBe)\
**Post date:** [December 5, 2022, 2:13pm UTC](https://community.auth0.com/t/empty-payload-in-accesstoken-is-not-valid/95678/1 "2022-12-05T14:13:06Z")

</div>

Hello,

I am using flutter as a frontend, the login works and I get a valid accessToken (valid because I can use this accessToken to the userProfile on the flutter side). When I want to use this accessToken in my backend, PyJWT crashes because the payload of the accessToken is empty. [https://jwt.io/](https://jwt.io/) also tells me that the accessToken is not valid ( invalid signature) with the warning “Looks like your JWT payload is not a valid JSON object. JWT payloads must be top level JSON objects as per [RFC 7519: JSON Web Token (JWT)](https://tools.ietf.org/html/rfc7519#section-7.2)”.

This is my accessToken: eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIiwiaXNzIjoiaHR0cHM6Ly9kZXYtb3NzMGpqMm90NTRjNTNlcC51cy5hdXRoMC5jb20vIn0…73aqD36lMmtxkB2d.1MV9uRDXBbaeod9QyWrevFkpDJo175dfUkKG1eMnen7ml28EnZo48d7ciGSghaCqtSbh70CcQI2pU9Iw3tlBso0Wpm2b1W5712OBPVDlnZWOF6YE7za1cU4rmJbUo90WlbQ8OnexwVMALgTibjWjin5bMeNEo9nwDTOagQaiwIJAlvXu-Q0RBPd3m1WUnJ0gMItU1mE1f0s74GF5AdscZXOt\_4LrnXQ134p8U9DClEskpzpKckAXImTbMXzCsPJ8S2v3Jvm4z72CResW9rPz3MIl47Kn-BUxJ8d\_5Kg9xto6k1Z0bC7ABq4K8ROtGMJzX971zbvy92aeliE3aMx-M7QHLlcYenziR5frL-82wrscUD7978c.3H4o6RUtDagT1a6WRTBpgw

How can I get a valid accessToken with a valid JSON as a payload?

---

<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:** [December 5, 2022, 6:24pm UTC](https://community.auth0.com/t/empty-payload-in-accesstoken-is-not-valid/95678/3 "2022-12-05T18:24:08Z")

</div>

Hi @BennyBe,

I understand that you have experienced issues getting a valid JWT Access Token.

> [@BennyBe](#):
>
> How can I get a valid accessToken with a valid JSON as a payload?

Firstly, could you please clarify if you have included an `audience` in your login request?

Usually, when the login request omits the `audience` property, it results in [opaque access tokens.](https://auth0.com/docs/secure/tokens/access-tokens/get-access-tokens#control-access-token-audience)

If this is the case, I recommend including the `audience` parameter in your login request to fix the issue. Please see our [Get Access Tokens](https://auth0.com/docs/secure/tokens/access-tokens/get-access-tokens) documentation for more information.

Please let me know how this goes.

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![BennyBe](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/bennybe/32/34077_2.png) [@BennyBe](https://community.auth0.com/u/BennyBe)\
**Post date:** [December 6, 2022, 7:38am UTC](https://community.auth0.com/t/empty-payload-in-accesstoken-is-not-valid/95678/4 "2022-12-06T07:38:51Z")

</div>

Thank you, the example did not use audience, so I did not know I had to set it myself.

This worked for me:

```auto
final credentials = await controller.auth0.webAuthentication(scheme: "example-auth0").login(
    audience: 'http://127.0.0.1:8000',
);

```

---

<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:** [December 20, 2022, 7:39am UTC](https://community.auth0.com/t/empty-payload-in-accesstoken-is-not-valid/95678/5 "2022-12-20T07:39:45Z")

</div>

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