Authentication
Onvera supports two authentication methods depending on your use case.
Authentication Methods
JWT - Web UI
Used by: Web dashboard
How it works:
- User authenticates via the web interface
- System issues a JWT token
- Frontend includes token in
Authorization: Bearer <token>header - Backend verifies token and extracts user information
Characteristics:
- Short-lived tokens (typically 1 hour)
- Automatic token refresh
- Browser-based authentication flow
- Not suitable for CLI or programmatic access
API Keys - CLI & Programmatic
Used by: CLI, API integrations, CI/CD
How it works:
- User creates API key in dashboard
- API key is stored securely (hashed in database)
- Client includes key in
X-API-Key: <key>header - Backend validates key and returns API key context
API Key Format:
onv_sk_live_<random_token>Characteristics:
- Long-lived (until revoked or expired)
- Suitable for automation
- Can be scoped to specific permissions
- Can be revoked at any time
API Key Scopes
API keys can have scopes that limit what they can do:
deployments:read- Read deploymentsdeployments:write- Create/update deploymentsdeployments:delete- Delete deploymentsoperations:read- Read operationsorg:read- Read organization information
Default: API keys have all scopes unless restricted.
Creating API Keys
Create API keys in the Onvera dashboard (opens in a new tab):
- Navigate to Organization > API Keys
- Click "Create API Key"
- Copy the key immediately (it's only shown once)
- Store securely
API Key Expiration
API keys can have expiration dates:
- No expiration - Key is valid until revoked
- Expiration date - Key expires on specified date
Expired keys cannot be used and must be replaced.
Revoking API Keys
Revoke API keys in the dashboard:
- Navigate to Organization > API Keys
- Find the key you want to revoke
- Click "Revoke"
Revoked keys cannot be used and cannot be restored.
Using API Keys
CLI
# Browser login (recommended)
onvera auth login
# Direct API key
onvera auth login --token onv_sk_live_...
# Environment variable
export ONVERA_API_KEY=onv_sk_live_...
onvera lsAPI
# Include API key in header
curl -H "X-API-Key: onv_sk_live_..." \
https://api.onvera.io/api/v1/deploymentsSecurity Best Practices
- Never commit API keys to version control
- Use environment variables for API keys in CI/CD
- Rotate keys regularly (every 90 days recommended)
- Revoke unused keys immediately
- Use scoped keys when possible (limit permissions)
- Monitor key usage via audit logs
Audit Visibility
All API key usage is logged:
- When the key was used
- Which endpoint was accessed
- Which organization/user context was used
View audit logs in the dashboard under Organization > Audit Logs.
Related Concepts
- API Authentication - API authentication reference
- Security & Trust - Security best practices