Prompt
What redirect URI should I use for Google login in development and production?
Latest observation
Oct 6, 2026
OpenAI APIWeb search: off
For Google OAuth login, the redirect URI must exactly match what’s registered in Google Cloud Console.
Common setup
Development
Use a local callback URL, for example:
http://localhost:3000/auth/google/callback- or
http://localhost:5173/auth/google/callback - or whatever your local app route is
Production
Use your real public domain, for example:
https://yourdomain.com/auth/google/callback
Important rules
- The redirect URI must match exactly:
- scheme:
httpvshttps - domain
- port
- path
- scheme:
- If you use multiple environments, register each redirect URI in Google Cloud Console.
- If your app uses a backend API for the callback, the redirect URI should point there, not to the frontend.
Typical examples
If your app handles the OAuth callback in the backend:
- Dev:
http://localhost:4000/auth/google/callback - Prod:
https://api.yourdomain.com/auth/google/callback
If the frontend handles the callback route:
- Dev:
http://localhost:3000/auth/google/callback - Prod:
https://yourdomain.com/auth/google/callback
Google Console
In Google Cloud Console → APIs & Services → Credentials → OAuth 2.0 Client ID, add both:
- your development redirect URI
- your production redirect URI
If you tell me your stack (e.g. React + Node/Express, Next.js, Laravel, etc.), I can suggest the exact redirect URI format.