Sign in with Google: Error 400
'Sign in with Google' works perfectly on your laptop. On your real domain, users see 'Error 400: redirect_uri_mismatch'.
This answers: How do I fix Google redirect_uri_mismatch? No coding needed. 2 quick decisions.
- Who is signed in
- How a request travels
Checking your access…
How do I fix Google redirect_uri_mismatch?
Add the exact your app uses in production to the allowed redirect URIs in Google Cloud Console and in your auth provider. It must match exactly, including https, domain, path and trailing slash. Google does not allow wildcards, so give each environment that needs sign-in a stable address.
Breaks at Google: Callback URL not registered
Why AI tools write this bug
Sign-in is usually set up and tested on , and the production callback is never added to the provider's settings.
How to fix it
- Read the shown on Google's error page.
3 more steps, and a prompt that checks your own app for this bug. Part of Pro.
UnlockCommon questions
- Can I use a wildcard redirect URI with Google?
- No. Google requires exact URLs, which prevents attackers redirecting login codes to their own sites.