Open WebUI SSO with Keycloak (OIDC)
Use Open WebUI’s generic OIDC integration with Keycloak and explicit application roles.
Last updated
On this page (5)
Open WebUI · Keycloak · OIDC
Before you start
- Pinned Open WebUI version with documented OAuth role settings.
- Dedicated confidential Keycloak client and retained admin recovery.
- Review of applicable Open WebUI licence.
Configure sign-in
- Set the Open WebUI public URL and register its exact /oauth/oidc/callback URI in Keycloak. Configure OPENID_PROVIDER_URL with realm discovery and set OAuth client credentials.
- Emit the needed profile claims; before enabling OAuth account creation, decide how pre-existing users will be matched. Leave email-based merging disabled unless verified email ownership and collisions have been addressed.
- Create a dedicated Keycloak mapper emitting an application roles claim. Enable OAuth role management, set OAUTH_ROLES_CLAIM to that claim and put only intended roles in OAUTH_ALLOWED_ROLES; keep the admin role separate.
Verify the result
- Test a permitted user, a denied user, and an existing user; verify access to models, tools and data, not just the login result.
- Check claim/role changes on new login and measure existing token/session survival independently. The upstream Keycloak walkthrough is community-contributed, not a production compatibility guarantee.
Official documentation
- Open WebUI: SSO reference
- Open WebUI: Keycloak walkthrough
- Open WebUI: v0.6.41 configuration definitions
