Google Authentication
Follow these steps to set up Google Authentication.
Step 1: Create a Google Cloud Project
- Go to Google Cloud Console.
- Create a new project.
- Navigate to “APIs & Services” > “Credentials.”
- Click “Create Credentials” and select “OAuth 2.0 Client IDs.”
- Configure your consent screen and create a new OAuth 2.0 client ID.
- Under “Authorized redirect URIs,” add your redirect URL:
http://localhost:3000/api/auth/callback/google
for local development.https://example.com/api/auth/callback/google
for production.
Step 2: Copy Credentials to .env.local
- After creating your OAuth credentials, copy the
Client ID
andClient Secret
provided by Google. - In your project’s
.env.local
file, add the following environment variables, and paste the values.GOOGLE_CLIENT_ID
GOOGLE_CLIENT_SECRET