Skip to main content

๐Ÿ” Troubleshooting OAUTH / SSO Issues

OAUTH or Single Sign-On (SSO) lets you secure Open WebUI with modern authentication, but when users encounter login problems, the solution is often simpleโ€”if you know where to look. Most of the time, one of these key issues below is the culprit. Hereโ€™s how to hunt them down and fix SSO headaches fast! ๐Ÿšฆ

Common OAUTH/SSO Issues and How to Fix Them ๐Ÿ› ๏ธโ€‹

1. WebUI URL Not Configured in Admin Panel ๐Ÿšช๐Ÿ”’โ€‹

Most OAUTH flows require the applicationโ€™s external URL (โ€œredirect URIโ€) so the provider knows where to send users after login. If this is missing, OAUTH wonโ€™t be able to complete!

โœ… Solution:

  • Navigate to: Admin Settings > General
  • Ensure your WebUI URL field is filled in and points to your deployed instance (e.g., https://yourwebui.yourdomain.com) ๐Ÿ“Œ Tip: Check for typos! OAUTH is strictโ€”URLs must match exactly, including https://.

2. Incorrect Environment Variable Configuration ๐Ÿ“๐Ÿšซโ€‹

This is by far the most common cause of OAUTH breakage. If you misspell, omit, or set the wrong environment variable (especially for OIDC/OAUTH config), authentication canโ€™t work.

โœ… Solutions:

  • Double-check your deployment environment:
    • Ensure all required environment variables are set (see docs for names like OIDC_CONFIG, OAUTH_CLIENT_ID, etc.)
    • If self-hosting, confirm these variables are present in your Docker Compose, Kubernetes manifest, or .env file.
  • Restart your backend/app after changing variables so the new values are loaded.

๐Ÿ“Œ Tip: Most OAUTH errors (loops, 401s, unresponsiveness) are due to an environment variable incorrectly set or missing entirely!


3. OAUTH Misconfiguration on the Provider Side ๐Ÿข๐Ÿ”—โ€‹

Sometimes the issue is with the identity provider (e.g., Google, Okta, Auth0, Azure AD) not aligning with your WebUIโ€™s setup.

โœ… Solutions:

  • Verify your application is correctly registered with the OAUTH provider. Confirm:
    • Redirect URIs exactly match your deployed WebUI address
    • Client ID and secret match the values given in your environment settings
    • Scopes and allowed grant types (e.g., authorization_code) are set as required by Open WebUI
  • Check the providerโ€™s logsโ€”misconfigured apps will often show clear error messages there.

๐Ÿ“Œ Tip: When in doubt, recheck your provider registration and regenerate client secrets if needed.


4. Server-Side Caching (A Hidden Trouble Spot!) ๐ŸงŠ๐Ÿšฆโ€‹

A new and tricky problem: If you use NGINX (or another reverse proxy) with server-side caching, OAUTH endpoints can misbehave. The result isnโ€™t always a total failureโ€”often, users experience random or โ€œweirdโ€ login bugs that are almost impossible to debug.

โœ… Solutions:

  • In your NGINX (or proxy) configuration:
    • Make sure to exclude the following endpoints from server-side caching:
      • /api, /oauth, /callback, /login, /ws, /websocket
    • Any critical login/auth endpoint must remain uncached!
  • Reload the proxy config after making changes.

๐Ÿ“Œ Warning: Never cache OAUTH or login endpoints! Caching can โ€œpoisonโ€ the session or deliver stale tokens, causing bizarre auth errors.


๐Ÿงช Pro Tip: Always Check the Logsโ€‹

  • Look at backend logs and browser network errors. The first error usually points to the misconfiguration (redirect URI mismatch, missing/invalid variable, provider-side error, or caching).
  • If unsure which side is the problem, try logging in from an incognito browser window and watch for any blocked or failed requests.

Summary Checklist โœ…โ€‹

ProblemFix
๐Ÿ”— WebUI URL missing or wrongSet correct WebUI URL in admin panel
๐Ÿ“ Env var typo or missingDouble-check and set all OAUTH/SSO env variables
๐Ÿข Provider misconfiguredConfirm app registration, URIs & client IDs/secrets
๐ŸงŠ Proxy caching interferingExclude OAUTH endpoints from all server-side caches
Still stuck?Review logs and test without caches

By carefully configuring BOTH your OAUTH provider and your WebUI environmentโ€”and keeping critical login endpoints immune to cachingโ€”youโ€™ll eliminate nearly all SSO/OAUTH login problems. Donโ€™t let a typo or a hidden cache block your users from seamless, secure AI access! ๐Ÿฆพ