Using access_token with external APIs

I am working on a nextjs app that needs to call an external API as described in How to Authenticate with Next.js and Auth0: A Guide for Every Deployment Model

The access token that I am receiving does not seem to be a JWT valid token, and I am not sure if its really an opaque token either (it has 32 characters). I tried validating the token against the /userinfo endpoint, but I am getting a 401.

Would you mind sharing a sample on how the external BillingAPI mentioned in the next js tutorial would validate the received token?


Alright, I finally got a JWT by specifying the audience while init auth0 in Next.JS. Something really strange: I was previously doing that on the .env file specifying AUTH0_AUDIENCE but for some weird reason it was not working, and only went through when I manually sent it on my initAuth0 function call.

1 Like

Glad you have it working now and thanks for sharing with the rest of community!