OAuth 2.0
For human users
Google Workspace OAuth with PKCE for secure sign-in. Domain restrictions ensure only authorized users can access.
Rack Gateway uses a multi-layered authentication system combining OAuth 2.0 for identity, session tokens for authorization, and optional multi-factor authentication for additional security.
OAuth 2.0
For human users
Google Workspace OAuth with PKCE for secure sign-in. Domain restrictions ensure only authorized users can access.
API Tokens
For automation
Long-lived tokens for CI/CD pipelines, scripts, and integrations. Each token has an assigned role.
The gateway supports two authentication channels:
| Aspect | Web Browser | CLI |
|---|---|---|
| OAuth Flow | Standard code flow | PKCE code flow |
| Session Storage | HTTP-only cookie | Local config file |
| Session Lifetime | Configurable (default 5 min idle) | 90 days |
| MFA | Browser-based prompts | Terminal prompts |
| CSRF Protection | Required (cookie-based) | Not needed (token-based) |
rack-gateway login~/.config/rack-gateway/config.jsonSessions are the primary authentication mechanism after initial OAuth:
See Sessions for details.
Only users from your Google Workspace domain can authenticate:
# Environment variableGOOGLE_ALLOWED_DOMAIN=yourcompany.comUsers from other domains receive an error during OAuth callback.
The gateway verifies that:
Session tokens are never stored in plaintext:
Stored: SHA-256(session_token)Client: session_token (raw)Even if the database is compromised, tokens cannot be recovered.
Web requests require CSRF tokens to prevent cross-site request forgery:
MFA adds a second factor after OAuth authentication:
MFA can be:
See MFA Overview for setup details.
| Characteristic | Session (Human) | API Token (Automation) |
|---|---|---|
| Creation | OAuth flow | Admin creates in UI |
| Lifetime | Short (idle timeout) | Long (until revoked) |
| Revocation | Logout or admin action | Delete token |
| MFA | Required if enabled | N/A |
| CSRF | Required (web) | Not required |
| Use Case | Interactive access | CI/CD, scripts |
Key authentication settings:
| Setting | Description | Default |
|---|---|---|
GOOGLE_CLIENT_ID | OAuth client ID | Required |
GOOGLE_CLIENT_SECRET | OAuth client secret | Required |
GOOGLE_ALLOWED_DOMAIN | Allowed email domain | Required |
APP_SECRET_KEY | Secret for sessions/CSRF | Required |
RGW_SETTING_SESSION_TIMEOUT_MINUTES | Idle session timeout | 5 |
See Configuration for complete reference.
GOOGLE_ALLOWED_DOMAIN set to your domainAPP_SECRET_KEY is strong and unique