OAuth Flow
Aurora uses OAuth 2.0 for secure authentication with cloud providers. Each provider implements OAuth differently.Supported OAuth Providers
Google Cloud Platform
OAuth 2.0 with consent screen
Tailscale
OAuth client credentials flow
OVH Cloud
OAuth 2.0 with custom scopes
Microsoft Azure
Service principal (client credentials)
Google Cloud Platform OAuth
GCP uses standard OAuth 2.0 authorization code flow.Flow Diagram
1. Initiate OAuth Flow
POST /gcp/login2. User Consent
Redirect user tologin_url:
- User authenticates with Google
- Reviews requested permissions
- Grants consent
- Google redirects to Aurora callback
3. Callback & Token Exchange
GET /gcp/callback Google redirects with:code- Authorization codestate- User ID (for security)
- Validates state parameter
- Exchanges code for tokens
- Stores tokens in Vault
- Triggers post-auth setup
- Redirects to frontend
4. Post-Auth Setup
Asynchronous setup tasks:- Fetch user’s GCP projects
- Enable required APIs
- Create service accounts
- Configure IAM permissions
- Set up billing exports
- Initialize project metadata
- Complete setup
OAuth Scopes
GCP OAuth requires:https://www.googleapis.com/auth/cloud-platform- Full cloud platform accesshttps://www.googleapis.com/auth/compute- Compute Enginehttps://www.googleapis.com/auth/cloudresourcemanager- Project management
Token Management
- Access Token - Short-lived (1 hour), used for API calls
- Refresh Token - Long-lived, used to get new access tokens
- Expiration - Stored in database (
expires_atfield) - Refresh - Automatic when access token expires
Tailscale OAuth
Tailscale uses OAuth 2.0 client credentials flow.Flow Diagram
Client Credentials Flow
POST /tailscale_api/tailscale/connect- Requests access token from Tailscale
- Validates token by fetching devices
- Stores credentials in Vault
- Generates SSH key pair
- Creates reusable auth key
Token Refresh
POST /tailscale_api/tailscale/refresh-token Manually refresh access token:OAuth Scopes
Tailscale scopes:devices- Read device informationdevices:write- Manage devicesacl- Read ACL configurationacl:write- Modify ACLkeys- Manage auth keys
Azure Service Principal
Azure uses service principal authentication (similar to OAuth client credentials).Flow Diagram
Service Principal Authentication
POST /azure/login- Creates ClientSecretCredential
- Requests management token
- Validates by fetching subscriptions
- Stores credentials in Vault
Token Expiration
- Access tokens expire after 1 hour
- Automatically refreshed on API calls
- Uses stored service principal credentials
- No manual refresh required
OAuth Security
State Parameter
Prevents CSRF attacks:External ID (AWS)
Adds security layer for role assumption:- Each workspace has unique external ID
- Prevents confused deputy problem
- Required for role assumption
Token Storage
HashiCorp Vault:Credential Rotation
GCP:- Access tokens expire after 1 hour
- Refresh tokens used to get new access tokens
- Refresh tokens rotated on use (optional)
- STS credentials expire after 1 hour (default)
- Automatically re-assumed on expiration
- External ID never changes
- Access tokens expire after 1 hour
- Client secrets expire after configured period
- No automatic rotation (manual renewal required)
- Access tokens expire after 90 days (default)
- Manual refresh via
/tailscale/refresh-token - Client credentials never expire