# Token is invalid JWT token auth0-react.js and .NET API

**URL:** <https://community.auth0.com/t/token-is-invalid-jwt-token-auth0-react-js-and-net-api/117116>\
**Category:** Get Help\
**Tags:** apis, application\
**Created:** [September 25, 2023, 9:37pm UTC](https://community.auth0.com/t/token-is-invalid-jwt-token-auth0-react-js-and-net-api/117116 "2023-09-25T21:37:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![waju](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/waju/32/33268_2.png) [@waju](https://community.auth0.com/u/waju)\
**Post date:** [September 25, 2023, 9:37pm UTC](https://community.auth0.com/t/token-is-invalid-jwt-token-auth0-react-js-and-net-api/117116/1 "2023-09-25T21:37:26Z")

</div>

I have an React app using the auth0-react.js to request tokens; the token that is returned is invalid and doesn’t authenticate against my api but when I use the token I request manually via the Auth0 dashboard, it works:

Is there any known issue with JWT tokens and auth0-react.js and .NET API?

---

<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:** [September 26, 2023, 8:55pm UTC](https://community.auth0.com/t/token-is-invalid-jwt-token-auth0-react-js-and-net-api/117116/3 "2023-09-26T20:55:38Z")

</div>

Hi @waju,

Welcome to the Auth0 Community!

It sounds to me that you may have generated an opaque access token. You can verify this by using it against the [`/userinfo` endpoint](https://auth0.com/docs/api/authentication#user-profile).

In this situation, you will need to configure the audience in the Auth0Provider component to specify the `audience` in the `auth0Provider` options:

```auto
<Auth0Provider
      domain="your-auth0-domain"
      clientId="your-auth0-client-id"
      redirectUri={window.location.origin}
      audience="your-api-audience" // Specify your API's audience here>
  <MyApp />
</Auth0Provider>

```

From doing so, your app should generate a JWT access token when logging in.

Please let me know if you have any questions.

Thanks,  
Rueben

---

<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:** [October 10, 2023, 8:55pm UTC](https://community.auth0.com/t/token-is-invalid-jwt-token-auth0-react-js-and-net-api/117116/4 "2023-10-10T20:55:47Z")

</div>

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