skip to Main Content

I would like to create a new Google API project for a nextJS webapp. I cannot understand how to get the API GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET without a domain.

I have to setup in the .env file

# Next Auth Google provider
GOOGLE_CLIENT_ID="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
GOOGLE_CLIENT_SECRET="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

I tried looking for solutions but I cannot find the resources.Screenshot showing the options

2

Answers


  1. Chosen as BEST ANSWER

    I realized that the field is optional and can be changed later in the console. Try to put in something to avoid the validation error and use the following resource to update the authorized origin to localhost.

    https://nextjstemplates.com/docs/authentication/google-login

    This is what worked for localhost.

    enter image description here


  2. Just leave the domain empty and you will get your credentials. This is a bad UX on Google’s part but it is done to prevent users from skipping the field just because they can.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search