User Authentication and MFA
Rexec provides multiple layers of authentication to secure your account and terminal sessions.Authentication Methods
PipeOps OAuth2 (Recommended)
Rexec uses PipeOps for secure OAuth2 authentication with PKCE (Proof Key for Code Exchange). Sign In Flow:- Click Sign In with PipeOps on the landing page
- Authorize Rexec to access your PipeOps account
- You’ll be redirected back to Rexec with a session token
- Your session includes:
- Access token (JWT) - valid for 1 hour
- Refresh token - for renewing your session
- User profile (name, email, subscription status)
Guest Mode
No sign-in required for quick access:- Instant access - No account needed
- Limited resources - Same as free tier (5 containers)
- Temporary - 50-hour session limit
- No persistence - Sessions expire and cannot be recovered
OAuth2 Flow Details
PKCE Challenge
Rexec implements OAuth2 with PKCE for enhanced security:- Client generates code verifier - Random 32-byte string
- Creates code challenge - SHA256 hash of verifier
- Authorization request - Includes challenge
- Token exchange - Provides original verifier for validation
Scopes
Rexec requests the following OAuth scopes:user:read- Access to basic profile information
Token Storage
Security Recommendations:- Use private browsing for shared computers
- Sign out when done on public devices
- Enable MFA for additional protection
Account-Level MFA
Setting Up TOTP MFA
- Navigate to Account → Settings
- Find the Multi-Factor Authentication section
- Click Enable MFA
- Scan the QR code with your authenticator app:
- Google Authenticator
- Authy
- 1Password
- Any TOTP-compatible app
- Enter the 6-digit code to confirm setup
- Save your backup codes - 10 one-time codes for account recovery
Backup codes are shown only once. Store them securely (password manager, printed copy, etc.).
Logging In with MFA
Once MFA is enabled:- Sign in with PipeOps OAuth as usual
- After OAuth completes, you’ll be prompted for a TOTP code
- Enter the 6-digit code from your authenticator app
- Click Verify to complete login
- Click Use a backup code instead
- Enter one of your 10 backup codes (format:
XXXX-XXXX) - The code will be consumed and removed from the list
Disabling MFA
- Navigate to Account → Settings
- Scroll to Multi-Factor Authentication
- Click Disable MFA
- Enter a TOTP code or backup code to confirm
- MFA is removed from your account
Terminal-Level MFA Protection
Add an extra layer of security to individual containers or agents.Enabling Terminal MFA Lock
From the Dashboard:- Find the container or agent you want to protect
- Click the ⋮ menu → Lock with MFA
- Enter your TOTP code to confirm
- The terminal is now MFA-protected (shows 🔒 icon)
Accessing MFA-Locked Terminals
When you try to connect to an MFA-locked terminal:- A modal prompts for your TOTP code
- Enter the 6-digit code from your authenticator
- Click Verify and Connect
- Terminal opens if code is valid
- Close the terminal
- Refresh the page
- Open in a new tab
Removing Terminal MFA Lock
- In the Dashboard, find the locked terminal (🔒 icon)
- Click ⋮ → Unlock Terminal
- Enter your TOTP code to confirm removal
- The terminal is no longer MFA-protected
API Authentication
API Tokens
For programmatic access, create long-lived API tokens:- Navigate to Account → API Tokens
- Click Generate New Token
- Provide details:
- Name: Descriptive label (e.g., “CI/CD Pipeline”)
- Scopes: Select permissions (
containers,agents, etc.) - Expiration: Optional expiry date
- Click Create
- Copy the token - it won’t be shown again!
rexec_<random-string>
Using API Tokens
Scopes
Available API token scopes:agent- Connect and manage agentscontainers- Create and manage containersssh- Access SSH key managementsnippets- Manage command snippetsrecordings- Access session recordings
Scope Permissions Table
Scope Permissions Table
| Scope | Read | Write | Delete |
|---|---|---|---|
| agent | ✓ | ✓ | ✓ |
| containers | ✓ | ✓ | ✓ |
| ssh | ✓ | ✓ | ✓ |
| snippets | ✓ | ✓ | ✓ |
| recordings | ✓ | ✗ | ✓ |
Token Management
List Active Tokens:- Use separate tokens for different services
- Rotate tokens every 90 days
- Revoke unused tokens immediately
- Never commit tokens to version control
Session Management
Token Refresh
Access tokens expire after 1 hour. Rexec automatically refreshes them using your refresh token. Manual Refresh (API):Session Duration
Free Tier:- OAuth sessions: Until token expires (refresh extends)
- Guest sessions: 50 hours maximum
- Container lifetime: 50 hours (without subscription)
- OAuth sessions: Indefinite (with active subscription)
- No container time limits
Logging Out
From UI:- Click your profile avatar
- Select Sign Out
- Session is cleared locally
Security Headers
Rexec sets the following security headers:WebSocket Authentication
Terminal Connections
WebSocket connections for terminal access support multiple auth methods: 1. Authorization Header:Method 3 is recommended for browser-based connections to avoid query parameter exposure in logs.
CORS and Origin Validation
Allowed Origins
Rexec validates WebSocket and API origins: Default Allowed:https://rexec.pipeops.apphttps://rexec.pipeops.iohttps://rexec.shhttp://localhost:*(development)
ALLOWED_ORIGINS environment variable:
Blocking Empty Origins
By default, requests without anOrigin header are allowed (for CLI/agent clients).
To block:
Best Practices
Password Security
Password Security
Rexec uses PipeOps OAuth, so password security is managed by PipeOps:
- Use a strong, unique password
- Enable MFA on your PipeOps account
- Don’t share OAuth tokens
- Sign out on shared devices
MFA Recommendations
MFA Recommendations
- Enable account MFA for all users
- Use terminal MFA for production containers
- Print backup codes and store offline
- Test backup codes before relying on them
- Regenerate backup codes periodically
Token Hygiene
Token Hygiene
- Rotate API tokens every 90 days
- Use minimal scopes - only what’s needed
- Monitor token usage in Account → API Tokens
- Revoke compromised tokens immediately
- Use environment variables - never hardcode
Network Security
Network Security
- Always use HTTPS/WSS - no plain HTTP
- Verify certificates - don’t ignore TLS warnings
- Use VPN for sensitive operations
- Avoid public WiFi for critical work
Troubleshooting
OAuth Login Failed
OAuth Login Failed
Symptoms:
- Redirect loop
- “Invalid state” error
- “Code expired” message
- Clear browser cookies and localStorage
- Try incognito/private mode
- Check system clock is accurate
- Verify PipeOps account is active
- Contact support if issue persists
MFA Code Not Accepted
MFA Code Not Accepted
Common Issues:
-
Time Sync: Ensure device clock is accurate (TOTP requires time sync)
- Wrong Account: Verify you’re using the correct entry in your authenticator
- Backup Codes: Try a backup code if authenticator fails
- Rate Limiting: Wait 30 seconds between attempts
Token Expired
Token Expired
If you see “Token expired” errors:
- Refresh token - Rexec should auto-refresh
- Sign out and back in if refresh fails
- Check subscription status - expired Pro users revert to free
- Verify time sync - JWT validation is time-sensitive
WebSocket Authentication Failed
WebSocket Authentication Failed
Check:Common Close Codes:
- Token format: Should be
Bearer <token>or just<token> - Origin header: Must be allowed origin
- Token expiry: Refresh if expired
- Firewall: Ensure WSS (port 443) is allowed
1000- Normal closure1008- Policy violation (auth failed)1011- Internal error