Prompt
Why is Google sign in failing in my app?
Latest observation
Google sign-in can fail for a lot of different reasons, and the fix depends on where it’s failing:
- Frontend OAuth flow
- Backend token exchange / verification
- Firebase Auth
- Google Cloud Console configuration
- Mobile app setup (Android/iOS)
Common causes
1) OAuth client is misconfigured
Check in Google Cloud Console:
- Correct Client ID
- Correct redirect URI exactly matches what your app uses
- For web apps, the redirect URI must be an exact match
- For mobile, the package name / bundle ID and SHA-1/SHA-256 may be missing
2) Missing authorized redirect URI
If you see errors like:
redirect_uri_mismatchThe given origin is not allowedUnauthorized redirect_uri
Then your app’s redirect URL isn’t added under: Google Cloud Console → Credentials → OAuth 2.0 Client IDs
3) Wrong OAuth client type
Using the wrong type can break sign-in:
- Web app client for a browser app
- Android client for Android
- iOS client for iPhone/iPad
4) SHA fingerprint missing (Android)
For Android sign-in, you often need:
- SHA-1
- sometimes SHA-256
Add them in: Firebase Console or Google Cloud Console then download updated config if using Firebase.
5) Consent screen not configured
If the OAuth consent screen is incomplete or in testing mode:
- only test users can sign in
- app may show access blocked or unauthorized
6) API not enabled
Make sure relevant APIs are enabled, especially if you use:
- Google Identity Services
- People API
- Firebase Authentication
7) Bad token handling on backend
If your backend verifies Google ID tokens:
- token audience (
aud) doesn’t match your client ID - token is expired
- wrong issuer
- clock skew on server
8) Cookies / third-party cookie issues
In browsers, sign-in can fail if:
- third-party cookies are blocked
- popup is blocked
- cross-site tracking restrictions interfere
9) Mismatch between local and production config
Common issue:
- works on localhost, fails on deployed app
- different redirect URI in production
- different client IDs used in environments
What to check first
If you want the fastest path to diagnosis, check these in order:
- Exact error message
- Google Cloud Console OAuth credentials
- Redirect URI / origin
- Consent screen status
- Client ID used in code
- Platform-specific setup (Android/iOS/Firebase)
If you paste this, I can pinpoint it
Send me:
- the exact error message
- your platform: web / Android / iOS / React Native / Flutter / backend
- the sign-in library you’re using
- the relevant code snippet
- whether you use Firebase or plain Google OAuth
Then I can tell you the likely cause and the exact fix.