Overview
Antigravity Manager uses OAuth 2.0 to securely access Google AI Studio accounts. This page explains the authorization flow and configuration options.Authorization Flow
The OAuth 2.0 flow is handled automatically through the Tauri backend:- Account Addition: When adding a new account, the application initiates an OAuth flow
- User Consent: Users authenticate with Google and grant permissions
- Token Storage: Access and refresh tokens are securely stored
- Automatic Refresh: Tokens are automatically refreshed when expired
Configuration
OAuth Endpoints
The application uses standard Google OAuth 2.0 endpoints:- Authorization URL:
https://accounts.google.com/o/oauth2/v2/auth - Token URL:
https://oauth2.googleapis.com/token - Device Code URL:
https://oauth2.googleapis.com/device/code
Required Scopes
Antigravity requests the following OAuth scopes:OpenID Connect authentication
Access to user email address
Access to basic profile information
Access to Google AI Studio / Gemini API
Security Considerations
Token Storage
Tokens are stored in the application data directory:- macOS:
~/Library/Application Support/com.antigravity.app/ - Linux:
~/.config/antigravity/ - Windows:
%APPDATA%\antigravity\
Token Refresh
Access tokens typically expire after 1 hour. The application automatically refreshes them using the refresh token before they expire.Troubleshooting
Authorization Failed
If OAuth authorization fails:- Check your internet connection
- Verify Google account permissions
- Try removing and re-adding the account
- Check for any browser extensions blocking the OAuth popup
Token Expiration
If you see frequent token expiration errors:- Ensure system time is correct
- Check if refresh tokens are being saved properly
- Verify network connectivity
- Re-authenticate the account
API Integration
The OAuth implementation is located in:start_oauth_flow()- Initiates OAuth flowexchange_code()- Exchanges authorization code for tokensrefresh_token()- Refreshes expired access tokens
Best Practices
- Keep the application updated to ensure OAuth implementation stays current
- Regularly review connected accounts in Google Account settings
- Use different accounts for development and production
- Enable 2FA on your Google account for additional security