Login Command
Authenticate with rs-tunnel using your email address:Start OAuth Flow
The CLI initiates a Slack OAuth flow and opens your browser automatically:If the browser doesn’t open automatically, the CLI displays a URL you can copy and paste.
Authorize with Slack
Complete the Slack OAuth authorization in your browser. The server validates:
- Your email domain matches
ALLOWED_EMAIL_DOMAIN - Your Slack workspace matches
ALLOWED_SLACK_TEAM_ID
Authentication Flow Details
The authentication process uses:- Slack OpenID Connect: Secure OAuth 2.0 flow
- PKCE: Proof Key for Code Exchange for enhanced security
- Local callback server: Temporary server to receive OAuth callback
- JWT tokens: Short-lived access tokens (15 minutes default) with refresh tokens (30 days default)
The CLI never stores your Slack credentials. Only short-lived JWT tokens are saved locally.
Access Policy Enforcement
The API server enforces strict access controls: Server-side configuration:ALLOWED_EMAIL_DOMAIN: Restricts to specific email domain (e.g.,@example.com)ALLOWED_SLACK_TEAM_ID: Restricts to specific Slack workspace
Token Storage
Credentials are stored securely using a two-tier approach:Keytar (Preferred)
If the optionalkeytar dependency is available, credentials are stored in your system’s native credential manager:
- macOS: Keychain
- Linux: Secret Service API (libsecret)
- Windows: Credential Vault
Fallback Encryption
Ifkeytar is not available, credentials are encrypted using AES-256-GCM and stored in:
Specifying API Domain
If your organization uses a self-hosted rs-tunnel API, specify the domain during login:~/.rs-tunnel/config.json for future commands.
On first run without a configured domain, the CLI will prompt you interactively to enter the API URL.
Token Lifecycle
Access Tokens:- Valid for 15 minutes (configurable server-side)
- Automatically refreshed by the CLI when expired
- Used for all authenticated API requests
- Valid for 30 days (configurable server-side)
- Used to obtain new access tokens
- Stored securely with access tokens
The CLI handles token refresh automatically. You won’t need to re-authenticate until your refresh token expires (typically 30 days).
Troubleshooting Login Issues
OAuth State Mismatch
If you seeOAuth state mismatch. Aborting login.:
- Clear your browser cache and cookies for the rs-tunnel domain
- Try the login flow again
- Ensure your system clock is synchronized
Slack Redirect URI Mismatch
If OAuth fails immediately:Email or Workspace Not Allowed
If authentication is rejected:- Verify your email domain matches
ALLOWED_EMAIL_DOMAIN - Confirm you’re a member of the authorized Slack workspace
- Contact your administrator to verify server configuration
Next Steps
Create Tunnels
Start exposing your local services with
rs-tunnel up
