External Api with User permissions from NextJs Server

I have a NextJs application that uses NextJs-auth0 for authenticating users. I also have an external dotnet Api which needs to store the user information of user CRUD actions.

The user log in for the Next App works great, but now I’m trying to generate an access token for the user when they try to access the external Api, so that the Api can validate their claims, and store their User information. I am able validate on the Api with an M2M access token, however as this is M2M, this token isn’t specific to the logged in user and doesnt contain their claims/user id.

Is there a way to configure the Api in Auth0, or use Nextjs-auth0 to generate an access token for the Api that is specific to the user that is logged in and contains all their info?


Solved this by re-using the token from the front end for the api as well.

This icludes all the permissions that I need so issue resolved.