Overview
Open WebUI supports OAuth 2.0 and OpenID Connect for Single Sign-On (SSO) with multiple identity providers. Enable seamless authentication with Google, Microsoft, GitHub, Feishu, or any OIDC-compliant provider.Supported Providers
Google OAuth 2.0 authentication
Microsoft
Azure AD / Microsoft Entra ID
GitHub
GitHub OAuth Apps
Generic OIDC
Okta, Auth0, Keycloak, etc.
Feishu
Lark/Feishu authentication
Trusted Headers
Proxy-based authentication
Quick Start
Google OAuth
Setup
Create OAuth Client
- Go to Google Cloud Console
- Navigate to APIs & Services > Credentials
- Create OAuth 2.0 Client ID (Web application)
- Add authorized redirect URI:
https://your-domain.com/oauth/google/callback
Configuration Options
Microsoft OAuth
Setup
Register Application
- Go to Azure Portal
- Navigate to Azure Active Directory > App registrations
- Create new registration
- Add redirect URI:
https://your-domain.com/oauth/microsoft/callback - Create a client secret under Certificates & secrets
Advanced Configuration
GitHub OAuth
Setup
Create OAuth App
- Go to GitHub Settings > Developer settings > OAuth Apps
- Click “New OAuth App”
- Set Homepage URL:
https://your-domain.com - Set Authorization callback URL:
https://your-domain.com/oauth/github/callback
Generic OIDC Provider
Connect to any OpenID Connect provider (Okta, Auth0, Keycloak, etc.).Configuration
Advanced OIDC Options
Role and Group Management
Role Mapping
Map OAuth roles to Open WebUI roles:Group Management
Automatically sync OAuth groups to Open WebUI:Domain Restrictions
Restrict access to specific email domains:Claim Mapping
Customize which JWT claims to use for user attributes:Custom Claims Example
User Profile Updates
Control whether OAuth updates user profiles on login:Account Merging
Merge OAuth accounts with existing email-based accounts:Session Management
LDAP Integration
Open WebUI includes LDAP support for enterprise directory services.File: backend/requirements.txt:140
Multiple Provider Setup
Enable multiple OAuth providers simultaneously:Troubleshooting
Redirect URI Mismatch
Redirect URI Mismatch
Error:
redirect_uri_mismatchSolution:- Verify redirect URI in OAuth provider matches exactly
- Include protocol (https://)
- Check for trailing slashes
- Ensure callback path is correct:
- Google:
/oauth/google/callback - Microsoft:
/oauth/microsoft/callback - GitHub:
/oauth/github/callback - OIDC:
/oauth/oidc/callback
- Google:
User Not Created
User Not Created
OAuth succeeds but no user account created.Solution:
- Enable
ENABLE_OAUTH_SIGNUP=True - Check domain restrictions in
OAUTH_ALLOWED_DOMAINS - Verify required claims are present (email, name)
- Review role restrictions in
OAUTH_ALLOWED_ROLES - Check logs for detailed error messages
Logout Not Working
Logout Not Working
Users not properly logged out.Solution:The
OPENID_PROVIDER_URL is required for proper logout functionality.Role/Group Sync Failing
Role/Group Sync Failing
OAuth roles or groups not syncing.Solution:
- Verify claim names match provider (check JWT)
- Check separator configuration
- Enable group creation if needed
- Review
OAUTH_BLOCKED_GROUPSconfiguration - Ensure claims are included in token response
Security Best Practices
Use HTTPS
Always use HTTPS for production OAuth
Secure Secrets
Store client secrets in environment variables or secrets manager
Validate Emails
Only enable account merging with trusted email verification
Limit Sessions
Configure OAUTH_MAX_SESSIONS_PER_USER
Domain Restrictions
Use OAUTH_ALLOWED_DOMAINS to restrict access
Audit Logging
Enable logging for OAuth authentication events
Advanced Features
Persistent OAuth Config
Enable database-backed OAuth configuration:Email Fallback
Allow OAuth signup even without email in claims:Client Info Encryption
Encrypt OAuth client information:Testing OAuth Configuration
-
Test Provider Connection:
- Visit login page
- Click OAuth provider button
- Verify redirect to provider
-
Test User Creation:
- Complete OAuth flow
- Check if user is created
- Verify role/group assignment
-
Test Claims:
- Decode JWT token
- Verify required claims present
- Check claim values
-
Test Logout:
- Log in via OAuth
- Log out
- Verify session cleared
References
- OAuth 2.0: oauth.net
- OpenID Connect: openid.net/connect
- Google OAuth: developers.google.com/identity
- Microsoft Identity: docs.microsoft.com/azure/active-directory
- GitHub OAuth: docs.github.com/apps/oauth-apps