# Invalid access token payload, jwt encrypted with A256GCM

**URL:** <https://community.auth0.com/t/invalid-access-token-payload-jwt-encrypted-with-a256gcm/77893>\
**Category:** Get Help\
**Tags:** jwt, login\
**Created:** [February 8, 2022, 4:03pm UTC](https://community.auth0.com/t/invalid-access-token-payload-jwt-encrypted-with-a256gcm/77893 "2022-02-08T16:03:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![thomaux](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/thomaux/32/35053_2.png) [@thomaux](https://community.auth0.com/u/thomaux)\
**Post date:** [February 8, 2022, 4:03pm UTC](https://community.auth0.com/t/invalid-access-token-payload-jwt-encrypted-with-a256gcm/77893/1 "2022-02-08T16:03:48Z")

</div>

Hi everyone,

I’m trying to set up a Vue3 SPA with a NestJS API in the back. I set up my Auth0 tenant and client to integrate with the SPA and plan to send the resulting JWTs to my API. In my SPA, I use the [vue-auth0-plugin](https://www.npmjs.com/package/vue-auth0-plugin), which uses [@auth0/auth0-spa-js](https://www.npmjs.com/package/@auth0/auth0-spa-js) under the hood.

I have successfully set up the Auth Code with PKCE flow, up to the point where I receive id, access and refresh tokens. However, something is wrong with the access token and I cannot understand why it is happening. The payload is invalid JSON and the token contains 2 consecutive `.`. When I paste the token into [jwt.io](http://jwt.io), the header is decoded as follows:

```auto
{
  "alg": "dir",
  "enc": "A256GCM",
  "iss": "https://xyz.auth0.com/"
}

```

I would be expecting:

```auto
{
  "alg": "RS256",
  "typ": "JWT",
  "kid": "w1-e..."
}

```

I have not enabled JWT encryption as far as I know (I used the wizard to set up the SPA client), could anyone point out to me what I am missing? For the sake of completeness, this is the format of my auth request:

```auto
https://xyz.auth0.com/authorize
    ?client_id=REq...
    &redirect_uri=http%3A%2F%2Flocalhost%3A1337
    &scope=openid%20profile%20email
    &response_type=code
    &response_mode=query
    &state=a2...
    &nonce=bT...
    &code_challenge=GjSw...
    &code_challenge_method=S256
    &auth0Client=eyJu...

```

Many thanks in advance,

---

<div class="post-metadata">

**Author:** ![thomaux](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/thomaux/32/35053_2.png) [@thomaux](https://community.auth0.com/u/thomaux)\
**Post date:** [February 10, 2022, 8:33am UTC](https://community.auth0.com/t/invalid-access-token-payload-jwt-encrypted-with-a256gcm/77893/2 "2022-02-10T08:33:45Z")

</div>

Solved, I needed to include an audience to receive a valid JWT. This was not very clear from the documentation.

---

<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 10, 2022, 11:08am UTC](https://community.auth0.com/t/invalid-access-token-payload-jwt-encrypted-with-a256gcm/77893/3 "2022-02-10T11:08:10Z")

</div>

Glad you have figured it out yourself! I’m gonna relay that to our docs team!

---

<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:35pm UTC](https://community.auth0.com/t/invalid-access-token-payload-jwt-encrypted-with-a256gcm/77893/4 "2022-02-22T14:35:53Z")

</div>


