A company identity provider can authenticate chat users without giving each person another password to manage. Open WebUI supports single sign-on (SSO) through OpenID Connect (OIDC), redirecting the browser to the provider and accepting its signed identity after login.
The integration connects an existing confidential OIDC application to an Open WebUI deployment behind trusted HTTPS. The provider must supply an email address and restrict application access to assigned users. An allowed email domain alone does not establish that a person is assigned to the application.
A local administrator account provides recovery if the provider or callback fails. Environment-managed OAuth settings remain separate from saved application defaults, and automatic linking to an existing account by email stays disabled. A new federated account receives the configured default role without granting administrator access from identity-provider claims.
Steps to enable Open WebUI SSO with OIDC:
- Confirm the confidential application's exact callback registration with the identity-provider administrator.
Open WebUI URL: https://openwebui.example.com OIDC redirect URI: https://openwebui.example.com/oauth/oidc/callback Client ID: open-webui Provider label: Corporate SSO Scopes: openid email profile Allowed email domain: example.com
The starting deployment has a working local administrator, trusted HTTPS, and a standard new-user role of user. The provider already has an assigned test user and an unassigned control account. A wildcard callback or an unrestricted provider application can expose sign-in to unintended users. Identity-provider deployment and application assignment are prerequisites.
The callback must match exactly, including its scheme, hostname and path. The discovery URL comes from the provider; a Keycloak realm includes its /realms/<realm> path.
Tool: OAuth Redirect URI Policy Checker - Request the provider's discovery document from the Open WebUI server.
$ curl -fsS https://idp.example.com/realms/corporate/.well-known/openid-configuration
The response identifies issuer, authorization_endpoint, token_endpoint and jwks_uri. The server must trust the provider's certificate chain; a certificate error blocks credential configuration.
- Request the signing keys at the discovery document's jwks_uri.
$ curl -fsS https://idp.example.com/realms/corporate/protocol/openid-connect/certs
This Keycloak realm returns a nonempty keys array. Other providers can use a different JWKS path. Discovery and signing keys must remain reachable by the application during sign-in.
- Back up the active Compose definition from its existing project directory.
$ cp -p compose.yaml compose.yaml.before-sso
Recreating the service briefly disconnects users. The existing image, data volume, provider connections and WEBUI_SECRET_KEY remain in place. A working local administrator session remains available during the SSO test.
Related: How to run Open WebUI with Docker Compose
Related: How to set WEBUI_SECRET_KEY in Open WebUI - Set private permissions for files created in the current shell.
$ umask 077
- Create open-webui.env if the service does not already have it.
$ touch open-webui.env
- Restrict the service's environment file to its owner.
$ chmod 600 open-webui.env
The environment file contains a client secret and must stay out of version control, shared logs and screenshots. An existing file retains its other service settings.
- Add the OIDC settings to open-webui.env with a text editor.
- open-webui.env
WEBUI_URL=https://openwebui.example.com ENABLE_LOGIN_FORM=true ENABLE_OAUTH_SIGNUP=true ENABLE_OAUTH_PERSISTENT_CONFIG=false DEFAULT_USER_ROLE=user OAUTH_PROVIDER_NAME=Corporate SSO OAUTH_CLIENT_ID=open-webui OAUTH_CLIENT_SECRET=<client-secret> OPENID_PROVIDER_URL=https://idp.example.com/realms/corporate/.well-known/openid-configuration OPENID_REDIRECT_URI=https://openwebui.example.com/oauth/oidc/callback OAUTH_SCOPES=openid email profile OAUTH_ALLOWED_DOMAINS=example.com OAUTH_MERGE_ACCOUNTS_BY_EMAIL=false ENABLE_OAUTH_ROLE_MANAGEMENT=false ENABLE_OAUTH_GROUP_MANAGEMENT=false
The client secret is entered privately in the editor. ENABLE_OAUTH_SIGNUP permits new federated accounts independently of local password registration. DEFAULT_USER_ROLE=user permits immediate standard access, so provider-side assignment must already be enforced. A saved Default User Role or WebUI URL overrides its environment default; the starting application settings must already match the intended role and HTTPS origin.
ENABLE_OAUTH_PERSISTENT_CONFIG=false makes OAuth settings environment-authoritative without disabling unrelated saved settings. A same-email local account is not automatically linked while OAUTH_MERGE_ACCOUNTS_BY_EMAIL is false. The generic provider identifier is oidc; Corporate SSO is its display label.
- Reference open-webui.env in the existing open-webui service.
- compose.yaml
services: open-webui: env_file: - ./open-webui.env
This fragment extends the existing service. Conflicting values under its environment key take precedence over env_file values. The original image, volumes, ports and other settings remain required.
- Validate the revised Compose definition without printing its secrets.
$ docker compose config --quiet
- Enable SSO by recreating the Open WebUI service with the loaded environment file.
$ docker compose up -d --force-recreate --wait open-webui
A restart alone does not load a changed container environment. If sign-in breaks, removing the added OIDC variables from open-webui.env and recreating the service restores local sign-in. The backup definition provides recovery for an incorrect Compose edit. The data volume must remain intact.
- Check the advertised OIDC provider through the public configuration endpoint.
$ curl -fsS https://openwebui.example.com/api/config
The oauth.providers.oidc value must be Corporate SSO. An empty provider list points to missing client settings, an unloaded environment file or disabled OAuth. This response establishes provider availability; the browser login below tests the integration.
- Open the HTTPS sign-in page in a separate private browser session.
The local administrator session remains open in its original window. A certificate warning must be resolved before entering credentials.
- Choose Continue with Corporate SSO.
The browser is now at the identity provider. The sign-in labels can differ for another provider.
- Enter the assigned test user's name in Username or email.

- Enter the identity-provider password in the masked Password field.

- Submit the provider's Sign In form.
A successful callback returns to the authenticated Open WebUI workspace as Morgan Identity. A redirect error points to a callback mismatch; a failed token exchange can indicate an incorrect secret or an untrusted provider certificate. A Pending account still requires administrator approval before it can use the workspace.
- Confirm that an unassigned control account is refused in another private session.
The same provider sign-in sequence with jordan.sales@example.com ends at Access denied. The assigned and unassigned accounts share the allowed email domain, so this checks provider-side application assignment.
- Open the user menu in the retained local administrator session.

- Select Admin Panel from the administrator's user menu.
The panel opens on Users.
- Confirm that Morgan Identity has the User role in the Users table.
The federated user has completed sign-in, the unassigned account was refused, and the local administrator retains Admin access. Role or group synchronization and SCIM provisioning are separate changes.
Related: How to enable SCIM provisioning in Open WebUI
Related: How to create an RBAC group in Open WebUI