Home/Wiki Errors/Google Antigravity
Google Antigravity / OAuth/Auth

Failed to exchange authorization code for token - Antigravity

The browser OAuth step returned a code, but Antigravity could not exchange it for a usable local token.

Antigravity failed to exchange authorization code for tokenAntigravity unexpected issue setting up your accountAntigravity Windows OAuth token
Paste an error to match it against the wiki. / 粘贴报错后自动匹配。

Error text / 报错原文

  • Failed to exchange authorization code for token
  • There was an unexpected issue setting up your account

What it means

The browser OAuth step returned a code, but Antigravity could not exchange it for a usable local token.

Most common causes

  • Local TLS or certificate validation problem during token exchange
  • Corporate proxy intercepting the OAuth callback
  • Browser profile mismatch between sign-in and app
  • Google account policy blocks the token exchange

Fastest fix

  • Retry sign-in from the default browser
  • Disable VPN or proxy briefly for the auth flow if policy allows
  • Use a clean browser profile
  • Restart the app after a successful browser confirmation

Safe fix

  • Fix root certificates instead of disabling TLS validation globally
  • Use an account allowed by your organization
  • Keep OAuth tokens out of project files
  • Record exact app version and OS when reporting

What not to do

  • Do not set global TLS bypass variables permanently
  • Do not paste auth codes into untrusted tools
  • Do not share screenshots containing tokens

How to confirm the fix

Run the smallest reproducible command first, then retry the agent task only after authentication, quota, and tool discovery are stable.

node -p "process.versions.openssl"
echo $HTTP_PROXY
echo $HTTPS_PROXY

Related errors

Related tools

Sources