Repository navigation
Closed
Labels
enhancementNew feature or request
Description
Summary
Add an opt-in, backend-enforced "SSO-only" policy that rejects local password authentication, where only the default super admin account can still use password login through a hidden sign-in entry.
Problem
How sign-in works today:
POST /auth/login(auth.Service.Login) looks the user up by username and checks the bcrypt hash. It does not know whether the account is SSO-managed.- SSO sign-in (
sso.Service.CompleteLogin→ResolveUser) ends in the sameIssueSession. Auto-provisioned accounts get a random, unguessable password, but nothing stops that from changing: an adminPATCH /admin/users/{id}/password, a password-set-token email (POST /auth/password/set), orPATCH /me/passwordcan give an SSO user a usable password. - With
LinkByEmail, an SSO identity can be linked to a pre-existing local account that still has its password.
So a user removed from the IdP group (the IdP group policy) can keep signing in with a local password, which defeats the policy.
Proposed Direction
- Instance-level setting (e.g.
auth.sso_only), default off, so existing installs are unchanged. Cannot be enabled unless at least one SSO provider is enabled, to avoid lock-out. - When on, the login page shows only the SSO providers. The username/password form is hidden by default but still reachable through a dedicated admin sign-in entry (e.g. a "Sign in as administrator" link or a separate URL), so no CLI or env var is needed for recovery.
- Only the default super admin account may use password login while SSO-only is on. This is the account Paca seeds at startup from the admin config (it holds the
SUPER_ADMINrole; seeseedAdminininternal/bootstrap). It can always sign in this way, so it can still configure settings and recover from a broken IdP setup. How the backend identifies this account (e.g. a persistent "bootstrap/default admin" marker on the user, rather than matching a username or role name) is to be decided in the issue. Other users holdingSUPER_ADMINor admin permissions are not exempt. - Enforce in the backend, not just the UI:
/auth/loginrejects every user except the default super admin with a clear policy error; password set/reset/change flows (/auth/password/set,/admin/users/{id}/password,/me/password) cannot give other SSO users a working password path;LinkByEmailcannot be used to bypass it. - Decide how password login is handled for other existing local accounts when the policy is turned on (blocked until they sign in via SSO and link).
- Log password sign-ins made while SSO-only is on.
- Revoking existing sessions is covered by the separate session revalidation work, not here.
Scope
- Product behavior, Architecture (auth/user/sso services, settings), Admin UI, Documentation (including recovery runbook), tests
Acceptance
- With SSO-only on, password login by any user other than the default super admin is rejected by the API, and password set/reset/change cannot give them a usable password path.
- The default super admin can still sign in with username and password through the hidden admin entry and turn the policy off.
- The policy cannot be enabled without a working provider.
- Tests cover enforcement and the default super admin exception; docs describe the hidden admin sign-in entry and recovery.
Additional Context
Raised in Discussion #673 (follow-up to #431). Extra hardening for the default super admin's password login (MFA, IP restriction) is out of scope here, since Paca has neither today; this is tracked separately as an MFA / IP allow-list feature. Can ship independently of the IdP group policy.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Activity
pullfrog commentedon Oct 31, 2026