Integrating Google OAuth with NextAuth.js: how to get Client and Token from google login
I would like to integrate Google OAuth with NextAuth.js and have an endpoint at /api/signin/google-oauth. To successfully authenticate a user, I need to provide the following data in the request body:
"email": "[[email protected]] "
"entry_event_id": "string" (I already have this value)
"google_client_id": "string"
"google_token_id": "string"
I'm unsure how to obtain the necessary "google_client_id" and "google_token_id" from Google. Could you please guide me on how to acquire these credentials? Additionally, once I have them, which approach is recommended for posting this data to the API from the client-side: using React Query or NextAuth.js callbacks? I'm new to Next.js, and any assistance would be greatly appreciated.
8 Replies
@vitor markis @Panda kindly guide lit bit
No clue why you tagged me but just follow this guide https://m.youtube.com/watch?v=A5ZN--P9vXM&pp=ygUZTmV4dCBhdXRoIGdvb2dsZSBwcm92aWRlcg%3D%3D
Code Commerce
YouTube
Next JS Authentication - Sign In With Google (NextAuth.js)
Learn how to incorporate Next JS authentication into your Next JS application. Sign in with Google using the Next-Auth package provided for us by Vercel! Start from a blank NextJS application and set up next-auth from scratch and sign in using your google account.
š Thank you for following along and please let me know what you think in the comm...
why its showing null
Did you edit the schema.prisma to accept the new field from google?
m not using prisma
But you're using a db, right?
yes mongodb