Verified against OpenWebUI open-webui:0.6.5. If you upgrade the image version in
compose.yaml, re-verify env var names against the new version before enabling SSO —
variable names can change between releases. Check the OpenWebUI changelog and update
this doc accordingly..env file (copied from .env.openwebui.example). No application code
changes are needed.
Supported providers: Google OAuth2, Microsoft/Azure AD, GitHub, any generic OIDC provider
(Okta, Keycloak, Auth0, etc.), and trusted header SSO.
Quick Start (Google OAuth2)
The fastest path to working SSO — under 5 minutes. Step 1 — Create OAuth2 credentials In Google Cloud Console, create an OAuth 2.0 Client ID (application type: Web). Add your authorized redirect URI:http://localhost:3000/oauth/google/callback
Step 2 — Add vars to .env
http://localhost:3000. A Continue with Google button should appear on the
login page.
Step 5 — Harden (optional)
Once SSO is confirmed working, you can disable new local account signups:
ENABLE_LOGIN_FORM=False until you have read the Safe Bootstrap Sequence.
Google OAuth2
Prerequisites
- A Google Cloud project with the OAuth consent screen configured
- Authorized redirect URI:
https://your-domain/oauth/google/callback
Environment Variables
Microsoft / Azure AD
Prerequisites
- An Azure AD app registration with redirect URI:
https://your-domain/oauth/microsoft/callback - Client secret generated under Certificates & Secrets
- Tenant ID from the Azure portal (use
commonfor multi-tenant apps)
Environment Variables
GitHub OAuth
Prerequisites
- A GitHub OAuth App registered at Settings → Developer settings → OAuth Apps
- Authorization callback URL:
https://your-domain/oauth/github/callback
Environment Variables
Generic OIDC Provider
Works with any OIDC-compliant provider: Okta, Keycloak, Auth0, Authentik, Dex, etc.Prerequisites
- OIDC discovery endpoint (usually
https://your-idp.example.com/.well-known/openid-configuration) - Client ID and secret from your IdP
- Redirect URI registered with your IdP:
https://your-domain/oauth/oidc/callback
Environment Variables
Trusted Header SSO
Environment Variables
docker compose logs openwebui | grep -i header
Safe Bootstrap Sequence
SSO configuration involves variables that can lock you out of your own instance if applied in the wrong order. Follow this sequence:- Enable SSO vars — add your chosen provider’s variables to
.env - Keep
ENABLE_LOGIN_FORM=TrueandENABLE_SIGNUP=Trueduring initial setup - Restart:
docker compose up -d openwebui - Verify SSO works — log in successfully via the SSO button at least once
- Optionally set
ENABLE_SIGNUP=Falseto block new local-account signups - Only then consider setting
ENABLE_LOGIN_FORM=Falseif you want SSO-only login
Configuration Reference
All variables verified against open-webui:0.6.5.Troubleshooting
SSO button doesn’t appear Verify the client ID variable is uncommented and set correctly in.env. Then check logs:
- Google:
https://your-domain/oauth/google/callback - GitHub:
https://your-domain/oauth/github/callback - Microsoft:
https://your-domain/oauth/microsoft/callback - Keycloak/Okta/other OIDC:
https://your-domain/oauth/oidc/callback
OPENID_REDIRECT_URI explicitly.
New users can’t sign in for the first time
ENABLE_OAUTH_SIGNUP=True must be set for a user’s first OAuth login — it controls
whether new accounts can be created via OAuth. ENABLE_SIGNUP only gates local account
creation via the sign-up form and has no effect on OAuth login.
SSO silently fails / no error shown
Wrong client ID/secret causes a silent failure at the OAuth callback stage. Check:
ENABLE_LOGIN_FORM=True to .env and restart:
Common Gotchas
ENABLE_SIGNUP vs ENABLE_OAUTH_SIGNUP
These are two separate variables with different scopes:
ENABLE_SIGNUP— controls whether new local accounts can be created via the sign-up form. Default:TrueENABLE_OAUTH_SIGNUP— controls whether new accounts can be created via OAuth login. Default:False
ENABLE_OAUTH_SIGNUP=True is required.
ENABLE_SIGNUP has no effect on OAuth — set it to False to block local sign-up form
registrations while keeping ENABLE_OAUTH_SIGNUP=True for continued SSO registration.
OAUTH_MERGE_ACCOUNTS_BY_EMAIL is a one-way door
Once enabled and a user logs in via OAuth, their OAuth identity is linked to any existing
local account with the same email. Disabling this variable later does not un-link accounts
already merged. Plan accordingly before enabling in production.
Disabling the login form
ENABLE_LOGIN_FORM=False hides the username/password form in the UI and blocks the local
sign-up endpoint (POST /api/v1/auths/signup), but does not disable backend password
authentication — the /signin endpoint remains accessible. Only set this after you have
confirmed SSO works end-to-end. See Safe Bootstrap Sequence.
Reverse proxy and cookie domains
If mAItion is behind a reverse proxy, ensure your proxy passes the Host header correctly
and that WEBUI_URL in .env matches the public URL. Cookie domain mismatches cause
sessions to drop silently after login.