dorfteich/apps/api
Claude Fable 5 5796b7a5dd
Some checks failed
CI / Lint, typecheck, test (pull_request) Failing after 14s
CI / Import/export fidelity gate (pull_request) Has been skipped
CI / Build container images (pull_request) Has been skipped
CI / Auth e2e pack (pull_request) Has been skipped
#214: OIDC Authorization Code with PKCE, Keycloak as reference IdP
External authentication (ADR 0021) built on jose (#188's vetted library)
plus fetch — no new dependency enters the supply chain for a security
base function. Discovery-configured; ID tokens validate against the
IdP's JWKS under an explicit RS256/ES256 allowlist with issuer,
audience, expiry and nonce binding. State, nonce and the PKCE verifier
travel in a signed HttpOnly Lax cookie keyed by a dedicated HKDF
purpose (oidc-state, ADR 0020).

Deploy-level configuration (OIDC_ISSUER/CLIENT_ID/CLIENT_SECRET/SCOPES/
PROVIDER_LABEL): who authenticates users is a platform decision. The
login page discovers the provider via GET /auth/methods and renders the
SSO button (i18n de+en).

Identities use the existing slot (provider oidc:<issuer>, subject from
the token). First login creates the account just-in-time — ACTIVE and
mail-verified only when the IdP asserts a verified address. An existing
local account is NEVER adopted silently by e-mail (account-takeover
path): login refuses with oidc_link_required and the owner links
explicitly via GET /auth/oidc/link (audited auth.identity_linked,
catalogue v1.3). Sessions come from the one existing session service.

Tests run the full flow against a protocol-faithful fake IdP: PKCE
verifier at the token endpoint, JIT creation incl. personal pond,
invalid state/nonce/signature/issuer/audience/expiry each rejected, the
linking refusal and the explicit link flow. Verified end-to-end against
a real Keycloak 26.0 (repeatable procedure documented in security.md
§External authentication).

Refs #214.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AUtYMxwTCMHG9mVHnwbFg8
2026-07-31 12:44:52 +02:00
..
assets #209: pandoc reference documents carry the VS-NfD marking for DOCX/ODT 2026-07-31 07:09:47 +02:00
prisma #224: read-trail storage — partitioning, retention, admin query path 2026-07-31 12:21:45 +02:00
scripts #209: pandoc reference documents carry the VS-NfD marking for DOCX/ODT 2026-07-31 07:09:47 +02:00
src #214: OIDC Authorization Code with PKCE, Keycloak as reference IdP 2026-07-31 12:44:52 +02:00
.swcrc Add NestJS API skeleton with config, logging, and /healthz 2026-07-04 19:10:07 +02:00
Dockerfile #209: pandoc reference documents carry the VS-NfD marking for DOCX/ODT 2026-07-31 07:09:47 +02:00
nest-cli.json Add NestJS API skeleton with config, logging, and /healthz 2026-07-04 19:10:07 +02:00
package.json #214: OIDC Authorization Code with PKCE, Keycloak as reference IdP 2026-07-31 12:44:52 +02:00
tsconfig.build.json Add NestJS API skeleton with config, logging, and /healthz 2026-07-04 19:10:07 +02:00
tsconfig.json Add NestJS API skeleton with config, logging, and /healthz 2026-07-04 19:10:07 +02:00
vitest.config.ts Add user, identity, session, and auth-support data model 2026-07-05 00:42:22 +02:00
vitest.global-setup.ts Add the first-run setup wizard API with env-backed secret store (#80) 2026-07-11 15:10:28 +02:00