Sign-in and OIDC SSO
Complete self-host first-run administrator setup, invite members with passwords, and configure OpenID Connect SSO with allowed email domains.
Self-hosted Executor supports email-and-password accounts (by invitation after initial setup) and OpenID Connect (OIDC) single sign-on restricted to specific email domains (Self-host only; Local uses a local API key and Cloud manages sign-in).
On first boot, open <BETTER_AUTH_URL> and complete Set up Executor to create the administrator account and the instance’s one organization. To turn on SSO, set SSO_DISCOVERY_URL, SSO_CLIENT_ID, SSO_CLIENT_SECRET, and SSO_ALLOWED_DOMAINS, and register <BETTER_AUTH_URL>/api/auth/callback/sso in your identity provider.
Prerequisites: A running self-host container (Self-host with Docker) with BETTER_AUTH_URL matching the exact origin users open. For OIDC SSO, you need an OIDC identity provider with an HTTPS discovery endpoint and administrator access to register a redirect URI.
You’ll know it worked when you can sign in to the dashboard as the organization owner, and (when SSO is configured) /login displays the Continue with SSO button and signs in a user whose email matches SSO_ALLOWED_DOMAINS.
First-run setup
A new self-host database starts with no users and no organization.
- Open
<BETTER_AUTH_URL>in your browser. Until setup completes, Executor shows Set up Executor (“Create your administrator account and organization”). - Enter:
- Organization name (1 to 100 characters)
- Your name (1 to 100 characters)
- Password (8 to 128 characters)
- Click Create administrator account.
Executor creates the instance’s single organization (with slug executor) and assigns your account the owner role. After setup completes, the setup endpoint permanently closes.
You’ll know it worked when the browser redirects into the dashboard and curl -sf http://127.0.0.1:4400/api/auth/self-host/config returns {"setup":false,...}.
Passwords and invitations
Self-host disables open self-registration (disableSignUp: true), allows only one organization per instance, and does not show Cloud’s Google, GitHub, ChatGPT, or passkey sign-in buttons.
To add teammates without SSO:
- An organization
owneroradmincreates an invitation from the organization members screen and shares the invitation link. - The invited user opens the link, sees Join with this invitation, chooses Join Executor (entering their name and a password of 8 to 128 characters, or signing in with their existing password if they already have an account), and clicks Accept invitation.
OIDC SSO and allowed domains
Configure OIDC SSO with four environment variables on the self-host container:
| Variable | Required when SSO is on | Purpose |
|---|---|---|
SSO_DISCOVERY_URL |
Yes (triggers SSO when non-empty) | Absolute https:// URL of your IdP’s .well-known/openid-configuration document. Leave unset or empty to keep SSO off. |
SSO_CLIENT_ID |
Yes | OIDC client ID from your identity provider. |
SSO_CLIENT_SECRET |
Yes | OIDC client secret from your identity provider. |
SSO_ALLOWED_DOMAINS |
Yes | Comma-separated list of email domains allowed to sign in through SSO (at least one domain required; exact domain match, case-insensitive). |
Register this exact callback URL in your identity provider:
<BETTER_AUTH_URL>/api/auth/callback/sso
When you restart the container with all four variables set:
- Executor fetches
SSO_DISCOVERY_URL(10-second timeout, no HTTP redirects) and validates thatSSO_DISCOVERY_URLplus the discoveredissuer,authorization_endpoint,token_endpoint,jwks_uri(and optionaluserinfo_endpointandend_session_endpoint) are all absolutehttps://URLs. - Executor requests scopes
openid,email, andprofileand verifies the ID token (requireIdTokenVerification: true). - Once first-run setup is complete,
/loginshows Continue with SSO. - A new user signing in via SSO must have a verified email from the identity provider whose domain matches
SSO_ALLOWED_DOMAINS. Executor creates their account and automatically adds them to the organization as amember. - An existing password user cannot automatically merge into SSO on
/login(account_not_linked): they must sign in with their password first and connect SSO from their account’s Security page.
You’ll know it worked when GET <BETTER_AUTH_URL>/api/auth/self-host/config returns {"setup":false,"sso":true}, /login shows Continue with SSO, and signing in with an allowed-domain IdP account opens the dashboard.
Session secret and origin
BETTER_AUTH_URLmust match the exact scheme, host, and port users open; otherwise browser sign-in is rejected as an invalid origin.BETTER_AUTH_SECREToverrides the auto-generated/app/data/auth-secret.keysession secret (must be at least 32 characters). RotatingBETTER_AUTH_SECRETsigns everyone out.
Example
Start a self-host container behind https://executor.example.com with Okta or another OIDC provider:
docker run -d --name executor-v2 --init --restart unless-stopped \
-p 127.0.0.1:4400:4400 -v executor-v2-data:/app/data \
-e BETTER_AUTH_URL=https://executor.example.com \
-e SSO_DISCOVERY_URL=https://idp.example.com/.well-known/openid-configuration \
-e SSO_CLIENT_ID=your-oidc-client-id \
-e SSO_CLIENT_SECRET=your-oidc-client-secret \
-e SSO_ALLOWED_DOMAINS=example.com,subsidiary.example.com \
ghcr.io/usefulsoftwareco/executor-selfhost:2.0.0-beta.79
Confirm SSO is active once startup completes:
curl -sf http://127.0.0.1:4400/api/auth/self-host/config
# {"setup":true,"sso":true}
Limits
- Setup (
/api/auth/self-host/setup) and invitation registration (/api/auth/self-host/register) are rate-limited to 3 requests per 10 seconds per client address. - All OIDC discovery endpoints must use
https://and must not rely on HTTP redirects; if discovery fails or times out (10 seconds) at startup, Executor logs the error and keeps SSO unavailable while password sign-in continues working. - Setting
SSO_DISCOVERY_URLwithoutSSO_CLIENT_ID,SSO_CLIENT_SECRET, orSSO_ALLOWED_DOMAINSis invalid and prevents SSO from activating. - Users whose IdP does not mark their email as verified, or whose email domain is not listed in
SSO_ALLOWED_DOMAINS, are rejected. - Self-host supports exactly one organization per instance; users cannot create additional organizations or delete the organization.