mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
[GH-ISSUE #23582] issue: [Bug] OIDC Authentication fails after Identity Provider Key Rotation (bad_signature) #58684
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 @IRScorpio on GitHub (Apr 10, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/23582
Check Existing Issues
Installation Method
Pip Install
Open WebUI Version
v0.6.32
Ollama Version (if applicable)
No response
Operating System
Ubuntu 22.04
Browser (if applicable)
No response
Confirmation
README.md.Expected Behavior
When a "bad_signature" error is encountered during the OAuth callback validation, Open WebUI should not immediately fail. Instead, it should proactively re-fetch the latest JWKS (public keys) from the provider's jwks_uri to check if the keys have been updated, and then retry the validation once more before returning an error.
Actual Behavior
Currently, when the Identity Provider rotates its keys, Open WebUI continues to use the old cached keys to validate new tokens. This results in a persistent "bad_signature" error for all login attempts. The system remains in this broken state until the service is manually restarted, which is the only way to force a refresh of the OIDC public keys.
Steps to Reproduce
Logs & Screenshots
DEBUG | httpcore._trace:atrace:87 - receive_response_headers.started request=<Request [b'POST']>
INFO | uvicorn.protocols.http.httptools_impl:send:476 - [CLIENT_IP] - "GET /oauth/oidc/login HTTP/1.1" 302
DEBUG | httpcore._trace:atrace:87 - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Server', b'Apache'), (b'Set-Cookie', 'REDACTED'), (b'Content-Type', b'application/json')])
INFO | httpx._client:_send_single_request:1740 - HTTP Request: POST https://[IDP_DOMAIN]/oauth2/token "HTTP/1.1 200 OK"
DEBUG | httpcore._trace:atrace:87 - receive_response_body.complete
WARNING | open_webui.utils.oauth:handle_callback:1073 - OAuth callback error: bad_signature:
ERROR | open_webui.utils.oauth:handle_callback:1266 - Error during OAuth process: 400: The email or password provided is incorrect.
INFO | uvicorn.protocols.http.httptools_impl:send:476 - [CLIENT_IP] - "GET /oauth/oidc/callback?code=[REDACTED]&state=[REDACTED] HTTP/1.1" 307
INFO | uvicorn.protocols.http.httptools_impl:send:476 - [CLIENT_IP] - "GET /auth?error=The%20email%20or%20password%20provided%20is%20incorrect. HTTP/1.1" 200
Additional Information