fix(dashboard): skip auto-SSO redirect for password-only providers - #56191
Closed
liuhao1024 wants to merge 1 commit into
Closed
fix(dashboard): skip auto-SSO redirect for password-only providers#56191liuhao1024 wants to merge 1 commit into
liuhao1024 wants to merge 1 commit into
Conversation
When BasicAuthProvider is the sole session provider, _auto_sso_response() unconditionally redirected to /auth/login which crashes with NotImplementedError (password-only providers don't support OAuth flow). Guard on supports_password to fall through to /login instead, which renders the password form. Regression test included. Fixes NousResearch#56130
Collaborator
Contributor
Author
|
This is a duplicate of #54887 by @sjfkai, which implements the identical fix — a Diff comparison:
Since #54887 was filed first with the same approach, I'll recommend closing this one in favor of #54887. The regression test from this PR could be contributed separately if needed. Note: #55988 is a complementary fix that adds defense-in-depth at the |
This was referenced Jul 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fixes an HTTP 500 crash when the dashboard is bound to a non-loopback interface with
basic_authconfigured. The_auto_sso_response()middleware unconditionally redirects to/auth/loginwhen exactly one session provider is registered, butBasicAuthProvideris password-only and crashes withNotImplementedErrorinsidestart_login().The fix adds a guard: if the sole provider has
supports_password=True, skip the auto-SSO redirect and fall through to/loginwhich renders the password form.Related Issue
Fixes #56130
Type of Change
Changes Made
hermes_cli/dashboard_auth/middleware.py— In_auto_sso_response(), skip auto-SSO redirect when the single provider is password-only (supports_password=True), letting/loginrender the password form instead.tests/hermes_cli/test_dashboard_auth_middleware.py— Addtest_password_only_provider_skips_auto_ssoregression test.How to Test
python -m pytest tests/hermes_cli/test_dashboard_auth_middleware.py -q— all 34 tests should pass (including the new regression test).python -m pytest tests/plugins/dashboard_auth/ -q— all 181 tests should pass.basic_authinconfig.yaml, start dashboard on non-loopback host, visit/— should redirect to/login(password form), not crash with 500.Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/A