Skip to content

Commit 059c4b8

Browse files
committed
docs(plugin-auth): changeset and self-hosting section for the last sign-in method
Claude-Session: https://claude.ai/code/session_01Utp6CadeYZeJahkVWxXfYx Co-authored-by: Claude <noreply@anthropic.com>
1 parent d23dd1b commit 059c4b8

2 files changed

Lines changed: 41 additions & 0 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
'@objectstack/plugin-auth': patch
3+
---
4+
5+
fix(plugin-auth)!: deleting the last identity provider is refused, and a boot that serves no sign-in method says so (#30300)
6+
7+
Clause-②: yes (narrowing) — a request an administrator could make before is now refused: `POST /api/v1/auth/sso/delete-provider` (Setup's "Delete SSO Provider") on the last identity provider, while email and password is off and nothing else signs anyone in, answers `409 DELETE_RESTRICTED` (an existing standard code, the one an organization delete refused for the same reason answers), or `503 SERVICE_UNAVAILABLE` when the provider list cannot be read to tell. No new error code, setting or field. The widening half: `AuthManager` gains `setSsoProviderDeleteFloor()`, marked `@internal`, through which `AuthPlugin` hands it the judge. The boot report is a new `error` log line only; nothing about the boot's outcome changes.
8+
Metadata-protocol: none
9+
Skills-docs: none — no file under `skills/**` teaches deleting an SSO provider or the sign-in boot reports; `content/docs/deployment/self-hosting.mdx` gains "No sign-in method left" with the three doors and the recovery.
10+
11+
<!-- adr-0087: not-required (no-migration-prescription) No key of any schema is added, removed, renamed or re-shaped: sys_sso_provider keeps its columns and the delete endpoint keeps its request shape; it now refuses only the delete that leaves no way to sign in. Nothing stored is rewritten, so there is nothing at rest for a migration to rewrite. -->
12+
13+
**BREAKING** accept-set narrowing at `POST /api/v1/auth/sso/delete-provider`: deleting the identity provider that is the last way to sign in is refused, where it was deleted before.
14+
15+
- **Before.** Email and password off, one SSO identity provider registered and nothing else in force. Setup → the provider → "Delete SSO Provider": `200 {"success":true}`, the row gone. From then on nobody could sign in, the administrator included (measured on a real boot).
16+
- **Now.** That delete answers `409` with `code: DELETE_RESTRICTED`, `lastSignInMethod: enterprise_sso`, and a message in the caller's language (en, zh-CN, ja-JP, es-ES) saying to turn email and password back on, or register another identity provider or set up another sign-in method, first. Nothing is deleted. When the provider list cannot be read to tell, it answers `503 SERVICE_UNAVAILABLE` instead of letting the delete through.
17+
- **Still allowed.** Deleting a provider while another one remains, while email and password is on, while enterprise SSO is switched off, or while another way in counts: a social or OIDC provider with a client ID and secret, phone-number sign-in, or a host sign-in handoff. An unknown provider is still the vendor's `404`, and a caller with no session the vendor's `401`; the vendor's own provider-access check still decides who may delete which provider.
18+
- **The redeploy door.** A boot whose configuration no longer declares the last way in (for example a redeploy without the `GOOGLE_CLIENT_*` pair while email and password is off) still boots, as before, and now reports at `error` under the grep token `no_sign_in_method_at_boot`, naming the consequence and the recovery. It is a positive claim only: a provider table that cannot be read says nothing. Refusing such a boot is a later option, not done: a deployment that signs people in through a door the auth plugin cannot see must keep starting.
19+
- **Already locked out.** Set `OS_AUTH_EMAIL_PASSWORD_ENABLED=true` and restart: the environment override wins over a stored `auth.email_password_enabled = false` and over the stack config, and email and password sign-in comes back.

‎content/docs/deployment/self-hosting.mdx‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,28 @@ logins too, or leave the directory empty until the first administrator exists.
628628
A deployment that boots with zero human rows is the case both paths above
629629
describe, and it needs none of this.
630630

631+
### No sign-in method left
632+
633+
Accounts are not enough if nothing serves a way to use them. With email and
634+
password sign-in off, the deployment depends on its other sign-in methods: a
635+
social or OIDC provider with a client ID and secret, enterprise SSO with at
636+
least one registered identity provider, phone-number sign-in, or a host
637+
sign-in handoff. Three doors used to remove the last of them without a word;
638+
each now answers:
639+
640+
| Door | What happens now |
641+
|:---|:---|
642+
| The auth settings save turns email and password off, or removes Google, leaving nothing | Refused `400 SETTINGS_VALIDATION` at the field |
643+
| Setup's **Delete SSO Provider** on the last identity provider (`POST /api/v1/auth/sso/delete-provider`) | Refused `409 DELETE_RESTRICTED`, nothing deleted; `503 SERVICE_UNAVAILABLE` when the provider list cannot be read to tell |
644+
| A redeploy whose configuration no longer declares the last provider (for example, without the `GOOGLE_CLIENT_*` pair) | Boots, and reports at **error** under the grep token `no_sign_in_method_at_boot` |
645+
646+
The boot is not refused: a deployment that signs people in through a door the
647+
auth plugin cannot see keeps starting. **Recovery:** set
648+
`OS_AUTH_EMAIL_PASSWORD_ENABLED=true` and restart. The environment override
649+
wins over a stored `auth.email_password_enabled = false` and over the stack
650+
config, and email and password sign-in comes back. Or restore the sign-in
651+
method the configuration no longer declares.
652+
631653
## Who may sign up — and what each posture tells a stranger
632654

633655
`auth.audience.posture` is the one declaration answering who may become a user

0 commit comments

Comments
 (0)