withApiAuthRequired deprecated

I rarely post on these forums but then again I’ve rarely been this frustrated with something that should be so simple.

I’ve been trying to make a very simple setup work for the better part of a day1.

  1. User logs in through my frontend (nextjs)
  2. frontend requests an accessToken and sends it to my backend to do other operations

Now, the accessToken I get using getAccessToken is ALWAYS encrypted, and thus can’t properly be decoded by my backend. The docs are absolutely useless, half of what I read seems to be deprecated, in short I’m thinking of tossing the whole thing and going with another provider - and never EVER use this again. But I’ll still ask if someone managed to solve the problem.

Hi @Gdasl

Welcome to the Auth0 Community!

Thank you for posting your question. Based on your description, you are missing an audience parameter in the calls to Auth0. That should be the reason why you are getting the opaque token instead of the JWT. → https://auth0.com/docs/secure/tokens/access-tokens#opaque-access-tokens You can find examples on how to pass the audience parameter here → nextjs-auth0/EXAMPLES.md at main · auth0/nextjs-auth0 · GitHub

Thanks!
Dawid

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.