Google API Errors
This guide covers errors specific to Google OAuth and Google Identity Services, providing detailed explanations and step-by-step solutions.
OAuth 2.0 Errors
Error 400: invalid_client
Full Message:
Error 400: invalid_client
The OAuth client was not found.
What It Means: Google can't find an OAuth client with the provided Client ID.
Causes:
- Client ID is incorrect
- Client ID has extra characters (spaces, newlines)
- OAuth client was deleted
- Wrong Google Cloud project
Solution:
- Go to Google Cloud Console
- Select your project (check you're in the right one!)
- Go to APIs & Services > Credentials
- Find your OAuth 2.0 Client ID
- Click the copy icon to copy Client ID
- In WordPress, go to Settings > OneTap Login
- Clear the Client ID field completely
- Paste the new Client ID (Ctrl+V)
- Save Settings
- Clear all caches
Verification:
Client ID format: 123456789-abc123def456.apps.googleusercontent.com
Error 400: redirect_uri_mismatch
Full Message:
Error 400: redirect_uri_mismatch
The redirect URI in the request, https://example.com/wp-json/onetap/v1/callback,
does not match the ones authorized for the OAuth client.
What It Means: The callback URL your site uses isn't in the allowed list.
Causes:
- Redirect URI not added to Google Cloud
- www vs non-www mismatch
- HTTP vs HTTPS mismatch
- Trailing slash mismatch
Solution:
- Go to Google Cloud Console > Credentials
- Edit your OAuth 2.0 Client ID
- In Authorized redirect URIs, add:
https://yourdomain.com/wp-json/onetap/v1/callback - If you use www, also add:
https://www.yourdomain.com/wp-json/onetap/v1/callback - Save
- Wait 5 minutes for propagation
- Try again
Important: URIs must be exact matches - no trailing slashes, correct protocol.
Error 400: invalid_request
Full Message:
Error 400: invalid_request
Missing required parameter: client_id
What It Means: The authentication request is malformed or missing data.
Causes:
- Plugin settings not saved
- Cache serving old data
- JavaScript error prevented proper initialization
- Plugin conflict
Solution:
- Go to Settings > OneTap Login
- Re-enter Client ID and Client Secret
- Click Save Changes
- Clear all caches:
- WordPress cache
- Browser cache
- CDN cache
- Hard refresh the page (Ctrl+Shift+R)
- Check browser console for JavaScript errors
Error 400: invalid_grant
Full Message:
Error 400: invalid_grant
Token has been expired or revoked.
What It Means: The authorization code or refresh token is no longer valid.
Causes:
- Code expired (codes are single-use and expire quickly)
- Clock skew between your server and Google
- User revoked access
- Refresh token limit exceeded
Solution:
- Try again: Simply restart the sign-in flow
- Check server time:
date
# Should match actual current time - Sync time if needed:
sudo ntpdate -u time.google.com - Don't refresh during OAuth: Completing OAuth quickly
Error 401: invalid_client
Full Message:
Error 401: invalid_client
Unauthorized
What It Means: Client Secret is incorrect.
Causes:
- Wrong Client Secret
- Secret has extra whitespace
- Secret was regenerated
- Copied from wrong project
Solution:
- Go to Google Cloud Console > Credentials
- Edit your OAuth 2.0 Client ID
- Under Client Secret, click Reset Secret (if you can't find original)
- WARNING: Resetting creates new secret and invalidates old one
- Copy the new secret immediately (only shown once)
- Update in Settings > OneTap Login
- Save and test
Error 403: access_denied
Full Message:
Error 403: access_denied
The developer hasn't given you access to this app.
What It Means: Your app is restricted or OAuth consent screen not properly configured.
Causes:
- App in "Testing" mode with limited test users
- OAuth consent screen not configured
- App verification required but not completed
- User not in test users list
Solution:
For Development/Testing:
- Go to APIs & Services > OAuth consent screen
- If "Testing", add test users:
- Click Add users
- Enter Google emails of testers
- Save
For Production:
- Go to OAuth consent screen
- Click Publish App
- For sensitive scopes, may need verification
- Review Google's app verification process
Error 403: access_denied (User Action)
Full Message:
Error 403: access_denied
The user denied access to the requested scope.
What It Means: User clicked "Cancel" or "Deny" on consent screen.
Causes:
- User intentionally denied
- User didn't understand the consent
- Consent screen is confusing
Solution:
-
Ensure consent screen is clear:
- Go to OAuth consent screen
- Add clear app name
- Add your logo
- Write clear privacy policy
- Explain why you need access
-
Request minimal scopes:
- OneTap only needs email and profile
- Don't request unnecessary permissions
Error 403: restricted_client
Full Message:
Error 403: restricted_client
The client is restricted and cannot request tokens.
What It Means: Your OAuth client has been restricted by Google.
Causes:
- Suspicious activity detected
- Terms of Service violation
- Client flagged for abuse
- Billing issue on Google Cloud
Solution:
- Check Google Cloud Console for notifications
- Review Google's emails about your project
- Ensure compliance with OAuth policies
- Contact Google Cloud support if needed
- May need to create new OAuth client
Error 503: temporarily_unavailable
Full Message:
Error 503: temporarily_unavailable
The service is temporarily unavailable.
What It Means: Google's services are experiencing issues.
Causes:
- Google outage
- Maintenance window
- Regional issues
Solution:
- Check Google Cloud Status
- Wait 15-30 minutes
- Try again
- If persistent, check other Google services
Google Identity Services Errors
These appear in browser console with [GSI_LOGGER] prefix.
Invalid origin for client
Console Message:
[GSI_LOGGER]: Invalid origin for client: CLIENT_ID.
Access blocked: This app's request is invalid.
What It Means: Your current domain isn't in Authorized JavaScript Origins.
Solution:
- Go to Google Cloud Console > Credentials
- Edit your OAuth client
- Add to Authorized JavaScript origins:
https://yourdomain.com
https://www.yourdomain.com - Save and wait 5 minutes
- Hard refresh your site
Note: Don't include paths or trailing slashes.
Cookie disabled
Console Message:
[GSI_LOGGER]: The given origin is not allowed for the given client ID.
Cookies are not enabled in current environment.
What It Means: Third-party cookies are blocked.
Causes:
- Browser blocking third-party cookies
- Privacy extension blocking cookies
- Safari ITP blocking
Solution:
For One Tap:
- Use browsers with FedCM support (Chrome 117+)
- FedCM doesn't require third-party cookies
For Sign-In Button:
- Should work even without third-party cookies
- Uses popup flow which has different cookie requirements
FedCM: Provider is not eligible
Console Message:
[GSI_LOGGER]: FedCM is not available because provider is not eligible.
What It Means: FedCM can't be used in current context.
Causes:
- Browser doesn't support FedCM
- Site requirements not met
- Google account state issue
Solution:
- This is often informational, not fatal
- GSI falls back to other methods
- Ensure button sign-in still works
- Update Chrome for better FedCM support
Missing required parameter
Console Message:
[GSI_LOGGER]: Missing required parameter: client_id
What It Means: Client ID not provided to Google scripts.
Solution:
- Check Client ID is saved in settings
- Clear all caches
- Verify settings output in page source:
<!-- Should see your Client ID in page HTML -->
data-client_id="YOUR_CLIENT_ID.apps.googleusercontent.com"
Debugging Google Errors
Check Network Tab
- Open Developer Tools (F12)
- Go to Network tab
- Filter by "google" or "oauth"
- Look for failed requests (red)
- Click to see response details
Check Console
- Open Developer Tools
- Go to Console tab
- Look for
[GSI_LOGGER]messages - Note any red error messages
Test OAuth Playground
Use Google's OAuth 2.0 Playground:
- Go to https://developers.google.com/oauthplayground
- Click gear icon
- Enter your Client ID and Secret
- Test the OAuth flow directly
Verify Configuration
Google Cloud Console checklist:
- Correct project selected
- OAuth consent screen configured
- OAuth client type is "Web application"
- JavaScript origins include your domain (HTTPS)
- Redirect URIs include callback URL
- APIs enabled: Google Identity Services
Common Configuration Mistakes
| Mistake | Correct |
|---|---|
http://example.com | https://example.com |
https://example.com/ | https://example.com |
| Missing www variant | Add both www and non-www |
| Trailing slash in redirect | No trailing slash |
| Wrong OAuth client type | Must be "Web application" |
| Scopes not matching | Request only needed scopes |
Next Steps
- Common Issues - General troubleshooting
- Error Codes - All error codes
- Cloudflare - CDN issues
- Debug Mode - Enable logging