fix(dashboard): skip auto-sso for password auth providers - #59491
Closed
Bohac-Petr wants to merge 1 commit into
Closed
fix(dashboard): skip auto-sso for password auth providers#59491Bohac-Petr wants to merge 1 commit into
Bohac-Petr wants to merge 1 commit into
Conversation
Collaborator
Duplicate of #54887 (earliest open canonical fix) — same code site ( |
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.
Summary
Dashboard auto-SSO currently auto-starts
/auth/loginwhenever exactly one interactive session provider is registered. That works for OAuth-style providers but breaks password-only deployments using the basic dashboard auth provider:BasicAuthProvider.start_login()intentionally raisesNotImplementedErrorbecause basic auth should render/loginand submit to/auth/password-login.This change filters password-capable providers out of the auto-SSO candidate list. With only basic auth configured, unauthenticated HTML navigations fall back to the login interstitial instead of attempting an OAuth redirect. OAuth-only single-provider deployments keep the existing auto-SSO behavior.
Verification
TestAutoSsoRedirect::test_single_password_provider_renders_login_not_auto_sso/auth/login?provider=basic&next=%2FsessionsPYTHONPATH="$PWD" /home/scoobydoo/.hermes/hermes-agent/venv/bin/python -m pytest tests/hermes_cli/test_dashboard_auth_401_reauth.py::TestAutoSsoRedirect -q -o addopts= --tb=short6 passedPYTHONPATH="$PWD" /home/scoobydoo/.hermes/hermes-agent/venv/bin/python -m pytest tests/hermes_cli/test_dashboard_auth_401_reauth.py tests/plugins/dashboard_auth/test_basic_provider.py tests/hermes_cli/test_web_server.py -q -o addopts= --tb=short408 passed, 11 warnings/home/scoobydoo/.hermes/hermes-agent/venv/bin/python -m py_compile hermes_cli/dashboard_auth/middleware.py tests/hermes_cli/test_dashboard_auth_401_reauth.pygit diff --check