# Receiving Opaque Token Instead of JWT Using Client Credentials Grant

**URL:** <https://community.auth0.com/t/receiving-opaque-token-instead-of-jwt-using-client-credentials-grant/128505>\
**Category:** Get Help\
**Tags:** configuration, application\
**Created:** [February 28, 2024, 2:53pm UTC](https://community.auth0.com/t/receiving-opaque-token-instead-of-jwt-using-client-credentials-grant/128505 "2024-02-28T14:53:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![B.KAN](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/b.kan/32/50677_2.png) [@B.KAN](https://community.auth0.com/u/B.KAN)\
**Post date:** [February 28, 2024, 2:53pm UTC](https://community.auth0.com/t/receiving-opaque-token-instead-of-jwt-using-client-credentials-grant/128505/1 "2024-02-28T14:53:53Z")

</div>

Hello Auth0 Community,

I’m currently encountering an issue where I receive an opaque token instead of the expected JWT when using the client credentials grant to authenticate against my API. I’ve verified that my API configuration and the `audience` parameter are correctly set up in the Auth0 dashboard, yet the issue persists. Below is the curl command I’m using to request the token:

curl --request POST   
–url ‘https://{DOMAIN}/oauth/token’   
–header ‘content-type: application/json’   
– data grant\_type: “client\_credentials”  
– data client\_id: “CLIENT\_ID”  
– data client\_secret: “CLIENT\_SECRET”  
– code: url parameter code  
– data redirect\_uri: “[https://APP/callback](https://APP/callback)”  
– data audience: “API\_IDENTIFIER”

I’ve ensured the following:

- The `audience` parameter matches exactly the API identifier set in the Auth0 dashboard.
- I’m using Wized to do the request.

Given this setup, I was expecting to receive a JWT to facilitate API access, but instead, I receive an opaque token. This outcome is puzzling, especially since the audience parameter is correctly specified, which typically triggers JWT issuance.

Could anyone provide insights or suggestions on what might be causing this issue or what further steps I could take to diagnose and resolve it? Any advice on additional configurations to check or common pitfalls to avoid would be greatly appreciated.

Thank you in advance for your help!

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [February 28, 2024, 11:53pm UTC](https://community.auth0.com/t/receiving-opaque-token-instead-of-jwt-using-client-credentials-grant/128505/3 "2024-02-28T23:53:09Z")

</div>

Hey there @B.KAN welcome to the community!

> [@B.KAN](#):
>
> I’m currently encountering an issue where I receive an opaque token instead of the expected JWT when using the client credentials grant to authenticate against my API.

Hmm that’s odd 🤔 What makes you think it’s opaque? Do you see any claims (iss, sub, aud, etc.) when you paste the token in [jwt.io](http://jwt.io)? Is there a reason you are passing a `redirect_uri` as it’s not a required (nor relevant) in a [client credentials exchange](https://auth0.com/docs/api/authentication?shell#client-credentials-flow).

---

<div class="post-metadata">

**Author:** ![B.KAN](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/b.kan/32/50677_2.png) [@B.KAN](https://community.auth0.com/u/B.KAN)\
**Post date:** [February 29, 2024, 9:38am UTC](https://community.auth0.com/t/receiving-opaque-token-instead-of-jwt-using-client-credentials-grant/128505/4 "2024-02-29T09:38:10Z")

</div>

Hey @ty.frith!

Thank you so much for your response!

I realize now that my initial message was missing some crucial information that I have updated now, and I appreciate your patience. Let me address your questions:

1. On the Token Being Opaque: The reason I believed the token to be opaque is based on the format of the response I received from my curl request. Here’s a redacted version of the token for privacy:

```auto
      "access_token": "eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIiwiaXNzIjoiaHR0cHM7Ly8kZXYtbjdjaHhsdWpjYnUwaGpvay5ldS5hdXRoMC5jb20vIn0..v56QqsldVs4O65u4.tDkvOBYxdcVPSAfSuczi9O4h-hfr0xNhHGasjFO2gjabA3X2YDCoW4G34Wo6vSp-FM-vYyIgB8GkHLqedyvtXPAKFbeH4C5Hz3e2fE1IkGjEnvy_oWok0gNKs6YSCTlc7mB4tf-cs4iMHX7AMdxaszsS6Dd1sNkfhk9Oj7Bw076ys_BdInXHU3dFpeGTQN3-I9Vw7nw2z8Xla93IP37RggY1zvjNpffjYR3U6zgEOueqL1YJ36xyM67JQWUQG24PhQmDZU3BsLXGEkQaBr1HhJfe5d6lYz9m1Ytuhp_wfLZjxDPFk-w.j7Hpre1s50JcBHg-fx3A0A
      "expires_in": 86400,
      "token_type": "Bearer"

```

When I attempted to decode this token on [jwt.io](http://jwt.io), it indicated an invalid signature. Furthermore, the structure of the token, notably the presence of two consecutive periods (…) led me to understand it as opaque, according to this documentation [Link opaque token](https://auth0.com/docs/secure/tokens/access-tokens/get-access-tokens#control-access-token-audience) I consulted.

1. Regarding the `redirect_uri` Parameter: Your point about the `redirect_uri` not being required or relevant in a client credentials exchange is well-taken. I included it following the documentation about the “Call Your API Using the Authorization Code Flow” [Call Your API Using the Authorization Code Flow](https://auth0.com/docs/get-started/authentication-and-authorization-flow/authorization-code-flow/call-your-api-using-the-authorization-code-flow).

I hope this clarifies the confusion and gives more insight into the issues I’m facing. If there are any further steps I can take or additional details I can provide to resolve this matter, please let me know. Your guidance is greatly appreciated!

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [February 29, 2024, 10:03pm UTC](https://community.auth0.com/t/receiving-opaque-token-instead-of-jwt-using-client-credentials-grant/128505/5 "2024-02-29T22:03:36Z")

</div>

Great, thanks for confirming! Happy to help 🙂

> [@B.KAN](#):
>
> Regarding the `redirect_uri` Parameter: Your point about the `redirect_uri` not being required or relevant in a client credentials exchange is well-taken. I included it following the documentation about the “Call Your API Using the Authorization Code Flow” [Call Your API Using the Authorization Code Flow](https://auth0.com/docs/get-started/authentication-and-authorization-flow/authorization-code-flow/call-your-api-using-the-authorization-code-flow).

The authorization code flow referenced there is a user based flow, whereas client credentials doesn’t involve a user. Have you tried constructing a cURL request based on the example [here](https://auth0.com/docs/api/authentication?shell#client-credentials-flow)?

---

<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:** [March 16, 2024, 1:13am UTC](https://community.auth0.com/t/receiving-opaque-token-instead-of-jwt-using-client-credentials-grant/128505/6 "2024-03-16T01:13:11Z")

</div>

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