fix(dashboard-auth): skip auto-SSO redirect for password-only providers - #54887
fix(dashboard-auth): skip auto-SSO redirect for password-only providers#54887sjfkai wants to merge 1 commit into
Conversation
_auto_sso_response unconditionally redirects a single provider to /auth/login (the OAuth PKCE entry point). BasicAuthProvider is the only registered provider in password-only setups, and its start_login() raises NotImplementedError because it has no OAuth redirect flow. Check supports_password before attempting the OAuth redirect; when True, fall through to the normal /login interstitial which renders the username/password form wired to /auth/password-login.
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: LGTM — clean fix for dashboard auth with password-only providers.
Small, targeted fix that correctly skips auto-SSO redirect for password-only providers.
Reviewed by Hermes Agent
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: LGTM
Clean, well-scoped change with no concerns.
--- Reviewed by Hermes Agent
|
Confirmed independently on a macOS + Tailscale dashboard setup. Setup:
Before the fix, unauthenticated We independently landed on the same +1 from another real-world setup that this PR fixes the right failure mode. |
|
Closing as superseded by #61330 (merged to Your |
Summary
Fix a
NotImplementedErrorcrash when the dashboard is bound to anon-loopback host with a password-only auth provider (e.g.
BasicAuthProvider).Background
PR #54846 introduced
_auto_sso_response()to silently bounceunauthenticated users through the portal OAuth flow when exactly one
interactive provider is registered. The assumption was that a single
provider would always be an OAuth provider — but
BasicAuthProvidersets
supports_password = Trueand has no OAuth redirect flow. Itsstart_login()raisesNotImplementedError:This only triggers when all of the following hold:
--host 0.0.0.0)auth_required = True)BasicAuthProvideris registered (no OAuth provider)Fix
In
_auto_sso_response(), checksupports_passwordbefore attemptingthe OAuth redirect. When the sole provider is password-only, return
Noneso the caller falls through to the normal/logininterstitialwhich renders the username/password form.
Testing
Verified locally:
--host 0.0.0.0withBasicAuthProvideronly → login page renderscorrectly (was: 500
NotImplementedError)--host 127.0.0.1→ auth gate inactive, unaffectedNoneat thelen != 1check,unaffected