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": "[johndoe@example.com] " "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
BinarySenseiii
BinarySenseiiiā€¢13mo ago
@vitor markis @Panda kindly guide lit bit
Panda
Pandaā€¢13mo ago
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...
BinarySenseiii
BinarySenseiiiā€¢13mo ago
BinarySenseiii
BinarySenseiiiā€¢13mo ago
why its showing null
deforestor
deforestorā€¢13mo ago
Did you edit the schema.prisma to accept the new field from google?
BinarySenseiii
BinarySenseiiiā€¢13mo ago
m not using prisma
deforestor
deforestorā€¢13mo ago
But you're using a db, right?
BinarySenseiii
BinarySenseiiiā€¢13mo ago
yes mongodb