Everruns supports flexible authentication for different deployment scenarios, from local development to production deployments with OAuth and API keys.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/everruns/everruns/llms.txt
Use this file to discover all available pages before exploring further.
Authentication Modes
Configure authentication using theAUTH_MODE environment variable.
None Mode (Default)
- User ID:
00000000-0000-0000-0000-000000000001 - Email:
anonymous@localhost - Name:
Anonymous User - Role: Admin
- Organization: Default organization (auto-created)
- Local development
- Internal deployments with network-level security
- Quick testing and prototyping
Admin Mode
- Single hardcoded admin account
- JWT-based authentication
- Cookie and bearer token support
- No user registration
- Local development with basic access control
- Single-user deployments
- Testing authentication flows
Full Mode
- User registration and login
- Password authentication (Argon2id hashing)
- OAuth providers (Google, GitHub)
- API key authentication
- Refresh token rotation
- Account linking by email
- Production deployments
- Multi-user applications
- SaaS platforms
External Mode
- External provider handles login, registration, user management
- Built-in password auth disabled
- Built-in OAuth disabled
- Built-in signup disabled
- API key authentication supported
- SaaS deployments with existing auth provider
- Enterprise SSO integration
- Custom authentication flows
AuthBackend trait implementation (see crates/server/src/auth/backend.rs).
Authentication Methods
When authentication is enabled (admin, full, or external modes), the following methods are supported:
1. Bearer Token (JWT)
JWT access tokens for API requests:- Short-lived (default: 15 minutes)
- Contains user ID, email, name, roles
- Signed with
AUTH_JWT_SECRET - Refresh via
/v1/auth/refreshendpoint
2. API Key
API keys for programmatic access:- Prefixed with
evr_for identification - Full key shown only at creation
- Stored hashed (SHA-256) in database
- Supports scopes and expiration
- Managed via UI (Settings > API Keys)
- Navigate to Settings > API Keys in the UI
- Click “Create API Key”
- Set name, scopes, and optional expiration
- Copy the key (only shown once)
3. Cookie-based Session
Automatic authentication for web UI:access_tokencookie with JWTrefresh_tokencookie (HTTP-only, Secure)- Cookies set on login with
Path=/ - Auto-refresh on 401 responses
OAuth Configuration
Google OAuth
-
Create OAuth credentials in Google Cloud Console
- Application type: Web application
- Authorized redirect URIs:
http://localhost:9300/api/v1/auth/callback/google(adjust for production)
- Configure environment variables:
- Optional: Restrict to specific domains:
openid- OpenID Connectemail- User email addressprofile- User name and profile
GitHub OAuth
-
Create OAuth App in GitHub Developer Settings
- Application name: Your app name
- Homepage URL:
http://localhost:9300(adjust for production) - Authorization callback URL:
http://localhost:9300/api/v1/auth/callback/github
- Configure environment variables:
user:email- User email addressesread:user- User profile data
OAuth Flow
- User clicks OAuth button (e.g., “Continue with Google”)
- UI persists return URL in
sessionStorage - Browser redirects to
GET /v1/auth/oauth/{provider} - Server redirects to provider’s authorization page
- User authorizes application
- Provider redirects to callback URL
- Server exchanges code for tokens
- Server creates or links user account
- Server sets cookies and redirects to UI
- UI redirects to original return URL
Worker gRPC Authentication
Workers communicate with the server via gRPC (port 9001) and must authenticate using a bearer token.Basic Authentication (Bearer Token)
Mutual TLS (mTLS)
For production deployments, enable mutual TLS for encrypted and authenticated worker-server communication.Generate Certificates
Server Configuration
Worker Configuration
Docker Compose Example
Password Requirements
Forfull mode with password authentication enabled:
- Minimum 8 characters
- Hashed with Argon2id (industry-standard secure defaults)
- Stored hashed in database (never plaintext)
Security Best Practices
Secrets Management
-
Never commit secrets to version control
- Use
.envfiles (add to.gitignore) - Use secrets management service (Doppler, Vault, AWS Secrets Manager)
- Rotate secrets regularly
- Use
-
Strong secret generation
Production Checklist
- Use
AUTH_MODE=fullorAUTH_MODE=external - Generate strong
AUTH_JWT_SECRET(32+ bytes) - Set secure
WORKER_GRPC_AUTH_TOKEN - Enable TLS for all external connections
- Configure
CORS_ALLOWED_ORIGINSif needed - Use HTTP-only, Secure cookies in production
- Set up database connection with TLS (
?sslmode=require) - Enable mTLS for worker-server communication
- Restrict OAuth to specific domains if applicable
- Configure token expiration policies
- Set up token refresh handling
- Monitor authentication failures
Cookie Security
In production, cookies are configured with:HttpOnly- Prevents JavaScript accessSecure- HTTPS onlySameSite=Strict- CSRF protectionPath=/- Available to all routes
Token Refresh
The UI automatically refreshes expired tokens:- API request returns 401 Unauthorized
- UI intercepts response
- UI calls
POST /v1/auth/refreshwith refresh token - Server rotates refresh token (old token deleted)
- Server returns new access + refresh tokens
- UI retries original request
Error Responses
401 Unauthorized
Missing or invalid credentials:- Missing Authorization header
- Expired access token
- Invalid API key
- Invalid JWT signature
403 Forbidden
Valid credentials but insufficient permissions:- API key lacks required scopes
- User lacks required role
- Resource access denied
UI Integration
Configuration Discovery
UI fetches auth config on startup:Protected Routes
All routes under/(main)/* require authentication:
/dashboard/agents/sessions/settings
/(auth)/*:
/login/register
State Management
Authentication state managed via:AuthProvider- React Context- React Query - Caching auth config and user info
- HTTP-only Cookies - Secure token storage
API Client Configuration
All API requests:- Go through
/apiprefix - Include
credentials: "include"for cookies - Auto-retry with token refresh on 401
/api prefix is stripped by the reverse proxy (Next.js in dev, Caddy in production) before reaching the backend.