I’m trying to achieve a simple concept, from a logged in authenticated user get a JWT that I can pass to an external API for authentication and get the user id. A few things I’ve determined
- From the next.js middleware the following code accessToken doesn’t not validate to the external API
const user = await getSession(req, res);
cont token = user.accessToken
- If I use a client_credentials call the jwt does validate to the external API, but doesn’t contain any information about the logged in user.
Any help would be greatly appreciated. I’m at a point where I may just give up on auth0. Thank you for your time.