Error 400: Invalid_request is typically encountered when setting up a Google OAuth client and can occur if the OAuth consent screen in the Google Cloud project is not properly configured. This error also appears when the Google account used for authorization is not listed as a test user on an application that’s set to ‘Testing’ status.
Resolving the Error – Solution
To fix Error 400: Invalid_request:
- Update OAuth Consent Screen Configuration:
- Switch to the ‘Testing’ status on your OAuth consent screen if your application is not yet in production.
- Add your Google account as a test user to allow authentication during the testing phase.
- Utilize App Passwords:
- If your application doesn’t support two-factor authentication, generate an App Password through your Google Account’s security settings.
- Use this App Password instead of your personal password when authenticating the application.