#Google Oauth stuck on login screen (cannot get redirect url)
1 messages · Page 1 of 1 (latest)
Based on my research, this is a known issue with Gemini CLI's OAuth flow. The problem is that after authenticating with Google, the browser tries to call back to localhost but fails to connect, leaving the CLI stuck waiting.
Workarounds to try:
1. Use an API Key instead of OAuth (Most reliable)
- Get a free API key from Google AI Studio
- Set it via:
export GEMINI_API_KEY=your_key_here - Or configure it in your settings when prompted for authentication method
2. Clear browser session data
- Sign out of all Google accounts in your browser
- Clear cookies/cache for Google domains
- Try incognito/private mode
3. Check for conflicting environment variables
If you have GOOGLE_CLOUD_PROJECT or GOOGLE_CLOUD_PROJECT_ID set, try unsetting them: