#Next-auth with Spring Boot oauth

9 messages · Page 1 of 1 (latest)

lusty turret
#

Hi, im using spring boot oauth2 for authentication with nextjs frontend. I want to use next-auth for the flow. Can anyone recommend any resources?

dense aspenBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

lean veldt
lusty turret
#

im using my own oauth flow from backend side i.e spring boot, now the thing is everything happens at backend, i just need to redirect my client to backend and from there it takes the google acc and returns me the jwt token upon success. Now how do i integrate this with next-auth?

lean veldt
#

Make the auth on nextjs, later u can make fetchs to the backend and pass the session...

#

Also u can use a db adapter to access data from ur backend https://authjs.dev/getting-started/adapters

An Adapter in Auth.js connects your application to whatever database or backend system you want to use to store data for users, their accounts, sessions, etc. Adapters are optional, unless you need to persist user information in your own database, or you want to implement certain flows. For example, the Email Provider requires an adapter to be a...

lusty turret
#

@lean veldt So you are saying to authenticate the user on nextjs instead of spring boot?

lean veldt