I have embedded setup with auth0-js in my NextJs application (app router). Integrated authentication flows as described in the auth0-js docs and everything works properly. But, all the authentication process are done in the client components. I want to integrate auth in the server session like next-auth to improve security. Is there a way to integrate auth0-js with next-auth? Or, how can I implement auth in the server components. Please help nerds.
Can I ask how you did the emdedded authentication? Are you using username/password? How do you handle verifying access tokens and what not?
This is actually a pretty standard flow with any authentication platform. The standard way is to get the session object and pass the token to a server action. You can then use that token in a fetch authorization bearer token to your backend. If you are using a ORM, you can use the email address or the auth0 id and just match it up to the user.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.