Auth using express API protected endpoints and NextJS

Hi, I’m trying to figure out how to implement a solution where my NextJS app initiates the login through the auth0 login widget, I get a token back from Auth0, and then use that token to access protected API routes on my Node Express back end. Or maybe I’m thinking about this all wrong.

Note, I’m not using NextJS API routes.

Hey there @itsm welcome to the community, and I apologize for the delayed response!

You’re thinking here makes sense to me :slight_smile: Your best bet is to use the express-oauth2-jwt-bearer library in your Node backend. You can find some helpful examples here.

Hope this helps!

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