Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

authenticate jwt token created by next-auth in nestjs backend with passportjs

I have a nextjs react app. It uses next-auth to create JWT. This app will send post requests to a nestjs backend. I'm planning to send my next-auth JWT as bearer token in request header and my nestjs backend will need to validate it using passportjs.

Is this a reasonable use case? Can passportjs validate my next-auth JWT?

like image 302
killjoy Avatar asked Aug 30 '25 16:08

killjoy


1 Answers

I've written an article on this. Sample projects also included.

https://dev.to/muratas/creating-nextjs-jwt-token-using-ldap-for-authentication-authorization-use-it-in-nestjs-graphql-backend-417a

like image 75
killjoy Avatar answered Sep 04 '25 14:09

killjoy