Skip to content

Commit 84390e3

Browse files
committed
docs(plugin-auth): SCIM connection credentials, and the changeset
Claude-Session: https://claude.ai/code/session_016WV4cycHNJyS5MXHqaGsFE Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 1c6ee7f commit 84390e3

2 files changed

Lines changed: 52 additions & 0 deletions

File tree

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
'@objectstack/plugin-auth': patch
3+
---
4+
5+
feat(plugin-auth): a platform administrator can mint and revoke SCIM connection credentials
6+
7+
Clause-②: yes (widening)
8+
Metadata-protocol: none
9+
Skills-docs: updated here — `content/docs/permissions/authentication.mdx` ("SCIM Connection Credentials" under Admin User Management); `skills/**` teaches no SCIM setup
10+
11+
An identity provider (Okta, Entra ID) provisions users through `/api/v1/auth/scim/v2/*` with a bearer credential that this platform issues, but nothing could issue one: the mint existed with no caller, and the credential object refuses create on the data API, so no identity provider could connect. Two routes now do it, for the platform administrator only (the shared ADR-0068 gate: anyone else is refused `403 PERMISSION_DENIED`, `401 UNAUTHENTICATED` when signed out):
12+
13+
- `POST /api/v1/auth/admin/scim/mint-credential` with `{ connectionId, label?, expiresAt?, provisioningDomainId?, organizationId? }` answers `{ credentialId, connectionId, token, expiresAt }`. The `token` is shown once, in that response only (`Cache-Control: no-store`); only its keyed one-way digest is stored, and it is not readable through the data API, the audit log or the logs. Refused `503 SERVICE_UNAVAILABLE` while SCIM is off. The credential row is owned by `organizationId` when given (it must exist), otherwise by the Default Organization.
14+
- `POST /api/v1/auth/admin/scim/revoke-credential` with `{ credentialId }` switches the credential off, so the identity provider's next SCIM request with it answers `401`. `404 RESOURCE_NOT_FOUND` for an unknown credential, `409 RESOURCE_CONFLICT` for one already revoked. Served whether or not SCIM is on.
15+
16+
Rotation is a second mint for the same `connectionId`, moving the identity provider to the new bearer, then revoking the old one. Each mint and each revoke writes one `sys_audit_log` row naming the administrator and the connection, never the credential. Nothing that existed changes: no route, response or stored row moves, and the credential object stays read-only on the data API.

‎content/docs/permissions/authentication.mdx‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,6 +1166,42 @@ rows that resolve to a temporary password (all of them under `temporary`, only
11661166
the unreachable ones under `auto`) — reveals the generated passwords once with a
11671167
download, splitting files above 500 rows into batches automatically.
11681168

1169+
#### SCIM Connection Credentials
1170+
1171+
With SCIM enabled (`OS_SCIM_ENABLED=true`, or `plugins.scim`), an identity
1172+
provider such as Okta or Entra ID provisions users through
1173+
`/api/v1/auth/scim/v2/*` with a bearer credential the platform issues. Only a
1174+
platform administrator mints or revokes one, through the same gate as the
1175+
routes above; anyone else is refused `403 PERMISSION_DENIED` (`401` when
1176+
signed out).
1177+
1178+
```bash
1179+
curl -X POST http://localhost:3000/api/v1/auth/admin/scim/mint-credential \
1180+
-H 'Content-Type: application/json' -H "Authorization: Bearer $ADMIN_SESSION" \
1181+
-d '{ "connectionId": "okta-prod", "label": "rotation 2026-Q4" }'
1182+
# → { success, data: { credentialId, connectionId, token, expiresAt } }
1183+
```
1184+
1185+
- `connectionId` (required) names the connection every provisioned resource
1186+
is scoped to. Optional: `label`, `expiresAt` (a future ISO date-time),
1187+
`provisioningDomainId`, and `organizationId` (the organization that owns the
1188+
credential row; the Default Organization when omitted).
1189+
- The `token` is shown **once**, in this response only (`Cache-Control:
1190+
no-store`). Only a keyed one-way digest of it is stored; it is not readable
1191+
through the data API, the audit log or the logs afterwards. Paste it into the
1192+
identity provider's SCIM settings as the bearer token.
1193+
- While SCIM is off the mint is refused `503 SERVICE_UNAVAILABLE`: a credential
1194+
nothing can verify is not issued.
1195+
1196+
`POST /api/v1/auth/admin/scim/revoke-credential` with `{ "credentialId": "…" }`
1197+
switches that credential off: the identity provider's next SCIM request with it
1198+
is refused `401`. An unknown credential answers `404 RESOURCE_NOT_FOUND`, one
1199+
already revoked `409 RESOURCE_CONFLICT`. Revocation works whether or not SCIM is
1200+
on. To **rotate**, mint a second credential for the same `connectionId`, move
1201+
the identity provider to it, then revoke the old one; both authenticate until
1202+
you do. Each mint and each revoke writes one `sys_audit_log` row naming the
1203+
administrator and the connection, never the credential.
1204+
11691205
---
11701206

11711207
## Client Integration

0 commit comments

Comments
 (0)