# Still getting an opaque token with audience and scope

**URL:** <https://community.auth0.com/t/still-getting-an-opaque-token-with-audience-and-scope/185359>\
**Category:** Get Help\
**Tags:** apis, application\
**Created:** [April 11, 2025, 8:03am UTC](https://community.auth0.com/t/still-getting-an-opaque-token-with-audience-and-scope/185359 "2025-04-11T08:03:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Heady](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/heady/32/72993_2.png) [@Heady](https://community.auth0.com/u/Heady)\
**Post date:** [April 11, 2025, 8:03am UTC](https://community.auth0.com/t/still-getting-an-opaque-token-with-audience-and-scope/185359/1 "2025-04-11T08:03:47Z")

</div>

Hello,

Even with setting both the audience to a valid API, I’m still getting an opaque token instead of a valid JWT:

```auto
auth0Client = await auth0.createAuth0Client({
        domain:"mycompany.eu.auth0.com",
        clientId: " ******",
        audience: "https://vault.mycompany.com",
        scope: "openid profile email"
    });

async function getToken() {
    const token = await auth0Client.getTokenSilently({
        scope: "openid profile email" // optional, include what you need
    }); // Get the JWT token silently without redirect
    console.log('JWT Token:', token); // Log the token for debugging
    return token;
}

```

I also tried to remove the add the audience in getTokenSliently, as well as removing all the parameters but I always get an in valid JWT token

---

<div class="post-metadata">

**Author:** ![Heady](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/heady/32/72993_2.png) [@Heady](https://community.auth0.com/u/Heady)\
**Post date:** [April 11, 2025, 8:09am UTC](https://community.auth0.com/t/still-getting-an-opaque-token-with-audience-and-scope/185359/2 "2025-04-11T08:09:05Z")

</div>

After reading this field: getting-opaque-token-instead-of-jwt-token-audience-added/129715, it seems that the audience is NOT present in the authorize request:

```auto
/authorize?client_id=**&scope=openid profile email&prompt=none&response_type=code&response_mode=web_message&state=c2hTWXRRZmI0c0tpNlpLU1JSTlJtUn41QTZWV2EwLmJ1VWJtLkcyRUxWcQ==&nonce=NnJGdGM2UHVJN2xNbmJRclFXVFJYcjA0c3g2dkJUcWNfZ3Y3WW05MjhtTw==&redirect_uri=http://localhost:3000&code_challenge=0KIblbiic-f3JikbLL9zkwKNcJZIzfAu87psSlbBZPA&code_challenge_method=S256&auth0Client=eyJuYW1lIjoiYXV0aDAtc3BhLWpzIiwidmVyc2lvbiI6IjIuMC44In0=

```

---

<div class="post-metadata">

**Author:** ![Heady](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/heady/32/72993_2.png) [@Heady](https://community.auth0.com/u/Heady)\
**Post date:** [April 11, 2025, 8:27am UTC](https://community.auth0.com/t/still-getting-an-opaque-token-with-audience-and-scope/185359/3 "2025-04-11T08:27:37Z")

</div>

Ok i finally found the issue: audience and scope have to be set inside authorizationParams:

```auto
auth0Client = await auth0.createAuth0Client({
        domain:"mycompany.eu.auth0.com",
        clientId: " ******",
        authorizationParams: {
          audience: "https://vault.mycompany.com",
          scope: "openid profile email",
       }
    });

```

---

<div class="post-metadata">

**Author:** ![dawid.matuszczyk](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dawid.matuszczyk/32/74550_2.png) [@dawid.matuszczyk](https://community.auth0.com/u/dawid.matuszczyk)\
**Post date:** [April 11, 2025, 9:38am UTC](https://community.auth0.com/t/still-getting-an-opaque-token-with-audience-and-scope/185359/4 "2025-04-11T09:38:19Z")

</div>

Hi @Heady!

Welcome to the Auth0 Community!

Thank you for posting your question and the solution that you found with the rest of the community!

Thanks!  
Dawid

---

<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 25, 2025, 9:39am UTC](https://community.auth0.com/t/still-getting-an-opaque-token-with-audience-and-scope/185359/5 "2025-04-25T09:39:15Z")

</div>

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