Skip to content

fix(dashboard-auth): skip auto-SSO for password-only provider (500 on login) - #57214

Closed
VignanTej wants to merge 1 commit into
NousResearch:mainfrom
VignanTej:fix/dashboard-auto-sso-password-provider-500
Closed

VignanTej wants to merge 1 commit into
NousResearch:mainfrom
VignanTej:fix/dashboard-auto-sso-password-provider-500

Conversation

@VignanTej

Copy link
Copy Markdown

Problem

With dashboard.basic_auth configured as the only auth provider and the dashboard bound to a non-loopback host (--host 0.0.0.0), every HTML navigation to a protected path returns 500 Internal Server Error and the login form never renders.

Fixes #57211.

Root cause

_auto_sso_response in hermes_cli/dashboard_auth/middleware.py fires whenever exactly one interactive provider is registered, and unconditionally 302-redirects to /auth/login?provider=basic. That route (routes.py) calls provider.start_login(), but BasicAuthProvider.start_login() (plugins/dashboard_auth/basic/__init__.py) raises NotImplementedError — it is password-only and has no OAuth redirect flow. NotImplementedError is not a ProviderError, so it escapes uncaught → 500.

Auto-SSO is documented as being for "the portal OAuth redirect", so it should never target a password provider.

Fix

Skip auto-SSO when the sole provider is password-based (supports_password), so the /login interstitial renders its credential form instead:

provider = providers[0]
if getattr(provider, "supports_password", False):
    return None

After this, an unauthenticated HTML load lands on /login (200, credential form) instead of 500ing.

Test

Adds test_single_password_provider_renders_login_not_auto_sso to TestAutoSsoRedirect, asserting a single supports_password provider redirects to /login rather than /auth/login. Full file passes:

tests/hermes_cli/test_dashboard_auth_401_reauth.py (45 passed)

Reproduction (before fix)

  1. Configure dashboard.basic_auth (username + password_hash) as the only provider.
  2. hermes dashboard --host 0.0.0.0 --port 9119
  3. curl -sL http://localhost:9119/Internal Server Error (500).

… login)

When dashboard.basic_auth is the sole registered provider and the
dashboard is bound to a non-loopback host, every HTML navigation to a
protected path 500s and the login form never renders.

_auto_sso_response() fires whenever exactly one interactive provider is
registered and unconditionally 302s to /auth/login?provider=basic. That
route calls provider.start_login(), but BasicAuthProvider.start_login()
raises NotImplementedError (it is password-only, no OAuth redirect). The
NotImplementedError is not a ProviderError, so it escapes uncaught -> 500.

Auto-SSO is only meaningful for redirect-based (OAuth) providers. Skip it
when the sole provider is password-based so the /login interstitial
renders its credential form instead.

Adds a regression test asserting a single supports_password provider
lands on /login rather than /auth/login.
@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 2, 2026
@alt-glitch

Copy link
Copy Markdown

This was generated by AI during triage.
Duplicate of #54887 — same supports_password early-return guard in the same _auto_sso_response function. This is the 6th identical fix in the dashboard-500 cluster (canonical fix PR #54887; issue anchor #55130). Maintainer to pick one.

@teknium1

Copy link
Copy Markdown
Collaborator

Thanks for the focused reproduction and regression test. This is already implemented on current main by automated hermes-sweeper review.

  • Commit 3e24b16f566045399012bc1185fe0cdb6e1a1be9 implements the same supports_password early return in hermes_cli/dashboard_auth/middleware.py:212, so password-only providers fall through to /login rather than auto-SSO.
  • The same commit additionally protects direct/stale OAuth-entry requests in hermes_cli/dashboard_auth/routes.py:195-202, redirecting password providers to /login before start_login() can run.
  • Regression coverage in tests/hermes_cli/test_dashboard_auth_password_login.py:201-217 verifies both the protected-page redirect and direct /auth/login?provider=testpw behavior.
  • This matches the duplicate analysis previously noted for fix(dashboard-auth): skip auto-SSO redirect for password-only providers #54887.

@teknium1 teknium1 closed this Jul 15, 2026
@teknium1 teknium1 added sweeper:implemented-on-main Sweeper: behavior already present on current main sweeper:risk-security-boundary Sweeper risk: may affect sandboxing, auth, credentials, or sensitive data sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels 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:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:implemented-on-main Sweeper: behavior already present on current main sweeper:risk-security-boundary Sweeper risk: may affect sandboxing, auth, credentials, or sensitive data type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dashboard 500s on login when basic_auth is the only provider (auto-SSO calls start_login() on a password provider)

3 participants