mirror of
https://github.com/open-webui/open-webui.git
synced 2026-03-09 23:35:09 -05:00
issue: HTTPX timeout for SSO #5656
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @akiraro on GitHub (Jun 27, 2025).
Check Existing Issues
Installation Method
Git Clone
Open WebUI Version
0.6.15
Ollama Version (if applicable)
No response
Operating System
Ubuntu 22.04
Browser (if applicable)
No response
Confirmation
README.md.Expected Behavior
The OIDC SSO authentication flow should complete successfully from end-to-end. After the user authenticates with the external provider, OpenWebUI should be able to complete the authorization code and token exchange, establishing a valid, authenticated session for the user
Actual Behavior
After the user authenticates with the OIDC provider and is redirected back, the OpenWebUI backend attempts to exchange the authorization code for a token. This back-channel request to the OIDC provider consistently hangs and fails with an httpx.ReadTimeout error in the server logs.
As a result of this backend timeout, the login process aborts, and the user is ultimately presented with a misleading error in the UI:
Steps to Reproduce
Steps:
slow_oidc_server.py) which has been configured with a 15-second delay on its/tokenendpoint.backend/.envto use this mock server as its OIDC provider (e.g.,OPENID_PROVIDER_URL=http://localhost:9090/...).Verification:
httpx.ReadTimeoutexception.This behavior indicates the fixed timeout in the backend's HTTP client is too short to handle providers with higher latency
Logs & Screenshots
When the OIDC callback fails, the server log displays a generic
400 Bad Requestwithout specific details about the cause:By placing a breakpoint inside the handle_callback function, the true underlying exception was captured. The application hangs on the authorize_access_token call and fails with a read timeout.
Additional Information
During local debugging, I was able to confirm that the
httpx.ReadTimeoutis the root cause. I successfully worked around the issue by modifying the source code to pass a longertimeoutvalue to theAsyncOAuth2Clientconstructor inbackend/open_webui/utils/oauth.py.This confirms that the bug specifically affects integrations with OIDC providers that exhibit high latency during the token exchange process. A permanent solution would likely involve making this HTTP client timeout configurable via an environment variable.