Describe the bug
When dashboard.basic_auth (the username/password auth provider) is configured as the only auth provider, accessing any protected page on the Dashboard (port 9119) triggers an HTTP 500 error.
The auto-SSO redirect sends the browser to /auth/login?provider=basic&next=... instead of /login (the password login form), and BasicAuthProvider.start_login() raises NotImplementedError because it is password-only — it has no OAuth redirect flow.
To Reproduce
- Configure basic auth in
config.yaml:
dashboard:
basic_auth:
username: admin
password_hash: ...
- Restart the dashboard
- Open
http://localhost:9119 in a browser
- Expected: See the password login form at
/login
- Actual: Redirected to
/auth/login?provider=basic&next=... → 500 error page
Root Cause
_auto_sso_response() in hermes_cli/dashboard_auth/middleware.py is designed for OAuth providers (silent redirect to the IdP). When exactly one provider is registered, it assumes it's an OAuth provider and redirects to /auth/login?provider=.... BasicAuthProvider has supports_password = True and start_login() raises NotImplementedError, producing a 500.
# Line ~180 in middleware.py
providers = list_session_providers()
if len(providers) != 1:
return None
# ↓ reaches here for password-only providers
provider = providers[0]
# ... builds /auth/login?provider=... URL
Fix
Skip auto-SSO when the single provider is password-only:
provider = providers[0]
if getattr(provider, 'supports_password', False):
return None # password-only provider, show /login form instead
Environment
- Hermes Agent version: 0.18.2
- Dashboard with basic_auth (password-only, no OAuth)
- OS: Linux
Additional context
Introduced when _auto_sso_response was added for OAuth SSO convenience. It never considered password-only providers. v0.17.x did not have this issue.
Describe the bug
When
dashboard.basic_auth(the username/password auth provider) is configured as the only auth provider, accessing any protected page on the Dashboard (port 9119) triggers an HTTP 500 error.The auto-SSO redirect sends the browser to
/auth/login?provider=basic&next=...instead of/login(the password login form), andBasicAuthProvider.start_login()raisesNotImplementedErrorbecause it is password-only — it has no OAuth redirect flow.To Reproduce
config.yaml:http://localhost:9119in a browser/login/auth/login?provider=basic&next=...→ 500 error pageRoot Cause
_auto_sso_response()inhermes_cli/dashboard_auth/middleware.pyis designed for OAuth providers (silent redirect to the IdP). When exactly one provider is registered, it assumes it's an OAuth provider and redirects to/auth/login?provider=....BasicAuthProviderhassupports_password = Trueandstart_login()raisesNotImplementedError, producing a 500.Fix
Skip auto-SSO when the single provider is password-only:
Environment
Additional context
Introduced when
_auto_sso_responsewas added for OAuth SSO convenience. It never considered password-only providers. v0.17.x did not have this issue.