Prompt
I’m getting redirect_uri_mismatch on Google login
Latest observation
Oct 6, 2026
OpenAI APIWeb search: off
redirect_uri_mismatch means the redirect URI your app is sending to Google does not exactly match one of the URIs configured in your Google Cloud OAuth client.
What to check
1) Compare the exact redirect URI
Look at the URI your app sends in the OAuth request, for example:
http://localhost:3000/api/auth/callback/googlehttps://example.com/auth/google/callback
It must match exactly in Google Cloud Console:
- same
httpvshttps - same domain
- same port
- same path
- trailing slash matters
- no extra query params
2) Add it in Google Cloud Console
Go to:
Google Cloud Console → APIs & Services → Credentials → OAuth 2.0 Client IDs
Then under your OAuth client, add the redirect URI in:
Authorized redirect URIs
3) Make sure you’re editing the right OAuth client
If you have multiple OAuth client IDs, confirm the app is using the same client ID that you updated.
4) Check your app/framework config
Common framework defaults:
- NextAuth/Auth.js:
http://localhost:3000/api/auth/callback/google - Passport.js:
depends on your callback route - Firebase/Auth UI:
often uses project-specific callback URLs
5) Watch out for environment differences
If it works locally but not in production, add both:
- local callback URL
- production callback URL
Example
If your app uses:
http://localhost:3000/auth/google/callback
then Google Cloud must contain exactly that URI, not:
http://localhost:3000/auth/google/callback/
https://localhost:3000/auth/google/callback
If you want, I can help you fix it quickly
Send me:
- the redirect URI your app is using
- the framework/library you’re using
- the redirect URIs currently listed in Google Cloud
and I’ll tell you exactly what to change.