Skip to content

Fix auto-SSO redirect for password-only auth providers - #59990

Closed
joe-bader wants to merge 1 commit into
NousResearch:mainfrom
joe-bader:fix/basic-auth-auto-sso-redirect
Closed

Fix auto-SSO redirect for password-only auth providers#59990
joe-bader wants to merge 1 commit into
NousResearch:mainfrom
joe-bader:fix/basic-auth-auto-sso-redirect

Conversation

@joe-bader

Copy link
Copy Markdown

Summary:

  • send password-capable auth providers to /login instead of /auth/login
  • preserve next= correctly for both /login and /auth/login URLs
  • add password-provider regression tests for the auto-redirect path

Problem:
When only a password provider (for example basic auth) is configured, the dashboard auto-SSO gate redirects unauthenticated HTML requests to /auth/login?provider=. Password providers do not implement the OAuth redirect flow, so that path raises NotImplementedError and returns a 500.

Fix:
Detect supports_password providers in the gate and redirect them to /login instead. Also build the next query parameter with the correct separator so /login gets ?next=... while OAuth providers keep &next=....

Test plan:

  • ./venv/bin/python -m pytest tests/hermes_cli/test_dashboard_auth_password_login.py tests/hermes_cli/test_dashboard_auth_401_reauth.py -q
  • manually verified the dashboard login works again with basic auth on 0.0.0.0:9119

When only a password provider (e.g. basic auth) is configured, the
auto-SSO path was redirecting to /auth/login?provider=basic which tries
an OAuth redirect flow that doesn't exist for password providers —
causing a NotImplementedError → 500 error.

Fix: check if the provider supports password login and go directly to
/login instead of trying an OAuth redirect.
@alt-glitch alt-glitch added type/bug Something isn't working comp/dashboard Web dashboard / control panel UI (dashboard/, landing) area/auth Authentication, OAuth, credential pools P2 Medium — degraded but workaround exists duplicate This issue or pull request already exists labels Jul 7, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Duplicate of #54887 — same fix at the same _auto_sso_response code-site (hermes_cli/dashboard_auth/middleware.py) for the password-only dashboard-auth 500 (issue #55130, regression from merged #54846). #54887 is the earliest open canonical fix. This variant rewrites the redirect to /login rather than returning None. Related: #58171 (broader superset fixing both middleware auto-SSO and the /auth/login route) and #59268 (routes.py facet).

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the focused reproduction and regression tests. This is an automated hermes-sweeper review; current main already provides this password-provider auto-SSO protection.

  • hermes_cli/dashboard_auth/middleware.py:212-213 returns to the normal /login fallback for supports_password providers; the fallback at :310-313 preserves the normal next= behavior.
  • hermes_cli/dashboard_auth/routes.py:195-202 also redirects password providers away from /auth/login while preserving validated next=.
  • Commit 3e24b16f566045399012bc1185fe0cdb6e1a1be9 added the production behavior and the equivalent regression coverage in tests/hermes_cli/test_dashboard_auth_password_login.py:201-217.

Closing as implemented on main.

@teknium1 teknium1 closed this Jul 15, 2026
@teknium1 teknium1 added the sweeper:implemented-on-main Sweeper: behavior already present on current main label Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/auth Authentication, OAuth, credential pools comp/dashboard Web dashboard / control panel UI (dashboard/, landing) duplicate This issue or pull request already exists P2 Medium — degraded but workaround exists sweeper:implemented-on-main Sweeper: behavior already present on current main type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants