# How to get JWT access token instead of opaque access token?

**URL:** <https://community.auth0.com/t/how-to-get-jwt-access-token-instead-of-opaque-access-token/60105>\
**Category:** Get Help\
**Tags:** opaque-tokens, access\_token, jwt\
**Created:** [March 26, 2021, 10:49am UTC](https://community.auth0.com/t/how-to-get-jwt-access-token-instead-of-opaque-access-token/60105 "2021-03-26T10:49:21Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![msontakke](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/msontakke/32/28369_2.png) [@msontakke](https://community.auth0.com/u/msontakke)\
**Post date:** [March 26, 2021, 10:49am UTC](https://community.auth0.com/t/how-to-get-jwt-access-token-instead-of-opaque-access-token/60105/1 "2021-03-26T10:49:22Z")

</div>

I am using Auth0 WordPress plugin for SSO. The plugin works well. However, I would like to extend the requirement and so I am using the “auth0\_user\_login” action to get the access token of the user. But it returns the Opaque access token e.g. aRPsWnVNDnLRhTTyqJXa\_PWxrKM7joOc and not JWT access token.  
Can you please provide me assistance on how to get JWT access token based on opaque access token?

---

<div class="post-metadata">

**Author:** ![stephanie.chamblee](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stephanie.chamblee/32/26087_2.png) [@stephanie.chamblee](https://community.auth0.com/u/stephanie.chamblee)\
**Post date:** [March 26, 2021, 11:36am UTC](https://community.auth0.com/t/how-to-get-jwt-access-token-instead-of-opaque-access-token/60105/3 "2021-03-26T11:36:54Z")

</div>

Hi @msontakke,

The opaque token is the Access Token you can use for the `/userinfo` endpoint to get user profile data. In order to get a JWT for the Access Token, you’ll need to provide an `audience`. The `audience` is the API Identifier of an API that you have registered with Auth0 ([Register APIs](https://auth0.com/docs/get-started/set-up-apis)).

As described in [this topic](https://community.auth0.com/t/wp-plugin-login-and-api-audience/9535/2), you can set the `audience` by configuring `Extra settings` under the `Advanced` tab in the plugin settings like so: `{"auth":{"params":{"audience": "http://your-domain.tld/example"}}}`

Related docs: [Access Tokens](https://auth0.com/docs/tokens/access-tokens)

---

<div class="post-metadata">

**Author:** ![msontakke](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/msontakke/32/28369_2.png) [@msontakke](https://community.auth0.com/u/msontakke)\
**Post date:** [March 26, 2021, 12:32pm UTC](https://community.auth0.com/t/how-to-get-jwt-access-token-instead-of-opaque-access-token/60105/5 "2021-03-26T12:32:48Z")

</div>

Hi @stephanie.chamblee,

I have set the audience under Extra Settings. But, it still returns the opaque access token and not JWT access token.

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

---

<div class="post-metadata">

**Author:** ![stephanie.chamblee](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stephanie.chamblee/32/26087_2.png) [@stephanie.chamblee](https://community.auth0.com/u/stephanie.chamblee)\
**Post date:** [March 26, 2021, 12:42pm UTC](https://community.auth0.com/t/how-to-get-jwt-access-token-instead-of-opaque-access-token/60105/6 "2021-03-26T12:42:27Z")

</div>

Are you using the New or Classic Universal Login Experience? Those settings are used for the Classic Universal Login

 ![screenshot-manage.auth0.com-2021.03.26-08_42_56](https://global.discourse-cdn.com/auth0/original/3X/2/c/2c978845998de5738c8dacc40689e9728805b389.png)

---

<div class="post-metadata">

**Author:** ![msontakke](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/msontakke/32/28369_2.png) [@msontakke](https://community.auth0.com/u/msontakke)\
**Post date:** [March 26, 2021, 1:35pm UTC](https://community.auth0.com/t/how-to-get-jwt-access-token-instead-of-opaque-access-token/60105/7 "2021-03-26T13:35:44Z")

</div>

Thank you @stephanie.chamblee. That worked. 🙂

---

<div class="post-metadata">

**Author:** ![stephanie.chamblee](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stephanie.chamblee/32/26087_2.png) [@stephanie.chamblee](https://community.auth0.com/u/stephanie.chamblee)\
**Post date:** [March 26, 2021, 1:37pm UTC](https://community.auth0.com/t/how-to-get-jwt-access-token-instead-of-opaque-access-token/60105/8 "2021-03-26T13:37:18Z")

</div>

Great! Glad to hear it!

Are you looking for an Access Token to use with an API, or are you looking for additional information about the user? You may want to try using the ID Token instead of the Access Token since that is always a JWT and is meant to provide profile info to the client.

> **[Tokens](https://auth0.com/docs/secure/tokens)**
>
> Describes the types of tokens related to identity and authentication and how they are used by Auth0.

---

<div class="post-metadata">

**Author:** ![msontakke](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/msontakke/32/28369_2.png) [@msontakke](https://community.auth0.com/u/msontakke)\
**Post date:** [March 26, 2021, 1:38pm UTC](https://community.auth0.com/t/how-to-get-jwt-access-token-instead-of-opaque-access-token/60105/9 "2021-03-26T13:38:59Z")

</div>

Yeah! I was looking for an Access Token to use with an API.

---

<div class="post-metadata">

**Author:** ![stephanie.chamblee](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stephanie.chamblee/32/26087_2.png) [@stephanie.chamblee](https://community.auth0.com/u/stephanie.chamblee)\
**Post date:** [March 26, 2021, 1:39pm UTC](https://community.auth0.com/t/how-to-get-jwt-access-token-instead-of-opaque-access-token/60105/10 "2021-03-26T13:39:27Z")

</div>

Ah, okay! That makes sense!

---

<div class="post-metadata">

**Author:** ![jeff7](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jeff7/32/28545_2.png) [@jeff7](https://community.auth0.com/u/jeff7)\
**Post date:** [April 1, 2021, 7:09pm UTC](https://community.auth0.com/t/how-to-get-jwt-access-token-instead-of-opaque-access-token/60105/11 "2021-04-01T19:09:08Z")

</div>

I can’t find this setting - where can I get to it?

---

<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:** [April 16, 2021, 7:09pm UTC](https://community.auth0.com/t/how-to-get-jwt-access-token-instead-of-opaque-access-token/60105/12 "2021-04-16T19:09:43Z")

</div>

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