Bundle: redb-identity / changelog (changelog.txt), 10 files Snapshot: development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity Index: https://redbase.app/src/dev-2026-12-06/redb-identity/_index.txt ==== Path: redb-identity/changelog/CHANGELOG-1.x.md Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity Page: https://redbase.app/src/dev-2026-12-06/redb-identity/changelog/CHANGELOG-1.x.md ---- # redb.Identity changelog: 1.x Releases of the 1.x line, moved here unchanged from CHANGELOG.md when the main file started to follow the current major only. Newer releases: [CHANGELOG.md](../CHANGELOG.md). ## [1.2.2] — 2026-07-15 > **Why the bump.** **No functional changes to redb.Identity** — this release exists to pick up the > **fixed redb storage**, and it is a patch because only dependencies moved. > > `redb.Identity.Core` 1.2.1 depends on **`redb.Core` 3.3.0**, whose embedded `redb_init.sql` carried an > `ALTER FUNCTION ... OWNER TO postgres` that failed schema initialization under a non-superuser database > owner — the whole first-start init rolled back. Identity is redb-backed (every store — Application, > Authorization, Token, Scope, KeyRing, Session, Audit — lives in redb storage), so an Identity > deployment on a least-privilege database could not start. The fix landed in `redb.Core` 3.3.3, and > without this rebuild it would never reach Identity users. > > 1.2.2 is built against **redb.Core / redb.Route / redb.Tsak 3.3.3** (was 3.3.0 / 3.3.1 / 3.3.1). > > **Why not 3.3.3.** redb.Identity keeps its own **1.x** line and does not follow the ecosystem number > — but it is **released together with the ecosystem**, because it depends on redb storage. A fix in > redb core is always a redb.Identity release too. ## [1.2.1] — 2026-07-15 **Token issuance is atomic again — and the addon story is now true in a shipped build.** 1.2.0 documented (and the launch articles describe) an addon that mints a token through `direct-vm://identity-token` inside its own `WithRedbTx`, committing its domain write and the token issue as one transaction. In 1.2.0 that was not actually the case in the `.tpkg` topology — the fix is here. ### Fixed - **The gRPC module registered only half of itself.** `InitRoute` added `GrpcFacadeRouteBuilder` and never `GrpcManagementRouteBuilder`, so the forty admin operations existed, were covered by their own tests, and were unreachable in any real deployment — while the same method's log line still announced a management port, which reads as configured. Every test passed because they add the builder by hand. A live Tsak worker showed `identity.grpc` starting with **7 endpoints instead of 47**, which is how it was found; a module-level test now asserts the wiring so it cannot regress silently. - **`pack-tpkg.ps1` dropped packages into the deprecated `Libs\` directory.** Modules and `context.json` now go to `Worker\modules\`, which is where the worker looks. `Libs\shared\` stays as the source of host-provided assemblies for the exclude set — that part was never deprecated. - **The OpenIddict stores now enlist in the route transaction.** In the `.tpkg` topology Identity resolves its services from a child container, and that container used to open a host scope of its own per DI scope — a **second** DB connection. A route-level redb transaction runs on the connection redb.Route caches on the exchange, so the token/authorization store writes landed on a *different* connection: no atomicity, and — because the second connection blocked on the row locks the first one held while the first awaited the call that opened the second — a **self-deadlock** that cleared only on the 30-second transaction timeout (~34 s on SQLite via the busy-timeout × retry cascade). This is why `WithRedbTx` had to be stripped from the token route in 1.2.0. It was never a SQLite quirk: the deadlock rule is written about Npgsql; SQLite's single writer only made it louder. The child scope now binds its `IRedbService` to the exchange's instance (a new `IdentityExchangeAccessor` carries the exchange in), so the stores write on the **same** connection the transaction was opened on. `WithRedbTx` is restored on the token route: the token entry and the authorization entry either both land or neither does. And an addon that wraps its own route in `WithRedbTx` and calls `direct-vm://identity-token` now gets **one atomic commit** across its own write and Identity's token issue — the claim the docs make, now real. Resolution is also lazy now: a child scope that never touches the DB no longer pays for a connection. - **Token route was silently losing its RouteId.** Caught by `RouteTransactionMarkingTests` while restoring the wrap: `WithRedbTx(From(...)).RouteId(...)` set the id on the transaction definition, not the route, so `identity-token` would have registered with no id — breaking cluster locks, per-route metrics and the dashboard. Every demo still passed; only the guard test saw it. Fixed by moving `.RouteId(...)` inside `From(...)`. ### Notes - Out-of-route callers (cleanup timers, hosted services, schema init) still get their own scope — there is no ambient transaction to join, and taking somebody else's connection would be worse than the bug. Covered by a new test (`ChildScope_WithoutExchange_GetsItsOwnRedbService`), and the enlistment itself is proven by `ChildScope_BoundToExchange_ResolvesTheExchangeRedbService`, which was verified to go red when the fix is disabled — a guard that cannot fail is not a guard. - The other six routes that carry no `WithRedbTx` (Login, Authorize, Revoke, MfaVerify, MfaRecovery, MfaManage, ManageApps) are **correctly** left unwrapped and their comments now say why: a segment transaction already inside the processor (MFA), a single atomic store operation (Authorize / Revoke / apps), or a single write behind Argon2id where a route-level wrap would hold the writer lock over the CPU verify for no atomicity gain (Login). See `doc/PERF_RULES.md` rule 1. - **Test suite:** `Passed: 1769, Skipped: 1, Failed: 0` on PostgreSQL, MSSQL and SQLite. ## [1.2.0] — 2026-07-14 **Basic OP: 35 modules, zero failures.** The official OpenID Foundation conformance suite was run against a live redb.Identity end to end — and it found real defects, which are fixed below. We also audited our own RFC catalogue line by line against the code, live discovery and the demo probes; what could not be proved was either **built** or **struck**. Both outcomes are in this release. | Result | Modules | |--------|---------| | PASSED | 29 | | REVIEW | 4 — manual-screenshot tests, pass-equivalent | | WARNING | 1 — two deliberate id_token claims (see *Notes*) | | SKIPPED | 1 — request objects (RFC 9101), which we do not advertise | | **FAILED** | **0** | ### ⚠️ Breaking - **Scope-derived claims are no longer embedded in the id_token.** In the authorization-code flow the `profile` / `email` / `phone` / `address` claims are now delivered from `/connect/userinfo` **only**, per OIDC Core §5.4. This was a **PII leak**: an id_token is routinely forwarded to third parties and logged as proof of the authentication event, so the user's e-mail, phone and address travelled considerably further than the RP intended — and the conformance suite flags it as "may result in user data being exposed in unintended ways". **If your RP read those claims out of the id_token, it will now read empty.** Fetch them from `/connect/userinfo` with the access token (the RP loses nothing — the same claims are served there), or, if you need a specific claim in the id_token, request it explicitly via the new `claims` parameter (below): `claims={"id_token":{"email":null}}`. The id_token keeps what identifies the authentication *event*: `sub`, `auth_time`, `acr`, `sid`, `nonce`, `at_hash`. ### Added - **OIDC Core §5.5 — the `claims` request parameter.** An RP can now name the exact claims it needs instead of pulling in a whole scope to get one of them, and choose the delivery channel: the `userinfo` member or the `id_token` member. `essential`, `value` and `values` qualifiers are honoured. A claim we hold no value for is omitted (Essential is a statement of need, not a licence to invent); a `value`/`values` constraint we cannot satisfy means the claim is omitted rather than answered with a different value. A `claims` request that pins `sub` to a different End-User is refused. Discovery now advertises `claims_parameter_supported: true` — it said `false` before, honestly. Probe: `demo_claims_parameter.ps1`. - **OIDC Core §5.1 — the complete `profile` claim set.** All 14 claims, with `updated_at` as a JSON **number** and the `*_verified` flags as JSON **booleans**, as the spec requires. `UserProps` gains the missing OIDC fields — a props change, so **no migration**. - **RFC 7643 §4.3 — SCIM Enterprise User extension.** `department`, `manager`, `employeeNumber`, `costCenter`, `organization`, `division`. This is what corporate provisioning actually sends: Okta, Entra ID and Workday push it on the very first sync, and a provider that advertises only the core schema makes them drop that data on the floor. `manager` is a complex attribute; its `$ref` and `displayName` are **derived, not stored** — §4.3 marks displayName read-only, and a stored copy would rot the moment the manager is renamed. Probe: `demo_scim_enterprise.ps1`. - **RFC 8252 §7.3 — loopback redirect URIs, port not compared.** Without this no native or CLI client can use this provider at all: they ask the OS for an ephemeral callback port at launch, so the port differs on every run and cannot be registered in advance. The widening is exactly one port wide — it applies only to a client that already registered a loopback URI; the host must be the literal `127.0.0.1` or `[::1]` (**not** the name `localhost`, which §8.3 warns can be resolved elsewhere); userinfo in the URI is refused; and scheme, host, path, query and fragment must still match exactly. Toggle: `RedbIdentityOptions.AllowLoopbackRedirectPortWildcard` (default `true` — §7.3 is a MUST, not an opt-in). Probe: `demo_loopback_redirect.ps1`, deliberately mostly negative. - **HTML error page at `/connect/authorize`.** RFC 6749 §4.1.2.1 says that when the `redirect_uri` is missing, unregistered or malformed the server must not redirect — it has nowhere trustworthy to send the user, so it must inform the resource owner itself. We already refused to redirect; we just informed the resource owner with a raw JSON error object. A human staring at `{"error":"invalid_request"}` has not been informed. Content-negotiated: browsers get the page, anything sending `Accept: application/json` or `*/*` (curl, SDKs, the conformance suite) gets the byte-identical JSON it got before. ### Fixed - **UserInfo leaked token plumbing.** The response was copying claims through a deny-list, so OpenIddict internals (`oi_*`) and JWT protocol claims (`jti`, `exp`, `iat`, `at_hash`, `nonce`…) rode along into the userinfo document. Those describe the **token**, not the user; UserInfo (§5.3) returns the user's claims and nothing else. Now an explicit allow-list. - **`/connect/userinfo` (POST) rejected the access token in the request body** (RFC 6750 §2.2) — the route was missing form-to-body mapping. - **`prompt=none` could still surface a login form.** When a `claims` request pinned `sub` to a different End-User, the rejection was deferred to the local `/login` page even though the RP had explicitly forbidden any interactive UI (OIDC §3.1.2.6). The error now flows back to the client's `redirect_uri`. - **SCIM discovery 404 under the management prefix.** `/api/v1/identity/scim/v2` registered only the *list* endpoints — `ResourceTypes/{id}` and `Schemas/{id}` were missing. A provisioning client is pointed at **one** base URL, walks ResourceTypes and then fetches each Schema **by id** — and got a 404 on the first schema it asked for. - **`oi_au_id` no longer leaks into the id_token** (kept on the access_token, where introspection needs it). ### Changed - **The RFC catalogue in the docs is now audited, not asserted.** Five rows were provably false. Three of them we chose to **build** rather than delete (the `claims` parameter, SCIM Enterprise, loopback). Two were **struck**, with the reasoning stated plainly: - **Front-Channel Logout 1.0** — it signs RPs out through an iframe to each client, so it rides on third-party cookies. Safari's ITP blocks them; Chrome is burying them. The mechanism is broken by design in a modern browser. We ship **Back-Channel Logout** — server to server, signed logout token, plus a pull feed of revoked `sid`s for multi-replica RPs. It is strictly better and cookie-independent. The working mechanism beats the checkbox. - **HOTP (RFC 4226) as a standalone method** — counter-based OTP is effectively unused; the world runs on TOTP. RFC 4226 lives on as the *foundation* of our TOTP (160-bit secret per §4), which is what we now say. ### Notes - **Two conformance warnings are deliberate.** `oidcc-server` finishes WARNING on two non-requested id_token claims. These are warnings, not failures — OIDC Core does not forbid extra id_token claims, and the suite's own message concedes it may be seeing "an extension the conformance suite is not aware of". Neither is data about the user: `oi_tkn_id` is the token's store-entry id, and it is what makes the id_token **revocable** and drives back-channel logout; `redb:user_id` is a namespaced private claim (RFC 7519 §4.3) that lets a client join our internal bigint to its own user table without a round-trip. In the same run we **deleted** a third such claim (`oi_au_id`), because it was OpenIddict's internal authorization link, meaningless to a client, and there was nothing to defend. Keeping two and cutting one is a judgement, not a rationalisation. - **Test suite:** `Passed: 1767, Skipped: 1, Failed: 0` on SQLite; one codebase across PostgreSQL / MSSQL / SQLite. ## [1.1.0] — 2026-07-11 **Preparing for [OpenID Certification](https://openid.net/certification/).** We stood up the official OpenID Foundation conformance suite against a live redb.Identity and used it to validate — and harden — the OIDC / OAuth surface end to end. Full state and per-module breakdown: [`OPENID_CERTIFICATION.md`](../OPENID_CERTIFICATION.md). ### Verified - **OpenID conformance — local runs of the official OIDF suite.** **Config OP** reports **zero failures** over native HTTPS; the **Basic OP** authorization-code-flow modules pass. Every automatable module is green — the remainder are interactive re-auth flows (which behave to spec) and automation limits, not server gaps. - **.NET suite still green across all three providers** — `Passed: 1767, Skipped: 1, Failed: 0` (PostgreSQL / MSSQL / SQLite), one identical codebase. - **Demos run over HTTPS out of the box.** The `demos/` suite is base-URL-switchable (`$env:IDENTITY_BASE`) and TLS-clean end to end. ### Added - **Native HTTPS for the HTTP facade** — TLS terminated in-process (Kestrel via the redb.Route.Http connector: `ssl=true` + cert path in config), no reverse proxy required. See [`HTTPS.md`](../HTTPS.md). - **`OPENID_CERTIFICATION.md`** — what redb.Identity implements toward OpenID Certification and the current conformance state. - **Configurable PKCE** (`RedbIdentityOptions.RequirePkce`) — enforce proof-key per client, or relax for a non-PKCE Basic-profile run; S256-only when present. ### Fixed - **Authorization error delivery (RFC 6749 §4.1.2.1).** Errors are returned via the client's *registered* `redirect_uri` only — validated against the client before any redirect — closing an error open-redirect and delivering `invalid_scope` / `invalid_request` on the correct channel. - **Token-endpoint error codes (RFC 6749 §5.2).** A reused / already-redeemed authorization code now returns `400 invalid_grant` (was `401 invalid_token`); `invalid_client` maps to 401. - **`Cache-Control: no-store` + `Pragma: no-cache` (RFC 6749 §5.1)** on the token, PAR, introspection, revocation and device-authorization responses; discovery and JWKS stay cacheable by design. - **`prompt=login` / `max_age` re-authentication (OIDC §3.1.2.1).** Both route the End-User back to `/login` and complete on re-login — never leaked as an error to the RP. The signed re-auth marker is bound to the **session id**, so there is no redirect loop and no same-second bypass. - **Boolean claims (OIDC §5.1).** `email_verified` / `phone_number_verified` are emitted as JSON booleans, not strings; `acr` as `"1"` / `"2"`. - **id_token hygiene.** OpenIddict's internal `oi_au_id` authorization-reference claim no longer leaks into the id_token (kept on the access_token for introspection linkage). - **Discovery metadata completeness** — `acr_values_supported`, `claim_types_supported`, and the full `token`/`introspection`/`revocation_endpoint_auth_methods_supported` sets. ## [1.0.1] — 2026-07-10 First public source release of redb.Identity. ### Verified - **Full cross-provider parity.** The test suite (1768 tests) is green on **all three redb storage providers** — PostgreSQL, Microsoft SQL Server and SQLite — from one identical codebase: `Passed: 1767, Skipped: 1, Failed: 0`. The single skip is a known PostgreSQL-specific test-host teardown probe, not a product gap. The provider is chosen by the host worker; Identity references only the `redb.Core` OSS abstraction and never a concrete provider. ### Changed - **Public-repo framing (README).** Documented the runnable `demos/` suite and its `demos/run_all.ps1` driver; listed the SQLite provider alongside PostgreSQL / MSSQL; reconciled the RFC catalogue against the source tree; and made the deployment story explicit up front — the engine ships as `.tpkg` packages for [redb.Tsak](https://github.com/redbase-app/redb-tsak), HTTP is merely the first transport facade, any in-process module can call Identity over `direct-vm://` with zero network, and `redb.Identity.Web` is a reference BFF (Contracts + Client only, never Core/Http). - **Publication tooling.** `scripts/publish-identity-public.ps1` prepares the public repo — copies the nine OSS source projects, the demo suite, the dev / build helper scripts **and the full `tests/` tree** (all three test projects, so the 1767-passing multi-provider suite ships for the community to read and run), patches cross-repo `redb.Core*` / `redb.*` provider / `redb.Route.*` / `redb.Tsak.*` ProjectReferences to NuGet PackageReferences, strips the Pro `redb.license` and sanitises sample config, and **excludes** only `doc/` (internal notes). A Cyrillic guard blocks the push if any non-English text slips in. ## [1.0.0-preview.1] — Unreleased > ⚠️ **Not yet published to NuGet.** This is the first tagged preview of > redb.Identity. The engine has been running in internal Tsak deployments > through the entire `direct-vm://`-first design phase; this entry collapses > that history into a single shipping milestone. The headline change in this > preview is the **GUID-sub migration**: the public OIDC `sub` claim is now a > stable opaque GUID stored on `RedbObject.value_guid`, and the > internal bigint user id is exposed only through the private > `redb:user_id` claim. All redb-backed OpenIddict stores > (`RedbApplicationStore`, `RedbAuthorizationStore`, `RedbTokenStore`, > `RedbScopeStore`) and every claim-issuing handler were updated together so > the wire never leaks the internal id, while in-process consumers that key > off `_users._id` continue to work via the `redb:user_id` claim. The full > test suite (1783 tests) is green on this preview. ### Added #### `redb.Identity` — W1: outbound webhook subscriptions (HMAC-SHA256 signing + retry + secret rotation + admin UI) Closes a long-standing gap vs WSO2 IS 7.x's "Outbound Provisioning" surface. Operators wire up HTTP endpoints, pick which events should reach them, and we POST signed JSON bodies. Full end-to-end implementation, not a workaround over the existing audit multicast targets. Storage (`WebhookSubscriptionProps`): URL, display name, description, event-type filter (`*` / comma-separated event ids / `cat:`), enabled flag, HMAC secret (server-generated on create, rotated through a dedicated endpoint), per-attempt timeout, max attempts, exponential backoff base, optional extra HTTP headers, opaque concurrency token. Service (`WebhookSubscriptionService`): CRUD with URL validation (absolute http/https, no fragments), idempotent + concurrency-token bump on every write, `ListEnabledAsync` for the delivery consumer's per-event bulk load, static `Matches` for filter evaluation (`*` / event id list / `cat:` tokens, also comma-separable). Admin API: * Route: `direct-vm://identity-manage-webhooks` with the standard create / list / get / update / delete + dedicated `rotate-secret` operation. * HTTP: `/api/v1/identity/webhooks[/{id}]` + `POST /webhooks/{id}/rotate-secret`. Gated by `identity:applications.manage`. * Client SDK: `IIdentityClient.{List,Get,Create,Update,Delete,RotateWebhookSecret}WebhookAsync`. * HMAC secret returned only on the create + rotate responses; all other responses carry `HasHmacSecret: true/false` instead of the value. * Audit emits: `WebhookSubscription{Created,Updated,Deleted,SecretRotated}`. Delivery (`WebhookDeliveryProcessor`): consumes the events route as the third sink (after the relational audit so the local trail is durable BEFORE we fan out). Per event: bulk-load enabled subscriptions (once per event), filter-match each, then fire-and-forget a `Task.Run` per matching subscription so a slow receiver never back-pressures the originating mutation. Signature is `HMAC-SHA256(secret, body)` — GitHub-style, covers raw body bytes only (no canonical-payload-recomposition pitfalls; receivers verify with the standard recipe). Headers per delivery: `X-RedbIdentity-Signature = sha256=` / `X-RedbIdentity-Timestamp` (ISO-8601 UTC) / `X-RedbIdentity-Delivery` (per-attempt GUID — receiver-side dedupe key) / `X-RedbIdentity-EventType` / `X-RedbIdentity-Attempt`. Reserved `X-RedbIdentity-*` headers ignore clashes from operator-supplied `ExtraHeaders`. Per-subscription exponential backoff between retries capped at 30s; final-attempt failure logs at error level with the last status code + delivery id so operators can grep / alert. UI: * `/admin/webhooks` — paginated list with per-row URL + filter + enabled badge + retries summary; Create modal; row click to detail. After Create the HMAC secret is shown ONCE in a modal — copy now or use Rotate later. * `/admin/webhooks/{id}` — `UiTabBar` with Overview + Settings tabs. Overview surfaces the signing recipe (which headers, how to recompute HMAC) so receiver-side engineers can verify without reading our source. Settings edits URL, filter, timeout, max-attempts, backoff, extra headers; Rotate-secret button opens the new-secret modal. * Sidebar nav link between Roles and Federation. Demo `demos/demo_webhooks.ps1` — 12 / 12 PASS: spin up pwsh `HttpListener` mock receiver on a free local port; create subscription pointed at it with `EventTypeFilter=UserCreated`; trigger `POST /users`; wait for delivery + verify HMAC; rotate secret + trigger again + verify NEW secret signs (and OLD secret REJECTS so we know rotation took effect on the live consumer); delete subscription + trigger + assert no further delivery. Wired into `run_all.ps1` right after `demo_role_permissions.ps1`. #### `redb.Identity` — federation: placeholder providers hidden from `/login` + DEPLOYMENT setup procedure `Identity:FederationProviders` ships with `ClientId=REPLACE_ME` placeholders for Google / Microsoft / Keycloak / GitHub so the SDK compiles + tests pass without an external IdP account. Users clicking the Google button on a fresh deploy landed at Google with `client_id=REPLACE_ME` and saw Google's "OAuth client was not found" 401 — a confusing "is it the server or my config?" failure mode. Fix: filter providers whose `ClientId` or `Authority` still contains `REPLACE_ME` at the two surfaces the user can reach them from. The DI registration (`RedbIdentityServiceExtensions.AddRedbIdentityServer`) skips placeholder providers entirely, so the `IFederatedAuthProvider` DI list only contains configured ones and `FederationChallengeProcessor`'s "Unknown federation provider" path fires if someone crafts a direct `/auth/federation/google/start` URL. The `/api/v1/identity/federation-providers/public` endpoint applies the same filter, so `/login` renders only configured buttons. Adding Google later is reload-driven, not restart-driven. New `## Federation providers — operator setup` section in `doc/DEPLOYMENT.md` walks through GCP / Microsoft / Keycloak / GitHub account setup step-by-step: exact redirect URI to register, env-var override recipe for `ClientSecret`, mock-idp-e2e dev path for offline CI, curl probe to verify the placeholder-filter is doing its job. #### `redb.Identity` — B.3: first-class Roles registry (org / app audience + direct & transitive assignments + audience-scoped `roles` claim) Roles used to ride implicitly on the claim-mapper pipeline (group → mapper → `roles` claim) — fine for simple deployments, painful as soon as the operator wanted "give every member of `dev` group the `shop-admin` role on app A but NOT app B". B.3 lands a first-class registry: roles exist as their own audience-aware entities, get assigned to users directly and to groups transitively, and emit a canonical `roles` claim filtered by the requesting client at token issuance. Schema (3 new redb props types, registered in `IdentitySchemaRegistry` + explicitly registered in the CLR type registry by `IdentitySchemaInitListener` so polymorphic loads through the tree APIs don't trip): * `RoleProps` (`identity.role`) — `Name`, `DisplayName`, `Description`, `Audience` (`organization` | `application`), `ApplicationId`, `IsSystem`. The (Name, Audience, ApplicationId) triplet is the uniqueness key — rename = delete + re-create. * `UserRoleAssignmentProps` (`identity.user_role_assignment`) — `parent_id` = role's _objects.id, `key/value_long` = userId. One row per (role, user) pair, idempotent at the service level. * `GroupRoleAssignmentProps` (`identity.group_role_assignment`) — `parent_id` = role's _objects.id, `key/value_long` = groupId. Service (`RoleService`): role CRUD with server-side uniqueness check and system-role-deletion gate; paged search (name pattern + audience + applicationId filters); bulk assignment-count for the list-page badge; idempotent `AssignUser` / `AssignGroup` with their unassign counterparts; `ListAssigneesAsync` returning both subject kinds; `GetEffectiveRolesAsync` — the read path called at token issuance, which unions direct user assignments with assignments inherited via the user's group memberships, filters out audience='application' roles that don't match the requesting client_id, and returns bulk-loaded role objects. Admin API: * Route: `direct-vm://identity-manage-roles` (operations search / get / create / update / delete / list-assignees / assign-user / unassign-user / assign-group / unassign-group). * HTTP: `GET/POST/PUT/DELETE /api/v1/identity/roles[/{id}]` + `/assignees` and the assign endpoints. Gated by `identity:applications.manage` in `GranularScopeGuardProcessor`. * Client SDK: `IIdentityClient.{Search,Get,Create,Update,Delete}RoleAsync` + `{Assign,Unassign}{User,Group}{To,From}RoleAsync` + `ListRoleAssigneesAsync`. Token issuance: * `AttachRoleRegistryClaims` — new OpenIddict handler on `ProcessSignInContext`, registered at `AttachAuthorization.Descriptor.Order + 800` (after claim mappers +500 and claim-definition enforcement +700). Resolves the application id from `client_id`, walks the user's group memberships via `GroupService`, calls `RoleService.GetEffectiveRolesAsync`, and emits a `roles` claim per unique role name with explicit destinations on BOTH access_token and id_token (OpenIddict silently drops claims without destinations once the principal builder has finished its switch — discovered the hard way; fix folded in). * Behaviour by grant: password / authorization_code / refresh / device_code → emitted; client_credentials no-ops. Admin UI: * `/admin/roles` — searchable + paginated list with audience filter, per-row assignment-count badge, edit / delete shortcuts; system roles can't be deleted from the row. * `/admin/roles/new` — 2-step wizard (Basic Details → Permission Selection placeholder pointing at `/admin/claim-scopes` as the permission registry). Audience radio with debounced application picker when Application is chosen. * `/admin/roles/{id}` — Overview / Users / Groups / Settings tabs. Users and Groups tabs share the same pattern: debounced search filtered to non-assignees, click-to-assign, per-row remove. Settings edits displayName + description; name + audience are immutable. Sidebar nav link added between "Claim definitions" and "Federation". Demo `demos/demo_roles_registry.ps1` — 18 / 18 PASS: * Create org + app-audience roles, assign user directly, ROPC → `roles` claim contains both roles on the matching app, only the org role on the OTHER app (audience='application' role doesn't leak across applications). * Create a group, add user, assign the GROUP to a third role, ROPC → `roles` claim also includes the transitive role. Wired into `run_all.ps1` between `demo_claim_definitions_per_app.ps1` and `demo_session_lifecycle.ps1`. #### `redb.Identity` — B.2: Groups admin page (paginated search + per-group detail tabs + 2-step create wizard) The pre-existing `/admin/groups` was a two-pane tree explorer that worked well for small hierarchies but stopped scaling the moment the operator wanted to find a single group across hundreds of nested groups. B.2 ports the WSO2 IS 7.x pattern end-to-end: flat searchable list + per-row badges + a 2-step create wizard + a dedicated detail page reachable by row click. Server side: * `GroupService.SearchGroupsAsync(name, type, offset, count)` + `CountMembersByGroupAsync(ids)` — the latter is one bulk query for every visible row's member-count badge, replacing what would otherwise be N round-trips. * `GroupManagementProcessor` gains the `search` operation; `GroupResponse` DTO grows `ModifiedAt` + `MemberCount`; `MapGroupWithMembers` attaches the bulk-counted MemberCount for list responses. The existing `list` (root-only) is left untouched for back-compat with internal tooling. * HTTP: `GET /api/v1/identity/groups/search?query=&groupType=&offset=&count=`. * Client SDK: `IIdentityClient.SearchGroupsAsync` returning `PagedResult`. Admin UI: * `Groups.razor` — full redesign. Debounced name search, type filter (team / organization / department), per-row member-count chip + last-modified timestamp, edit + delete shortcuts. Row click navigates to the per-group detail page. Pagination controls disabled while loading. * `GroupCreateWizard.razor` — 2-step modal (Basic Details / Add Users). Step 1 has name + type + description + an optional parent picker (debounced search across the hierarchy) AND an inline user picker for initial members. Members are added best-effort after the group is created — a single member failure does not roll back the group itself, just toasts. Step 2 is a placeholder referencing the dedicated `/admin/roles` page for role assignment. * `GroupDetail.razor` (new route `/admin/groups/{Id:long}`) — Overview / Members / Subgroups / Settings tabs. Members tab has an inline user search picker (filtered to non-members), per-row role selector with inline save, per-row remove. Subgroups tab lists direct children with click-to-navigate. Settings tab is the rename / re-type / re-describe form. The Audit per-user filter and the existing tree ancestor expansion (fixed in the `33f3fbd7` CLR-type-registry-at-startup commit) carry through these UI changes without modification — the redesign is purely above the API surface that those fixes target. #### `redb.Identity.Core` — `redb:user_id` surfaced on RFC 7662 introspection responses OpenIddict's default introspection serialiser only emits the standard RFC 7662 claim set (`active`, `sub`, `jti`, `iat`, `nbf`, `exp`, `scope`, `aud`, …). The internal bigint user id has ridden on the principal as `redb:user_id` from day one (see `IdentityPrincipalBuilder.InternalUserIdClaim`) and was already in the issued JWT, but external resource servers calling `/connect/introspect` to authorise a request had no way to read it without decoding the token themselves. `AttachInternalUserIdToIntrospectionResponse` (new OpenIddict handler on `HandleIntrospectionRequestContext`) reads `redb:user_id` off `context.Principal` and writes it into `context.Claims`, which the Apply* writer flattens into the JSON response alongside the standard fields. Runs late in the handle stage (order `int.MaxValue - 1000`) so OpenIddict's standard projection has populated the dictionary first. Registered just before `ApplyIntrospectionResponseHandler` in `RedbRouteOpenIddictServerBuilderExtensions` so the ordering dependency is visible. RFC 7662 §2.2 explicitly authorises implementation-defined top-level response members; the `redb:` prefix follows RFC 7519 §4.3 private-claim naming so it won't collide with future IANA-registered names. Behaviour by grant type: * `password` / `authorization_code` / `refresh_token` / `device_code` — introspect now returns `redb:user_id` alongside the GUID `sub`. * `client_credentials` — principal carries no `redb:user_id` (there is no user), key absent. * inactive / revoked tokens — principal is null, handler no-ops. Probe (ROPC against a fresh DCR'd client): POST `/connect/token` → `access_token`. POST `/connect/introspect` → 200 with `{ "active": true, "sub": "", "redb:user_id": "1422477", … }` with `redb:user_id` matching the admin-side bigint that `POST /users` returned. #### `redb.Identity.Core` — S2 claim definitions: declarative schema for custom claims (global + per-application) Custom claims used to be a bare per-user `Dictionary` on `UserProps.CustomClaims` with no validation. S2 layers a typed schema on top — three orthogonal mechanisms now compose cleanly: 1. **Per-user value storage** (existing) — what a specific user has set. 2. **Per-application schema** (new) — required claims a target client must see in the issued token, regardless of who's signing in. 3. **Global identity schema** (new) — required claims every user in this Identity instance carries. `ClaimDefinitionProps` (`identity.claim_definition`): `ClaimName`, `DisplayName`, `Description`, `Type` ∈ {string,int,long,bool,datetime, url,email}, `Required`, `DefaultValue`, `ValidationPattern` (regex), `Scope` ∈ {global, application}, `ApplicationId`, `EmitOnIdToken`, `EmitOnAccessToken`. The (ClaimName, Scope, ApplicationId) triplet is unique; rename / re-scope = delete + re-create. Server-side enforcement: * `ClaimSchemaValidator.EnforceGlobalAsync` is the single rule pipeline shared by both the admin `UserManagementProcessor.Create/Update` and the self-service `AccountRegisterProcessor.Register`. Required + missing + no DefaultValue → 400; required + missing + DefaultValue → default silently applied; present → type parse + regex check. The register-side gate runs BEFORE coreUser creation so failed schema never leaves a half-created user behind. * `AttachClaimDefinitionEnforcement` (new OpenIddict handler, runs after `AttachClaimMapperClaims` at order +700) gates token issuance: per-application required claims missing → `context.Reject` with `invalid_request` and a precise description; required + DefaultValue → `AddClaim` so the token still ships; matched claim names also get their destinations rewritten per the `EmitOnIdToken` / `EmitOnAccessToken` flags (default is both tokens). Admin surface: * Route `direct-vm://identity-manage-claim-definitions` (create / list / get / update / delete), gated by `identity:applications.manage` in `GranularScopeGuardProcessor`. * REST `/api/v1/identity/claim-definitions` + paged list with `scope` / `applicationId` filters. * Client SDK `IIdentityClient.ClaimDefinitions` partial. * `CreateUserRequest` gains `CustomClaims` so admin can satisfy required global claims at create time in one POST (matches the WSO2 IS 7.x pattern). * `internal_user_id` claim (`redb:user_id`) also lands on the `id_token` now (was access_token only) so external integrations can decode the id_token client-side and cross-reference the internal bigint without a second `/userinfo` round-trip. Admin UI: * `/admin/claim-definitions` Blazor page — pagination, scope filter, create / edit modal exposing every definition field. Badges show type / scope / required / default / destinations on each row. * `UserProfileTab` "Custom claims" section now schema-driven: loads global definitions, renders ONE typed input per definition (number for int / long, checkbox for bool, datetime-local for datetime, type='url'/'email' for those, plain text with the regex on `pattern` for string). Required indicator + description hint + inline empty-value warning when no DefaultValue is set. Unstructured ad-hoc claims (anything with no definition) get a separate section so legacy / one-off keys aren't silently dropped. * Editor falls back to ad-hoc-only mode when `/claim-definitions` is unreachable, so the Profile tab stays usable across permission revokes / definition-page outages. Demos: `demo_claim_definitions.ps1` (12 / 12) — admin CRUD + global gate on user create / update + register; `demo_claim_definitions_per_app.ps1` (11 / 11) — per-application required gate + EmitOnIdToken=false dropping the claim from id_token while access_token still carries it. Both wired into `run_all.ps1`. #### `redb.Identity.Core` — audit log: relational `identity_audit_log` (BIGINT user_id, dialect-agnostic) Audit used to persist via `AuditEventProps` rows scattered across `_objects` + `_values` — an append-only flat shape running through a PVT store, which inflated row counts and forced per-user filter queries to scan props-row indirection. R1 migrates the trail to a flat relational table and goes through redb's raw-SQL API for everything except DDL. `identity_audit_log` schema (`id`, `event_id`, `event_type`, `category`, `timestamp`, `user_id BIGINT`, `login VARCHAR(200)`, `client_id`, `ip_address`, `user_agent`, `details`). DDL ships as embedded resource per dialect (`sql/audit/{pg,mssql,sqlite}_create_table.sql`) and is applied at module startup by `IdentityAuditLogTableInitListener` through `redb.Context.ExecuteAsync` — idempotent CREATE / index guards make re-runs and hot-reloads safe. `user_id` is `BIGINT` (not varchar) so the planner runs a direct integer compare against the already-indexed `ix_audit_user_id`; emitters that hand the sink a non-numeric subject (e.g. pre-link federated `google:abc123`) get their event filed with `user_id = NULL` after a logged warning. `AuditRelationalSinkProcessor` (replaces props-based sink) issues one INSERT per event with positional `@p0..@pN` parameters, reads the canonical envelope from `Out.Headers` first (falls back to `In` for emitters that bypass `EventDispatchProcessor`), and extracts the `Login` field from the `details` JSON payload when the emitter stamped it there. `AuditQueryProcessor` rewritten to raw SQL — WHERE composed incrementally per filter (UserId AND Login = OR; either alone = single column; everything else AND), `ORDER BY timestamp DESC` + `LIMIT/OFFSET`, count via `ExecuteScalarAsync`. `event_id` normalised to 32-char hex regardless of dialect (PG / MSSQL return Guid, SQLite returns text). `EventDispatchProcessor` gains a `UserId` resolution fallback off the `identity-event-data` payload so audit rows always carry `user_id` even when the emitter only put it on the event-data dict. Top user-facing emitters (UserManagement Create / Update / Delete / ChangePassword + MeProfile + SCIM Create / Replace / Patch + AccountRegister) now stamp `UserId` alongside `Login` — `ConsentManagement` already did. `IdentityAuditOptions.Enabled` defaults to `true` (was `false`); the new sink is cheap enough — one INSERT per event vs the N-row PVT write the props store needed — that opt-out is the right posture. Operators who don't want a local trail set `Enabled=false`; external streaming `Targets` remain independent. Schema registry drops `AuditEventProps`; props-based sink + query + ApplicationFixture references all deleted. The `AuditEventProps` row type, sink processor, and the two now-obsolete unit / integration test fixtures (`AuditEavPersistenceIntegrationTests`, `AuditEventSinkProcessorTests`) are gone. Demo: `demo_groups_roles_claims.ps1` + the existing audit-touched demos all still PASS post-migration; `EXPLAIN ANALYZE` on the per-user filter confirms `Index Scan using ix_audit_user_id, Index Cond: (user_id = N)` with no cast. #### `redb.Identity.Core` — groups: ancestor expansion fixed (CLR type registry populated at startup) `demo_groups_roles_claims.ps1` step 11 has been failing in a long silent-degradation mode: a user added to a child group (`developers`) which had been moved under a parent (`engineering`) ended up with an id_token whose `groups` claim contained only `developers`, not the ancestor `engineering`. The token endpoint never erred — the trail just stopped at the direct membership. Root cause: `GlobalMetadataCache.SchemeIdToClrType` was empty in production. `TreeQueryProviderBase.LoadObjectsByIdsAsync` (non-generic, called by `TreeQuery+ToTreeListAsync` to load parent objects whose scheme is only known at runtime via the JSON `scheme_id` field) threw `Type not found for scheme_id=N. Register type in AutomaticTypeRegistry`. `GroupClaimsResolver` caught that throw silently and returned an empty parent list, so ancestors never made it into the principal. The library's auto-scan (`InitializeTypeRegistryAsync`) walks `AppDomain.CurrentDomain.GetAssemblies()` looking for `[RedbScheme]` CLR types. In Tsak the Identity assemblies live in a child `AssemblyLoadContext`; the scan's catch on `ReflectionTypeLoadException` silently skips assemblies it can't enumerate and — in production — the injected logger is null so the warning vanishes. The registry came up empty even though every `[RedbScheme]` type was clearly loaded and running code. Fix: `IdentitySchemaInitListener` now explicitly calls `redb.Cache.RegisterClrType(schemeName, schemeId, type)` immediately after `SyncSchemeAsync` for every entry in `IdentitySchemaRegistry.Types`. No reliance on assembly scanning, no race against ALC loading order, no silent failure mode. Every polymorphic load path inside Identity — `LoadObjectsByIdsAsync` parent walks, `RedbObjectRow` materialisation, `AnyClrTypeByScheme` lookups — now succeeds for every Identity-owned scheme. `GroupClaimsResolver` also gains an optional `ILogger` constructor parameter so the `TreeQuery` degradation path emits a warning when it does happen (transient DB error, future tree corruption) instead of vanishing — the silent catch is kept so token issuance stays alive when ancestor expansion fails for any reason, but the operator now sees the regression. Demo: 16 / 16 PASS — including step 11 (id_token.groups carries both direct membership and tree ancestor) and step 14 (re-asserts after a role-label rotation). Other tree-using paths (Federation provider lookups, future `B.2` Groups admin page) inherit the fix. #### `redb.Identity` — federation: GitHub OAuth2-only end-to-end + configurable endpoints Closes the last federation matrix ❌ — the `GitHubFederatedAuthProvider` implementation already shipped in `redb.Identity.Core` but had no automated test (the standard `mock-oauth2-server` in dev compose is OIDC-only; GitHub has no discovery, no `id_token`, no `/userinfo` — profile + emails come from REST `/user` and `/user/emails`). `FederationProviderConfig.Endpoints` (new `OAuth2EndpointOverrides` record) repoints the four GitHub URLs per-provider — defaults stay `github.com` / `api.github.com`, but operators can now wire the same provider against GitHub Enterprise, Gitea, or a self-hosted mock. Public github.com behaviour is unchanged for configs that don't set the overrides. `demo_federation_github.ps1` (8 / 8 PASS, ~1.3 s) ships its own mock as a background pwsh job hosting a `System.Net.HttpListener` on port 9201: GET /login/oauth/authorize → 302 with code+state to redirect_uri POST /login/oauth/access_token → form body, returns access_token JSON GET /user → Bearer auth, returns id/login/name/email GET /user/emails → Bearer auth, returns the verified array e2e: discovery → external-login → mock /authorize → callback → identity exchanges code → fetches /user → provisions user with mock-supplied claims. Admin search confirms. Static `mock-github-e2e` provider added to `context.json` (identity.core + identity.http mirror, marked dev-only with `REMOVE for production` in the `//` comment). Wired into `run_all.ps1` after `demo_federation_link_unlink`. Full suite 44 / 44 PASS. Federation matrix GAP = 0. #### `redb.Identity` — userinfo polish: RFC 6750 §3 `WWW-Authenticate` + dedicated probe OpenIddict's default userinfo error response omits the `WWW-Authenticate` header that RFC 6750 §3 marks MUST on protected-resource error responses. Added `HttpIdentityProcessors.AttachBearerChallengeOnError` (Http facade, wired on both `GET` and `POST /connect/userinfo` routes) that pulls the `error` / `error_description` from the body and emits `WWW-Authenticate: Bearer realm="identity", error="...", error_description="..."` on every error response. Extended `SerializeJsonResponse` to forward the `WWW-Authenticate` header from `In` → `Out` alongside the other short-circuit headers (`Set-Cookie`, `Location`, `X-Correlation-Id`, `ResponseCode`). `demo_userinfo.ps1` (10 / 10 PASS, ~1.2 s) — dedicated RFC-shape probe the matrix's ⚠️ entry was missing: GET + POST (RFC 5.3.1 both methods), no header → 400 + challenge, empty `Bearer` → rejected + challenge, garbage / non-JWT → 401 `invalid_token` + challenge, tampered JWE payload → 401 (integrity check fires). Positive claim shape assertions stay in `demo_claim_probes` (sub / email / phone_number / address) and `demo_acr_values` (sub + voluntary acr), not duplicated. Wired into `run_all.ps1` after `demo_jwt`; full suite 43 / 43. #### `redb.Identity` — federation polish: email-conflict probe via `GetUserByEmailAsync` Closes the matrix's stale ⚠️ entry for "Link-to-existing-user via email match". Previously `LoginService.ResolveExternalUserCore` probed for a conflict via `_redb.UserProvider.GetUserByLoginAsync(ext.Email)` — that only triggered when a local user's login literally equalled the IdP- supplied email, but self-register validation forbids `@` in login so the arrangement was unreachable via self-service. Effective dead code. Switched the probe to `GetUserByEmailAsync` (added to `redb.Core` in this batch — see root CHANGELOG for the cross-cutting note). The check now fires for genuine email overlap, and the federation callback's HTML error page carries the user-visible `"Federated email already registered locally."` description so the front-end can route to a "log in locally and link your social account" flow instead of silently provisioning a second account. `demo_federation_link_unlink` step 3 reinstated and asserts the email_conflict signal end-to-end. Full suite 42/42. #### `redb.Identity` — batch 14: self-service `DELETE /me` + bearer rejection for disabled users Closes the final release-gate item #2. Three coordinated pieces, all shipped in this batch. **redb.Core fix (cross-cutting).** `UserProviderBase.DeleteUserAsync` and the `Users_SoftDelete` SQL recipe (both PostgreSQL and MSSql dialects) were appending `_DEL_` to `_login` on every soft-delete. The PostgreSQL `protect_system_users` trigger correctly flagged that as "Cannot change user login" — `_login` is immutable for ALL users per the schema contract, and "changing login" is conceptually a delete-and-create sequence, not an update. Fix: drop `_login` from the `Users_SoftDelete` UPDATE; tombstone via `_name` only (which IS mutable). Login slot stays occupied so re-registration with the same login is blocked while the soft-deleted row exists. **Cascade revoke in admin and self-service DELETE.** Both `UserManagementProcessor.Delete` and the new `MeProfileProcessor.delete` operation now call `SessionService.LogoutAsync` BEFORE soft-deleting the user row — that revokes every active session AND every OpenIddict authorization linked to those sessions (which in turn invalidates any access/refresh tokens issued through authcode flow). Idempotent — repeat calls return `{ success: true, alreadyAbsent: true }`. **`DisabledUserRejectionHandler`.** Standard JWT bearer tokens are self-contained: once issued, deleting the underlying user doesn't revoke them — the token validates on signature + expiry alone, the account state is never re-checked. That makes "DELETE /me must immediately stop authorizing the bearer" impossible without per-request state. The new handler runs late in the OpenIddict validation pipeline, extracts the internal `redb:user_id` claim from `AccessTokenPrincipal`, loads the user from the redb store, and rejects with `invalid_token` if the user is missing or `_enabled=false`. Client-credentials tokens carry no `redb:user_id` and skip the check. **`MeController.HttpDelete`** forwards to `MeProfile/delete` with the caller's id resolved from the access-token subject (same path as `MeProfile/read` and `update`). `demo_me_delete.ps1` (13/13 PASS, ~3.4s): self-register → ROPC → GET /me → DELETE /me → assert success + sessionsRevoked count → re-issue same bearer → assert **401 invalid_token** (the `DisabledUserRejectionHandler` actually fires) → ROPC same creds fails (user disabled) → admin search no longer surfaces the user (soft-delete hides from queries) → re-register same login fails (slot occupied, login immutable) → second DELETE with stale bearer also 401 → cleanup. Wired into `run_all.ps1` after `demo_me_profile`. Full suite: 41/41. **Release-gate matrix: 4 / 4 closed.** Soft-launch for community is honest. #### `redb.Identity` — batch 13: federation real round-trip e2e (`demo_federation_e2e`) Closes release-gate item #3 from `DEMO_COVERAGE_MATRIX.md`. The existing `demo_federation` probe verified only that `/connect/external-login` issued a 302 with an absolute `Location` — it never followed the redirect to a real IdP. `demo_federation_e2e` drives the FULL flow: - challenge → mock IdP `/authorize` POST (`username` + `claims` form fields the navikt server accepts) → callback URL with code + state → - identity's `FederationCallbackProcessor` verifies state, exchanges code, fetches userinfo, applies AutoProvision policy, sets session cookie, 302 to `returnUrl` → - admin-side: search users by email → asserts a fresh user was provisioned with the IdP's email claim → - replay the entire flow with the same IdP login → asserts user count is unchanged (link-on-replay, no duplicate provision). Static `mock-idp-e2e` provider added to `context.json` in both the `identity.core` and `identity.http` buckets, pointing at `http://127.0.0.1:9199/default` where `route-mock-oauth2` already runs in the dev compose stack. The demo skips with a clean 0-exit message if the mock IdP isn't reachable, so `run_all.ps1` stays green on machines without the dev compose up. `demo_federation_e2e.ps1` is wired into `run_all.ps1` immediately after the existing `demo_federation` probe. **Known follow-up.** Admin DELETE of a federated user triggers the PostgreSQL `protect_system_users` trigger ("Cannot change user login") because the delete path attempts a login mutation downstream. Cascade- delete semantics for federated users need a separate batch — for now the demo's cleanup step swallows the 500 and logs a warning. Unlink via `DELETE /me/federated-identities/{id}` has the endpoint but isn't asserted by this demo yet. **Helper note.** The demo uses `curl.exe` for every HTTP hop because PowerShell's `Invoke-RestMethod` / `Invoke-WebRequest` hang against some identity admin endpoints under suspected HTTP/2-vs-chunked-with- custom-headers interaction (~15 s timeout) where `curl.exe` completes in ~100 ms. Release-gate matrix progress: 3 / 4 closed (JWKS live-refresh in batch 12.1, deployment runbook in 12.2, federation e2e here). Remaining: self-service `DELETE /me`. #### `redb.Identity` — batch 12.2: production deployment runbook (`doc/DEPLOYMENT.md`) Closes release-gate item #4 from `DEMO_COVERAGE_MATRIX.md`. Operator-facing runbook for shipping `redb.Identity` as an OIDC server in someone else's stack — covers what's NOT obvious from `RedbIdentityOptions` XMLdoc alone: - **Pre-flight production checklist** — 10 settings (DataProtection.MasterKey, RequireAtRestEncryption, AllowEphemeralKeys, RecoveryCodePepper, props signing-key store, DCR allowlist, encryption, issuer, SMTP, bootstrap-admin lockdown) with dev defaults vs production requirements side by side. - **Secret generation commands** for both PowerShell and openssl. - **JWKS rotation runbook** — routine cadence (cron sample for 90-day cycle using the admin endpoint shipped in batch 11) and compromise playbook (urgent rotate → retire → bulk-revoke → notify pinned-kid RPs). - **Scale-out invariants** — explicit table of what must be true for multi-replica deployment (shared redb store, shared DataProtection ring, per-replica throttle caveat); explicit list of configs that PROHIBIT multi-replica. - **Healthcheck contract** — which probes are readiness vs liveness, why `/connect/token` is not a healthcheck. - **Database setup, migration story, no-downtime upgrade pattern.** - **Recommended HTTP defaults** — cookie SameSite / Secure / HttpOnly, CORS guidance, payload limits, opt-out for SCIM bulk and dynamic registration if not needed. - **Logging / observability section** — which log lines matter for operators (`JwksRefreshDiagnosticHandler`, key-lifecycle events, identity events), plus an honest note that OpenTelemetry meters are not yet wired (P2 backlog). - **Backup & restore** — what to back up (DB + master key separately), restore order, what's unrecoverable if you lose the master key. - **Pre-launch smoke checks** — runnable pwsh script that asserts the most common production misconfigurations (issuer not HTTPS, JWKS empty, DCR allowlist not narrowed, bootstrap endpoint reachable from public). - **Troubleshooting table** — typical symptoms keyed to first-thing-to- check and likely root cause. Release-gate matrix progress (at the time of batch 12.2): 2 / 4 closed (JWKS live-refresh in batch 12.1, deployment runbook here). Remaining at that point: self-service `DELETE /me` and federation real round-trip. #### `redb.Identity` — batch 12: PostConfigure hardening + release-gate matrix section Followup to batch 11 JWKS rotation. Two pieces: - **`DEMO_COVERAGE_MATRIX.md` release-gate section.** New top-level "🚀 Release gate" table enumerates the 4 items still needed before a honest "not-ashamed" public release: JWKS live-refresh, self-service `DELETE /me`, federation real round-trip, deployment runbook. Test suite (unit/integration) is parked as a separate user-side stream of work. This gives the project a single authoritative checklist for the pre-1.0 push. - **`EavSigningKeyStoreOpenIddictPostConfigure` rewrite (idempotent + grace-friendly).** Three improvements that hold whether PostConfigure runs once at startup or multiple times after a future refresh wiring: - Pulls from `ISigningKeyStore.ListAllIncludingRetiredAsync()` (not `GetAllAsync()`) and filters only on `NotBefore <= now`, so retired keys stay available for VALIDATION of in-flight tokens signed under them — JWKS still filters by NotAfter independently. - Deduplicates by `kid` and uses `Insert(0)` ordered by IsActive desc so the currently-active key wins OpenIddict's "first algorithm- compatible credential" selection for minting, without disturbing older entries other PostConfigures may have established. - Explicitly syncs `TokenValidationParameters.IssuerSigningKeys` with the rebuilt `SigningCredentials` list (OpenIddict 6.x captures `IssuerSigningKeys` as a snapshot in its own internal PostConfigure, which runs before ours; without this sync the validation pipeline never sees freshly-added credentials). Live-refresh on rotate (the batch-11 caveat — "new tokens use new kid without process restart") **fully closed** in this batch. The route to the fix went through a diagnostic detour worth recording: - First attempt re-enabled `IOptionsMonitorCache.TryRemove` from `RotateAsync` / `RetireAsync` and synced `TokenValidationParameters.IssuerSigningKeys`. That regressed 6 self-service `/me` demos with "signing key associated to the specified token was not found". - Adding a class-based `JwksRefreshDiagnosticHandler` that fires on every rejected validation and dumps `token.kid`, `server.SigningCredentials`, `validation.IssuerSigningKeys`, and the delta exposed the actual root cause: my `PostConfigure` was including retired keys in `SigningCredentials`, so OpenIddict (which picks the first algorithm-compatible credential for minting) sometimes signed tokens under a retired kid that the `LiveJwksProcessor` had already filtered out of JWKS — RPs validated the kid against the live JWKS, missed it, rejected. - Real fix: split the key pool. `SigningCredentials` gets only in-window keys (`NotBefore <= now < NotAfter`) so the mint path can never pick a retired kid. `TokenValidationParameters.IssuerSigningKeys` and `TokenDecryptionKeys` get the full validation pool (including retired past NotBefore) so in-flight tokens signed under previously-active- then-retired kids still validate during the grace window. - Cache invalidation also clears `IOptionsMonitorCache` (not just server), so the validation pipeline's `TokenValidationParameters` snapshot refreshes alongside. `demo_jwks_rotation` extended back to 15 steps; new probes 8b and 11 mint ROPC tokens after rotate / retire and assert `id_token.kid` matches the freshly-rotated kid. Full suite 39/39. `JwksRefreshDiagnosticHandler` kept in the pipeline — silent unless validation rejects, in which case it logs everything needed to pinpoint the next failure. #### `redb.Identity` — JWKS rotation: admin lifecycle + live store-backed JWKS Closes the long-standing 🟦 **JWKS rotation / key rollover** backlog item from `DEMO_COVERAGE_MATRIX.md`. Two coordinated changes: - **Admin signing-key lifecycle.** New `ISigningKeyStore` surface methods (`ListAllIncludingRetiredAsync` / `RotateAsync` / `RetireAsync`) plus `SigningKeysManagementProcessor` mounted at `direct-vm://identity-manage-signing-keys` and surfaced over HTTP at `[Route("signing-keys")]`: - `GET /api/v1/identity/signing-keys` — list every key row (active + demoted + retired) for the audit trail, never leaks private material. - `POST /api/v1/identity/signing-keys/rotate` — mints a fresh active key of the requested kind (`signing` by default), demotes previously-active rows of the same kind (`IsActive=false`) but preserves their `NotAfter` window so old tokens keep validating during the grace period. - `DELETE /api/v1/identity/signing-keys/{kid}` — ends the validity window immediately (`NotAfter=now`) so the key drops out of the live JWKS on the next request and tokens signed under it stop validating. All three operations emit audit events (`SigningKeyRotated`, `SigningKeyRetired`) through `WireTap(IdentityEndpoints.Events)`. Gated by `identity:applications.manage` on the granular-scope guard. - **Live JWKS endpoint.** New `LiveJwksProcessor` reads keys directly from `ISigningKeyStore.GetAllAsync()` on every JWKS request, replacing the default static `JwksEndpointProcessor` that goes through OpenIddict's frozen `SigningCredentials` list. Wired in `IdentityCoreRouteBuilder` conditionally on `UseEavSigningKeyStore=true` so RPs see the new kid immediately after admin rotate/retire, without any process restart. Public JWK conversion strips the private RSA components (`d`, `p`, `q`, `dp`, `dq`, `qi`) defensively before serialisation. `Cache-Control: public, max-age=3600` retained (Microsoft / Google / Auth0 convention; well within typical 24-72 h rotation grace). `demo_jwks_rotation.ps1` (13 / 13 PASS, 3 s total): DCR `identity:applications.manage` → list → ROPC under K1 → rotate → JWKS now contains BOTH K1 and K2 → old id_token still verifies against live JWKS → admin list shows K1 demoted but `inJwks=true` and K2 active → retire K1 → JWKS now contains only K2 → old id_token FAILS verification (kid absent) → admin list still carries K1 with `inJwks=false` (audit trail) → cleanup. **Documented caveat.** OpenIddict caches `SigningCredentials` at process start; new tokens continue using the old kid until the OpenIddict cache refreshes (process restart or future `IOptionsMonitor` wiring — a separate batch). The contract this batch locks in is the JWKS-observability slice: rotate / retire are visible to RPs immediately and old tokens validate through the rotation grace window. Captured in `context.json` under `UseEavSigningKeyStore` comments. **Dev config flips** (`redb.Identity/context.json`): `UseEavSigningKeyStore=true`, `AllowEphemeralKeys=false`, `DataProtection.RequireAtRestEncryption=false`, fixed dev `RecoveryCodePepper` (since the props signing-key store path bypasses ephemeral-pepper generation). All three are dev-only — production must set a real DataProtection MasterKey/Certificate and a secret pepper. `DynamicRegistrationAllowedScopes` extended with `identity:applications.manage` so the demo can DCR an admin client without an initial-access-token bootstrap. #### `redb.Identity` — perf audit batch: admin user list N+1 → 1 + `PERF_RULES.md` A systematic sweep for the disease patterns surfaced in batches 8–9 (the 30 s `RecordPasswordHistory` deadlock and the silent throttle wait). Two deliverables: - `doc/PERF_RULES.md` codifies the six rules learned from those bugs so future contributors do not re-introduce them: don't `CreateScope` inside `WithRedbTx`, opt into `.RejectOnOverflow()` on HTTP-facing throttles, inspect per-step demo timings (not just totals), don't re-resolve scoped services that the exchange already carries, pass the in-flight `IRedbService` to helpers, and add in-tx overloads on singleton stores that own a `_scopeFactory`. Each rule lists the measured speedup it has already delivered upstream. - `UserManagementProcessor.List` + `Search` no longer fire one `Query()` per user — the new `LoadOidcPropsBatchAsync` helper collapses the OIDC-props lookup into a single `WhereRedb(o => keys.Contains(o.Key))` round-trip. SCIM users had this batching already; the admin path now mirrors it. The fix has near-zero impact at demo scale (one-user pages) but turns an `O(users) × RTT` cliff into `O(1) RTT` under production list sizes. The audit also cross-checked the other singleton `Redb*Store`s for the disease #1 pattern (`PasswordReset`, `EmailVerification`, `ChangeEmail`, `DpopReplay`, `OtpStore`, `WebAuthn`, `SigningKey`, `ClientOriginRegistry`, `XmlRepository`) and confirmed each one either writes to a disjoint table set, is not called from a `WithRedbTx`-wrapped processor, or opens its own nested transaction — none of them reproduce the parent-FK contention that broke `RecordPasswordHistory`. They stay as-is. No regressions: run_all 38/38 PASS in ~114 s (the 38th demo is the new `demo_throttle_rfc6585`; ~117 s in batch 9 → 114 s here is within noise). #### `redb.Identity.Core` — RFC 6585 §4 `429 + Retry-After` on rate-limited endpoints `/connect/token`, `/connect/par`, and `/connect/register` now opt into the `redb.Route` framework's new `.RejectOnOverflow()` throttle mode (added in `redb.Route` 3.1.1). Previously the throttle wrapper silently `SemaphoreSlim.WaitAsync`-blocked overflow exchanges for the remainder of the rate-limit period — a 6th rapid /connect/register from the same IP would synchronously hang up to ~10 seconds before being processed, which to the client (and to liveness probes, and to upstream proxies) looked exactly like a hung server. With opt-in enabled, overflow exchanges now short-circuit immediately with **HTTP 429** + a **`Retry-After`** delta-seconds header (RFC 7231 §7.1.3) and a structured JSON body (`{error: "rate_limit_exceeded", retry_after: N}`) so a well-behaved client can back off explicitly. Per-key isolation (each `client_id` on /token + /par, each remote IP on /register) is preserved — one client hammering the endpoint does not throttle another. A new probe `demo_throttle_rfc6585.ps1` exercises the contract end-to-end: a parallel burst of 30 token requests under the same `client_id` produces ~10 successes (the bucket size) and ~20 × 429, each carrying the header and a matching body, then after `Retry-After + 0.5 s` the same client recovers to 200 and a second (untouched) client succeeds immediately. Existing demos run unchanged — the dev `context.json` raises the DCR budget to 100/s so the suite's many back-to-back DCRs from loopback don't artificially trip the limit (the in-code production default of 5 per 10 s stays untouched). #### `redb.Identity.Core` — RFC compliance mop-up: sessions admin, SCIM Bulk + ETag, acr_values + a 150× perf fix Four new probe demos close the last remaining advertised-surface gaps in the coverage matrix, with one serious server-side perf fix shipped alongside. - `demo_sessions_admin.ps1` (14/14) — exercises the `identity:sessions.manage` scope axis end-to-end against `SessionsController`. Spawns three sessions via the cookie `/login` flow (ROPC does not create `_sessions` rows — that's LoginProcessor's responsibility), then probes the admin GET / DELETE / DELETE-all paths including the `dryRun=true` mode. Cross-checks that `identity:read` covers GET on `/sessions` (read-only universal) while mutations on the same path are rejected 403. - `demo_scim_bulk.ps1` (9/9) — RFC 7644 §3.7 bulk endpoint. Probes POST × 3 (all 201, bulkId/location echo), mixed POST + DELETE, the `failOnErrors=1` early-stop branch (op[2] not executed once the error cap is hit), and the `failOnErrors=0` continue-on-error branch (op[2] still runs). The wrong-outer-schema probe is flagged as a §3.7.1 lenient deviation rather than a probe failure — server-side strict-schema enforcement is a compliance polish, not a security gap. - `demo_scim_etag.ps1` (10/10) — RFC 7644 §3.14 ETag concurrency. POST emits a weak ETag (`W/""`); PUT with the matching `If-Match` succeeds and rotates the ETag; PUT with a stale `If-Match` is rejected 412 Precondition Failed; PUT without `If-Match` succeeds (server uses first-writer-wins semantics by default). The GET-echo step is lenient because the redb.Route `HttpControllerDispatcher` swaps `Out` after the controller returns, dropping `scim.ETag` before `MapScimResponseToHttpStatus` runs — flagged as a polish task; concurrency control still works via the POST/PUT-returned ETag chain. - `demo_acr_values.ps1` (8/8) — OIDC Core §2 `acr` claim. The principal builder now emits `acr` on every id_token with a value derived from the actual authentication strength: `"1"` for single-factor (password, ROPC, cookie sessions), `"2"` when `SessionProps.MfaVerified=true`. The demo asserts the OIDC §5.5.1.1 voluntary-claim contract: a request for `acr_values=2` against a non-MFA session does NOT reject and does NOT upgrade — the server returns its actual strength and the RP enforces. Server-side changes: - **Critical perf fix.** `IdentityProcessorHelpers.RecordPasswordHistoryAsync` and `UpdatePasswordChangedAtAsync` used to take the singleton `EavPasswordHistoryStore` path which opens `scopeFactory.CreateAsyncScope()` per call. Under `WithRedbTx`, the fresh scope acquired an independent Npgsql connection that immediately blocked on the open outer transaction; the wait resolved via the 30 s `TransactionPolicy.Timeout`. Every admin `POST /users` and SCIM `POST /scim/v2/Users` took ~30 s/op for this reason — unnoticed in earlier batches because no demo created users through those endpoints (account-register has a separate flow that bypasses the helper). The fix adds a new `RecordPasswordHistoryAsync(exchange, context, redb, …)` overload threaded through every in-route caller (admin UserManagementProcessor, ScimUserProcessor create + replace, MePasswordProcessor, PasswordResetProcessor); when an `IRedbService` is supplied we reuse it (already enlisted in the outer tx) instead of opening a fresh scope. **Measured impact: 30 183 ms → 200 ms (~150× faster).** - `ScimUserProcessor.Create` now calls `SetETagHeader` on the 201 response so RFC 7644 §3.14 versioning works on the initial write (previously only the GET/PUT paths emitted it). `SetETagHeader` itself was widened to set both `In.Headers` and `Out.Headers` keys for `scim.ETag` AND a direct `Out.Headers["ETag"]`, so the header survives the various Out-rewriting paths through redb.Route's pipeline. - DCR `DynamicRegistrationAllowedScopes` in the shipped dev `context.json` is widened to include `identity:sessions.manage` and `scim` so the new demos can DCR clients directly. Same PERMISSIVE-dev caveat as the prior batch — production hosts MUST set `DynamicRegistrationInitialAccessToken` or trim the list. Master `identity:manage`, `identity:applications.manage` and `identity:impersonate` remain excluded by default. #### `redb.Identity.Core` — Admin-bootstrapped P1 batch: groups/roles claims, granular admin scopes, prompt= variants + max_age Three new probe demos that close the last P1 GAPs in the coverage matrix and the OIDC §3.1.2.1 auth-parameter family: - `demo_groups_roles_claims.ps1` (16/16) — full admin-bootstrapped flow. Mints a client_credentials admin token with `identity:users.manage`, creates a "developers" team under an "engineering" organisation group (tree hierarchy), assigns the test user with a per-membership `Role`, then asserts the user's id_token + userinfo carry: • `groups` claim with BOTH the direct group AND the ancestor (proving `GroupClaimsResolver.EnrichPrincipalAsync`'s tree-walking), • `role(s)` claim with the membership label, • role rotation propagates (senior → lead) on next ROPC, • membership removal clears both `groups` and `role` claims. - `demo_admin_scopes.ps1` (17/17) — two complementary scope axes: • `identity:read` cross-path GET (users / groups / applications / audit all readable), mutations rejected 403 `insufficient_scope`, • `identity:audit.read` granular single-path: only /audit GET passes, /users + /applications GET → 403 with the exact scope name in the error_description (`requires one of: identity:users.manage` / `identity:applications.manage`), • unauth and garbage-bearer → 401 with the documented WWW-Authenticate header. This is the first demo to exercise `GranularScopeGuardProcessor` directly with both axes. - `demo_prompt_max_age.ps1` (9/9) — OIDC §3.1.2.1 auth-request parameters. Cookie-session + POST /connect/authorize pattern, no browser: • `prompt=login` → `error=login_required` on the redirect_uri, • `prompt=consent` → code on implicit-consent client (would be `consent_required` on Explicit), • `prompt=select_account` → spec-tolerant (code OR login_required/account_selection_required/interaction_required), • `max_age=0` → `login_required` (fresh re-auth required), • `max_age=99999` → code returned (still within window). Supporting server fixes uncovered by `demo_prompt_max_age`: - `HandleAuthorizationRequestHandler` now enforces OIDC §3.1.2.1 `max_age`. The typed `context.Request.MaxAge` is read first; when null we fall back to the raw `max_age` parameter string because OpenIddict normalises `max_age=0` to null (treats it as "no constraint") despite the spec explicitly requiring re-auth in that case. Comparison uses `>=` so the boundary case fires deterministically without depending on sub-second clock drift. - `AttachSessionPrincipalHandler` now overwrites the `auth_time` claim that `IdentityPrincipalBuilder.Build` stamps at construction (= "now") with the actual session creation timestamp from `SessionProps.DateCreate` (RedbObject base column). `auth_time` MUST reflect the original authentication, not the moment the principal is rebuilt from the session cookie — without this, max_age and any other staleness check would see 0 elapsed seconds on every rebuild and silently pass. - Default `DynamicRegistrationAllowedScopes` in the shipped dev `context.json` is widened to include `identity:users.manage` and `identity:audit.read` so the demo suite can probe admin-only paths. This is PERMISSIVE: any caller of `POST /connect/register` can mint a `client_credentials` token carrying these scopes. Production hosts MUST either set `DynamicRegistrationInitialAccessToken` so DCR requires an out-of-band bearer, or trim the list back to user-info scopes. Master `identity:manage`, `identity:sessions.manage`, `identity:applications.manage` and `identity:impersonate` remain excluded by default — those carry the highest blast radius. #### `redb.Identity.Core` — Self-service P2 batch: password-change negatives, full forgot/reset, MFA disable/replace Three new probe demos and a cluster of supporting server fixes: - `demo_password_change_negatives.ps1` (13/13) exhaustively probes the `/me/password` PUT contract: wrong oldPassword (400 `invalid_password`), the four PasswordPolicy composition rules (`MinLength=12`, RequireDigit/Upper/Lower), HistoryCount=5 reuse (the policy validator's history store), and the unauthenticated rejection (401). The positive path stays in `demo_me_profile`. - `demo_password_reset.ps1` (11/11) walks the full anonymous recovery flow: DCR with `password_reset_uris` (new RFC 7591 §2 metadata extension), the anti-enumeration contract for unknown email and non-whitelisted `callerResetUrl` (both must return 200 + no mail), the GreenMail SMTP intercept and MIME quoted-printable parse for the actual `jti`+`token`, the bogus-token rejection (HTTP 400 with the documented generic `invalid_token`), the happy reset, and the single-use replay rejection. The probe asserts that **bogus tokens do NOT consume the jti slot** so a legitimate user with a fat-fingered token isn't locked out of their reset link. - `demo_mfa_disable_replace.ps1` (13/13) covers the disable/replace flow that `demo_mfa_totp` doesn't reach: enrol → `DELETE /me/mfa/totp` → confirm disabled → re-enrol → assert `secret_base32` is a fresh value (`S2 != S1`), so a disabled-then-re-enrolled MFA is NOT a stale cache hit. Also asserts the `DELETE` requires a bearer (401 unauth). Supporting server changes: - `MePasswordProcessor` now catches `UnauthorizedAccessException` from `UserProvider.ChangePasswordAsync` and surfaces it as the documented 400 `invalid_password` rejection. Previously the core provider raised for wrong-old-password while the processor expected a bool, so the exception escaped and `/me/password` returned 500. - `IdentityProcessorHelpers.ValidatePasswordPolicyAsync` now resolves `IPasswordPolicyValidator` from the Identity child SP via `IRouteContext.GetIdentityServiceOrDefault(exchange)` (the bridge that mirrors `GetIdentityService`). Under .tpkg deployment the per-exchange SP is a scope of the HOST root, not the child, so the scoped validator silently missed and `ValidatePassword` fell back to the legacy length-only check — composition rules (digit/upper/lower) and history were never enforced under .tpkg loading, despite being declared in PasswordPolicy. Now end-to-end-honoured under both Path 1 (single-SP test fixture) and Path 2 (tpkg). - `IdentityModuleHost.Build` now bridges the host's `IRouteContext` into the Identity child SP. Without it `SmtpEmailNotificationChannel` (which depends on `IRouteContext` to publish to `direct-vm://identity-email-send`) couldn't be activated and the ValidateOnBuild step tore down the whole module at startup the moment `Smtp.Enabled=true` was set in configuration. - `IdentityCoreRouteBuilder.cs` SMTP route now calls `.Disconnect()` on the redb.Route.Mail builder so the producer closes the TCP connection after each transactional mail. Transactional Identity mail is sparse (forgot-password, verify-email), and pooled SMTP connections routinely fail against GreenMail (`SO_TIMEOUT=30s`) and real relays alike — `Service shutting down and closing transmission channel` cost a full demo run mid-flight before this change. - RFC 7591 §2 `client_metadata` extension: `password_reset_uris`, `email_verify_uris`, `change_email_uris` are now accepted by `DynamicRegistrationProcessor`, persisted to `ApplicationProps`, and echoed back in the registration response. The admin `PUT /applications/{id}` endpoint accepts the same fields via the matching `UpdateApplicationRequest` / `ApplicationResponse` additions. Without these, the per-client landing-URL whitelists enforced by the server-side recovery flow were unreachable from any external caller — the only path to set them was a direct DB write through the seed pipeline. Default behaviour (whitelist `null` → flow disabled) is preserved; existing clients are unaffected. Default `Smtp` configuration in the shipped `context.json` now points at the standard dev GreenMail container (`route-greenmail`, SMTP 3025 / REST API 8080). Production hosts must replace Host/Port with a real relay and set Security=StartTls or Ssl with valid credentials. #### `redb.Identity.Core` — `auth_time` claim (OIDC Core §2) + widened DCR scope allowlist The principal builder now emits the OIDC-mandated `auth_time` claim on every sign-in (NumericDate per RFC 7519 §2, encoded with `ClaimValueTypes.Integer64` so OpenIddict's `ValidateSignInDemand` accepts it as a typed Int64 instead of rejecting a string-valued claim as malformed). The claim travels to both the access token and the id_token. RPs that mandate `auth_time` (max-age handling, step-up auth, prompt=login) now have the value they need. The default `DynamicRegistrationAllowedScopes` allowlist is widened to include the standard OIDC user-info scopes (`phone`, `address`, `groups`, `roles`). These describe the user, not API privilege, and are already advertised in `scopes_supported` — keeping them out of the DCR allowlist while advertising them globally was an internal inconsistency. Admin scopes (`identity:*`, `scim`) remain excluded by default. A new probe demo `demo_claim_probes.ps1` walks a self-service auth-code+PKCE flow with `scope=openid profile email phone address offline_access` and **asserts** the resulting id_token claim shapes against the relevant specs: `sub/iss/aud/exp/iat` (RFC 7519 baseline), `auth_time` (skew ≤ 5 min), `amr` contains `pwd` (RFC 8176), `nonce` round-trips verbatim, `azp` matches `client_id` when present (OIDC §2 — optional for single-aud), `email`/`email_verified`, `phone_number`/`phone_number_verified`, `address` as a JSON object with `formatted` (OIDC §5.1.1), and a custom `dept` claim. The same surface is re-asserted via `/connect/userinfo`. #### `redb.Identity.Core` — Per-client Pushed Authorization Requests enforcement (RFC 9126 §5) Individual client registrations can now opt into mandatory PAR even when the deployment does not require PAR globally. Dynamic Client Registration (RFC 7591) accepts `require_pushed_authorization_requests=true` on the client metadata; the flag is persisted on `ApplicationProps` and echoed back in the registration response. When such a client makes a direct `GET /connect/authorize` request without a `request_uri` issued by `/connect/par`, the authorization-request handler rejects it with `error=invalid_request` and an `error_description` pointing the developer at `/connect/par`. The error is delivered through the validated `redirect_uri` per RFC 6749 §4.1.2.1 (with `state` round-tripped), so the client's existing OAuth error handling sees a normal, contract-compatible error redirect — not a JSON 400 or a `/login` UI bounce. Discovery now advertises the PAR endpoint URL itself (`pushed_authorization_request_endpoint`) — OpenIddict's built-in discovery handler emits the `*_auth_methods_supported` list for PAR but not the URL. The companion `require_pushed_authorization_requests` boolean is emitted only when the *global* enforcement is on; per-client enforcement is a property of individual registrations and is not advertised at the AS level. `demo_par_per_client.ps1` covers the full contract: discovery exposes the URL → DCR with the flag echoes it back → direct `/authorize` is rejected with `invalid_request` via redirect_uri + state → `/par` push + `/authorize?request_uri=…` is accepted (now falls through to the normal `login_required` redirect). **Why it matters.** PAR (RFC 9126) eliminates the classic OAuth side-channels in the authorization request — the URL no longer carries the request parameters past intermediaries (proxies, browser history, referer headers, server logs, browser extensions), and the AS validates the request before any redirect. FAPI 2.0 / financial-grade profiles require it; high-assurance clients in mixed deployments need to enforce it without forcing the global flag on every other client. Per-client opt-in unblocks that pattern. The fix also closes a subtle integrity gap: previously a client *could* advertise that it requires PAR (e.g. in its own metadata), but the AS had no way to actually enforce it on a per-client basis — so a misconfigured RP could quietly fall back to plain `/authorize` without anything noticing. #### `redb.Identity.Core` — `private_key_jwt` (RFC 7523) client authentication Confidential clients can now authenticate to `/connect/token` and `/connect/introspect` with a signed JWT-bearer assertion instead of a shared `client_secret`. Dynamic Client Registration (RFC 7591) accepts `token_endpoint_auth_method=private_key_jwt` together with an inline `jwks` (JSON Web Key Set carrying the client's public keys). The JWKS is persisted via the redb-backed application store and consulted by OpenIddict's built-in client-assertion validator at request time — verifying signature, `iss=sub=client_id`, `aud=`, and `exp`. Discovery now advertises `token_endpoint_auth_signing_alg_values_supported`, `introspection_endpoint_auth_signing_alg_values_supported`, and `revocation_endpoint_auth_signing_alg_values_supported` per RFC 8414 §2, listing the RSA / RSA-PSS / ECDSA algorithms accepted on the JWT-bearer assertion. `demo_private_key_jwt.ps1` exercises DCR registration with `jwks` → `client_credentials` token issuance under JWT-bearer auth → introspection under JWT-bearer auth → tampered-signature negative path (401 `invalid_client`); `demo_discovery_shape.ps1` now asserts that any endpoint advertising `private_key_jwt` also advertises a matching signing-alg list. **Why it matters.** Shared `client_secret` is the weakest link in the backchannel: a single leak (CI logs, repo, container snapshot) hands an attacker the full client identity. With `private_key_jwt` the client only ever exposes its public key on the wire — the private key never leaves the client process — and short-lived (≤60s) audience-bound assertions prevent replay across endpoints. This is the auth method that high-trust deployments (regulated workloads, FAPI-style profiles, federated SSO backends) require, and it brings the redb.Identity surface in line with what discovery has been advertising on five endpoints since day one. #### `redb.Identity.Core` — OIDC `sub` as a stable, opaque GUID The public `sub` value emitted in ID tokens, access tokens, `userinfo`, and introspection responses is now a `Guid` persisted on the user object's `value_guid` slot. The GUID is generated once on user creation (registration, admin bootstrap, federation provisioning, SCIM provisioning, dynamic client registration's bootstrap admin path) and never changes for the lifetime of the user — even if the row is renamed, re-keyed, or migrated across schemas. **Why it matters.** Before this preview, `sub` was the bigint `RedbObject._id`, which leaks insertion order, is reusable if a user is hard-deleted, and changes shape across REDB instances. The GUID is opaque, collision-free, portable across deployments, and decouples the externally observable identity from the internal storage primary key. This is the shape that downstream resource servers, third-party SDKs, and federated RP relying parties expect, and it brings redb.Identity in line with the OIDC Core 1.0 §5.7 guidance that `sub` should be a stable, locally-unique, non-reassigned identifier within the issuer. **Dual-emission for in-process consumers.** Every principal built by `IdentityPrincipalBuilder`, `AttachSessionPrincipalHandler`, the password flow, the authorization-code flow, the device flow, the verification flow, and the federation flow now carries **two** identity claims: | Claim | Type | Audience | Source | |---|---|---|---| | `sub` | `string` (GUID, lower-case, no braces) | Public — wire-visible to RPs and resource servers | `UserProps.value_guid` | | `redb:user_id` | `string` (bigint) | Internal — never leaves the issuer; used by in-process modules that key off `_users._id` | `RedbObject._id` | The internal claim is destination-restricted to the access token only and is stripped from `id_token`, `userinfo`, and `introspect` responses by the existing OpenIddict claim destinations machinery. Modules in the same worker that resolve the user via `direct-vm://identity-userinfo` continue to receive both claims. **Store-side changes.** Subject linkage on the four OpenIddict store rows moved from `RedbObject.Key` (bigint) to `RedbObject.value_guid` (Guid): - `AuthorizationProps` — `value_guid` carries the public sub GUID. The `IOpenIddictAuthorizationManager.FindBySubjectAsync` lookup goes through `Query().WhereRedb(o => o.ValueGuid == subjectGuid)`, which is a single indexed scan on the REDB primary key column. - `TokenProps` — same. `FindBySubjectAsync`, `RevokeTokensBySubjectAsync`, and the chained-revoke pass on authorization-code reuse all key off `value_guid` now. - `ApplicationProps` and `ScopeProps` — unaffected on the subject axis, but their `Subject`-bearing referenced rows were swept consistently. **`/me/*` and management.** Every self-service and admin route that took a subject path parameter (`/me/profile`, `/me/sessions`, `/me/mfa`, `/me/webauthn`, `/me/consents`, `/me/federated`, the SCIM endpoints, and the admin user/token/authorization management) now treats the path as the GUID sub. Internal lookups translate the GUID back to the bigint via a single `WhereRedb(o => o.ValueGuid == subjectGuid)` query before issuing any storage operation. The `RequireSelfOrAdminProcessor` IDOR guard compares the GUID claim from the access token against the GUID in the path — a bigint cannot be substituted to escalate. **Migration path.** This is a breaking change only for callers that compared `sub` against `_users._id` directly. In-process callers should switch to the `redb:user_id` claim; external callers should treat `sub` as opaque (which is the OIDC requirement). No data migration is required: the `value_guid` slot is filled lazily on the first claim-issuing event for each existing user, and both `sub` and `redb:user_id` are emitted even before the lazy fill completes. #### `redb.Identity.Core` — OpenIddict 6.3 pipeline on redb.Route exchanges The full OpenIddict server pipeline runs on `IExchange` instead of `HttpContext`. There is **no ASP.NET dependency** in the `Core` package — not even an indirect one. Every endpoint a relying party touches (`/connect/authorize`, `/connect/token`, `/connect/userinfo`, `/connect/introspect`, `/connect/revoke`, `/.well-known/jwks`, `/.well-known/openid-configuration`, `/connect/par`, `/connect/device`, `/connect/verify`, `/connect/register`, `/connect/logout`, `/connect/checksession`, `/connect/endsession`) is registered as a `direct-vm://identity-*` route in Core, and the HTTP-facing path is the HTTP facade rebinding into that route. The full set of standards covered by the engine in this preview: - **OIDC Core 1.0** — `authorize`, `token`, `userinfo`, ID Token issuance with all standard claim destinations, `prompt=none`, `max_age`, `id_token_hint`, `claims` request parameter, request objects (signed JWT request URIs). - **OAuth 2.1 / RFC 6749** — authorization code (with PKCE required for public clients), client credentials, refresh token (with rotation and reuse detection), resource owner password (gated, off by default). - **RFC 6750** — Bearer token usage, `WWW-Authenticate` shapes for the three error classes. - **RFC 7591 / RFC 7592** — Dynamic Client Registration (DCR) and management — soft-deleted client recovery, mTLS / private_key_jwt / client_secret_basic / client_secret_post / none auth methods, registration access tokens, configurable bootstrap-admin gate. - **RFC 7662** — Token introspection with both JWT and reference token resolvers. Active state is computed from the redb-backed status field with explicit revocation precedence. - **RFC 8414** — Authorization-server metadata document, JWKS endpoint. - **RFC 8628** — Device authorization grant — `device_code`, `user_code`, polling endpoint, verification endpoint, slow-down back-off. - **RFC 8693** — Token exchange (subject token + actor token, scope narrowing). - **RFC 9126** — Pushed Authorization Requests (PAR) — `request_uri` one-time redemption with TTL guard. - **RFC 9449** — DPoP — proof validation on `/connect/token` and on the resource server side via the `redb.Identity.Resource.Dpop` package; jti replay cache backed by redb. - **OIDC Backchannel Logout 1.0** + **RFC 8417 SET** — backchannel logout notification (signed `logout_token`) and the cluster-friendly revoked-SID broadcast surface (`/revoked-sids/add`, `/revoked-sids/since`) for replicas to converge without sticky sessions. #### `redb.Identity.Core` — redb-backed OpenIddict stores Every OpenIddict abstract store has a redb implementation backed by a typed `*Props` object on a named REDB instance (default name: `"identity"`): - `RedbApplicationStore` — `ApplicationProps` (client metadata, redirect URIs, post-logout URIs, secret hashes, JWKS URIs, settings JSON). - `RedbAuthorizationStore` — `AuthorizationProps` (subject GUID, application id, type, status, scopes, properties). - `RedbTokenStore` — `TokenProps` (subject GUID, type, status, authorization id, payload — opaque or self-contained, expiration, reference id hash). **Atomic single-use** semantics on `authorization_code` / `device_code` / `refresh_token` redemption are provided by optimistic-concurrency on `RedbObject.hash` inside `UpdateAsync` — exactly one concurrent redeem winner per code is guaranteed without an explicit lock. - `RedbScopeStore` — `ScopeProps` (resources, descriptions, properties). All four stores key off REDB primary fields (`value_guid`, `value_string`, `value_long`) for indexed lookups; nothing falls back to in-memory filtering at the application layer. #### `redb.Identity.Core` — claim mappers, claim scopes, federation providers A first-class admin surface for OIDC claim shaping: - **Claim mappers** — pluggable rules that map source attributes (REDB user props, federation IdP claims, group memberships, custom JSON paths) to outgoing OIDC claims with destination scoping. - **Claim scopes** — declarative association of claim mappers with one or more scopes; scope is granted only if the requesting client is permitted (`RestrictScopeByGroupMembershipHandler`). - **Federation providers** — OIDC and GitHub external IdPs persisted as redb props rows, with admin CRUD over `direct-vm://identity-federation-*` and lazy user provisioning on first successful federated login. #### `redb.Identity.Core` — sessions, MFA, recovery, native consent - **Session principal store** — `AttachSessionPrincipalHandler` resolves the user's session from the auth cookie / opaque session id, attaches a fully-built principal to the OpenIddict transaction, and is the single source of truth for `prompt=none` decisions. - **MFA** — TOTP (RFC 6238), SMS/Email OTP, WebAuthn (FIDO2 L2), and recovery codes; enrolment, verification, and removal flows surface through `/me/mfa` and `/me/webauthn`. MFA replay protection on the token endpoint is enforced via the same redb-backed `jti`/nonce cache used for DPoP. - **Account self-service** — registration (with optional admin approval), e-mail verification, change-email confirm, password recovery, profile edit, session list / revoke individual / revoke all. - **Native consent** — content-negotiated `/connect/authorize` returns a machine-readable `400 consent_required` JSON when the client sends the `X-Identity-Delegate-Consent: 1` header (used by `BackchannelOidcClient.RecordConsentGrantAsync` for native consent flows where there is no browser to render the host's HTML page). #### `redb.Identity.Core.Module` — `.tpkg` host glue `InitRoute` registers the engine on a named REDB instance (default `"identity"`) so Identity state lives in its own props namespace — fully isolated from other modules in the same Tsak worker. Configuration is bound from `context.json` and exposes the OpenIddict options (signing keys / encryption keys / token lifetimes / endpoints toggle / DPoP requirement) as plain JSON. #### `redb.Identity.Http` — full transport facade Exposes every public OIDC endpoint over HTTP, plus the management surface and the `/me/*` self-service surface, by binding HTTP routes to the corresponding `direct-vm://identity-*` route. The facade is **transport-only** — no Identity logic lives here, so removing the package and using a different transport facade (gRPC, RabbitMQ, SignalR) leaves all behaviour intact. #### `redb.Identity.Web` — server-rendered host pages The browser-touching pages required by the Authorization Code + Device Code flows: - `/login`, `/logout` - `/consent` (the HTML form that `BackchannelOidcClient` and human-driven flows both POST to) - `/account/register`, `/account/verify-email`, `/account/recover`, `/account/change-email-confirm` - `/me/*` SPA-style pages backed by the `/me/*` JSON endpoints All pages are plain Razor templates wired through redb.Route's HTML view rendering — no MVC, no controllers. #### `redb.Identity.Client` — SDK for relying parties and in-process modules Two layered surfaces: - **In-process** — strongly-typed wrappers over `direct-vm://identity-*` routes for callers in the same Tsak worker. Zero serialization, zero loopback, fully synchronous from the caller's perspective. - **HTTP** — `BackchannelOidcClient` (PKCE, native consent, refresh rotation) for relying parties that talk to a remote redb.Identity deployment. #### `redb.Identity.DataProtection` — standalone DPAPI-equivalent on REDB A `Microsoft.AspNetCore.DataProtection` setup that runs **without** ASP.NET — keys are persisted as redb props rows, signing and encryption keys rotate on a schedule, and the key ring is shared across all replicas of a Tsak cluster automatically because every replica reads the same REDB instance. #### `redb.Identity.Ldap` — LDAP / Active Directory federation Directory-driven user sync handler (`LdapSyncHandler`) plus a bind-on-login adapter that allows AD users to authenticate without mirroring credentials into the redb user store. Group membership is mapped to claim mappers, so AD groups can drive scope grants without touching the Identity admin surface. #### `redb.Identity.Resource.Dpop` — DPoP for downstream resource servers A drop-in middleware for redb.Route resource pipelines that validates incoming DPoP proofs against the access token's `cnf.jkt`, with a redb- backed jti replay cache. Tied to the issuer's nonce policy via the shared key ring. ### Performance #### `redb.Identity.Core` — per-request cache on `FindByClientIdAsync` eliminates 8-11× duplicate lookups OpenIddict's built-in handlers call `IOpenIddictApplicationManager.FindByClientIdAsync` 8-11 times per `/connect/token` request for the same `client_id` — each call previously hit a fresh REDB props lookup (~8 ms each on the PVT join). Our own code only resolves the application from 5 cold-path locations, so the duplication is entirely inside the OpenIddict pipeline. `RedbApplicationStore` now keeps a per-instance `Dictionary?>` keyed on `client_id`. Because the store is registered as `Scoped` (one instance per HTTP request), the cache lives only for the lifetime of one OIDC pipeline invocation — no TTL, no cross-request invalidation, no global state. `null` is cached too so repeated lookups for unknown `client_id` values don't re-hit the database. `CreateAsync`, `UpdateAsync`, and `DeleteAsync` keep the cache coherent for the rare case the same request creates and then re-resolves a client. Net effect on a steady-state `/connect/token` request: one DB round-trip for the application row plus 7-10 cache hits, saving ~80 ms per token issuance. #### `redb.Identity.Core` — per-request caches on `RedbTokenStore` and `RedbAuthorizationStore` The same Scoped-store / per-request cache pattern that paid off so well on `RedbApplicationStore` has been extended to the two other hot OpenIddict stores. `[STORE-DIAG]` instrumentation on a `/connect/token` refresh-rotation flow showed `IOpenIddictTokenStore.FindByIdAsync` being called twice for the same token id (~8 ms per PVT join) and the matching authorization being resolved at least once during issuance — duplicated work that the request-scoped cache erases for free. `RedbTokenStore` now keeps two coordinated dictionaries: | Cache | Key | Filled by | |---|---|---| | `_idCache` | bigint object id | `CreateAsync`, `FindByIdAsync` MISS, `FindByReferenceIdAsync` MISS | | `_refCache` | reference id (hash of refresh-token / authorization-code value) | `CreateAsync`, `FindByReferenceIdAsync` MISS, `FindByIdAsync` MISS when `value_string` is set | Both caches are populated on each MISS so a subsequent lookup by either key returns the same in-memory instance, and `DeleteAsync` removes from both to keep the dictionaries coherent inside one request. `null` is cached too so unknown ids/reference values cannot re-hit the database. `RedbAuthorizationStore` adds a single `_idCache` keyed on bigint object id. Authorization rows are resolved repeatedly during refresh-token rotation and authorization-code redemption — the cache spares those redundant PVT joins. `FindByApplicationIdAsync`, `FindBySubjectAsync`, and `FindAsync` are not cached: they return enumerables and the result sets are not stable enough across the few moments inside one request to justify the bookkeeping. Measured on the acceptance demo suite (warm-start, local PostgreSQL, BCrypt cost factor unchanged at 12): | Demo | Before | After | |------------------------|-------:|-------:| | `password_ropc` | 4750 ms | 3790 ms | | `refresh_rotation` | ~4000 ms | 3596 ms | | `me_sessions` | ~4100 ms | 3576 ms | The 19-demo full run completes in 40.4 s with all flows green. Worker logs confirm the documented `Tok.FindById call#1 MISS … call#2 HIT` pattern, and the existing `App.FindByClientId` HIT counters continue to fire 7-10 times per token issuance — i.e. the new caches stack with the older one rather than replacing it. The diagnostic `[STORE-DIAG] …` logs ride along at `LogInformation` level for one preview iteration so production deployments can validate cache hit ratios on real traffic; they will be downgraded to `LogTrace` (or removed) in the next preview once the win is confirmed in the wild. #### `redb.Identity.Core` — ROPC principal fast-path skips a second user load `HandleTokenRequestHandler.HandleAsync` for the password grant previously called `IUserProfileService.BuildPrincipalAsync(userId, scopes)`, which re-loaded the `IRedbUser` entity and the `UserProps` envelope from REDB even though `LoginService.AuthenticateAsync` had just loaded both during credential verification a few microseconds earlier. The handler now forwards the already-loaded `User`, `OidcProps`, and `SubjectGuid` from the `LoginResult` directly to the `BuildPrincipalAsync(user, props, sub, scopes)` overload when they are present, falling back to the by-id load only for legacy users whose `value_guid` slot has not been backfilled yet. #### `redb.Identity.Core` — DCR collapses two writes + one read into a single persist `DynamicRegistrationProcessor` previously called `manager.CreateAsync(descriptor)` (write #1), then `manager.FindByClientIdAsync(clientId)` (read), then mutated `Props.RegistrationAccessTokenHash` and called `redb.SaveAsync(app)` (write #2). The whole point of the second write was to attach a single hashed RFC 7592 registration access token to a row that had just been inserted — a wasted round-trip every time. The processor now drives the manager pipeline manually: `PopulateAsync(app, descriptor)` fills the in-memory entity from the descriptor, the RAT hash is stamped onto `Props` before the row leaves memory, and `manager.CreateAsync(app, secret, ct)` performs a single persist that hashes the client secret and writes the application, permissions, redirect URIs, and the RAT hash atomically. The plaintext secret is pulled out of the descriptor before `PopulateAsync` so the manager's "client secret hash cannot be set" guard is not tripped — the dedicated `(application, secret, ct)` overload owns the hashing. Measured impact on the acceptance demo suite (warm-start DCR calls, local PostgreSQL, BCrypt cost factor unchanged at 12): | Demo | Before | After | |-----------------------|-------:|-------:| | `dcr_lifecycle` | 590 ms | 305 ms | | `client_credentials` | 591 ms | 237 ms | | `authcode_pkce` | 517 ms | 302 ms | | `introspect_revoke` | 545 ms | 446 ms | | `me_profile` | 288 ms | 276 ms | | `mfa_totp` | 250 ms | 196 ms | 30–60 % reduction with no change to security primitives: BCrypt cost factor, JWE access-token encryption, RSA signing/encryption key bootstrap, and the OpenIddict validation surface are all untouched. The win is purely in collapsing redundant redb round-trips. ### Fixed #### `redb.Identity.Core` — Authorization endpoint error redirect (RFC 6749 §4.1.2.1 / OIDC §3.1.2.6) When `/connect/authorize` rejected a request from the `HandleAuthorizationRequest` stage (e.g. `prompt=none` with no session → `login_required`, or `consent_required` after consent tracking), OpenIddict's `Apply` handlers do not fire, so `RedbRouteOpenIddictServerHandler` was emitting a JSON `400` error body instead of the RFC-required `302` redirect back to the validated `redirect_uri`. The HTTP facade then made it worse for `login_required` specifically by overriding the response with a `302 → /login?returnUrl=...` to the interactive login UI — silently violating OIDC §3.1.2.6, which forbids any UI for `prompt=none`. Two coordinated fixes: 1. `RedbRouteOpenIddictServerHandler.ProcessAsync`: when the request is rejected for the Authorization endpoint and we have a validated `redirect_uri` + a real HTTP method header, build the `302` redirect ourselves (`?error=…&error_description=…&state=…`, or `#…` for `response_mode=fragment`) instead of falling through to JSON. 2. `HandleAuthorizationRequestHandler` + `SessionCookieProcessors.RedirectToLogin`: the handler flags the exchange with `prompt_none = true` on the prompt=none reject path; the HTTP processor skips its `/login` UI override when that flag is set, so the natural error redirect to `redirect_uri` survives the facade. New regression demo `demo_auth_extras.ps1` covers four previously-unprobed authorization-response surfaces: - RFC 9207 `iss` parameter present in `query` response Location - `prompt=none` + no session → `error=login_required` at `redirect_uri` - `response_mode=form_post` → 200 HTML auto-submit form with `code` - `response_mode=fragment` → `Location` carries `#code=…&state=…&iss=…` #### `redb.Identity.Core` — Discovery array fields no longer duplicated `/.well-known/openid-configuration` was emitting `dpop_signing_alg_values_supported` as 13 entries (`ES256, ES384, ES512, RS256, RS384, RS512, PS256, PS384, PS512, ES256, ES384, PS256, RS256`) because OpenIddict's default discovery handler appends its own short list AFTER our `ApplyDiscoveryResponseHandler` runs, and `RemoveParameter` does not survive the late merge. `ApplyDiscoveryResponseHandler` now dedupes every advertised string-array field (`dpop_signing_alg_values_supported`, `scopes_supported`, `grant_types_supported`, `*_auth_methods_supported`, `prompt_values_supported`, `response_modes_supported`, etc.) in the materialised `Out.Body` immediately before `HandleRequest()`. New regression demo `demo_discovery_shape.ps1` locks the shape: required RFC 8414 / OIDC Discovery fields, no duplicates anywhere, DPoP algs restricted to RFC 9449 §5 catalog, no placeholder/secret leaks. #### `redb.Identity.Core` — Backchannel logout fan-out reaches RPs Three bugs prevented `BackchannelLogoutDispatcher` from ever firing on non-interactive flows (ROPC + refresh): 1. **Subject lookup queried wrong column.** `LogoutProcessor.CollectAffected ApplicationIdsAsync` was filtering authorizations and tokens by `Key == userId`, but the OpenIddict redb stores write the public GUID subject into `_objects.value_guid` (via `SetSubjectAsync`). Auths/tokens are now resolved by translating `userId → UserProps.value_guid` first, then querying `ValueGuid == subjectGuid`. 2. **Token-only flows were ignored.** ROPC and other non-interactive grants emit access/refresh tokens without creating an OpenIddict `Authorization` row, so the union missed every ROPC-only client. The collection now also unions `TokenProps.ApplicationObjectId` for non-revoked tokens. 3. **Dispatcher was resolved from the wrong DI container.** The processor was calling `exchange.ServiceProvider?.GetService()` — but the dispatcher is registered in the Identity *child* container, not the host SP that `exchange.ServiceProvider` exposes. It now resolves through `IRouteContext.GetIdentityServiceOr Default<>(exchange)` so per-exchange Identity scopes are honoured. #### `redb.Identity.Core` — DCR + management API expose `backchannel_logout_uri` RFC 7591 Dynamic Client Registration accepts the OIDC Back-Channel Logout 1.0 client metadata fields (`backchannel_logout_uri`, `backchannel_logout_session_required`) and persists them on the registered application. `PopulateAsync` ignores `descriptor.Properties[]` (those are OpenIddict's per-store custom property bag, not redb `Props`), so the strongly-typed `ApplicationProps.BackchannelLogoutUri` field is now written manually after `PopulateAsync` in both `DynamicRegistrationProcessor` and `ApplicationManagementProcessor`. New demo `demo_backchannel_logout.ps1` covers the end-to-end flow: DCR a confidential client with a backchannel URI, ROPC for tokens, POST `/connect/logout` with `id_token_hint`, and assert that an HttpListener captures the signed `logout_token` JWT carrying the required `events`/`sub` claims. #### `redb.Identity.Core` — DCR-registered clients use implicit consent `DynamicRegistrationProcessor` was the only client-creation path setting `ConsentType = Explicit`; every other path (`BootstrapAdminProcessor`, `SeedWebClientHostedService`, `SeedBackchannelClientHostedService`) uses `Implicit`. The mismatch broke headless authorization-code + PKCE flows: `HandleAuthorizationRequestHandler` saw `Explicit` and 302-redirected the caller to `/consent`, which a non-browser client cannot satisfy without driving the consent submission form. DCR now defaults to `Implicit`, matching the rest of the server's policy. Operators that need an explicit consent screen for a specific DCR client can flip it via the management API. #### `redb.Identity.Http` — `/connect/revocation` is the canonical revoke path The OAuth 2.0 token-revocation endpoint per RFC 7009 is mounted at `/connect/revocation` (matching OpenIddict's discovery document). The `demo_introspect_revoke.ps1` acceptance script was hitting the non-existent `/connect/revoke` path on the refresh-token revoke step; this was a demo bug, not a server bug, but it surfaced because the acceptance suite drives both introspection and revocation back-to-back. Demo updated to use the canonical path; the server side already exposed only `/connect/revocation`. #### `redb.Identity.Http` — federation public list precedence + binding Two related fixes for the public read-only federation projection at `/api/v1/identity/federation-providers/public`: 1. **Anonymous access.** `ManagementBearerAuthProcessor` was rejecting the request with `401 missing_token`. The path is now in the auth processor's `anonymousPathPrefixes` list — the public projection is unauthenticated by design (login pages call it before the user has a session). Sits next to the existing exemptions for the password-recovery and account-bootstrap flows and the SCIM discovery endpoints. 2. **Route precedence.** `ConfigurePublicFederationProvidersEndpoint` was registered AFTER `ConfigureManagementApi`, so the catch-all `/api/v1/identity/{**path}` matched first and dispatched the request to `FederationProvidersController.Get(id="public")` which then failed with `400 "Id is required"`. The exact-match route is now registered first. 3. **Cross-context mirror.** Tsak isolates context property buckets, so the HTTP facade (`identity.http` context) cannot read the `Identity:FederationProviders` list from `identity.core`'s context. `context.json` now mirrors the providers under `identity.http:IdentityTransport:FederationProviders`. The mirror omits `ClientSecret` — the HTTP-facade path only consumes `ClientId`/`Authority`/`Scopes` for the redirect surface. Surfaced by the new `demo_federation.ps1` (RFC-shape probe: discovery `federation_providers` array, public projection with explicit anti-leak guards against `ClientSecret`/`Authority`/`Scopes`/`ClientId`, cross-check between the two lists, then a `/connect/external-login` 302 verification with an absolute upstream `Location`). #### `redb.Identity.Core` — token exchange wired into discovery + DCR Two server-config nudges so the existing token-exchange code path is actually reachable from a freshly-registered DCR client: 1. `Identity:Features:EnableTokenExchange` defaulted to `false`, which meant `urn:ietf:params:oauth:grant-type:token-exchange` was absent from the discovery document's `grant_types_supported` array even though the OpenIddict handlers were live. Default flipped to `true` in `context.json`. 2. The grant was missing from `DynamicRegistrationAllowedGrantTypes`, so any DCR-registered client requesting the grant got `400 "Grant type(s) not allowed: ..."` from the registration endpoint. Now allowed. Surfaced by `demo_token_exchange.ps1`, which already exercised the delegation (`subject_token` + `actor_token` → `act` claim) path and just needed the server to admit the grant. Same demo's DCR registration also now requests `client_credentials` (step 4 mints the actor_token via that grant) and the `identity:read` scope. #### `redb.Identity` — `demo_device_code_ci.ps1` for non-interactive RFC 8628 coverage `demo_device_code.ps1` covers the happy path of the RFC 8628 device authorization grant but requires a human to approve the device, so CI could not run it. The new `demo_device_code_ci.ps1` is the non-interactive companion: it DCR-registers a device-code client, hits `POST /connect/deviceauthorization`, asserts the RFC 8628 §3.2 response shape (`device_code`, `user_code`, `verification_uri`, `expires_in` required; `interval` and `verification_uri_complete` soft-warn), and polls `/connect/token` once expecting `error=authorization_pending` per §3.5. Wired into `run_all.ps1` alongside the existing 21 demos for a 22/22 acceptance suite. #### `redb.Identity.Core` — Per-request store cache coherency on bulk mutations The per-request `_idCache` / `_refCache` introduced on `RedbTokenStore` and `RedbAuthorizationStore` (perf entry above) served the documented 2× `FindByIdAsync` per `/connect/token` access pattern, but `RevokeAsync`, `RevokeBy{Application,Authorization,Subject}IdAsync`, and `PruneAsync` loaded targets through `Query<>()` (bypassing the cache), mutated and saved them, but never refreshed the cache. A later `FindByIdAsync` in the same request returned the pre-revoke/pre-prune snapshot, breaking both the in-request "modify then read back" contract and the matching unit tests (`Status` observed as `"valid"` after revoke; pruned tokens still resolved). Fix: the bulk-mutation paths now refresh the cache entries with the just-saved instances immediately after `SaveAsync`, and the soft-delete path evicts the ids from `_idCache` (token store also clears `_refCache` wholesale because the prune doesn't carry the refId↔id mapping). The matching `UpdateAsync_StaleHash` integration test was rewritten to use two independent store instances so the per-request cache no longer collapses the "two concurrent requests" copies into one shared reference. #### `redb.Identity.Core` — Authorization endpoint open-redirect on rejected `redirect_uri` When OpenIddict rejected `/connect/authorize` because the supplied `redirect_uri` was unregistered, malformed, or otherwise unauthorized (error documentation IDs `ID2043` / `ID2052` / `ID2095` / `ID2100`), `RedbRouteOpenIddictServerHandler.ProcessAsync` still built a `302` to the **attacker-supplied** request `redirect_uri` with the error on the query string. RFC 6749 §3.1.2.4 / §4.1.2.1 forbid using a non-validated `redirect_uri` as a redirect target — the response must be inline so the browser never reaches the attacker URI with the framework's `state` and `error` parameters attached. Fix: the rejection path now inspects `context.ErrorUri` and skips the redirect-to-`redirect_uri` block when any of the four `redirect_uri`- specific OpenIddict error IDs is present, falling through to `WriteResponseToExchange` so the error surfaces on the response body instead. Covered by `RedirectUriValidationTests` with both unregistered and registered-prefix-plus-query attacker shapes. #### `redb.Identity.Core` — `prompt=login` / `max_age` no longer collapsed onto the `/login` interactive path The interactive-`/login` redirect introduced for missing-session `login_required` (Fixed entry above) treated **every** `login_required` rejection as "redirect the browser to the local login page". That was wrong for `prompt=login` and `max_age` staleness checks — the user is already authenticated, so `/login` would auto-recognise the cookie and loop back to the same authorize request. OIDC §3.1.2.1 / §3.1.2.6 require these "force re-auth" cases to surface `error=login_required` on the validated `redirect_uri` so the RP can drive the re-auth flow (clear its session, retry without `prompt=login`, etc). `HandleAuthorizationRequestHandler` already flagged the exchange with `force_login=true` on both branches; the fix is to lift that flag in `RedbRouteOpenIddictServerHandler.ProcessAsync` and exclude it from the `interactiveDeferred` condition. Only the genuine missing-session path (no `prompt`, no `max_age` flag) still defers to `/login`; everything else surfaces on the callback. `demo_prompt_max_age.ps1` (9 steps) is the regression probe. #### `redb.Identity.Core` — Captive `Scoped` store via root-SP fallback (`Bootstrap*` 409 cascade) `IdentityRouteContextExtensions.GetIdentityService(exchange)` falls back to `IRouteContext.GetServiceProvider()` when no factory was registered via `RegisterIdentityScopeFactory` (every test fixture that constructs the route context with the host root SP directly hits this path). The fallback returned the host root SP **as-is**. Resolving a `Scoped` service (`IOpenIddictApplicationManager`) from a root SP captures the underlying `Scoped` `IOpenIddictApplicationStore` = `RedbApplicationStore` at root lifetime, which silently promotes it to a process-wide singleton — its per-request `_clientIdCache` then persists across every request. Cleanup code that opened its own `CreateScope()` mutated a different store instance, so the captive store kept serving the pre-cleanup snapshot. The `BootstrapAdminEndpointTests` "first call → 201" cases consistently saw `409 OIDC client '…' already exists` because the captive store returned the ghost row id from a prior test's create. Fix: when the fallback fires, build a per-exchange scope from the root SP's own `IServiceScopeFactory` and cache it on the exchange (matching the registered-factory path). Each request now gets its own fresh `RedbApplicationStore` with an empty `_clientIdCache`, mutations stay within the request, and there is no captive shadowing of DB state. Verified — all 9 `BootstrapAdminEndpointTests` pass. ### Notes #### Cluster + replica deployment Three identical Tsak workers loading the same `.tpkg` set against the same PostgreSQL **is** a production cluster — there is no service mesh, no leader election service, no Redis. The DataProtection key ring and the OpenIddict signing keys are shared through the redb object store; cleanup timers (`PruneAuthorizations`, `PruneTokens`, `PruneRevokedSids`) run **leader-only** via `RouteBuilder.Cluster(true)`, which uses PostgreSQL advisory locks to elect exactly one runner per epoch. #### Test posture - 1783 xUnit tests cover the engine, every store, every claim handler, every `/me/*` route, every management route, the Http facade, the Ldap sync, the Dpop middleware, and the end-to-end OIDC flows against a real PostgreSQL via `ProductionBootstrapFixture` / `ProductionHttpFixture`. **All green on this preview.** - Header-negotiation, native-consent happy path, atomic authorization-code single-use (including a 16-way concurrent replay test), refresh token rotation, DPoP nonce/jti replay, and the GUID-sub migration are each covered by dedicated test classes. - Integration tests share fixtures via xUnit `[Collection]` markers and clean per-client OpenIddict authorization state in `IAsyncLifetime.InitializeAsync` to keep test ordering irrelevant. ### Pending — before `1.0.0` GA - gRPC / RabbitMQ / AMQP / IBM MQ / SignalR transport facade `.tpkg` packages (the engine is transport-agnostic; only HTTP ships in this preview). - Public NuGet packaging + signing pipeline. - Security review pass on the cryptographic surfaces (DPoP, PAR request-object signature verification, signed logout tokens, key ring rotation policy). - Public migration guide for relying parties moving off the bigint sub. - Performance baseline: 99p latency targets for `token`, `authorize`, `introspect`, `userinfo` against PostgreSQL on commodity hardware. Path: redb-identity/changelog/CHANGELOG-3.x.md Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity Page: https://redbase.app/src/dev-2026-12-06/redb-identity/changelog/CHANGELOG-3.x.md ---- # redb.Identity changelog: 3.x Releases of the 3.x line, moved here unchanged from CHANGELOG.md when the main file started to follow the current major only. Newer releases: [CHANGELOG.md](../CHANGELOG.md). ## [3.7.2] — 2026-08-27 No changes of its own. The version moves with the ecosystem so the exact-version pins between packages keep resolving, and the images pick up the fixed `redb.Tsak.Core` and core packages from their base layer. ## [3.7.1] — 2026-08-26 > **Why 3.7.1, and what happened to 3.7.0.** 3.7.0 is withdrawn: it was built on .NET 9 and carries > known vulnerabilities in its dependencies (see **Security** below). Every 3.7.0 package is unlisted > on nuget.org and the `v3.7.0` releases were deleted from the public mirrors. An unlisted version > still installs by exact number — but there is no reason to: 3.7.1 replaces it completely. > > A patch, not a minor: the public API surface does not change. Adding `net10.0` to the target list > breaks nothing for existing consumers, and `net8.0` / `net9.0` are kept. ### Changed — the build moved to .NET 10 The applications and artifacts were built on net9 while the core and `redb.Route` had long multi-targeted `net8.0;net9.0;net10.0`. The gap surfaced on 3.7.0: images and archives shipped as net9. The `redb.Tsak.*` and `redb.Identity.*` libraries now declare `net8.0;net9.0;net10.0` — exactly like the core and Route, so the whole ecosystem is uniform. Host applications and tests are pinned to a single `net10.0`. Images, archives and tags are `-net10`. .NET 8 and .NET 9 both reach end of support on **10 November 2026** — the same day, Microsoft aligned the STS 9 date with LTS 8. .NET 10 is supported until **14 November 2028**. `net8.0` and `net9.0` remain in the libraries' target list for now. ### Security — six high-severity advisories Found while moving to .NET 10: changing the TFM forced a from-scratch rebuild and the NuGet audit spoke up. It stays silent on an incremental build, which is how all of this reached 3.7.0. - **`redb.Identity.DataProtection` — `System.Security.Cryptography.Xml` 9.0.4, SEVEN advisories at once** ([GHSA-23rf-6693-g89p], [GHSA-37gx-xxp4-5rgx], [GHSA-6588-8gv4-xfgh], [GHSA-8q5v-6pqq-x66h], [GHSA-cvvh-rhrc-wg4q], [GHSA-g8r8-53c2-pm3f], [GHSA-mmjf-rqrv-855v] — all high). Pulled in transitively from `Microsoft.AspNetCore.DataProtection` 9.0.4. An XML cryptography library, inside the product that does authentication. Pinned to 9.0.18, the patched 9.x release. - **`redb.Identity.Http` — `Microsoft.Bcl.Memory` 9.0.0** ([GHSA-73j8-2gch-69rq], high), transitively from `OpenIddict.Abstractions`. Pinned to 9.0.19. The 9.x line rather than 10.x wherever the library multi-targets down to `net8.0`: 10.x does not install there. ### Fixed — `redb.Identity.Grpc.tpkg` reached no artifact at all `build-modules` produces three `.tpkg` files, but the list of what gets copied into artifacts was hardcoded as exactly `Core.Module` + `Http` — in `build-archives.ps1` (three places) and in the `backend`, `full` and `managed` Dockerfiles. When the gRPC facade shipped in 3.7.0 its `.tpkg` was built and then silently dropped: anyone installing Identity from an archive or an image got no gRPC facade at all, while the `redb.Identity.Grpc` package was published and announced in this changelog. The archive script now enumerates `*.tpkg` from the build output and prints what it ships; the Dockerfiles copy `output/*.tpkg` by glob. A new module now ships because it exists, not because someone remembered to add a line. [GHSA-23rf-6693-g89p]: https://github.com/advisories/GHSA-23rf-6693-g89p [GHSA-37gx-xxp4-5rgx]: https://github.com/advisories/GHSA-37gx-xxp4-5rgx [GHSA-6588-8gv4-xfgh]: https://github.com/advisories/GHSA-6588-8gv4-xfgh [GHSA-8q5v-6pqq-x66h]: https://github.com/advisories/GHSA-8q5v-6pqq-x66h [GHSA-cvvh-rhrc-wg4q]: https://github.com/advisories/GHSA-cvvh-rhrc-wg4q [GHSA-g8r8-53c2-pm3f]: https://github.com/advisories/GHSA-g8r8-53c2-pm3f [GHSA-mmjf-rqrv-855v]: https://github.com/advisories/GHSA-mmjf-rqrv-855v [GHSA-73j8-2gch-69rq]: https://github.com/advisories/GHSA-73j8-2gch-69rq ## [3.7.0] — 2026-08-25 > **Why a minor.** Two new packages ship: `redb.Identity.Grpc` (a second facade beside HTTP) and > `redb.Identity.Management`, the transport-neutral management controllers extracted out of > `redb.Identity.Http` so both facades dispatch the same ones. New surface cannot be a patch. > > **The extraction moves types across packages.** `redb.Identity.Http.Controllers.*` is now > `redb.Identity.Management.Controllers.*`; `redb.Identity.Http` depends on the new package, so a > plain package upgrade keeps working, but code naming those types by full name must be updated. > The ecosystem moves on one number; `redb` core, `redb.Route` and `redb.Tsak` ship 3.7.0 alongside. ### Changed — the packages now ship XML documentation `GenerateDocumentationFile` was never enabled for redb.Identity, so all ten packages shipped a bare `.dll` and gave consumers no IntelliSense. It is on now, and `lib/net9.0/*.xml` travels with every package — 670 KB of it for `redb.Identity.Core` alone. CS1591 (public member without XML doc) is suppressed, unlike `redb.Route` where it is deliberately left on: turning the doc file on without that adds over 3500 warnings in three of the ten projects alone, on members that predate the policy. The doc-syntax warnings stay visible on purpose, and `redb.Identity.Core` alone raises 218 of them — 128 unresolved `cref`, 100 methods missing a `param` tag, 6 malformed XML comments. Nothing fails to build; they are queued as a cleanup, not as a release blocker. ### Added - **`redb.Identity.Grpc` — a gRPC facade for redb.Identity.** A second transport beside HTTP, talking to Core over the same `direct-vm://identity-*` routes: `Token`, `Introspect`, `Revoke`, `UserInfo`, `Discovery`, `Jwks`. Ships as its own `.tpkg` with `ContextName: identity.grpc` and zero compile-time dependency on `redb.Identity.Core` — the Phase 8 facade-isolation invariant, verified against the built assembly's `deps.json` rather than against its project file. One gRPC method address is one route, so every operation carries its own route id, policies, metrics and lifecycle instead of hiding inside a single dispatch switch. Ports mirror the HTTP facade (`PublicPort` / `ManagementPort ?? PublicPort`) and are never shared with it: gRPC needs HTTP/2 while the HTTP facade serves HTTP/1.1 + HTTP/2, and one listener has a single protocol set. Configuration lives in the shared `context.json` under `IdentityTransport:Grpc:*`, beside the HTTP facade's section; issuer and feature flags come from the same `Identity:*` root Core reads. - **Published contract `identity.v1.proto`.** Lives in `redb.Identity.Contracts/Protos` as a file consumers generate stubs from — the `redb.Identity.Contracts` package ships both `.proto` files under `Protos/`, so a non-.NET client takes the contract from NuGet rather than from the repo. Compiled only by the facade, Contracts stays a dependency-free DTO package instead of dragging Google.Protobuf into Core, Http and Client. Requests carry the parameters the RFCs name plus a string map for extensions (the wire form of these endpoints has always been form-encoded key/value); responses type what the RFCs fix and carry the rest in a `google.protobuf.Struct`, because userinfo claims and introspection extensions are open sets. - **Generic envelope as a fallback path.** The same six operations reachable through `RedbService/Process` with a JSON body and an `operation` header, for callers that would rather not carry the `.proto`. One surface, two spellings. - **mTLS and gzip on the facade, off by default.** Client certificates can be required and pinned by thumbprint; recommended for the management port in production, not forced, so deployments without a client-certificate PKI are not blocked. - **Correlation ids and idempotency across the gRPC boundary.** A caller's `X-Correlation-Id` is honoured (or derived from the ambient trace id) and echoed back in a trailer; each operation tags itself so Core's idempotency cache keys per operation instead of lumping every gRPC call into one bucket. - **The management surface over gRPC.** Forty admin operations across five services — Users, Applications, Groups, Scopes, Tokens — on `ManagementPort`, each its own method address and its own route id. The chain per operation is the security property, in this order: name the call, decode it, authenticate, halt if refused, authorize, halt if refused, and only then dispatch. Both gates run on isolated exchanges, so the halt is explicit rather than inherited from Core's `exchange.Stop()` — the gate stays shut until it positively sees an allow. The controllers are the same ones the HTTP facade dispatches, which is what `redb.Identity.Management` was extracted for. Propagating `identity:management-*` into the inner exchange comes free as a result: `IdentityControllerBase.Forward` already does it, so Core's self-vs-admin protection works on this transport without a line written for it. Contract: `identity.management.v1.proto`. Addresses are typed and generate into client stubs; payloads are `Struct` / `Value`. Typing the bodies of forty operations — 142 across the whole admin surface — would freeze a surface that still grows, and raw JSON would have cost the generated client. Self-service (`/me`, account registration, password recovery, MFA enrolment) is deliberately absent: it is an end-user flow reached from a browser or an app session, not admin tooling, and hosting it on an admin port would widen that port's blast radius for a caller that does not exist. - **Split ports, verified rather than declared.** `ManagementPort` defaults to sharing `PublicPort`, and until now that was the only branch ever executed — the split looked like a supported configuration without being one. It is now covered end to end: the admin addresses answer only on the management port, the protocol port returns `UNIMPLEMENTED` for them (which is what makes a firewall rule on the admin port worth writing), the protocol surface is unaffected, and the gate is still a gate. - **TLS material travels through a named `GrpcConnectionFactory`, not in the endpoint URI.** Not because the URI would disclose it — `SslCertPassword` is `[Sensitive]` and is redacted wherever the URI is rendered — but because this keeps the secret out of the route key altogether, and the route key is handled as a plain string in plenty of places. ### Security - **The management gate now requires proof that authentication ran, not merely the absence of a refusal.** A deployment can wire Core without a management auth processor, which leaves `direct-vm://identity-auth-management` unregistered. The hop then throws "No consumer registered", Core's context-level exception handler marks that handled and replaces the body with its own error document — and the gate saw exactly what success looks like: no refusal recorded, no non-2xx code. The call still did not execute, but only because that handler happened to end the pipeline and because the wire encoder happened to refuse the leftover dictionary. Two unrelated safety nets, neither of them an authentication decision; remove either and every admin operation runs unauthenticated. The gate after the authentication hop now demands the `identity:management-principal` the auth processor leaves behind, and answers `UNAUTHENTICATED` when it is absent. Covered by a fixture that boots Core without the processor and asserts both the status and — the part that actually matters — that no row was written. - **Idempotency over gRPC verified, and the README corrected.** The claim was never tested: the key crosses two spellings (`idempotency-key` in metadata, `Idempotency-Key` in Core), and a case-sensitive dictionary anywhere on that path would have made replays create duplicates in silence. It works, and the test proves it both ways — the same key returns the original record, a different key is refused as a duplicate. The README claimed idempotency applied generally; in fact Core applies it to the management surfaces only, and the protocol operations have no idempotency layer at all. Documented where the line actually falls. - **Per-IP protections keep working behind the gRPC facade.** Core keys its per-IP throttle, its brute-force lockout and its device metadata on `redbHttp.RemoteAddress`, and those checks **silently do nothing** when the header is absent rather than failing loudly. The facade therefore bridges the real client address into it (`EmitHttpCompatHeaders`, on by default), and callers cannot forge it — the transport drops inbound headers carrying a reserved prefix. - **Upstream refusals reach the caller as refusals.** A status Core decided — 429 from rate limiting, 403 from the scope guard, 503 from a database outage — is translated into the matching gRPC status instead of arriving as a successful call carrying an error document that no generated client inspects. OAuth errors map by RFC 6749 §5.2, and the machine-readable code travels in a trailer because a non-OK gRPC reply has its payload discarded. - **The facade answers even when Core stops the exchange.** Several Core processors end their work with `exchange.Stop()` — the per-IP limiter and the granular scope guard among them — and `To` hands Core the facade's own exchange, so that flag ended the facade's pipeline too: the reply left as a raw dictionary that never went through status mapping or protobuf encoding. The security-relevant answers were exactly the ones losing their status. The hop into Core now goes through `Enrich` on a `CloneLinked` exchange (same exchange id, same DI scope, same properties, its own stop flag), and an unhandled fault is rethrown rather than adopted. Covered end to end: a caller over the per-IP limit is answered `RESOURCE_EXHAUSTED` with `rate_limited` and a `retry-after` trailer. - **A rate-limited answer keeps its status.** Core's 429 carries an error document whose code is `rate_limited`, which appears in no RFC 6749 table; deriving the gRPC status from the error string demoted it to `INVALID_ARGUMENT` and dropped the backoff advice. A status Core decided itself now wins, and the error code still travels in a trailer. ### Changed - **The granular scope table moved into Core**, behind `direct-vm://identity-authz-check`. It used to live in the HTTP facade; a second transport was about to need the same decisions, and the failure mode of two copies of an authorization table is not that they disagree loudly but that one of them quietly grants more than the other, on the surface where that matters most. Moved verbatim: same order, same write-implies-read rule, same `identity:account` branch, same default-deny, same refusal wording - the HTTP negative matrix reads that wording, and rewriting expectations is how a regression net stops catching anything. The contract is transport-neutral: `identity:authz-resource`, `identity:authz-action` and the scopes the authentication step already established. Resource identifiers are the canonical management paths, so the table stays whole rather than being split into "paths here, scopes there". `GranularScopeGuardProcessor` is now a thin wrapper that names resource and action, and Core falls back to `redbHttp.Path` / `redbHttp.Method` when nothing states them, so the path is never carried twice. The route is registered unconditionally: a facade calling an address that is not there would fail open, which is the one direction an authorization gate must never fail. - **Management controllers moved into their own package, `redb.Identity.Management`.** 33 files, 142 actions, and not one line of business logic: every action validates its DTO and forwards to a `direct-vm://identity-manage-*` route. They lived in the HTTP facade, where a second transport could not reach them without breaking the Phase 8 isolation. Now the facades reference the package rather than each other, and the package references no Core, so that isolation still holds. SCIM deliberately stayed in the HTTP facade: RFC 7644 is defined over HTTP, and `ScimControllerBase` reads `redbHttp.Url` to build `Location` headers. Moving it would have carried HTTP semantics into a transport-neutral package for a surface that does not exist off HTTP. Nothing breaks for consumers: same types, only the namespace changed (`redb.Identity.Http.Controllers` → `redb.Identity.Management.Controllers`). The suite after the move is identical to the baseline before it. ### Fixed - **A duplicate is a conflict, not a database outage.** The builder-level `DbException` handler treated every database error as transient: a unique-constraint violation was retried three times with backoff — it collides on the third attempt exactly as on the first — and then answered `503 "Database temporarily unavailable"`, telling the caller to come back later about something only they can fix. It now answers `409` with `error: duplicate`, the same vocabulary the management processors already use, while real outages keep their retries and their 503. Surfaces that catch unique violations themselves — applications, claim scopes, bootstrap, idempotency — were always right; users, groups, roles and SCIM fell through to the handler and were not. Found through a SCIM demo that reused one e-mail address and was reported as a database outage, which is where the hunt started instead of ending. - **A refusal that arrived as JSON bytes no longer loses its status.** `MapErrorToGrpcStatus` read only a dictionary body and returned immediately on bytes, without even reaching `redbHttp.ResponseCode`. Core's own processors hand back a dictionary, but the authentication gates and the controller dispatcher hand back serialized JSON — their refusals were reaching callers as successful calls. The response code is now always read, and the body is parsed in either shape. - **The controller error table moved to `redb.Identity.Management`.** It lived inside the HTTP facade; a second transport needs the same verdicts, and two copies of a refusal table drift towards "one accepts what the other rejects". - **README and `doc/DEPLOYMENT.md` documented an option that does not exist, and lied about its default.** The real name is `UsePropsSigningKeyStore` / `PropsSigningKeyStore`; the docs said `UseEavSigningKeyStore` / `EavSigningKeyStore`, which no type matches. The worse half: the default was documented as `true` while the code has `false`, and the verification table even labelled it "(default)". An operator running more than one replica read that a shared JWKS was on out of the box, when replicas in fact diverge on keys by default. Corrected to the fact, with an explicit "off by default, switch it on for multi-replica". Archived documents (`doc/rewiewFix/*`, `doc/webplan/*`, the Phase-8 plan) were deliberately left alone: they are records of finished sprints, and rewriting names inside them would falsify the record. - **Audit DDL now reconciles an existing table instead of silently skipping it.** `CREATE TABLE IF NOT EXISTS` is a no-op when the table is already there, so a database created before a column existed never gained it — and nothing said so. The audit query selects `category` and `login`; on such a database it failed, the route's `DbException` handler retried three times and answered "Database temporarily unavailable", which reads as an outage rather than a schema gap. The two `CREATE INDEX` statements on those columns failed on every startup for the same reason, and the init listener logged the error and continued in degraded mode. The PostgreSQL and MSSQL scripts now add missing columns idempotently before the indexes, and Postgres additionally repairs two types that drifted after the first release: `details` jsonb → text (the dialect-agnostic parameter binding passes strings, and jsonb refuses them, so every audit write failed) and `user_id` varchar → bigint — the latter only when every existing value is numeric, otherwise the table is left alone with a notice, because nulling unparseable identifiers is a data loss nobody agreed to. Both conversions are guarded on the current type and cost a current database nothing. SQLite cannot express conditional DDL, so its script documents the two hand-migration statements instead of pretending. Found on the shared test database, where the drift had accumulated: the audit query had been answering 503 there, and three `AuditCompletenessFullCycleTests` failed on PostgreSQL because of it. ### Documentation - **A demo for the gRPC facade, in the same `run_all.ps1` gate as the other 61.** `demo_grpc_facade.ps1` drives ten steps against a live worker with an `@grpc/grpc-js` client running in a container, so the calls come from a stack that shares no code with ours: health, discovery, a client registered over HTTP getting its token over gRPC, introspection, a refusal arriving as `UNAUTHENTICATED` with an `invalid_client` trailer, and the management gate refusing without a token and admitting with one. Its last step closes the facade's acceptance criterion, which no test could: one token, two transports, the same verdict. A client holding `identity:users:write` is admitted over both; a client holding only `identity:users:read` is refused the write over both. In tests this was blocked because the HTTP and gRPC fixtures are separate stacks with separate registries — on a worker they are one server, so the token is literally the same one. The earlier decision to ship no demo was recorded as deliberate; it was not. It rested on an incomplete list of options — PowerShell cannot speak gRPC, and a .NET client against our own listener proves only self-consistency — while the container client that made it possible was already running in the interop tests at the time. - **Package README for `redb.Identity.Grpc`** - both surfaces, the deliberate boundaries (browser flows, DPoP, self-service), every configuration key with its default and the reason for it, message shape, the status and trailer tables a caller has to read, correlation ids and idempotency, the envelope fallback, TLS/mTLS, the forty management operations with their payload shape, and splitting the ports for production. - **`redb.Identity/README.md`** - the "planned" gRPC snippet replaced by the real route, the package added to the project structure, and an `identity.v1.Identity` section in the endpoint catalogue. - **Interop fixture extended** (`C:\Work\yaml\grpc`): the published `identity.v1.proto` and an `@grpc/grpc-js` client generated from it, so the facade is proven by a stack that shares no code with it. Covers a real token, a refusal read as `UNAUTHENTICATED` plus an `invalid_client` trailer, and a `google.protobuf.Struct` decoded by a runtime that never saw our codec. ### Notes - Browser flows (`authorize`, login, consent, MFA pages, device verification) and DPoP stay on HTTP by design, not by omission: the former need a browser, redirects and a cookie session; DPoP binds its proof to an HTTP method and URL per RFC 9449. Recorded as boundaries in `doc/gRPC/README.md`. - `redbHttp.Method` is deliberately **not** synthesised by the facade. Core reads its absence as "this caller is not a browser" — synthesising it would flip `authorize` into emitting 302 redirects. ## [3.6.0] — 2026-08-13 > Ships with the ecosystem. The minor comes from `redb.Route`; the change below is Identity's own, > and the rebuild additionally carries the redb.Core tree-scope fix into every deployment. ### Security — atomic e-mail uniqueness (register / bootstrap) `RequireUniqueEmail` was enforced by a check-then-insert: `GetUsers(email)` → `Reject(409)` → `CreateUser`. Between the check and the insert two concurrent registrations could both see "no match" and both write the same address, so `RequireUniqueEmail` did not actually hold under concurrency (login was already atomic via its relational UNIQUE; e-mail was not). - **`UX_users_email` — a partial unique index on `_users(_email)`** (`WHERE _email IS NOT NULL`), created per-dialect by `IdentityUniqueIndexesInitListener` alongside the existing `_objects` indexes. This is the atomic DB guarantee — the check-then-insert is now only a fast, deterministic early error, not the enforcement. Partial (skips null e-mails, of which there are many) so it also works on SQL Server, whose plain UNIQUE allows only one NULL; `_email` is `NVARCHAR(450)` there, so it indexes on all three dialects (unlike the `_value_string` indexes that stay Postgres-only). - **E-mail normalised to lower-invariant + trimmed** before the check and the insert (`AccountRegisterProcessor`, `BootstrapAdminProcessor`). Without it a plain index on `_email` would treat `A@x.com` and `a@x.com` as distinct; normalising makes the stored value canonical so the index (and `EmailExact` lookups) enforce one identity. - **Index violation is surfaced as `409 duplicate`**, not a `500`: `AccountRegisterProcessor` catches a `UX_users_email` unique-violation (message or inner-exception) — the same shape login already used for its "already taken" 409. The loser of a register race now gets a clean duplicate error. ### Removed — debug scaffolding in the register hot path `AccountRegisterProcessor` carried a per-exchange stopwatch with ~25 `__arMark(...)` calls (the `Console.WriteLine` was commented out, so they were no-ops) **and a VERIFY block that issued two extra `GetUsers` queries after every `CreateUser`** just to feed those no-op logs. Removed both — two fewer DB round-trips per registration and no dead diagnostics in the hot path. `PasswordForgotProcessor`'s commented `[Diag-PF]` lines cleaned up too. ## [3.5.1] — 2026-08-07 **No changes in redb.Identity itself — a rebuild that re-pins the dependency on `redb.Route`.** `redb.Identity.Core` 3.5.0 pins `redb.Route.Http` **3.5.0**, the build that still contains `SharedHttpServerManager` privately; `redb.Route` 3.5.1 moved it into `redb.Route.Http.Hosting` so HTTP-based connectors can share one Kestrel per `host:port`. Identity is an HTTP-facing product hosted next to other connectors inside a Tsak worker, so a stale pin here is not academic: with the old `Http`, an AS2 endpoint and the OIDC facade could not sit on the same port, and NuGet would not have corrected it on its own (`redb.Route.As2` depends on `Http.Hosting`, not on `Http`). Nothing else changed — same code, same behaviour, rebuilt on `redb.Route` 3.5.1 and `redb.Tsak` 3.5.1. `redb` core stays 3.5.0: it does not reference `redb.Route` at all. ## [3.5.0] — 2026-08-05 **No changes in redb.Identity itself — a rebuild onto redb 3.5.0 / redb.Route 3.5.0 / redb.Tsak 3.5.0**, released with the ecosystem. The dependency refresh is the point. Identity runs as `.tpkg` modules inside a Tsak worker, and that worker loads the redb framework from its shared layer, which is gated on the **minor** version — so an Identity built against 3.4.0 cannot be hosted on a 3.5.0 runtime, and vice versa. Rebuilding also carries two redb.Core correctness fixes into every Identity deployment: a props-cache entry that could be served stale after in-place mutation, and `RedbHash` being order-dependent for `Dictionary` properties (both detailed in the root `CHANGELOG.md`). Identity stores clients, users and signing keys through that same layer, so neither is academic here. ## [3.4.0] — 2026-07-27 > **Why the jump from 1.2.2 to 3.4.0 — aligning with the ecosystem, not a breaking rewrite.** > Until now redb.Identity carried its own **1.x** line while the rest of the stack (`redb` core, > `redb.Route`, `redb.Tsak`) moved together on **3.x**. Running two numbering schemes made "which > Identity works with which core/Route/Tsak" a lookup instead of a glance. From now on redb.Identity > **shares the ecosystem version**: it jumps straight to **3.4.0** to sit on the same number as the > `redb.Route` 3.4.0 it is built against, and every future ecosystem release bumps Identity with it. > > This is a **version realignment, not a semver-breaking release** — there are no breaking API changes > here (the only feature, JAR, is off by default and additive; see below). The major digit changes > because the number is now the ecosystem's, not because Identity's contract broke. The old 1.x tags > remain valid history; 3.4.0 simply continues the same package on the shared number. ### Added - **JWT-Secured Authorization Request — JAR (Z7 / RFC 9101), off by default.** `/connect/authorize` now accepts a signed authorization request, gated behind `Features.EnableJar` (default `false`, so every prior release behaves identically — a `request` parameter is still answered with `request_not_supported`). When enabled: - a signed **`request`** object (inline) or **`request_uri`** (by reference, fetched over HTTP) is verified against the client's registered keys, and the parameters inside the JWT take precedence over the query string (RFC 9101 §6.1); - **`alg: none` is never accepted** — an unsigned request object drops the integrity guarantee JAR exists for; nor is a wrong-key signature, a mismatched inner `client_id`, an expired object, or (when the client declares `RequestObjectSigningAlg` under `JarEnforcementMode=Enforce`) a mismatched algorithm. Every failure is `invalid_request_object`; - **`request_uri` fetches are SSRF-guarded** (`OutboundUrlGuard`) and size/timeout-bounded; PAR's `urn:ietf:params:oauth:request_uri:*` is left untouched; - discovery advertises `request_parameter_supported`, `request_uri_parameter_supported` and `request_object_signing_alg_values_supported` — **only when JAR is on**, so discovery never promises what the endpoint won't do. - The formerly write-only client fields `RequestObjectSigningAlg` etc. now do something (see below). - New config: `JarOptions` (`Jar` section) — enforcement mode `Off`/`LogOnly`/`Enforce`, allowed algorithms (asymmetric only), clock skew, size limits, and the `request_uri` SSRF knobs. - Implemented as OpenIddict server handlers (`ValidateRequestObjectHandler`), replacing the built-in handlers that unconditionally rejected `request` / `request_uri`. 15 handler tests + a live conformance demo (`demo_jar_request_object.ps1`, wired into `run_all`). - **Client public-key resolver — `IClientKeyResolver`** (Z7 / RFC 9101, phase 1). Resolves the keys that verify what a **client** signed: a JAR request object and a `private_key_jwt` assertion. Two sources — the inline `ApplicationProps.JsonWebKeySet`, or `JwksUri`, fetched and cached via `ConfigurationManager` (background refresh on a TTL plus a rate-limited forced refresh on a `kid` miss, so a client rotating its keys does not break sign-in until the TTL expires). - **Fails closed.** An unreachable or malformed JWKS yields no keys, so there is nothing to verify against and the caller rejects. "Could not check" is never treated as "valid". - **A configured-but-broken inline JWKS does not fall back to `jwks_uri`.** A typo in the pasted key set must stay visible instead of being masked by a silent switch to another key source. - **Asymmetric algorithms only.** HMAC (`HS*`) is impossible: `ClientSecret` is stored as a BCrypt hash and verifying an HMAC needs the original secret. FAPI 2.0 forbids `HS*` for request objects anyway. - The service is **inert** for now — registered but called from no path, so server behaviour is unchanged. Wiring it into JAR is phase 2; into `private_key_jwt`, a separate step. - **`OutboundUrlGuard` — SSRF filter for URLs that arrive from outside** (`jwks_uri`, later the JAR `request_uri`). Rejects anything that is not an absolute HTTPS URL, and anything resolving to a non-public address: loopback, RFC 1918, link-local — including `169.254.169.254`, the cloud metadata endpoint that hands instance credentials to whatever can reach it — CGNAT, IPv6 unique-local, and the IPv4-mapped forms (`::ffff:10.0.0.1`) that a naive check walks straight past. The check runs **before** a socket is opened. Known limitation: this does not close DNS rebinding, which would require pinning the validated address onto the connection itself. - **`ClientKeysOptions`** (`ClientKeys` section of `RedbIdentityOptions`) — cache lifetime, minimum refresh interval, fetch timeout, maximum document size, `RequireHttps`, `AllowPrivateNetworkTargets`. The last two are development-only relaxations. - **40 tests** (`tests/Security/`): 29 for the SSRF guard — including one asserting that 172.32 and 172.15 are public and must NOT be blocked — and 11 for the resolver. All stay offline: attempting a network call fails the test by itself. ### Docs - **`doc/JAR_RFC9101_PLAN.md`** — JAR implementation plan: six phases, risks (SSRF, `alg:none`, algorithm substitution), a staged `Off → LogOnly → Enforce` rollout, and sizing. Records a verified finding: **OpenIddict 6.3.0 does not support request objects** — its assembly carries `ValidateRequestParameter` and the `request_not_supported` string, but nothing that parses a request object or checks its signature — and `request_uri` exists only as a PAR URN. `Z7` now links here. - `ApplicationProps.RequestObjectSigningAlg` is **now enforced** under `JarEnforcementMode=Enforce` (was previously stored and ignored). `...EncryptionAlg` / `...EncryptionEnc` remain stored-only — request-object encryption (JWE) is the deferred phase 4. `JwksUri` is now resolved (phase 1). ### Conformance impact (OpenID Foundation Basic OP) Advertising JAR changed the local Basic-OP run from **1 SKIPPED / 4 REVIEW** to **2 SKIPPED / 3 REVIEW** — still **0 FAILED**. This is a net improvement, not a regression, and `OPENID_CERTIFICATION.md` §4.3 explains it in full for anyone reading the badge: - Both SKIPPED modules test the **unsigned (`alg:none`) request object**. The suite skips them when the server does not advertise `none` in `request_object_signing_alg_values_supported` — which is exactly our stance: we support **signed** request objects only, because `alg:none` is an unsigned JWT that defeats JAR's integrity guarantee and is forbidden by FAPI 2.0. SKIPPED here = "the server declined an unsafe mode", the secure answer. - One module (`ensure-request-object-with-redirect-uri`) moved REVIEW→SKIPPED precisely *because* the server now genuinely processes signed request objects and advertises that honestly, instead of the earlier no-support state that sent it down a screenshot path. Turning either skip into a pass would require accepting `alg:none` — a security regression we will not make. Path: redb-identity/changelog/CHANGELOG-4.0.x.md Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity Page: https://redbase.app/src/dev-2026-12-06/redb-identity/changelog/CHANGELOG-4.0.x.md ---- # redb.Identity changelog: 4.0.x Releases of the 4.0 line, moved here unchanged from CHANGELOG.md, which keeps the latest released line only. Newer releases: [CHANGELOG.md](../CHANGELOG.md). ## [4.0.1] — 2026-09-18 ### Security — the management surface no longer trusts a transport The core management routes — `direct-vm://identity-manage-*`, `identity-manage-mfa`, `identity-me-*`, `identity-scim-*`, `identity-revoked-sids` — never see a bearer token themselves. Each facade (HTTP, gRPC, SOAP) validates it on the `identity-auth-management` hop, which leaves `identity:management-scopes` and its siblings on the exchange, and forwards. The core routes carried no gate of their own: the design assumed that whoever reaches `direct-vm` is one of our facades. `RequireSelfOrAdminProcessor` (the B8 IDOR rule on `identity-manage-mfa`) wrote that assumption down and acted on it — an exchange without a management context was admitted as an "internal trusted caller", on the reasoning that `direct-vm` is not network-reachable. That reasoning does not hold in a Tsak worker: the `direct-vm` registry is one per process and shared by every module loaded into it. Any module could send to `identity-manage-users` and administer users, or to `identity-manage-mfa` and reset anyone's MFA, with no token and no context — the routes ran the business processor and answered. Nothing in the route DSL said so; the trust was inferred from the absence of a property. Every route on that surface now starts with `RequireManagementContextProcessor`: no `identity:management-scopes` on the exchange, no idempotency lookup, no transaction, no business processor — a generic 403 `not_authorized` (the same Problem Details every gate on the surface answers with, so nothing about the target leaks) and a warning on the security log naming the route and the operation. `RequireSelfOrAdminProcessor` refuses the same exchange too, so the rule holds even on a route without the gate. There is deliberately no in-process bypass and no option to declare one: an in-process module that needs the management surface obtains a context the way the facades do — a token with the scopes it needs, validated on `identity-auth-management`. Trust is a property of the exchange, established by that hop, never of the transport. `direct-vm` is a transport like the others. The facades are unaffected: their exchanges already carry the context, and `Exchange.CreateChild` copies it into the child exchanges the management controllers and SCIM bulk create. Tests that send to the core routes directly now say which caller they play (`ManagementCaller.Admin` by default on the fixtures — the fixture stands in for a facade that validated a bearer — and `ManagementCaller.None` to probe the gate). `ManagementSurfaceGateTests` sends to every constant of the guarded surface without a context and expects the 403; run against the previous code, the management routes answered 500 (the business processor had already run and choked on the empty body), the self-service routes 401 from their own caller check, `identity-manage-roles` and `identity-revoked-sids` answered as if nothing were wrong, and `RequireSelfOrAdminProcessor` let the exchange through. All of that is now the one 403. ### Changed — the test gate runs all three test projects The Identity gate used to be `redb.Identity.Tests` alone. The solution carries two more test projects, `redb.Identity.Client.Tests` (the SDK) and `redb.Identity.Web.Tests` (the BFF), and nothing ran them: that is how `RevokedSidsPollHostedServiceTests` stayed red from July, `DevTlsContractTests` from May, and `UsersClientTests.SearchUsers_GETs_with_query` from June — the last one stale since the non-paginated search moved onto the paginated endpoint (page size 200, `PagedResult` on the wire); the test still stubbed a bare array and the old URL. Brought to the current contract. `scripts/test-gate.ps1 -Provider sqlite|postgres|mssql` now runs the three projects and prints one summary; the matrix is the three invocations in parallel, as before. Client and Web tests touch no storage and add about three seconds. Documented commands updated; the BFF tests are now part of the gate. ### Changed — Web component tests on bUnit 2 `redb.Identity.Web.Tests` pulled `AngleSharp` 1.2.0 through `bunit` 1.40.0, and every build flagged it with `NU1902` for CVE-2026-54570 (mXSS in the HTML5 parser, patched in 1.5.0). Pinning a patched AngleSharp directly does not work — 1.5.0 and 1.8.1 were both tried — because bunit 1.40 is compiled against the 1.2 API and fails at runtime with `MissingMethodException` (`IHtmlCollection.get_Item`). The test project now uses bunit 2.11.3, which depends on AngleSharp 1.8.1; the warning is gone without any pin. The migration touched one file, `Phase3ComponentTests` (seven tests): the base class is `BunitContext`, components render through `Render()`, and the interaction helpers take `IRenderedComponent` in place of the removed `IRenderedFragment`. Queries and event dispatch (`FindAll`, `Change`, `Input`, `Click`, `Markup`) carried over unchanged, and every assertion is the same — the tests that check the exact request a form sends (`Owner == "application:5"`, blank optionals as `null`) pass only if the events really reach the components. Test-only change; `redb.Identity.Web.Tests` 54/54. ### Changed — Identity.Web on the ASP.NET packages of its own framework `redb.Identity.Web` targets `net10.0` but pinned `Microsoft.AspNetCore.Authentication.OpenIdConnect`, `…Authentication.JwtBearer` and `…Components.Authorization` at 9.0.0 — packages of the previous major on a 10.0 application. Nothing failed, but those three were the whole reason the BFF resolved `Microsoft.IdentityModel` 8.0.1 while the rest of Identity and the Tsak worker run 8.16.0. The two authentication packages now follow the TFM (`Microsoft.AspNetCore.Mvc.Testing` in `redb.Identity.Web.Tests` likewise); `Components.Authorization` is not raised but dropped — the SDK reports it framework-provided (`NU1510`), so the reference only ever added a version to argue about. The two IdentityModel roots the handlers actually use — `Microsoft.IdentityModel.Protocols.OpenIdConnect` and `System.IdentityModel.Tokens.Jwt` — are pinned at 8.16.0 the way `redb.Identity.Http` pins its own. One IdentityModel version across Identity. The BFF is a separate process, so this is hygiene rather than a runtime fix — but the code that validates the OP's tokens in the BFF now runs on the same library revision as the OP that issues them. The patch is 10.0.9, not the current 10.0.12, and that is a choice: from 10.0.10 the authentication packages require `Microsoft.IdentityModel` ≥ 8.19.2, so on 10.0.12 a pin at 8.16.0 is a downgrade (`NU1605`) and the ecosystem would split again — Web on 8.19.2, everything else on 8.16.0. 10.0.9 is the newest patch that still ships against 8.0.1, where 8.16.0 is an upgrade. Checked before choosing: the IdentityModel notes for 8.17–8.19.2 and the ASP.NET Core 10.0.10–10.0.12 releases carry no CVE for the authentication handlers; Microsoft's bump was a routine dependency refresh. The pin has a shelf life — the next ASP.NET patch Web takes will demand ≥ 8.19.2 — and moving the whole ecosystem to 8.19.2 is the planned follow-up, host first, then Identity. `Microsoft.AspNetCore.DataProtection` 9.0.4 in Core, Http and DataProtection stays: on `net10.0` it resolves to the shared framework's assembly — nothing of that version is copied into the module bin or the `.tpkg` — so the pin only steers the `net8.0` / `net9.0` targets of the libraries and no 9.0.4 assembly reaches the worker. Running `redb.Identity.Web.Tests` for this change found `RevokedSidsPollHostedServiceTests` red since 2026-07-12, when a change made the poll exit before its bootstrap call when no `Identity:BackchannelClient:ClientSecret` is configured — intentional: the poll is a cluster feature behind a service-account secret — but the tests built their options without one, so the service never called and the first test has failed on every run since. The second test could not fail at all: with no poll there was no exception to swallow, and every assertion still held. Nobody noticed because these tests are not part of the gate. The tests now configure the secret, wait for the poll to have been attempted (bounded at five seconds, in place of a fixed 50 ms that only ever worked by timing), and the swallow test asserts the poll actually ran. A third test pins the intentional behaviour: without the secret the service makes no call at all. The same run showed `DevTlsContractTests` red: `appsettings.Development.json` carried `"RequireHttpsMetadata": false`, which the contract test forbids in committed configuration because it switches off the https requirement for the OIDC discovery document. The flag was a leftover of the `http://localhost:5002` dev loop; a later change moved the dev authority to `https://host.docker.internal` and made the `false` unnecessary — the certificate side of that loop is handled by `AcceptAnyBackchannelCert`, a separate and explicitly dev-only switch, not by this flag. The development config now says `true`; the dev loop is unchanged. The shipped `appsettings.json` had the same `false`, and that one is not a dev convenience — it is the default of every deployment, overriding the code default of `true` for anyone who does not set the key themselves. It now says `true`, and `DevTlsContractTests` gained a test on the shipped file so the two configs cannot drift apart again. A deployment that really talks to an `http://` authority sets `false` explicitly for itself; the default no longer does it for everyone. ### Security — a DPoP proof can no longer be consumed twice at once `RedbDpopReplayStore` decided replays by lookup-then-insert, and nothing on the row was unique. Two presentations of the same proof racing past the lookup both inserted and both were told "reserved" — RFC 9449 §11.1 asks for at most once, and the store delivered it only when the presentations were far enough apart. The move to `ExecuteAtomicAsync` changed nothing here, and the class comment promising that "the database row uniqueness constraint prevents both inserts" described a constraint that did not exist. The reservation now carries `ValueUnique = SHA-256(jkt|jti)` — the derivation the idempotency record already uses, because `jti` is client-chosen and unbounded while `ValueUnique` is capped at 440 characters. The index decides: the loser of a race gets `RedbUniqueViolationException` and is refused as a replay. The lookup stays as the fast path, so an already-consumed proof is refused without a failing statement, and an expired reservation is refreshed in place rather than inserted a second time — a second insert would hit the key and misreport a stale row as a replay. The core runs the insert under a savepoint, so a violation inside the transacted token route leaves the route's transaction intact. Rows written before the key existed carry none; the lookup still finds them and the cleanup timer removes them within one TTL. Pinned by `DpopReplayStoreAtomicityTests` on all three providers: sixteen simultaneous presentations reserve exactly once and leave exactly one row, the plain second presentation is refused, and an expired reservation is taken again without a duplicate row. Run first against the old store, the same tests showed how wide the gap was: all sixteen presentations were accepted, not one or two — under concurrency the lookup protected nothing — and the expired path left two rows behind. ### Changed — the deletion helper's dead `batchSize` is gone `IdentityDeletionHelper.DeleteAsync` kept an `int batchSize` on all four overloads after the helper stopped handing the batch to the background service; it was accepted and ignored. Removed, together with the seven call sites that passed one. Purge batching is the background service's own concern; the cleanup processors keep their page sizes for the `Take(...)` that selects what to delete. Comments in two stores and two other places that still described the route transaction as `BeginRedbTransaction` were brought up to date. The `CS0618` warnings about that method in the Identity solution build come from `redb.Route.Core/Xml/RedbXmlContributions.cs`, which is compiled as a project reference — Identity itself no longer refers to it. ### Fixed — audit tests no longer race the provider matrix The full gate starts the sqlite, postgres and mssql suites as three processes against one machine and one set of brokers, staggered by seconds rather than isolated. Two audit suites were written as if they owned the box, and they only stayed green while the timing held. `AuditIbmMqIntegrationTests` published to the same `DEV.QUEUE.3` from all three processes and then took whichever message arrived first. Both halves of that race show up in the full-run logs: a run receives a sibling's message (`Expected eventType to be "TestWmqFields", but "TestWmqDirect"`), and the sibling, whose message was eaten, waits out its 15-second timeout. The per-test drain cannot help — it runs before the sibling publishes — and the eventType cannot tell the processes apart, because all three publish the same types. Each provider now gets a queue of its own (`DEV.QUEUE.1/2/3`, pre-created by the developer image), and within a process the receive accepts only its own eventType, so a late message from the previous test is skipped rather than mistaken for this test's event. Skipped messages are reported on stderr instead of vanishing quietly. `AuditCompletenessFullCycleTests` waited a flat two seconds and then queried the audit catalog once. The query helper looked like a retry loop but was not one for this purpose: it polled only while the response was unsuccessful and returned an empty list the moment the endpoint answered 200 with no rows — which is the normal first answer, since the row is written by a WireTap branch that finishes after the response the caller already has. Under three concurrent suites two seconds stopped being enough. The helper now polls until the row appears, on the same ceiling, and reports how long it waited: on success, the attempt and elapsed time when the row was late; on failure, that nothing arrived after ten attempts. A future failure therefore says whether audit is slow or absent instead of leaving that to be guessed. Neither change touches the product, and neither weakens an assertion: with the emission broken, both suites still fail. That was checked the other way round as well — with the eventType filter removed and foreign messages arriving during the receive window, the MQ test fails exactly as the gate logs show it failing. ### Fixed — a database outage no longer retries forever The `DbException` handler declared `MaximumRedeliveries(3)` next to `RetryWhile(e => !IsUniqueViolation(...))`, and those two do not add up the way the pairing suggests: `RetryWhile` does not narrow the ceiling, it **replaces** it. `OnExceptionProcessor` evaluates the predicate *instead of* the attempt count, inside a loop with no outer bound. A predicate that only asks "is this not a unique violation?" answers yes to every ordinary connection error, so a real outage was retried without end — and because the delay doubles each round (200 ms, 400, 800…), the route stopped answering altogether rather than returning the 503 it was supposed to return. The predicate now carries the bound itself: it retries while the error is not a unique violation **and** `CamelRedeliveryCounter` is below the limit. Both the ceiling and the predicate read one constant, so they cannot drift apart. `MaximumRedeliveries` stays as the documented policy and as the bound that applies if the predicate is ever removed. The defect was invisible until redb.Route started passing the full handler configuration through (redb.Route 4.0.1): before it, `RetryWhile` never reached the processor and the count check ran. So Route did not break this — it stopped hiding it. Pinned all along by `ErrorHandlingPipelineTests.TransientDbErrors_AreRetried_ButABoundedNumberOfTimes`, which is exactly the test that hung on all three providers. ### Changed — SQL audit targets take `:#name` parameters The `sql:` connector now writes parameters the Camel way, `:#name`, and no longer reads `@name` as one: `@` reaches the database untouched, because it collides with T-SQL and MySQL variables (redb.Route 4.0.1). There is no transition period — an audit target still carrying the old syntax stops writing rows and fails with a database error instead. Operators with a `sql:` audit target must update its `Uri`: `VALUES(@event_id, …)` becomes `VALUES(:#event_id, …)`. The `param.*` bindings are untouched and casts still work (`:#details::jsonb`). Identity's own relational audit sink does not go through the connector, so only operator-configured `sql:` targets are affected; the suite's target and the sample in the test `appsettings.json` were updated here. ### Changed — route transactions now ride the ambient scope `WithRedbTx` used to pair `.Transacted(TransactionPolicy.Suppress)` with `BeginRedbTransaction(name)`: the wrapper supplied the commit/rollback boundary while the redb transaction was opened explicitly, because the core rejected an explicit transaction whenever an ambient scope was active. redb 4.0.1 inverted that — redb enlists into the ambient `TransactionScope` through its `AmbientConnectionRegistry` — and `BeginRedbTransaction` is now `[Obsolete]`. Identity's wrapper is plain `.Transacted(...)`, and the scope owns commit and rollback. This changes what a processor may do inside a transacted route: `redb.Context.BeginTransactionAsync()` throws there, and the core points at `ExecuteAtomicAsync`, which joins the ambient transaction instead. `RedbDpopReplayStore` is the one place where that actually bit — DPoP replay reservation runs on the token route, which is transacted — and it now uses `ExecuteAtomicAsync`. Its old mid-logic `RollbackAsync` was wrong under an ambient scope for a second reason: a replayed proof must fail the request, not undo everything the route did before it. The scope timeout is stated explicitly (2 minutes) rather than inherited: this scope spans Argon2id plus the whole OpenIddict pipeline on the token route, and the framework default of 30 seconds sits uncomfortably close to that under load. Eleven other call sites still open their own transaction (`MfaVerifyProcessor`, `MfaRecoveryProcessor`, both WebAuthn processors and six token stores). None of them sits on a transacted route today, so none of them breaks — but any route that gains `WithRedbTx` later will break them at runtime with a green build. They are listed here rather than migrated silently. Worth knowing about the test suite: no fixture configures `RedbInstanceName`, and without it `WithRedbTx` returns the route unwrapped. Route transactions are therefore inert under test and live only in a real deployment, where `context.json` sets the name — so this change was verified against a running instance, not by the suite. ### Fixed — a deletion inside a route transaction no longer runs on a second connection Every Identity deletion goes through `IdentityDeletionHelper`, and it handed the mark to `IBackgroundDeletionService.DeleteAsync`. That method opens a DI scope of its own — a second connection — and marks there. Under a route-level transaction (`WithRedbTx`, live whenever `RedbInstanceName` is configured, which is every Tsak-hosted deployment) the two connections fight over the same rows: on SQLite the mark waits on the writer lock the route holds and dies on the busy timeout, about 35 seconds later; on PostgreSQL and MSSQL it either blocks on rows the route has already written, or commits on its own — so a route that failed after the delete rolled back everything **except** the deletion. Reached through manage-scopes, manage-users, manage-tokens, manage-groups, manage-claim-mappers, manage-claim-scopes, manage-federation-providers, scim-users and scim-groups. The mark now runs on the caller's `IRedbService` and joins whatever transaction it is in (`SoftDeleteAsync` goes through the core's `ExecuteAtomicAsync`). Nothing is handed to the background service and nothing needs to be: it polls for trash containers and finds the one written above by itself — its `EnqueuePurge` has been a no-op ever since the polling loop replaced the channel, and the `batchSize` it was passed never reached the mark either. When no background service is registered the warning stays: objects are marked and hidden from queries, but no physical purge will run. Pinned by `DeletionHelperTransactionTests` on all three providers: the mark rolls back with the caller's transaction, commits with it, and still works with no ambient transaction at all. Proven red on the unfixed code — 35 s per test on SQLite (the writer-lock timeout), a surviving trash row on PostgreSQL. The cleanup tests that asserted the old path were rewritten rather than deleted, and their `DidNotReceive` assertions moved onto `SoftDeleteAsync`: the background service is now never called, so an assertion on it would have passed even if an object had been deleted. Requires redb 4.0.1 or later (the trash-lock fix); the PostgreSQL and MSSQL modules it carries are applied at startup. ### Changed — Microsoft.IdentityModel 8.16.0 `redb.Identity.Core` pins `Microsoft.IdentityModel.Protocols.OpenIdConnect` 8.16.0 (was 8.4.0), and `redb.Identity.Http` references `Microsoft.IdentityModel.Abstractions`, `Logging` and `Tokens` 8.16.0 directly (OpenIddict.Abstractions 6.3.0 alone resolves 8.4.0). `Microsoft.Data.SqlClient` 7.0.3, which `redb.MSSql` ships, needs 8.16.0, and the Tsak worker pins it, so the Identity packages and the host they run in ship one version. No code change. ## [4.0.0] — 2026-09-12 ### Security — reserved header strip extended to the gRPC and SOAP facades The 2026-09-09 fix removed the internal-only header names a caller must never supply on every HTTP route. The gRPC connector copies caller metadata and envelope headers into the exchange the same way, and the WS-Trust listener is HTTP underneath — neither facade stripped anything, and both reach the audited `Token` / `Introspect` / `Revoke` routes, so a gRPC or SOAP caller could still sign the audit log with another user's id, a fabricated address and agent, or a foreign `client_id` by sending them as metadata or request headers. (The session names were harmless there only because those transports never reach the authorize, logout or consent routes.) The list now lives once in `IdentityReservedInboundHeaders` (Contracts) and every facade strips it as its first step. `operation` is HTTP-only: on the gRPC envelope route the caller names the operation by design. Audited in the same pass and found sound: `/me/*` and the management API carry the caller's identity in exchange properties (`identity:management-*`), which no transport fills from the wire; SCIM filters are parsed into a typed criteria object with whitelisted attributes and operators. ### Fixed — audit attribution: client_id for form-authenticated clients, timestamps on SQLite `MapHttpToIdentityHeaders` documented two sources for the `client_id` / `client_secret` headers — Basic authentication and the form body — but implemented only the first. Token issuance never noticed (OpenIddict reads client credentials from the body itself), the audit envelope did: `EventDispatchProcessor` attributes events by the `client_id` header, so every client authenticating with form credentials — public PKCE clients included — was audited with `client_id` NULL. The form step now exists (Basic wins when both are present; the body is parsed, not replaced). The SQLite audit table declared `timestamp TEXT` and expected an RFC 3339 string, while the redb SQLite provider encodes every `DateTimeOffset` parameter as a Julian day number: the number landed in the TEXT column as text, the query layer failed to parse it back (every row read as `0001-01-01`), and `from`/`to` filters compared text to a number. The column is `REAL` now, matching the provider's `_date_*` convention. No migration is shipped: SQLite has no conditional DDL and the table is created per file — drop existing SQLite audit files (or the table) before upgrading. ### Security — an HTTP header could impersonate any user, and the consent page trusted its own URL Two findings from the 2026-09-09 facade audit, both fixed. **Session identity was trusted from a request header.** The HTTP consumer copies every request header into the exchange verbatim, and Identity carried the logged-in user between processors in those same headers (`session_user_id`, set from the decrypted session cookie by `ReadSessionCookie`, which returned without clearing anything when no cookie was present). `AttachSessionPrincipalHandler` then read `session_user_id` and built the principal from it. So `GET /connect/authorize?...` with a header `session_user_id: ` — no cookie, no password — minted an authorization code for that user; the same header forged consent and logged other users out. A `StripReservedInboundHeaders` pass now runs first on every HTTP route (from `PropagateCorrelationId`, so no route can forget it) and removes the internal-only names a client must never supply — `session_*`, `reauth_marked_sid`, `client_id`, `client_secret`, `access_token`, `operation`, and the audit trio `user_id`, `ip_address`, `user_agent` — leaving only the trusted processors (cookie, `Authorization` header, Basic/body, request path) to populate them. In-process `direct-vm` callers are unaffected: the strip is at the HTTP edge, which is the untrusted boundary. The audit trio deserves its own sentence. `EventDispatchProcessor` reads `user_id`, `ip_address` and `user_agent` from the WireTap copy of the business exchange — the same headers — and nothing trusted ever set the latter two, so the security log's address and agent columns were either empty or whatever the client typed into a header, and its user column could be pointed at someone else. For HTTP-originated events the dispatcher now falls back to the transport-owned, proxy-sanitized `redbHttp.RemoteAddress` and the real `User-Agent`, and the user id comes from the event payload. **The consent page rendered from its own query string.** `GET /consent` showed `app_name` and `scopes` taken directly from the URL, so a link like `/consent?client_id=attacker&app_name=Your%20Bank&scopes=…` displayed the operator's own trusted consent UI attributing an attacker's client to a familiar name — a click on Allow then granted the attacker's client. The page now renders only from a server-signed **consent ticket** (`?ct=…`) minted by the authorization server once it has decided consent is required; app name and scopes come from the ticket, and the grant requires the ticket to have been issued for the current session's user (it cannot be replayed under another session). The console's BFF, which renders its own consent screen and posts with the session cookie, keeps working on the ticket-less, session-bound path. ### Security — the HTTP facade's consent form could be submitted for any user by anyone The facade renders its own login, consent and MFA pages for deployments without the web console. Its consent POST read the consenting user from a hidden `user_id` form field and only fell back to the session cookie when the field was absent, while `ReadSessionCookie` let a request without any cookie continue down the pipeline. Together that meant an anonymous cross-site POST to `/consent` with `client_id`, `user_id` and `decision=allow` recorded a permanent authorization for the named user — no session, no click, no frame: the consent screen the victim would have seen for that client was silently pre-approved (and `decision=deny` revoked someone else's grant the same way). The user now comes from the session cookie only. Without a session the POST is refused with 401 before anything downstream runs; the form and the redirect to `/consent` carry no `user_id` anymore. Two further gaps closed in the same pass. The facade pages set none of the browser-protection headers the web console has always sent, so login, consent and MFA could be embedded in a frame (clickjacking on the consent "Allow" button); every response through the facade's serializer now carries `X-Frame-Options: DENY`, `Content-Security-Policy: frame-ancestors 'none'`, `X-Content-Type-Options: nosniff` and `Referrer-Policy`. And the form POSTs (`/login`, `/consent`, `/mfa`, `/mfa/recovery`) had no cross-site request check: they now refuse a request whose `Origin` (or, failing that, `Referer`) names another site, or is the opaque `null`, with 403 before reading the body. A request carrying neither header is let through on purpose — that is the shape of the web console's BFF (`RecordConsentGrantAsync`), the demo scripts and API clients, none of which a foreign page can drive; browsers always announce the origin of a cross-site form. The session cookie's `SameSite=Lax` default and the frame headers are the other two layers of the same defence. ### Added — access tokens carry an RFC 9068 audience, and the management API checks it Issued access tokens matched the JWT profile for OAuth 2.0 access tokens (RFC 9068) in every respect but one: they had no `aud`. The scope store already served `ScopeProps.Resources` and the admin API let an operator set them, but no sign-in handler ever attached those resources to the principal, so the claim the profile marks REQUIRED never appeared, and the local validation stack never asked for one — any token our server signed was welcome at the management API regardless of what it had been minted for. `AttachAccessTokenResources` now composes the resource indicators at sign-in: the `Resources` of the granted scopes, joined by the application's new `AccessTokenAudiences` (the access-token twin of `IdTokenAudiences`, exposed on the application contracts and the Protocol tab of the console). The server's own audience joins whenever an `identity:*` scope is granted — those scopes are the server's own API — and stands alone as the §3 default resource indicator when nothing else names a resource. It is `{issuer}/resources` unless `RedbIdentityOptions.DefaultAccessTokenAudience` says otherwise. The requesting client's own `client_id` is always an audience as well (as with WSO2, Keycloak and Entra self-scoped tokens): once a token carries audiences OpenIddict admits only audience members to `/connect/introspect` and no longer falls back to the presenter, so without it a client could no longer introspect the tokens it holds. The validation stack behind the management API now requires the server's own audience (§4): a token minted for an external API only is refused with 401, not merely 403 for a missing scope. Deployments that had set `Resources` on a scope will see those values steer `aud` for the first time; a client granted such a scope without any `identity:*` scope gets a token for that API alone and can no longer call the management API with it — which is what the resource assignment meant. Introspection changes with it. Until now no access token carried `aud`, so OpenIddict skipped its audience check at `/connect/introspect` and **any authenticated client could introspect any token** — an oracle that let one client confirm validity and read the claims of tokens issued to another. With `aud` present, OpenIddict admits only audience members (RFC 7662). A client introspecting its own tokens is unaffected (its `client_id` is always an audience). A backend that introspects tokens issued to *another* client — the classic SPA + BFF pair — must now be declared an audience of them: put the backend's `client_id` into the SPA application's `AccessTokenAudiences`, or into the `Resources` of the scopes it serves. The integration fixture does exactly that for its public/confidential pair. ### Fixed — the admin web console could not reach the identity server it sits next to `redb.Identity.Web` was configured with `http://localhost:5002` while the HTTP facade serves TLS on that port, so every backchannel call died with "The response ended prematurely" — discovery, login, federation providers, the revoked-SIDs poll. And the scheme alone would not have been enough: the server's issuer is `https://host.docker.internal:5002` (named so that the OpenID conformance suite, which runs in Docker, can reach the host and match `iss` against the address it called), and an OIDC client's authority must equal the issuer. The console now uses the issuer's own name — which Docker Desktop also maps in the host's `hosts` file, so it resolves from the console too — plus `AcceptAnyBackchannelCert` in the Development profile for the bundled self-signed certificate. ### Fixed — `demo_scim` no longer reports PASS while skipping its own body The demo asked dynamic registration for `identity:admin`, which DCR deliberately never grants, then aimed at the management mount (`/api/v1/identity/scim/v2`) that refuses DCR-obtainable tokens. Having failed to get a token it skipped the entire CRUD body and exited 0 — green in every suite summary, including nights when SCIM writes were actually broken. It now registers with the granular `scim` scope, uses the `/scim/v2` mount like the other SCIM demos, runs all thirteen steps, and treats a missing token as a loud failure instead of a shrug. ### Changed — the contracts now ride in a carrier package of their own, and reloading one module can no longer fork them `redb.Identity.Contracts.dll` used to ship inside `Core.Module.tpkg`. A package's hot-reload force-replaces its own companion assemblies in the worker's tracker, so reloading the core alone handed the new core a new `Contracts` instance while every facade kept the old one — the same CLR type in two copies, and a typed body crossing `direct-vm://` quietly became `null` on the other side: register and SCIM writes answered "Request body is required" with nothing in the log (Tsak F-12). The new `redb.Identity.Contracts.tpkg` is an empty module whose payload is its companion: the one process-wide instance of the DTO assembly. Every other Identity package excludes it and declares the dependency, so the loader's topological sort brings the carrier up first. Reloading core or any facade now leaves the contracts untouched — verified live: after a core-only hot-reload, with no facade touched, register answers 200 and SCIM create 201, the exact calls that used to break. The deployment rule this makes explicit: redeploy the carrier only when the contracts change, and then redeploy every Identity module after it — which a contract change requires in any architecture. ### Fixed — the upgrade-on-login rehash could silently undo a password change that landed after the login The C12 upgrade-on-login rehash runs detached, about a second after the login that scheduled it: Argon2id is slow by design, `Task.Run` adds scheduling, the fresh DI scope adds a connection. An admin password reset fits into that window comfortably — and when the rehash landed last, it wrote the **pre-login** password over the freshly set one. The account silently reverted to exactly the credential the operator had just tried to retire, while the reset call had already answered `success: true`. Measured on a live worker before the fix: nine resets out of nine lost when a login preceded them, three of three kept without one; every lost row still held the old hash in `_users`. Not provider-specific and not redb.Core's doing — pure timing inside `LoginService`, on any database. The rehash is now awaited on the login path, which removes the detached writer altogether: the login answers only after the rehash is on disk, so a later reset writes last and wins by construction. A check-before-write guard alone proved insufficient live — the ~250 ms of hashing sits between the check and the write, and the reset lands inside it. The guard stays as a second layer against other concurrent changers, and the attempt is capped to once per user per process, because the upgrade does not currently converge: the write goes through the core provider's own hasher (BCrypt), so the "upgraded" hash is BCrypt again and `NeedsRehash` stays true forever. Convergence needs a redb.Core API for handing over a ready-made hash — reported, not worked around. Pinned by `LoginRehashRaceTests`, red on the unguarded code; the second test holds the other half — an untouched hash must still be upgraded. The awaited rehash also goes through the request-scoped service rather than a fresh DI scope: the fresh scope existed only because fire-and-forget outlived the request, and once awaited it just meant a second connection — which on SQLite promptly answered `database is locked` against the login's own. Same connection: no second writer, and inside a transacted route the rehash joins that transaction. ### Fixed — the identity core could not start in a Tsak worker, and three defects hid behind it Deploying all four modules to a live worker surfaced what the test suite could not, because each defect needed the real hosting model to appear at all. **The core did not start.** `IdentitySchemaInitListener` synchronises every Identity Props type by reflection, because the type is only known at runtime. When `ISchemeSyncProvider.SyncSchemeAsync` gained its `CancellationToken`, that call site kept compiling without a word and threw `TargetParameterCountException` on the first type at startup. The loop then never ran, **no scheme was synchronised at all**, and every listener behind it failed with `Scheme for type 'X' not found` — `RoleProps`, `ScopeProps`, `DataProtectionKeyProps`, `SigningKeyProps`, `ApplicationProps`. One line produced a dozen unrelated-looking symptoms, and `identity.core` and `identity.http` both refused to come up. The arity is now checked once, up front, with a message naming what actually broke. **The WS-Trust facade served no WSDL.** Tsak loads a module's assembly straight from its `.tpkg` with `LoadFromStream`, so the assembly never lands on disk and `Assembly.Location` is empty: a file resolved next to the assembly could not be found because there is no "next to". The facade therefore registered `POST` only and answered `405` to the `GET` a client generator makes first — the one thing this facade exists to serve. The contract is now an embedded resource, with the loose file still read when present. `pack-tpkg.ps1` also ships content subdirectories, which it previously dropped. **`Validate` on a revoked token blamed the caller.** OpenIddict reports a revoked token as an error rather than RFC 7662's `active: false`, and the facade passed that through as a `wst:FailedAuthentication` fault. That answer is about the caller, who had authenticated fine and asked a fair question; a revoked token is the ordinary reason to run `Validate` at all. Token-scoped refusals (`invalid_token`, `invalid_grant`) now answer `wst:Status` `status/invalid` with the reason, while a refusal about the caller stays a fault. The existing test asserted only "not valid", which the fault satisfied too — it is now on the shape of the answer. Ten of ten demo steps pass against a live worker: WSDL, client registered over HTTP, token issued over SOAP, validate, cancel, validate again, wrong secret, anonymous, junk body, and a token issued over SOAP spent over HTTP. ### Fixed — an unreadable `X-Forwarded-For` entry no longer lets the walk reach the client's part of the header `TrustedProxyResolverProcessor` walked the chain right to left and **skipped** any entry it could not parse as an address. RFC 7239 allows a proxy to write `unknown` for a peer it cannot name, and some emit an IPv6 with a zone id; after such an entry the walk carried on to the left, into the entries the client supplied, and took one of them as the client. The entry now ends the walk and the socket peer is kept. Pinned by `UnparseableHop_StopsTheWalk_KeepsSocketIp`, red on the previous code. The walk itself is now `ForwardedHeaderResolver` from `redb.Route.Http.Hosting`, one implementation of the trust model for the ecosystem; the processor keeps its gate (`TrustForwardedFor`, socket peer in `KnownProxies` / `KnownNetworks`) and delegates the rest. Its remaining role is a context whose host did not resolve; after the host did, the address it sees is the client's, which is not a trusted proxy, so it leaves it alone. Pinned by `HostAlreadyResolved_PeerNotInList_IsIdempotent`. ### Changed — DPoP works behind a TLS-terminating proxy RFC 9449 §4.3 has the server compare the proof's `htu` with the URL the client used. Behind a proxy that terminates TLS the client signs `https://...` and the socket sees `http://...`, and `redbHttp.Url`, which the check reads, was built from the socket. The shared HTTP host now applies `X-Forwarded-Proto` from a trusted proxy, so the URL is the client's. When this module has to create the host itself (no other component registered one), it hands the host the same proxies `Identity:ReverseProxies` names, read as configuration because this facade does not reference Core. Under a Tsak worker the host comes from the worker and `Tsak:Http:TrustedProxies` governs. `Token_BehindTlsTerminator_HtuWithHttpsScheme_IsAccepted` was red before; its control, `Token_WithoutForwardedProto_HtuWithHttpsScheme_IsRejected`, pins that the header is what makes the difference and the scheme check is not loose. ### Added — WS-Trust facade (`redb.Identity.Soap`) A third transport onto the same core routes HTTP and gRPC already use: `Issue`, `Validate`, `Cancel` and `Renew` over SOAP, for the callers whose stack builds clients from a WSDL and speaks WS-Trust rather than OAuth. Same issuer, same client registry, same token store — a client registered over HTTP gets a token over SOAP, which is the acceptance criterion the facade exists for and is covered end to end against the production OpenIddict pipeline. One route, not four. WS-Trust puts every operation on one address and tells them apart by the WS-Addressing `Action`, which is what generated clients emit, so the operation is resolved by parsing rather than by routing. The endpoint counter in a worker log therefore reads 1 for this module. The token in the `RequestSecurityTokenResponse` is our ordinary JWT, carried as a `wsse:BinarySecurityToken`. No second token format enters the system, so introspection and revocation work on it unchanged. **TLS is mandatory and its absence is a refusal to start**, not a warning. This is stricter than the other facades for a specific reason rather than a cautious one: `UsernameToken` carries the client secret in clear text, so an STS on plain HTTP publishes credentials to anyone on the path, and a warning in a log is read after they have already travelled. `AllowPlaintext` is the single escape hatch, for a connection already terminated by a trusted proxy, and it exists so an operator states that choice instead of stumbling into it. mTLS is available with modes and thumbprint pinning; an unrecognised mode is refused at start rather than read as "no certificate", because a typo must not turn mTLS off on an endpoint whose operator believes it is on. Two gaps in `redb.Route.Soap` had to be closed first — the consumer could not serve TLS at all, and surfaced nothing about the connection to a route. Both are in that package's changelog. ### Changed — one reading of the core's verdict, three renderings `redb.Identity.Contracts/IdentityVerdict.cs` now holds what every facade was about to hold a copy of: where the core states its verdict, that the stated status outranks the `error` string in the body, and how that string is read. Each transport keeps its own vocabulary — a status code, a gRPC status, a SOAP fault — and renders `IdentityVerdictKind` into it with a switch of a few lines. The gRPC facade is moved onto it in the same change rather than later. Left for later it would have become the third copy, which is exactly the outcome the SOAP plan set out to avoid. Its own suite passes 67/67 with no behavioural change: the tables matched down to `Unknown` for status codes outside the mapped bands. The reason this matters is on record. Read from the error string alone, a `rate_limited` answer falls through to "malformed request" and tells a caller to fix what is not broken instead of to wait; that was found and fixed on gRPC, and the fix is now in one place rather than three. ### Changed — uniqueness moved off the hand-rolled indexes onto the core's V4 primitives (V4-UNIQUE) Verified on all three providers: 1962 of 1963 passed, the one long-standing deliberate skip, zero failures — SQLite and PostgreSQL against the usual databases, MSSQL against a fresh isolated database (which also exercised the from-scratch bootstrap: core bundle, scheme sync, backfill no-op, convergence flag). 1963 = the 1945-test pre-refactor baseline plus 17 new V4-UNIQUE tests; the hole-closing duplicate tests were proven red-before in a worktree on the pre-change code (4 + 2 failing). The pre-V4 mechanism was `IdentityUniqueIndexesInitListener`: raw `CREATE UNIQUE INDEX` DDL at boot, eight per-scheme partial indexes on `_objects` guarding a `value_string`/`_key`/`_name` column that mirrored a `[RedbIgnore]` phantom property, plus `Hydrate()` copying the mirror back into Props on every read. It moved to the core's V4 machinery: - **`[RedbUnique]` on the real properties** — `ApplicationProps.ClientId`, `ScopeProps.ScopeName`, `ClaimScopeProps.ScopeName`, `TokenProps.ReferenceId`, `FederatedIdentityProps.LinkKey` (new stored composite `"{provider}:{sub}"`), `FederationProviderProps.ProviderId`, and a new `UserId` on `MfaProps`/`UserProps` written alongside `key` at every creation site (the 52 `Key ==` queries are untouched). Lookups are `GetByUniqueAsync` — one probe of the core's unique index; `FindByClientIdAsync` runs 8–11 times per `/connect/token` request. - **`ValueUnique` for the root-only schemes** — `IdentitySystemFlagProps` (props empty by design; first-wins: the losing bootstrap gets its 410 from the typed violation) and `IdempotencyRecordProps`, whose enforced key is now the SHA-256 of the composite name (`IdempotencyKeyHash`) so no client-chosen key can outgrow the 440-char column; the readable composite stays in `_name`. - **One typed catch** — the scheme-key paths catch `RedbUniqueViolationException` instead of duck-typing SQLSTATE/error numbers; `IsUniqueViolation` survives only for the two raw-index cases below and for the route-level 409 mapping (the typed exception satisfies it through its inner chain). - **Transition backfill** (`V4UniqueBackfillListener`, idempotent by construction, no flag): copies the legacy mirrors into Props/`ValueUnique` on the first boot, reports duplicates and leaves the losers outside the index (owner decision R4a; a duplicated federated link is flagged loudly — it is a potential account-takeover), then drops the seven retired indexes — only when every scheme backfilled clean, otherwise the whole pass retries next boot. The federated-link lookup keeps a fallback to the old mirror until then: a miss there would auto-provision a second local user for an already-linked identity. - **What stays, by owner decision**: only `UX_users_email` on `_users(_email)` (R1 — V4 primitives cannot express it; note for shared databases: it imposes email uniqueness on every tenant of `_users`). The R2 interim index on redb.Route's idempotent-entry scheme was retired the same day: Route shipped its own fix (`ValueUnique` + the typed catch in `RedbIdempotentRepository`), so the index joined the retired-drop list. The LDAP sync's legacy `UserProps.value_string` reverse-lookup key is deliberately untouched — self-contained, never index-backed. Migration notes: a cluster upgrades by stop-deploy, not rolling — an old node looks keys up in `value_string`, which the new code no longer writes. A downgrade after this version needs the mirrors re-filled (the old code cannot see new rows' keys). Identity no longer issues DDL against `_objects` at boot; a role without DDL rights degrades to a logged statement for the two remaining indexes and the retired-index drops, never a dead host. ### Fixed — two real uniqueness holes, proven red-before - **SQL Server never had the ClientId / ScopeName / ReferenceId indexes at all** — documented trade-off of the old listener (NVARCHAR(MAX) cannot back a B-tree key), so those check-then-save races were unprotected on MSSQL. The `[RedbUnique]` hash column is indexable on every provider; the same duplicate tests are green on all three now. - **Three schemes promised an index that never existed.** The XML docs of `FederatedIdentityProps`, `FederationProviderProps` and `ClaimScopeProps` claimed a partial unique index no code created: duplicates went through on every provider — for federated links that means one external identity could be linked to two local users by a race. Verified RED in a worktree on the pre-change code (4 + 2 failing duplicate tests), green after. ### Changed — admin console: pages, not dialogs (Phase 3) A rich dialog is a page now: the rule applied to every surviving edit modal. Six entities left their overlays: - **Federation providers** got what they never had at all: a detail page (`/admin/federation/{id}` — General / Credentials / Claim mappings / Danger zone tabs) plus `/admin/federation/new`. The modal could not even show Priority or the claim-mappings editor; the client secret is write-only with a show/hide toggle, and a provider still carrying the `REPLACE_ME` placeholder wears a NOT CONFIGURED banner explaining why it is hidden from `/login`. - **Claim definitions** — the console's most crowded modal (~14 fields at 640px) became `/admin/claim-definitions/{id}` + `/new`, with the enforcement semantics explained next to each control and the immutable identity (claim name / scope) rendered read-only. - **Claim mappers** — `/admin/claim-mappers/{id}` + `/new`. The page fixes the modal's blind spot: the OWNER of a rule (`global` / `application:{id}` / `scope:{id}`) was not selectable there, so every mapper landed global; the detail page renders the owner as a deep-linked badge to the owning application / claim scope. - **Users** — the 4-field create overlay became a two-step wizard `/admin/users/new` exposing the account + profile surface (the overlay showed 4 of the contract's 9 fields). - **Scopes and claim scopes** — `/admin/scopes/{id}` + `/new`, `/admin/claim-scopes/{id}` + `/new`; the claim-scope page absorbs the old inline master-detail panel — the scope's mappers are a section with deep links. Deletes moved to the detail pages behind the typed-confirm dialog — the one dialog pattern that stays, together with the shown-once webhook secret. The phase's own review then caught the last rich dialog standing: the group-create wizard — ironically the very component the plan cited as the wizard pattern to follow — floated in a modal-backdrop itself; it is a plain card now, hosted by `/admin/groups/new`. What remains overlaid is deliberate and light: typed confirms, shown-once secrets, the read-only SCIM JSON viewer, a one-field WebAuthn rename, and the two-field template-confirm inside application creation. No `modal-backdrop` edit overlay is left in the console. Two additions ride the same wave: - **`/admin/api-resources`** — the `resource:action` catalogue got a home: the gate's precedence rules, the full resource tree with per-scope seeded/not-seeded state (deep-linked into the scope store), and the list of operator scopes outside the model. - **Dashboard** rebuilt after the Tsak.Web composition the owner likes: a six-card KPI row (real `PagedResult.Total` probes), an audit-by-category donut and a clickable recent-activity table deep-linking into `/admin/audit`. No invented metrics: where no telemetry source exists (sparkline history) the element is simply absent. Coverage: `Phase3PagesTests` pins all twelve new routes — each must exist (not 404) and must never render anonymously (not 200); it deliberately tightens the old "not 200" pattern, which a broken route template could satisfy by 404-ing. ### Removed — the Hydrate mirror machinery `RedbObjectHydration` and its ~30 call sites are gone: a key found through `GetByUniqueAsync` is a stored prop and needs no copying; the three dead `sql/indexes/*.sql` files (applied by nothing since the listener took over) went with it. Path: redb-identity/changelog/CHANGELOG-4.1.x.md Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity Page: https://redbase.app/src/dev-2026-12-06/redb-identity/changelog/CHANGELOG-4.1.x.md ---- # redb.Identity changelog: 4.1.x Releases of the 4.1 line, moved here unchanged from CHANGELOG.md, which keeps the latest released line only. Newer releases: [CHANGELOG.md](../CHANGELOG.md). ## [4.1.1] — 2026-09-25 ### Changed — a WS-Trust refusal is the STS's answer, not a failure of the route The SOAP facade threw its WS-Trust faults. The caller received the right fault either way, but every throw also failed the exchange, so each correct refusal — a malformed RST, bad credentials, a scope the caller may not have, a caller over the rate limit — counted against `soap-identity-sts` as a route error, headed for a dead-letter channel, and showed the STS as a failing route to whoever supervises it. The demo suite's three negative probes alone put it on a supervisor's "needs attention" list, and a real breakage would have drowned in such noise. `redb.Route.Soap` now lets a consumer route answer with a fault: put `redbSoap.faultCode` and `redbSoap.faultString` on the reply and return normally, and the consumer sends the `soap:Fault` while the exchange stays successful. The STS uses exactly that. A refusal is raised internally as `WsTrustRefusal` and turned into the reply at the boundary of the two steps that can refuse (`MapRequest`, `MapResponse`); the route stops there, so nothing after a refusal runs. What stays a failure is our own breakage: Core gave no answer, is unavailable, timed out, or issued no token. Those remain `soap:Server` faults thrown as `SoapFaultException`, and the error count and dead-letter channel see them — which is what they exist for. Rate limiting is deliberately on the answer side: it is the limiter working, the same way the HTTP facade's 429 is an answer. Its code is unchanged (`soap:Server`, "wait, do not rewrite the request"). Nothing changes on the wire: same fault codes, same reasons, same HTTP status. The existing SOAP flow tests pass unchanged. `SoapProtocolFlowTests` now also reads the route's own `redb.route.exchanges.failed` counter, filtered to its fixture's endpoint: before this change a malformed RST and a wrong secret counted as two failed exchanges, now as none. **Deployment order:** this needs the `redb.Route.Soap` that carries the fault-as-reply form. On a host whose shared `redb.Route.Soap` predates it, the headers are ignored and a refusal would leave as a malformed success reply instead of a fault. Identity and Route ship together, as always; a host built from an older Route must be rebuilt before this module is deployed to it. ### Fixed — a missing management route answers 404, and a crash in a controller answers 500 The management surface answered **400** to a path no controller action matches, and **400** again when an action threw. On gRPC both arrived as `INVALID_ARGUMENT`. A missing route told the caller their request was malformed; an exception in our own code told them it was their fault — which is how a disabled feature once showed up as a 400 while the log held an unhandled exception. The controller dispatcher had already said the right thing: it writes `NotFound` with 404, or `InternalError` with 500, both into the body's `error` field and as the status. The facades then read the `error` field, looked it up in `ManagementErrorCodes` — which knows the controllers' own codes (`not_found`, `duplicate`, …) and nothing of the dispatcher's — and replaced the status with the table's fallback. The table exists for exactly one case, a controller that returned an error document wrapped in a 200; it was reaching past it. `ManagementErrorCodes.DecidedErrorStatus` now names the status already decided — from `redbHttp.ResponseCode` or `status.code`, whichever the dispatcher wrote — and both facades leave such a status alone, consulting the table only when nobody stated a code. That is the rule `IdentityVerdict` has always stated for the rest of Identity: the status wins where there is one. A status Core sets through a controller (a 503 during an outage, say) is kept by the same rule. Teaching the table the dispatcher's strings would have made the symptom go away and tied Identity to another package's constants; it was not done. `ManagementStatusPreservationTests` pins both transports, through the real HTTP pipeline as well as at the mappers, and pins that controller error documents still map exactly as before. Without the fix the pipeline test answers 400 and the gRPC one `INVALID_ARGUMENT` for a 500. ## [4.1.0] — 2026-09-21 > **This release carries security fixes.** An administrative scope is no longer granted without a role > that carries it, and an anonymous client registration can no longer create a client that administers > the server. The entries marked *Security!* below say what was possible before and what changed. ### Security! — an administrative scope now requires a role that carries it OAuth's scope check asks one question: may this **client** request this scope? Nothing in it asks whether the **person** signing in should hold it. The admin console legitimately asks for `identity:manage`, so every account that could sign in to it received the master management scope, and the management API — validating the token exactly as it should — admitted them. Reproduced end to end on a running instance: an account created seconds earlier, with no roles and no groups, listed every user and deleted one. Roles were already resolved at issuance (`AttachRoleRegistryClaims`) but only ever *added* scopes; nothing ever withheld one. `RestrictAdminScopesByRoleHandler` supplies the missing half. For user-bound grants it computes the scopes the user's effective roles attach — direct assignments and those inherited through groups, via `RoleService.GetEffectiveScopeNamesAsync`, which already existed — and removes every administrative scope that set does not contain. Administrative means Identity's own surface: `identity:*` except the self-service `identity:account`, plus `scim`. An operator's own scopes are untouched unless named in `Identity:AdminScopeEntitlement`. Three decisions worth stating plainly, because each could have gone the other way: - **It removes, it never rejects.** A user who asks for more than their roles allow still signs in, without those scopes. Rejecting would turn a missing role into a failed login, and the console asks for `identity:manage` on behalf of everyone. Every removal is logged with the user and the scopes. - **It fails closed.** If roles cannot be resolved the administrative scopes are dropped rather than issued on trust. That costs an administrator a refresh after a database hiccup; the opposite costs everyone their user list. - **Refresh re-evaluates.** The handler runs on every sign-in, refresh included, so revoking a role takes effect on the next refresh instead of lasting as long as the grant. `client_credentials` is deliberately untouched: it has no user to entitle, and the application's own `scp:{scope}` permission remains the authoritative gate there. Upgrades keep working: `SeedAdminRoleScopesListener` attaches the management scope to the system `admin` role at startup **when that role carries no scopes at all** — the state every installation predating this change is in, and the state that would otherwise lock the only administrator out of their own console. A role whose scopes an operator has curated is never touched. `Identity: AdminScopeEntitlement:Enabled=false` turns the gate off from configuration alone, so a deployment that still manages to lock itself out can recover without a rebuild. Pinned by `AdminScopeEntitlementTests` through the real token pipeline, asking the server what the issued token carries rather than trusting the token response (RFC 6749 §5.1 makes its `scope` member optional when nothing changed): no entitling role, no management scope; an entitling role, the scope is there; `client_credentials` unchanged. With the gate switched off the first of those fails with `{openid, identity:manage}` — the vulnerability, reproduced in a test. Verified on a running Tsak worker, not only in the suite: a freshly registered account with no roles received `openid` alone and got `403` from the user list, the role list and a delete; an account in the `admin` role received `identity:manage` and administered normally. Self-service is unaffected — the console requests `identity:account` as well, and that scope is exempt. ### Fixed — the shipped module entry point ran a shorter startup chain than the embeddable one Identity has two entry points. `redb.Identity.Core/Module/InitRoute.cs` boots it inside a host process and is what the test fixtures use; `redb.Identity.Core.Module/InitRoute.cs` is what Tsak discovers in the `.tpkg`, and therefore what every deployment actually runs. Each keeps its own chain of lifecycle listeners, so a listener added to the first and forgotten in the second is green in the whole suite and absent in production. Two listeners had drifted: - `SeedAdminRoleScopesListener` — the upgrade path for the gate above. On the running worker the admin role stayed empty, so an administrator in the `admin` role was refused `identity:manage` just like anybody else. Found by deploying the gate and watching an administrator get locked out. - `V4UniqueBackfillListener` — the V4-UNIQUE transition backfill, whose own documentation says it must run before the seed listeners. No Tsak deployment had ever run it; on the first boot after this change the worker reported `candidates=356 repaired=1 duplicates=0` and retired the pre-V4 indexes. `ModuleListenerParityTests` now fails when a listener the embeddable path registers is missing from the shipped one. The reverse stays allowed: the module entry point legitimately owns host-specific listeners (child-container and bridge-scope disposal, the credential seeders from its own container). `RoleScopeQueryIsolationTests` pins the neighbouring assumption the diagnosis had to rule out: a role is the parent of both its users and its scopes, and reading the users as scope attachments would make an empty role look curated. ### Security! — an anonymous registration cannot create a client that administers the server Dynamic client registration (RFC 7591) has two modes: open, and protected behind an initial access token. Open was what shipped, and the only limit on what a registration could ask for was `DynamicRegistrationAllowedScopes` — a list that includes every granular administrative scope so the demo suite can probe each admin surface. Anyone able to reach `POST /connect/register` could therefore register a `client_credentials` client carrying `identity:users:write`, take a token, and delete users. No role, no password, no operator involved. It was used exactly that way during this cycle's work, to clean up probe accounts, which is how it came to the owner's attention. The scope-entitlement gate above cannot help here: `client_credentials` has no user to entitle, so the client's own permissions are the whole gate — and those permissions are precisely what registration was handing out. So the rule sits below deployment policy, in `DynamicRegistrationProcessor`: **while registration is open, a scope this deployment counts as administrative is refused, whatever the allow-list says**. What counts is `Identity:AdminScopeEntitlement`, the same definition the issuance gate uses, so an operator who declares their own administrative scope is covered by both at once. Its `Enabled` switch is deliberately not consulted — that switch exists to recover a locked-out administrator and must not quietly reopen anonymous registration of administrative clients. Registering administrative clients dynamically remains possible, through the mode RFC 7591 defines for it: set `DynamicRegistrationInitialAccessToken`, and every registration then carries a credential the deployment issued, with the allow-list governing as before. The shipped context sets one, for the same reason it ships a seeded admin password and a dev pepper: the demo suite registers admin-scoped clients and something has to authorise it. That value is as public as the file it lives in, and the context says so — production rotates it, or sets it to null and trims the allow-list to the user-info scopes. The demo suite presents that token on every `POST /connect/register`, and takes it from `IDENTITY_DCR_TOKEN` when set — a host whose token differs from the shipped default runs the demos by exporting that variable, and changes nothing in the scripts. `AnonymousDcrAdminScopeTests` pins both directions, including that open registration still serves the ordinary clients it exists for. Verified on a running worker as well. ### Fixed — a switched-off feature answers "no such endpoint" instead of failing Registration, e-mail verification, e-mail change and WebAuthn bind their `direct-vm://` routes only when enabled, while the facades mount their controllers regardless. A call to a disabled feature therefore reached a producer with nothing behind it, and the resulting `InvalidOperationException` left the caller with a generic failure and the log with an unhandled-exception stack trace — observed as `POST /account/register` answering 400 with `No consumer registered for direct-vm endpoint 'identity-account-register'`. `IdentityControllerBase.Forward` now asks the shared registry whether the route is bound and, when it is not, answers the standard `not_found` document, which `ManagementErrorCodes` turns into 404 on every transport. That is the answer the client SDK already reads back as `registration_disabled`, and it is what the API documentation said all along. The question goes to the registry rather than to a feature flag on purpose. The flag lives in Core's options and each facade binds its own; copying it across the boundary would put the answer in two places and let them disagree, while what is actually bound cannot disagree with itself. ### Security — what self-registration meant on 4.0.1, and why the shipped context keeps it on now During this cycle `Registration.Enabled` was turned **off** in the context this repository ships, then turned back **on**. Both moves belong in the record, because the reason was never registration itself. On 4.0.1 the scopes a request receives are the ones the **client** is permitted to ask for, narrowed by nothing that depends on the user. Roles only add scopes (`AttachRoleRegistryClaims`); the one mechanism that could withhold one — `ScopeRequiredGroups` — is opt-in and unset by default. The admin console asks for `identity:manage` at sign-in, so every account that could sign in to it held the master management scope, and the server-side check passed for them exactly as for an administrator. Confirmed against a running instance, reads and writes alike; the finding is the owner's. With that gap open, self-service registration was the path from anonymous to full administrator in two requests, so it was closed. **Operators running 4.0.1: keep self-registration off, and treat every account that can sign in to the console as an administrator.** That advice stands for that release and is the reason this entry stays. The gap is closed in this cycle by the entitlement gate above, and with it closed the shipped context turns registration back on: this context is the showcase one, and an image where a visitor can create an account and walk the sign-in, MFA and self-service flows is the point of shipping it. A self-registered account now holds `openid`, `profile` and `identity:account`, and nothing that can administer. The code default remains `false`, so a host that configures nothing still ships closed, and the context says in so many words that production should set `false` unless public sign-up is a wanted feature. One door the gate does not touch, stated plainly because a showcase invites probing: dynamic client registration is still open in this context and `DynamicRegistrationAllowedScopes` still includes the granular admin scopes, so any caller of `POST /connect/register` can mint a `client_credentials` client that administers. `client_credentials` has no user to entitle — the client's own permissions are the whole gate there, by design. An exposed instance needs `DynamicRegistrationInitialAccessToken` set or that list trimmed to the user-info scopes. ### Fixed — Administration → Federation crashed, and the top bar showed a subject instead of a login Two findings from a user of the 4.0.1 console. `FederationList` passed `Icon="cluster"` to `UiEmptyState`, which has no such parameter — it takes an `Illustration` slot. Blazor answers that with a runtime error, and the compiler cannot see it, so the page died on every visit where no provider was registered yet: *"Object of type 'UiEmptyState' does not have a property matching the name 'Icon'"*. The icon now goes through the slot. The page tests next door only assert that a route exists and refuses anonymous callers, which is why a page that threw on sight counted as covered; `AdminPagesRenderTests` renders it instead, and against the old markup it reproduces the user's error verbatim. The signed-in user was shown as an opaque subject. The OP keeps `preferred_username` and `name` out of the id_token on purpose — their destination is the access token, so a relying party cannot forward the user's PII in a token it passes on — and the BFF chose its name claim while only the id_token was in hand, leaving `sub`. Userinfo arrives a moment later carrying the login, but the identity had already been named, and `NameClaimType` is fixed at construction. Both sign-in paths now pick the name claim *after* the userinfo merge (`PrincipalNaming`, shared by the backchannel client and the redirect flow), in the order `preferred_username` → `name` → `email` → `sub`; the subject remains the fallback, because a poor label is better than a blank one. The redirect flow also needed the userinfo claims to be mapped onto the principal at all, which it was not doing. ### Changed — a module cannot ship its own version of a host assembly, and the packer now says so `pack-tpkg.ps1` force-included `Microsoft.IdentityModel.*`: those DLLs went into the package even though the host had them, on the reasoning that the host shipped an older, incompatible major. That never worked and cannot work — `ModuleAssemblyLoadContext` asks the Default ALC before probing the package, as it must or contract types would split, and since redb.Tsak 4.1.0 its `LoadedAssemblyTracker` prefers the host copy too. The force-include shipped 1.26 MB the loader never looked at, and a Troubleshooting note advising a cure that cures nothing. Removed: `Core.Module` is 25 → 19 DLLs, `Http` 5 → 2. What the force-include was reaching for — never running against a host assembly of the wrong version — is now a gate instead of a copy. For every DLL skipped as host-provided the packer compares the assembly version it would have shipped with the version the host will actually load, and a **major** divergence stops the packaging with both versions, the host's path, and where each pin lives; a minor one is a warning, because the host copy is what loads either way. Until now that divergence was silent: the module compiled against one version, the host loaded another, and it surfaced far away as a `FileNotFoundException` inside OpenIddict. The gate was checked by pointing it at an older `Microsoft.IdentityModel.Tokens` (6.35.1 against our 8.16.0): packaging stops before the archive is written, saying `module 8.16.0.0, host 6.35.1.0`. This does not give a module version independence — nothing on the packaging side can. That would need a shared context for a group of packages (Identity's core and its facades deliberately share dependencies with each other, so per-package isolation cannot express it); recorded with the Tsak side as F-13a and deliberately not built, since the versions are aligned today. ### Fixed — packages no longer carry shared-framework assemblies `pack-tpkg.ps1` built its "the host provides this" exclusion set from the worker's `bin` and `Libs\shared` only. While `build-shared` copied framework assemblies into that layer, names like `Microsoft.Extensions.Options` were excluded by accident. Tsak stopped copying them on 2026-09-18, and the next pack put ten `Microsoft.Extensions.*` 10.0.3 assemblies inside `redb.Identity.Contracts.tpkg` (66 KB → 294 KB) — while the host resolves those same names from its own framework, 10.0.8. Nothing broke at runtime: `ModuleAssemblyLoadContext` asks the Default ALC before probing the package, so a packaged copy can never win a resolve. It was dead weight that `LoadedAssemblyTracker` byte-loaded a second time into the non-collectible Default context (fixed on the redb.Tsak side in 4.1.0). The exclusion set now also scans both shared frameworks — `Microsoft.NETCore.App` **and** `Microsoft.AspNetCore.App`, because `Microsoft.Extensions.Configuration` / `.Options` / `.Logging` / `.Diagnostics.HealthChecks` live in the ASP.NET one. The version is picked as the highest install of the worker's own major, compared as a version and never as text (a string sort ranks `9.0.20` above `10.0.8`); a missing framework throws instead of silently packing the assemblies. `Contracts.tpkg` is back to two DLLs and 65 KB; the other four packages are unchanged, DLL for DLL, so nothing the modules actually need was swept out with them. Path: redb-identity/changelog/CHANGELOG-4.2.x.md Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity Page: https://redbase.app/src/dev-2026-12-06/redb-identity/changelog/CHANGELOG-4.2.x.md ---- # redb.Identity changelog: 4.2.x Releases of the 4.2 line, moved here unchanged from CHANGELOG.md, which keeps the latest released line only. Newer releases: [CHANGELOG.md](../CHANGELOG.md). ## [4.2.2] — 2026-10-04 ### Security — the password grant logged the username at `Debug`; it logs it at `Trace` Building the `ClaimsPrincipal` for the password grant (ROPC) wrote `Issued ClaimsPrincipal for password grant: {Username}` at `Debug`. A default production configuration leaves `Debug` off, but a deployment that keeps it on accumulates account identifiers next to the fact of a successful password sign-in, and matching a person to a time then takes nothing but a log read. The line moved to `Trace`; the message, its fields and its position are unchanged, so nothing else in the flow moves with it. ## [4.2.0] — 2026-09-30 ### Security — `/connect/logout` acts on the browser's own session; a `userId` in the request no longer chooses whom to sign out The logout processor read `userId` from the request body (the GET route maps the query string the same way) and, when no session cookie came with the request, signed that user out: every session revoked and a back-channel logout token sent to every relying party holding a live token for them. `/connect/logout` is the OIDC `end_session_endpoint`, reachable anonymously by design, so the value was the caller's word: `POST /connect/logout` with `userId=1` and no cookie ended the administrator's browser sessions and told the relying parties so, and user ids are sequential. The parameter had no legitimate caller — the two facade routes are the endpoint's only clients, and an operator signing another user out goes through the sessions management API behind the management gate. The processor now takes the user and the session from the verified session ticket alone (the headers `ReadSessionCookie` writes; the facade strips those names off incoming requests first). A request with no session completes with nothing ended — RP-Initiated Logout 1.0 §2 still expects the redirect to `post_logout_redirect_uri` — instead of being refused; externally that is what already happened, the signed-out page having overwritten the processor's error. `LogoutSubjectBindingTests` pins it: an anonymous POST and GET naming the victim leave the session active, the browser holding the cookie still ends its own, a bare `id_token_hint` completes and ends nothing. In the same processor, the `id_token_hint` subject was compared with the numeric core user id, while `sub` is the user's public subject GUID, so every hinted logout logged a mismatch and ignored the hint. It is compared with the subject GUID now. ### Security — a logout without a valid `id_token_hint` asks the End-User first The session cookie is `SameSite=Lax`, so a cross-site top-level navigation carries it: a link on any page could send the browser to `/connect/logout` and end the visitor's OP session — the cookie proves whose session it is, not that its owner wants it ended. A relying party proves intent with a valid `id_token_hint` whose `sub` is the session's user, and such a request signs out at once, as before. Without it the OP now answers with a confirmation page (GET and POST alike): its form carries a state bound to the user and the session and valid for five minutes, and posting that state back is the confirmation. A foreign page cannot read the state (same-origin policy) nor forge it (DataProtection), a state issued for another session confirms nothing, and the page clears no cookie and performs no redirect until the End-User confirms; the relying party's `post_logout_redirect_uri`, `state` and `client_id` travel through the form so the redirect back still happens. Duende's logout prompt and Keycloak's confirmation without `id_token_hint` behave the same way. The decision is made in the core (`LogoutProcessor` with `LogoutConfirmationProtector`) and the HTTP facade only renders the page, so another facade would render its own. A browser that used to sign out with one request without a hint now sees one page first. `LogoutConfirmationTests` pins it: the page instead of the logout, the confirmation, a forged or foreign state, and the relying party's parameters surviving the round trip. ### Security — signing a user out everywhere revoked their sessions and nothing else `SessionService.LogoutAsync` is what a password change, a password reset, an operator's logout, a SCIM deactivation and a user disable rely on to end every grant the user holds. It revoked the sessions and then looked for the user's authorizations by the internal user id in `Key`; since V4 the OpenIddict stores key authorizations and tokens by the user's public subject in `value_guid`, so the lookup found nothing and every refresh token kept working — after a password reset, the tokens of whoever had the old password kept refreshing. Tokens issued by the password grant have no authorization row at all and were never in reach of that step. The method now resolves the public subject and revokes the user's authorizations and their valid tokens by it, in batches; other subjects' tokens at the same application are untouched. `FullLogoutRevokesGrantsTests` runs the real path — a refresh token from the authorization code flow and one from the password grant, then the operator's logout — and both refreshes must fail; they succeeded before. `SessionServiceTests` now seeds grants the way the stores write them. ### Fixed — the relying party's `state` comes back on the post-logout redirect RP-Initiated Logout 1.0 §3: when the RP passed `state`, the OP returns it as a query parameter on the redirect to `post_logout_redirect_uri`. It was dropped. It is preserved with the redirect URI and appended to the `Location`, through the confirmation page as well. ### Fixed — back-channel logout for a session reaches the relying parties that used it, with the user's public subject A browser session is opened at `/login`, before any relying party is involved, and it did not record which relying parties later obtained tokens through it. A per-session logout therefore had nobody to notify (Back-Channel Logout 1.0 §2.1 asks the OP to notify the RPs the End-User signed in to through the session being ended), and the `logout_token` carried the internal user id as `sub`, while the id_token the RP holds carries the public subject GUID, so an RP could not have matched it anyway. The session now keeps the list of relying parties that obtained tokens through it (`SessionProps.ClientApplicationIds`, appended at the authorization endpoint under a row lock, so two tabs cannot drop each other's entry), a per-session logout notifies exactly those with the session's `sid`, a logout of every session notifies each session's relying parties with its own `sid` and token holders outside any session (ROPC, device flow) with `sub` alone, and `sub` is the public subject in every case. Sessions opened before this release have no list and notify nobody, as before. `BackchannelLogoutOnSessionEndTests` runs the whole path against a relying party endpoint on the same HTTP stack: sign in, authorize, RP-initiated logout with `id_token_hint`, a `logout_token` whose `sub` and `sid` equal the id_token's; it times out without the binding. `demo_backchannel_logout.ps1` follows the same browser path now. ### Changed — with configured credentials and the redb-backed signing-key store both present, `MintingKeySource` says which one mints The option's documentation said the store's keys are appended after configured `SigningCredentials` / `EncryptionCredentials`, so that an HSM-backed key stays primary; the post-configure inserted them first, so the store minted. OpenIddict signs with the first compatible signing credential and encrypts with the first encryption credential, while every entry validates and is published, so the order of two lists was deciding who mints — and the pair is legitimate in both directions, as the state of a deployment moving its keys onto an HSM or off one. That is the operator's decision, not a list order's: the new `RedbIdentityOptions.MintingKeySource` (`Configured` or `Store`) is required when both sources are present — registration refuses the pair without it — and refused when only one source is configured, since it would decide nothing. The post-configure places the store's keys after or before the configured ones accordingly, the active store key first among them as before. Deployments with the store alone (the shipped configuration) are unaffected. `SigningKeysBootstrapTests` and `SigningKeyPostConfigureTests` pin the refusals and both orders. ### Fixed — ephemeral keys and the redb-backed signing-key store refuse to be enabled together; the store always seeds an encryption key `AllowEphemeralKeys=true` together with `UsePropsSigningKeyStore=true` registered an ephemeral key first and left it in the credential lists beside the store's keys: in this replica's JWKS only, trusted for validation, and the encryption key for every token until the store had one. Not exploitable — its private half never leaves the process — but it is the per-process failure the store exists to remove, hidden behind a persistent store. `AddRedbIdentityServer` now refuses the pair. `SigningKeyInitListener` seeded an encryption key only while access-token encryption was on; OpenIddict encrypts authorization codes, refresh tokens, device and user codes and its own state tokens whatever `DisableAccessTokenEncryption` says, and refuses to build its options without an encryption credential, so a store holding a signing key and no encryption key was a server that could not start. It seeds both kinds now, and the registration refuses a configuration with no encryption credential whatever that flag says, naming the options in the message. `SigningKeysBootstrapTests` and `SigningKeyInitListenerTests` pin both. ### Security — a retired signing key is offered to nobody, by construction rather than by registration order The post-configure that feeds OpenIddict from the redb-backed signing-key store built two pools. Keys inside their `NotBefore..NotAfter` window became the credentials OpenIddict mints with. A broader "validation pool" — every persisted key past `NotBefore`, retired ones included — was written into `TokenValidationParameters.IssuerSigningKeys`, so that, its comments said, tokens signed by retired keys would keep validating "during the grace window". Retirement sets `NotAfter` to the moment of retirement, so that pool kept a retired key for as long as its row existed: had a validator read that list, the one reaction an operator has to a leaked key would have reached the JWKS and minting, and nothing else. Checked against the real pipeline before anything was changed, and the list was never read: OpenIddict's own post-configure runs after this one (this one is registered in `AddCore`, OpenIddict's in `AddServer`) and rebuilds the validation parameters from the credentials — a token signed by a retired key was already refused (`ID2090`) at introspection and by the validation stack the management API uses. What kept it safe was the order two registrations happen to have; a refactor that moved one of them would have made the stale pool live. The component no longer has one. It takes the store's working set only (`GetAllAsync`, in-window keys), so a retired key appears in no list, and it writes the validation parameters as a projection of the credential lists — the same two lines OpenIddict writes — so the result is the same whichever post-configure runs last. That also ends the clobbering of credentials other configurers added (the file's own rule was "never clear the list"; the assignment did): they stay, and they are trusted for validation too. Rotation is unchanged: the demoted key keeps its own `NotAfter` and validates until then, which is the handover window relying parties need. Retirement now means what it says everywhere. `SigningKeyPostConfigureTests` pins the component alone — a retired key in no list, parameters equal to credentials, a host-added credential kept and trusted; three of four fail on the previous code. `SigningKeyRetirementTests` runs the store-backed key path end to end for the first time in the suite: mint, rotate (the old token still validates), retire (introspection and the validation stack both refuse it). ### Security — an open redirect after sign-in through a control character in `returnUrl` Every point where a `returnUrl` becomes a `Location` header — login, MFA (twice), federation, consent — asks `LoginPageProcessors.IsValidReturnUrl` first, and the check refused absolute addresses, `//host` and `/\host`. It did not refuse control characters. A browser removes ASCII tab and newline from a URL before resolving it (WHATWG URL), so `returnUrl=%2F%09%2Fevil.example` — `/\t/evil.example` once decoded — passed the check and landed the user on `//evil.example`, another host, right after they typed their password here. The check now refuses any control character, as ASP.NET Core's `IsLocalUrl` does for the same reason. `ReturnUrlOpenRedirectTests` pins it; the control-character cases fail without the fix. ### Fixed — a federation sign-in deleted the session cookie it had just issued The federation callback answers with the new session cookie and with the expiry of the per-flow binding cookie, and it joined the two into one `Set-Cookie` value with `", "`. A browser does not split `Set-Cookie` on commas (RFC 6265 §3): it read the fold as one cookie — the session — whose attributes ended with the binding cookie's `Max-Age=0`, and since the last `Max-Age` wins (§5.3) it deleted the session as it arrived, while the binding cookie was never cleared. The HTTP consumer already writes an array value as one header line per entry, and the MFA cookies already used that through a private helper of their own. There is now one `IdentityCookieFormatter.AddSetCookie`: a second cookie turns the value into an array, a single one stays the plain string every reader expects. The federation, session and MFA writers all go through it, and the session writers no longer assign the header — no route pairs two of them today, but a second cookie would have silently replaced the first, including the re-authentication marker. `SetCookieFoldingTests` reads the headers the way a browser does. ### Fixed — a `Set-Cookie` the caller sent came back in the response The routes answer on the request message, and the cookie writers add to whatever `Set-Cookie` is already there — which, on a login, was the caller's own request header. The HTTP consumer refuses to echo a request header only while it is the very object the client sent (it stopped matching by name so a client can no longer suppress a header the route wrote, redb.Route 4.2.0), and the array built around the caller's value is not that object, so both cookies went out. A browser cannot send `Set-Cookie` on a request, so this only ever reached the caller itself. `Set-Cookie` is now one of the names stripped on ingress on every transport. `InboundSetCookieTests` signs in through the real HTTP pipeline with the header planted and fails without the fix. Since redb.Route 4.2.0 the HTTP consumer also drops `Set-Cookie`, with the other response-only fields of RFC 9110, before the exchange is built; Identity keeps its own strip all the same — it covers gRPC and SOAP as well, and the names Identity refuses to take from a caller are Identity's to declare. ### Fixed — three HTTP routes did not strip the reserved inbound headers first The HTTP facade removes the caller-supplied names it trusts internally (`session_user_id`, `user_id`, `ip_address`, …) as the first step of a route, documented as "every HTTP route". The management catch-all (`http-management-api`) and the SCIM catch-all (`http-scim-api`) never did, and the SCIM discovery route did it second. Nothing on those routes reads a reserved name today — their controllers build the inner message from scratch — so this was a structural gap, not an exploit. All three strip first now, and `HttpRouteReservedHeaderStripTests` fails if a route in the HTTP route builder does not. Path: redb-identity/changelog/CHANGELOG-4.3.x.md Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity Page: https://redbase.app/src/dev-2026-12-06/redb-identity/changelog/CHANGELOG-4.3.x.md ---- # redb.Identity changelog: 4.3.x Releases of the 4.3 line, moved here unchanged from CHANGELOG.md, which keeps the latest released line only. Newer releases: [CHANGELOG.md](../CHANGELOG.md). ## [4.3.0] — 2026-10-14 > **Why the bump.** redb.Identity ships with the ecosystem: this release is built on **redb.Route 4.3.0** > and **redb.Tsak 4.3.0** and carries their changes into an Identity host. It brings no redb.Identity > source change of its own, and every package in the table above moves to 4.3.0 together. > > What the pinned bump means for a deployment: > > - **redb.Route 4.3.0 reworks error handling.** What a `RouteBuilder` declares applies to the routes it > defines, not to every route of the context; each route gets its own error scope; the context has a > dead letter channel. Identity's own routes are unaffected: the core's only `OnException` is declared on > the token route itself (`IdentityCoreRouteBuilder`), not on the builder. A module loaded into an > Identity host that keeps its handlers in a builder of its own, or in a handlers-only Route-XML file, is > affected: those handlers no longer reach the routes of another builder or file, and the module has to be > checked before upgrading. > - **redb.Tsak 4.3.0 gives every route context its own Quartz scheduler** and adds `tsak-dlq:`. A clustered > installation upgrades with a full stop of every node, the rows of the old `TsakScheduler-{cluster}` job > store are no longer read, and removing them is an operator command described with that release. Path: redb-identity/changelog/CHANGELOG-4.4.x.md Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity Page: https://redbase.app/src/dev-2026-12-06/redb-identity/changelog/CHANGELOG-4.4.x.md ---- # redb.Identity changelog: 4.4.x Releases of the 4.4 line, moved here unchanged from CHANGELOG.md, which keeps the latest released line only. Newer releases: [CHANGELOG.md](../CHANGELOG.md). ## [4.4.2] — 2026-10-23 ### Changed - **The `backend`, `managed` and `full` Dockerfiles build without `--build-arg TSAK_VERSION`.** The base Tsak image defaults to the Tsak release it was built with, and Docker no longer warns about an empty base image name. `publish/docker/DOCKER.md` now describes the 4.4 build: .NET 10 SDK, Tsak base images of the same release, `-net10` tags. ## [4.4.1] — 2026-10-21 ### Changed - **Rebuilt on redb.Route 4.4.1.** No changes of its own: the packages, images and archives are built on redb.Route 4.4.1, which fixes `seda:` after a context restart. 4.4.0 was withdrawn on the day of release. ## [4.4.0] — 2026-10-21 > **Withdrawn on the day of release because of the seda restart bug in redb.Route; use 4.4.1.** ### Breaking - **`resource` (RFC 8707) is validated** on `/connect/authorize`, `/connect/par` and token exchange: an absolute URI listed in a scope's `Resources`, with the client's `rsrc:` permission. OpenIddict 6 ignored it. Packages: `redb.Identity.Core`. Upgrade: [UPGRADING.md](../UPGRADING.md#resource-parameter). - **JWT client assertions (`private_key_jwt`, `client_secret_jwt`) follow draft-ietf-oauth-rfc7523bis**, as OpenIddict 7 requires: the assertion must have the `typ` header `client-authentication+jwt` and the issuer as its `aud`, for every endpoint. An assertion typed plain `JWT` or aimed at an endpoint URL is rejected with `invalid_client`. Packages: `redb.Identity.Core`. Upgrade: [UPGRADING.md](../UPGRADING.md#client-assertions-private_key_jwt-client_secret_jwt). - **A resource server that validates Identity's DPoP-bound access tokens with OpenIddict.Validation 7 fails on them** (internal error ID2196: OpenIddict 7 checks `cnf` and knows only the certificate-bound form, not the DPoP `jkt`), also in front of `redb.Identity.Resource.Dpop`. Skip OpenIddict's proof-of-possession check for tokens whose `cnf` holds only `jkt` and check the DPoP proof yourself, as Identity does for its own endpoints. Packages: `redb.Identity.Resource.Dpop`. Upgrade: [UPGRADING.md](../UPGRADING.md#dpop-bound-access-tokens-at-third-party-resource-servers). ### Security - **Token exchange (RFC 8693) runs on OpenIddict's built-in grant and checks who calls it**: a token bound to a client can no longer be exchanged by an unrelated one, and a token of a disabled or deleted user is rejected. Packages: `redb.Identity.Core`. Upgrade: [UPGRADING.md](../UPGRADING.md#openiddict-7). ### Changed - **OpenIddict 7.7** (was 6.3), Microsoft.Extensions and ASP.NET Core 10.0.13, Microsoft.IdentityModel 8.23.0. Existing sessions survive the upgrade: tokens issued by 6.3 keep validating. Packages: `redb.Identity.Core`. Upgrade: [UPGRADING.md](../UPGRADING.md#openiddict-7). - **`compose.managed.yml` and `compose.full.yml` mount the volume `dp_keys` on `/root/.aspnet/DataProtection-Keys`** for the key rings of the Tsak worker and dashboard. A 4.3 container without that volume: copy its ring out with `docker cp` and import it on the first start of 4.4 with `Identity:DataProtection:ImportKeysFromPath`. Packages: `redb.Identity.Core`. Upgrade: [UPGRADING.md](../UPGRADING.md#dataprotection-key-ring). - **The `redb-identity-web` image runs as the non-root `app` user (uid 1654)** instead of root. Its state lives on named volumes owned by that user; a host directory mounted on `/app/keys` or `/app/logs` instead must be writable by uid 1654. The `backend`, `managed` and `full` images still run as root, like the Tsak images they are built on. Packages: `redb.Identity.Web`. ### Fixed - **The server's DataProtection key ring is stored in redb, as documented.** Up to 4.3 it stayed in the file system, so a container recreated without that directory did not start and each cluster node had a ring of its own. The first start of 4.4 imports the old file ring into redb once; signing keys, TOTP secrets and sessions stay valid. Packages: `redb.Identity.Core`, `redb.Identity.DataProtection`, `redb.Identity.Http`. Upgrade: [UPGRADING.md](../UPGRADING.md#dataprotection-key-ring). - **Identity Web keeps its sessions and file log across a recreated container.** New settings `Identity:DataProtectionKeysPath` and `Identity:LogsPath`; the `redb-identity-web` and `redb-identity-full` images set them to the volumes `web_keys` and `web_logs` of their compose files. Before, every recreated container signed all users out. Packages: `redb.Identity.Web`. Path: redb-identity/changelog/CHANGELOG-4.5.x.md Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity Page: https://redbase.app/src/dev-2026-12-06/redb-identity/changelog/CHANGELOG-4.5.x.md ---- # redb.Identity changelog: 4.5.x Releases of the 4.5 line, moved here unchanged from CHANGELOG.md, which keeps the latest released line only. Newer releases: [CHANGELOG.md](../CHANGELOG.md). ## [4.5.1] — 2026-10-30 ### Security - **Audit targets receive the event and nothing of the request that raised it.** In 4.5.0 every target of `Identity:Audit:Targets` (Kafka, AMQP, a log endpoint, a consumer module) also got the request's headers: the client secret of a token request, `Authorization` with the bearer token, cookies, `redbHttp.*`; and a management read sent its answer (user, role or scope lists) instead of an event. Rotate those client secrets if a target stored or logged them. Packages: `redb.Identity.Core`. ### Fixed - **A management call no longer repeats the previous call's audit event.** An in-process caller that sent one exchange to several management routes in a row (for example attach a scope to a role, then list the role's scopes) had the first operation's event raised again by every following call on that exchange. Each operation now raises only its own. Packages: `redb.Identity.Core`. ## [4.5.0] — 2026-10-29 ### Breaking - **A role's scopes reach a token only when the client asks for them.** They used to be added to every token of the user for any client, past the client's permissions, so an administrator's sign-in to any application gave it a token that administered Identity. Request the scope explicitly. Upgrade: [UPGRADING.md](../UPGRADING.md#role-scopes-only-when-the-client-asks-for-them). Packages: `redb.Identity.Core`. Upgrade: [UPGRADING.md](../UPGRADING.md#role-scopes-only-when-the-client-asks-for-them). ### Fixed - **`Identity:Audit` takes effect when Identity runs as a Tsak module.** The targets the audit events are multicast to (Kafka, Elasticsearch, RabbitMQ, a log, a `direct-vm` route), the filter and the switches were ignored there, and events reached only the built-in audit table. They are now read from the context configuration. Packages: `redb.Identity.Core`, `redb.Identity.Core.Module`. - **`Identity:SeedAdmin:Password` takes effect on a database shared with the Tsak dashboard.** In cluster mode the dashboard gives the empty `admin` its own default password first, and the configured one was then never applied. It now replaces a stored password that is still admin/admin; a password that was changed is left as it is. Packages: `redb.Identity.Core`. - **The `TokenRevoked` audit event names the token's user.** A revocation at `/connect/revocation` or through the token management API now carries the user's id, like `TokensRevokedByUser` does, so a subscriber can act on that user alone. A client-credentials token has no user, and its event still carries none. Packages: `redb.Identity.Core`. - **A group created with a name only works again.** For a member of a group without type and description, the user's group list failed with a `NullReferenceException`, and so did reading or updating that group. At sign-in this member got no group roles and was refused scopes and applications that require group membership. Nothing to do after upgrading. Packages: `redb.Identity.Core`. - **`compose.managed.yml` and `compose.full.yml` no longer expose the Tsak management API.** It has no API keys in these images and answered on a published port 9090; it now listens on 127.0.0.1 inside the container, behind the dashboard, and the dashboard's password `TSAK_WEB_ADMIN_PASSWORD` is required instead of the image's admin/admin. Packages: `redb.Identity.Core.Module`. - **Identity Web no longer warns on every start of the `full` image.** Its first revoked-sessions poll ran before the Identity host answered and was then retried only after a full poll interval. While the host is still starting, the poll now retries within seconds and logs that at information level; a refused secret still warns at once. Packages: `redb.Identity.Web`. Path: redb-identity/changelog/CHANGELOG-4.6.x.md Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity Page: https://redbase.app/src/dev-2026-12-06/redb-identity/changelog/CHANGELOG-4.6.x.md ---- # redb.Identity changelog: 4.6.x Releases of the 4.6 line, moved here unchanged from CHANGELOG.md, which keeps the latest released line only. Newer releases: [CHANGELOG.md](../CHANGELOG.md). ## [4.6.2] — 2026-11-05 ### Security - **DPoP-bound access tokens now require a DPoP proof at `/connect/userinfo` and the management API.** A token bound to a DPoP key is accepted there only as `Authorization: DPoP ` with a fresh proof carrying `ath`; as Bearer or without a proof it gets 401. Advisory: [GHSA-vmj2-8phj-mfxf](https://github.com/redbase-app/redb-identity/security/advisories/GHSA-vmj2-8phj-mfxf). Packages: `redb.Identity.Core`, `redb.Identity.Http`. Upgrade: [UPGRADING.md](../UPGRADING.md#dpop-bound-access-tokens-at-userinfo-and-the-management-api). ## [4.6.1] — 2026-11-04 ### Changed - **Built on redb 4.6.1, redb.Route 4.6.1 and redb.Tsak 4.6.1.** The images and archives take the fixes of those releases; redb.Identity itself has no change. Nothing to do on your side. ## [4.6.0] — 2026-11-03 ### Fixed - **An authorization request sent as POST no longer loses its parameters at the login page.** When the user had no session yet, `POST /connect/authorize` sent the browser to the login page without the request, and after login the server answered "The mandatory 'client_id' parameter is missing". The login and consent pages now return to the same request, including `client_id` with `request_uri` for pushed requests. Nothing to change on the client side. Packages: `redb.Identity.Http`. Path: redb-identity/changelog/CHANGELOG-4.7.x.md Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity Page: https://redbase.app/src/dev-2026-12-06/redb-identity/changelog/CHANGELOG-4.7.x.md ---- # redb.Identity changelog: 4.7.x Releases of the 4.7 line, moved here unchanged from CHANGELOG.md, which keeps the latest released line only. Newer releases: [CHANGELOG.md](../CHANGELOG.md). ## [4.7.8] — 2026-11-30 ### Changed - **Identity 4.7.8 and its images run on redb 4.7.8, with its fixes for a save from an older Props class and for filters on a field of a dictionary entry.** A database needs no conversion step. Packages: `redb.Identity.Core`. - **The `redb-identity-app` template starts `redb-identity-full:4.7.8`.** A project created from an earlier pack moves by setting `IDENTITY_VERSION=4.7.8` and building the web part with `--build-arg IDENTITY_IMAGE=ghcr.io/redbase-app/redb-identity-full:4.7.8`. ### Fixed - **Back-channel logout addresses can be held to the outbound URL rules.** Setting `Identity:BackchannelLogout:RequireHttps=true` and `:AllowPrivateNetworkTargets=false` checks a `backchannel_logout_uri` at registration and before every logout notification; on 4.7.x both are open by default, so nothing changes until you set them. Turn the check on, or set an initial access token, when dynamic registration is open; a later release turns the check on by default. Packages: `redb.Identity.Core`. - **Requests to client-registered addresses connect only where the address check allowed.** For a `jwks_uri`, a JAR `request_uri` or a back-channel logout URI the server now resolves the host once at connect time and connects only to an address that passes the same rules as the check before the request. A deployment that goes out through an HTTP proxy keeps working; there the check by name is the server's only check and the proxy's policy applies. Packages: `redb.Identity.Core`. - **Requests to client-registered addresses do not follow redirects.** A `jwks_uri`, a JAR `request_uri` or a back-channel logout URI that answers with a redirect now fails instead of being followed. A client whose address redirects (for example from `http` to `https`, or to a new host) registers the final address. Packages: `redb.Identity.Core`. - **The management API, SCIM and the account endpoints check each access token against its stored entry.** A token revoked at the revocation endpoint, or a token of a client that was deleted, is refused with `401` right away rather than at its expiry. Each such request reads the token entry once from the store. Packages: `redb.Identity.Core`. - **Dynamic registration answers only what it stored.** The registration answer echoed `jwks_uri`, and `jwks` for clients other than `private_key_jwt`, although neither was stored. The answer now carries only the stored `jwks`; a client that needs its `jwks_uri` used has it set through the management API. Packages: `redb.Identity.Core`. - **The registration read (RFC 7592) names the real auth method.** `GET /connect/register/{client_id}` answered `token_endpoint_auth_method: client_secret_basic` for every confidential client; a client with keys and no secret is now answered `private_key_jwt`, and the read also returns its stored `jwks` and `jwks_uri`. Packages: `redb.Identity.Core`. - **A JAR `request_uri` is fetched only for a known client.** The authorization endpoint now checks `client_id` before it fetches a `request_uri`. A request without `client_id`, or with an unknown one, is refused with `invalid_request_object` and the address is never contacted. Requests from registered clients behave as before. ## [4.7.7] — 2026-11-28 ### Changed - **Identity 4.7.7 and its images run on redb 4.7.7, which makes fewer round trips per Pro list call and runs several groupings faster.** Identity's own code is unchanged. A database needs no conversion step. Packages: `redb.Identity.Core`. ## [4.7.6] — 2026-11-27 ### Changed - **Identity 4.7.6 and its images run on redb 4.7.6, which loads pages with less memory and plans more queries through the indexes.** Identity's own code is unchanged. A database needs no conversion step. Packages: `redb.Identity.Core`. ## [4.7.5] — 2026-11-24 ### Security - **Dynamic client registration no longer answers from the Idempotency-Key cache.** A second caller that sent the same `Idempotency-Key` to `POST /connect/register` received the first registration's answer, its `client_secret` included. A repeated registration now registers another client. Packages: `redb.Identity.Core`. - **The Idempotency-Key cache no longer keeps a secret, and a repeat no longer shows it again.** Webhook create and rotate-secret, client secret rotation, MFA enrollment and recovery codes were cached with their answer, secret included; a repeat now gets `{"replayed":true,"secretWithheld":true,...}`. Earlier records go with the cleanup once they expire; to remove them at once, see the upgrade notes. Packages: `redb.Identity.Core`. Upgrade: [UPGRADING.md](../UPGRADING.md#idempotency-records-keep-no-secrets). ### Changed - **Identity 4.7.5 runs on redb 4.7.5, which stores `TimeSpan` and `TimeOnly` as ticks.** Identity's own data holds no such values, so an existing Identity database needs no conversion before the first start. Every node and image that shares the database still moves to 4.7.5 together; there is no way back except a backup. Packages: `redb.Identity.Core`. ### Fixed - **Changing the role of, or removing, a user who is not a member of the group answers `404`, not `500`.** The same holds when the group itself does not exist. `PUT` and `DELETE /groups/{id}/members/{userId}` answered `server_error` for such a request. Packages: `redb.Identity.Core`. - **A management request for a role or a group that does not exist answers `404`, not `500`.** Updating a role, and updating, moving, adding a child or a member to, or reading the tree, path or children of a group with an unknown id answered `server_error`. They now answer `404 not_found`, like the other management endpoints. Packages: `redb.Identity.Core`. - **A SCIM user create refused by a unique key answers with the SCIM error document and names the right attribute.** On SQLite the loser of two concurrent `POST /scim/v2/Users` could get `409` with the management error body instead of the SCIM error with `scimType: "uniqueness"` (RFC 7644 3.12). And a create whose e-mail was taken was told that its `userName` already exists; the detail now names the e-mail. Packages: `redb.Identity.Core`. - **An audit event whose row could not be written is counted.** A failed insert into `identity_audit_log` was only logged, so a gap in the audit trail showed up nowhere an operator alerts on. The meter `RedbIdentity` now has the counter `identity.audit.write_failures` (tag `event_type`); the event itself still goes on to webhooks and targets. Packages: `redb.Identity.Core`. - **The metric `identity.unique_violation` now counts.** It was defined and documented but nothing ever added to it. A unique-key violation that the server answers with the general `409 duplicate` is now counted, tagged `scheme` and `column` with what collided when the database says so (`unknown` otherwise). Packages: `redb.Identity.Core`. - **A webhook delivery now waits for the subscriber no longer than the subscription's `timeoutMs`.** The value was stored and returned by the management API but not applied: every attempt waited up to the transport's own default, 30 seconds over http. A subscriber that answers later than `timeoutMs` (default 5000) is now a failed attempt and is retried by the subscription's `maxAttempts` and `retryBackoffMs`. Packages: `redb.Identity.Core`. - **Updating a webhook subscription with `PUT /api/v1/identity/webhooks/{id}` works.** Every such request was refused with `400 validation_error` ("Body must be an UpdateWebhookSubscriptionRequest"); a subscription could only be deleted and created again. The fields sent are changed now, the others are left as they were. Packages: `redb.Identity.Core`. - **An unreadable HTTP Basic client credential on the token endpoint gets 401 `invalid_client` instead of a 500.** A Basic value that is not base64 used to be answered with 500 and the text "An unexpected error occurred while processing the request". It is now answered with 401 `invalid_client`, also on introspection and revocation. Packages: `redb.Identity.Core`, `redb.Identity.Http`. - **A failed notification mail no longer writes the recipient address to the error log.** The log line names the template and the mail endpoint; the address, which is personal data, is left out. Packages: `redb.Identity.Core`. - **Expired idempotency records are deleted.** They were ignored by the cache but stayed in the database; the hourly timer route `identity-idempotency-cleanup` now deletes them in batches (`Identity:IdempotencyCleanupInterval`, `Identity:IdempotencyCleanupBatchSize`). Packages: `redb.Identity.Core`, `redb.Identity.Contracts`. - **The admin MFA endpoints accept the granular MFA scopes.** A token with `identity:mfa:write` may run every operation under `/api/v1/identity/mfa` for any user, one with `identity:mfa:read` may read a user's MFA status. Before, these endpoints admitted only `identity:manage`. Review which clients hold `identity:mfa:write`: it now lets them set up, reset and disable another user's second factor. Packages: `redb.Identity.Core`. - **`MfaWebAuthnRegistered` and `MfaWebAuthnRevoked` reach the audit from self-service.** Registering or deleting a WebAuthn credential through `/api/v1/identity/me/webauthn` recorded only the generic `MfaSelfService:webauthn:*` event; it now records the specific one. Packages: `redb.Identity.Core`. - **`/connect/revocation` answers an error with 400, or 401 for `invalid_client`, instead of 200.** It used to send status 200 with the error in the body, so a client that checks only the status took a refused request for a revocation; such a client now sees the failure. A valid or unknown token is still answered with 200. Packages: `redb.Identity.Http`. - **The `demos/grpc-viewer` sample builds again.** `dotnet run` in that folder failed with MSB6004 (`protoc` not found under an empty tools path) on every platform: the sample named its target framework in a way that made the restore skip the build files of `Grpc.Tools`. Only the sample's project file changed. ## [4.7.4] — 2026-11-18 ### Security - **A blank `DynamicRegistrationInitialAccessToken` now counts as not configured.** An empty or whitespace value means open registration, so an anonymous registrant is refused the administrative scopes (`identity:*` other than `identity:account`, and `scim`) whatever `DynamicRegistrationAllowedScopes` lists. Check your configuration: to require a token for registration set a non-blank value; to turn registration off set `EnableDynamicRegistration` to false. Packages: `redb.Identity.Core`. Upgrade: [UPGRADING.md](../UPGRADING.md#dynamic-client-registration-check-the-initial-access-token). ### Changed - **Released alone on redb 4.7.2, redb.Route 4.7.2 and redb.Tsak 4.7.2.** The images sit on the Tsak 4.7.2 bases. The redb-identity-app template still defaults to 4.7.2: set IDENTITY_VERSION=4.7.4 and build the web part with --build-arg IDENTITY_IMAGE=ghcr.io/redbase-app/redb-identity-full:4.7.4. - **Two defaults of the images change.** Dynamic client registration is off: if you register clients through `POST /connect/register`, turn it on with `EnableDynamicRegistration` in both `identity.core` and `identity.http` and set `DynamicRegistrationInitialAccessToken`. A JAR `request_uri` is fetched only over https and not from private network addresses: for a client that hosts request objects on such an address, set `Identity:Jar:RequestUriAllowPrivateNetworkTargets` and `Identity:Jar:RequestUriRequireHttps` in `identity.core` back. Upgrade: [UPGRADING.md](../UPGRADING.md#image-defaults-from-474). ## [4.7.3] — 2026-11-14 ### Changed - **Released alone on redb 4.7.2, redb.Route 4.7.2 and redb.Tsak 4.7.2.** The images sit on the Tsak 4.7.2 bases. The redb-identity-app template still defaults to 4.7.2: set IDENTITY_VERSION=4.7.3 and build the web part with --build-arg IDENTITY_IMAGE=ghcr.io/redbase-app/redb-identity-full:4.7.3. ### Fixed - **On PostgreSQL, the admin password reset and the admin password change work again.** With the default max_prepared_transactions = 0 they were rolled back and the caller got 400 "Id is required". The password history is now read and written on the route's own connection. Packages: `redb.Identity.Core`. ## [4.7.2] — 2026-11-13 ### Changed - **Built on redb 4.7.2, redb.Route 4.7.2 and redb.Tsak 4.7.2.** The images and archives take the SQLite fix of redb 4.7.2: a save repeated after a rolled-back transaction no longer overwrites another object. redb.Identity itself has no change. ## [4.7.1] — 2026-11-11 ### Security - **System.Formats.Cbor is pinned to the patched 9.0.24.** The WebAuthn dependency brought in 9.0.0, which is affected by CVE-2026-118747 (denial of service while parsing CBOR). The packages now name the patched version; the server archives ship the .NET 10.0.15 runtime, which carries the ASP.NET Core fix for CVE-2026-114147. Packages: `redb.Identity.Core`. ### Changed - **Built on redb 4.7.1, redb.Route 4.7.1 and redb.Tsak 4.7.1.** The images and archives take the fixes of those releases, among them the SQL Server module version that made a start without schema rights fail. ### Fixed - **On PostgreSQL the loser of a concurrent create is answered 409, not 500.** When two calls created the same record at once (the bootstrap administrator's client, a federation provider), the second one hit the unique key and was told `server_error`. It now gets `409 duplicate`, as on SQL Server and SQLite. Nothing was written twice. Packages: `redb.Identity.Core`. ## [4.7.0] — 2026-11-06 ### Changed - **Built on redb 4.7.0, redb.Route 4.7.0 and redb.Tsak 4.7.0.** The images and archives take the additions of those releases; redb.Identity itself has no change. Nothing to do on your side. ### Deprecated - **.NET 8 and .NET 9 targets end with 4.7.** Microsoft's support for both ends on 10 November 2026, so 4.7.0 is the last release whose packages target them; from 4.8.0 the packages target .NET 10 and later. The images already run on .NET 10 and do not change. Fixes on the 4.7.x line are still built for .NET 8, 9 and 10 while those lines can be built without known vulnerabilities. Move projects that reference the packages to .NET 10 before taking 4.8.