-
-
Notifications
You must be signed in to change notification settings - Fork 43
OpenID Connect
WebSSH provides optional OIDC authorization-code authentication with PKCE. It is disabled by default and never auto-provisions a WebSSH account.
An administrator links an exact provider identity to an existing local account:
(normalized issuer, subject) -> WebSSH user
Email addresses and usernames are not identity keys. Optional subject and email domain allowlists are additional policy checks.
OIDC identities cannot be linked to LDAP-managed accounts.
- OIDC discovery and authorization-code flow.
- Exact HTTPS issuer.
- Registered WebSSH client ID.
- Client secret stored in a private read-only file.
- Exact callback URL ending in
/oidc/callback. - Claims containing a stable
suband the expected issuer.
Loopback HTTP callback is accepted only in the homelab profile. Use HTTPS for real deployments.
OIDC_ENABLED=true
OIDC_ISSUER=https://idp.example.com
OIDC_CLIENT_ID=webssh
OIDC_CLIENT_SECRET_FILE=/run/secrets/webssh_oidc_client_secret
OIDC_REDIRECT_URI=https://ssh.example.com/oidc/callback
OIDC_ALLOWED_SUBJECTS=
OIDC_ALLOWED_DOMAINS=example.com
OIDC_LOGIN_RATE_LIMIT=10 per minute| Variable | Purpose |
|---|---|
OIDC_ENABLED |
Register and expose OIDC integration |
OIDC_ISSUER |
Exact provider issuer URL |
OIDC_CLIENT_ID |
Registered client ID |
OIDC_CLIENT_SECRET_FILE |
Absolute private secret-file path |
OIDC_REDIRECT_URI |
Exact registered callback |
OIDC_ALLOWED_SUBJECTS |
Optional comma-separated subject allowlist |
OIDC_ALLOWED_DOMAINS |
Optional email-domain policy |
OIDC_LOGIN_RATE_LIMIT |
Per-IP start and callback limit |
Do not place the client secret directly in .env or Compose environment. Mount
the file read-only and restrict it to the service account.
WebSSH creates a random state, nonce, PKCE verifier, and browser-session binding for each login. The state record is stored server-side, consumed once, and deleted before the identity is accepted. The callback validates state binding, expiry, token claims, nonce, issuer, subject policy, domain policy, account link, and account state.
Provider failures return a generic unavailable response and do not expose token or secret details.
- Enable OIDC and restart WebSSH.
- Sign in as a local administrator.
- Create or select the target local account.
- In the Admin Panel, choose the OIDC link action.
- Provide the exact provider subject.
- Reauthenticate with the administrator password.
- Confirm the exact target username.
- Sign out and test OIDC login with the target identity.
The mapping is unique. A provider identity cannot be attached to multiple users.
The administrator must reauthenticate and confirm the exact target username. Unlinking removes only the mapping; the underlying local account remains.
Before unlinking the user's only practical sign-in method, verify a local password, passkey, or recovery path.
OIDC_ALLOWED_SUBJECTS restricts accepted stable subjects. It is strongest when
the provider has a manageable fixed set of users.
OIDC_ALLOWED_DOMAINS requires a matching email claim and domain. It is an
admission condition only. Linking and login still resolve identity by issuer
and subject.
| Symptom | Check |
|---|---|
| OIDC button absent |
OIDC_ENABLED and startup logs |
| Provider unavailable | discovery URL, DNS, TLS, secret file, egress |
| Callback rejected | exact callback, state cookie, proxy origin, system time |
| Identity not linked | Admin mapping for issuer and subject |
| Domain rejected | email claim and OIDC_ALLOWED_DOMAINS
|
| User rejected after link | locked account or LDAP-managed state |
Keep a local break-glass administrator. If the provider fails, local accounts continue to use their configured factors. OIDC does not introduce automatic account creation or privilege mapping.
WebSSH documentation - Project - Issues - Discussions - Security
WebSSH Wiki
Install and operate
- Installation from Source
- Docker and Docker Compose
- Production Deployment
- Reverse Proxy and Subfolder Deployment
- Upgrading, Rollback, and FAQ
Identity and access
- Users and Account Management
- Authentication Overview
- LDAP and Active Directory
- OpenID Connect
- Passkeys and Recovery Codes
SSH and files
- SSH Connections and Host Keys
- Profiles, Jump Hosts, and Commands
- Terminal and Persistent tmux Sessions
- SFTP File Workspace and Transfers
- Tailscale SSH
Reference and administration