I am new to auth0 and authentication in general so I’m hoping someone can help me out here.
I have a nextjs site and used the quick start tutorial to hook it up to auth0, so now I can login and get auth0 user info on the front end.
Now that I have an authorized user I want to call an external api (one that I wrote) from a authorized only page to get user specific data. So a wrote a component whose link is only visible on the home page if a user object from useUser exists, then that page calls an endpoint in the nextjs api folder wrapped with withApiAuthRequired(). Within that method I tried to get a jwt token that had some of the auth0 information in (email and id) that I could pass to the api; but all I’m getting from the getAccessToken() method is an opaque token.
I read in the docs that I need to set an audience and that’s where I get completely lost. I don’t know where to set it (in the […auth0].js file?) , how to set it (in my auth0 application setup?) , or what to set it to (do I set it to the api I’m going to call, or from the application that calls it?).
I know this question is all over the place, but I’m that lost…