To begin with,
To begin, obtain OAuth 2.0 client credentials from the Google API Console
Got this from below:
Google Documentation https://developers.google.com/identity/protocols/oauth2
Configuration
Then
- your client application requests an access token from the Google Authorization Server,
- extracts a token from the response, and
- sends the token to the Google API that you want to access.
Same steps in detail:
given here: https://developers.google.com/identity/protocols/oauth2
New Project:
on same page, asks for Authorized redirect URI
As per https://next-auth.js.org/providers/google
Configuration
https://console.developers.google.com/apis/credentials
The "Authorized redirect URIs" used when creating the credentials must include your full domain and end in the callback path. For example;
For production: https://{YOUR_DOMAIN}/api/auth/callback/google
For development: http://localhost:3000/api/auth/callback/google
Going to use
http://localhost:3000/api/auth/callback/google