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

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?

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.

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

<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

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