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.
Was this page helpful?