I have a NextJS app that uses the @auth0/nextjs-auth0 as its authentication library. I’m trying to get an access token but the returned JWT is not a valid object according to jwt.io.
I looks like you are not including an audience string in your request. Without an audience string Auth0 will return an opaque access token which can be used only for querying the userinfo endpoint.
For anyone else that might be reading this, I went to the API section of the Auth0 dashboard and copied the identifier value as the AUTH0_AUDIENCE value in my .env.local file. You will need to restart the Next.js server and re-authenticate for the changes to work.
Thanks for setting me in the right direction @markd!