Skip to main content

Overview

Open WebUI provides enterprise-grade authentication with support for multiple authentication methods, SSO providers, and granular permission controls.

Authentication Methods

Traditional credential-based authentication:
  • Secure password hashing with bcrypt
  • Password validation rules
  • Account creation and management
  • Password reset workflows

Sign Up & Sign In

User Registration

New users can create accounts through the sign-up flow:
1

Navigate to Sign Up

Access the registration page at /auth/signup
2

Provide Details

3

Account Creation

  • First user becomes admin automatically
  • Subsequent users get the default role (configured in settings)
  • Email validation ensures proper format
4

Automatic Sign In

Upon successful registration, users are automatically signed in
Password requirements are enforced server-side. Passwords are hashed using bcrypt and never stored in plain text.

Sign In Process

Authenticate existing users:
Response includes:

Rate Limiting

Sign-in attempts are rate-limited to prevent brute force attacks:
  • 5 attempts per 3 minutes per email address
  • Automatically resets after the time window

LDAP Authentication

Integrate with corporate directories.

Configuration

Configure LDAP settings through the admin panel:

LDAP Authentication Flow

1

User Submits Credentials

2

Directory Lookup

Open WebUI searches LDAP for the user:
  • Queries using configured search base and filters
  • Retrieves user attributes (email, name, groups)
3

Credential Verification

Binds to LDAP using the user’s DN and password to verify credentials
4

Account Provisioning

  • Creates local account if it doesn’t exist
  • First LDAP user becomes admin
  • Subsequent users get default role
5

Group Synchronization

If enabled, synchronizes LDAP groups to Open WebUI groups

LDAP Group Management

Automatic group synchronization:
Features:
  • Auto-sync: Groups updated on each login
  • Group creation: Automatically creates missing groups
  • CN extraction: Extracts group names from DNs
  • Role preservation: Doesn’t affect admin users

OAuth/SSO Integration

Supported Providers

Configure multiple OAuth providers:
  • OpenID Connect (OIDC)
  • Google
  • GitHub
  • Microsoft Azure AD
  • Okta
  • Custom providers

OAuth Flow

1

User Initiates Login

Click “Sign in with [Provider]” button
2

Redirect to Provider

User is redirected to OAuth provider for authentication
3

Authorization Grant

User approves application access
4

Token Exchange

Provider returns authorization code, exchanged for access token
5

User Info Retrieval

Open WebUI fetches user profile from provider
6

Account Linking

  • Links OAuth account to existing user (if email matches)
  • Creates new user if no match found

Token Exchange Endpoint

Exchange external OAuth tokens for Open WebUI JWT:
This endpoint is disabled by default. Set ENABLE_OAUTH_TOKEN_EXCHANGE=true to enable.

Trusted Header Authentication

Integrate with reverse proxy SSO.

Configuration

How It Works

1

Proxy Authentication

Reverse proxy (Nginx, Traefik, etc.) handles authentication
2

Header Injection

Proxy adds trusted headers with user information
3

Account Auto-Creation

Open WebUI:
  • Reads headers on each request
  • Creates user if doesn’t exist
  • Updates name/groups from headers
4

Automatic Sign-In

User is automatically authenticated without credentials
Security Critical: Only enable trusted headers when Open WebUI is behind a properly configured reverse proxy. Exposed directly to the internet, this allows authentication bypass.

Session Management

JWT Tokens

Open WebUI uses JWT for session management:

Token Configuration

Customize token behavior:
Supported formats:
  • ms: milliseconds
  • s: seconds
  • m: minutes
  • h: hours
  • d: days
  • w: weeks
  • -1: No expiration

Sign Out

Terminate user sessions:
Sign-out process:
  1. Invalidates JWT token
  2. Clears browser cookies (token, oui-session, oauth_id_token)
  3. Optionally redirects to OAuth provider logout
  4. Returns to configured redirect URL

OAuth Logout

For OAuth users, sign-out includes:
  • Retrieval of provider’s end session endpoint
  • Redirect to provider logout URL
  • Return to configured WEBUI_AUTH_SIGNOUT_REDIRECT_URL

User Profile Management

Viewing Profile

Get current user information:
Returns:

Updating Profile

Modify profile information:

Changing Password

1

Submit Request

2

Verification

Current password is verified against stored hash
3

Validation

New password validated against security requirements
4

Update

Password hash updated in database
Password changes are not available when using trusted header authentication.

API Keys

Generate API keys for programmatic access.

Creating API Keys

Response:

Using API Keys

Managing API Keys

Retrieve your current API key

API Key Restrictions

Optionally restrict API key usage:
API key functionality requires the features.api_keys permission for users.

Admin Functions

Adding Users

Admins can create user accounts:

Admin Configuration

Manage authentication settings:

Admin Contact Display

Show admin contact information to users:
Enable SHOW_ADMIN_DETAILS to display admin contact on the UI for user support.

Security Best Practices

Strong Passwords

  • Minimum length requirements
  • Complexity validation
  • Bcrypt hashing with salt
  • 72-byte maximum for bcrypt compatibility

Rate Limiting

  • Sign-in attempt throttling
  • Redis-backed rate limiter
  • Configurable time windows

Secure Cookies

  • HttpOnly flag set
  • SameSite protection
  • Secure flag for HTTPS
  • Proper expiration

Token Security

  • JWT signed with secret
  • Expiration enforcement
  • Token invalidation on logout
  • Secure storage recommendations

Troubleshooting

Common Issues

Check:
  • LDAP server connectivity and port
  • TLS/SSL certificate validation
  • Search base and filter syntax
  • App DN credentials
  • User attribute mappings
Verify:
  • Redirect URI matches OAuth app config
  • Client ID and secret are correct
  • OAuth scopes include email
  • Provider allows account merging
Ensure:
  • Headers are properly configured in proxy
  • Header names match environment variables
  • Open WebUI not directly exposed
  • Headers properly URL-encoded
Confirm:
  • API keys are enabled in settings
  • User has features.api_keys permission
  • Key not expired or deleted
  • Endpoint restrictions allow the request