idip: idss-idp-bridge — the OIDC bridge at id.<apex>: sign-in by AID + membership credential #776

Closed
opened 2026-08-25 04:27:00 +00:00 by ben · 2 comments
Owner

Parent

Feature spec: #767 (idip; wayfinder map #725).

What to build

The idss-idp core service (ADR 0196): a Go binary wrapping zitadel/oidc/v3's op package (ory/fosite fallback; never hand-roll the OIDC surface), served at id.<apex> — kanidm's slot, so every existing route and client keeps its door — with its own unit and declared health check, its OIDC clients declared in Nix (ADR 0199). Sign-in (prototype #732's proven sequence): the brand-kit-worn native sign-in page (ADR 0199 — a named member-facing surface owed wireframe-fidelity design in this slice) accepts the member's recovery phrase, reconnects their agent from the derived passcode, runs the KERI challenge/response, verifies the membership ACDC (right issuer, right schema, issued-not-revoked via the issuer-side IsIssued check), and completes the code flow. Claims: sub = AID prefix; profile from the membership ACDC; groups mirror kanidm 1:1 (members, operators, committee:<slug>). Lifetimes: ID/access 1 h; refresh 30 d rotating with the IsIssued re-check on every refresh; session cookie 12 h; PKCE S256 required for every client. The bridge persists only signing keys, code/refresh records, and a short-lived key-state cache — no member records. Per the slice-map ruling it consumes IsIssued through the port's FAKE binding here (no dependency on the keria adapter — the e2e drive is the join point). Named build-time verification: Netbird's flows (authorization-code; device-code if used) work against the bridge.

Acceptance criteria

  • (story 12) Given an active member at an OIDC-gated service, when they sign in at id. with their phrase, then challenge/response + ACDC verification + the issuer-side check complete the code flow; a repeat sign-in where the bridge holds the credential runs only the challenge.
  • (story 14) Given an AID with no membership credential, when sign-in is attempted, then the bridge refuses with the waiting state's honest wording — no token minted.
  • (story 16) Given the ID token, then sub = AID prefix, profile claims come from the membership ACDC, and groups are members/operators/committee: mirroring kanidm 1:1.
  • (story 17) Given a revoked credential, when the next refresh runs, then it is refused (IsIssued re-check); token lifetimes and PKCE S256 hold as ruled.
  • (story 18) Given a wiped and re-provisioned bridge, then only live sessions are lost — no member records existed in it.
  • (story 15) Given the sign-in page, then it wears the full brand kit natively (no override.css machinery).
  • (story 16, Netbird row) Given Netbird's OIDC flows, when verified against the bridge, then authorization-code (and device-code if used) complete.

Blocked by

  • #771 — idip:keri-stack-nix
  • #773 — idip:credential-schemas
  • #772 — idip:keri-client-core
  • bootstrap:brandkit-seam (#27) (done — satisfied)

Task manifest

task: idip:idss-idp-bridge
interface: 'the idss-idp core service at id.<apex>: OIDC discovery/auth-code+PKCE/refresh over zitadel-oidc
  op; KERI challenge/response + ACDC presentation sign-in; claims sub=AID + ACDC profile + kanidm-mirroring
  groups; 1h/30d-rotating-with-IsIssued-recheck/12h; brand-native sign-in page; clients in Nix'
seam: 'the OIDC-over-HTTP smoke (smoke-idp pattern) against the real packaged stack: discovery, code+PKCE,
  claims/groups content, credential-less refusal, refresh-after-revoke refused; IsIssued via the port
  fake (slice-map ruling — the e2e drive joins the real adapter)'
acceptance:
- given: an active member with their phrase
  when: sign-in at id.<apex>
  then: challenge/response + ACDC check + issuer-side check complete the code flow
- given: an AID without a membership credential
  when: sign-in attempted
  then: honest refusal, no token
- given: a revoked credential
  when: next refresh
  then: refused — IsIssued re-check
- given: a wiped bridge re-provisioned
  when: members return
  then: only live sessions were lost
depends_on:
- keri-stack-nix
- credential-schemas
- keri-client-core
- bootstrap:brandkit-seam
out_of_scope:
- the real IsIssued binding — keria-adapter-core (joined at idip-e2e-drive)
- mail / app passwords (spec Out of Scope, ADR 0199)
- passkeys (ADR 0195)
needs_human_decision: []
## Parent Feature spec: #767 (idip; wayfinder map #725). ## What to build The `idss-idp` core service (ADR 0196): a Go binary wrapping `zitadel/oidc/v3`'s `op` package (`ory/fosite` fallback; never hand-roll the OIDC surface), served at `id.<apex>` — kanidm's slot, so every existing route and client keeps its door — with its own unit and declared health check, its OIDC clients declared in Nix (ADR 0199). Sign-in (prototype #732's proven sequence): the brand-kit-worn native sign-in page (ADR 0199 — a named member-facing surface owed wireframe-fidelity design in this slice) accepts the member's recovery phrase, reconnects their agent from the derived passcode, runs the KERI challenge/response, verifies the membership ACDC (right issuer, right schema, issued-not-revoked via the issuer-side IsIssued check), and completes the code flow. Claims: `sub` = AID prefix; profile from the membership ACDC; groups mirror kanidm 1:1 (`members`, `operators`, `committee:<slug>`). Lifetimes: ID/access 1 h; refresh 30 d rotating with the IsIssued re-check on every refresh; session cookie 12 h; PKCE S256 required for every client. The bridge persists only signing keys, code/refresh records, and a short-lived key-state cache — no member records. Per the slice-map ruling it consumes IsIssued through the port's FAKE binding here (no dependency on the keria adapter — the e2e drive is the join point). Named build-time verification: Netbird's flows (authorization-code; device-code if used) work against the bridge. ## Acceptance criteria - [ ] (story 12) Given an active member at an OIDC-gated service, when they sign in at id.<apex> with their phrase, then challenge/response + ACDC verification + the issuer-side check complete the code flow; a repeat sign-in where the bridge holds the credential runs only the challenge. - [ ] (story 14) Given an AID with no membership credential, when sign-in is attempted, then the bridge refuses with the waiting state's honest wording — no token minted. - [ ] (story 16) Given the ID token, then sub = AID prefix, profile claims come from the membership ACDC, and groups are members/operators/committee:<slug> mirroring kanidm 1:1. - [ ] (story 17) Given a revoked credential, when the next refresh runs, then it is refused (IsIssued re-check); token lifetimes and PKCE S256 hold as ruled. - [ ] (story 18) Given a wiped and re-provisioned bridge, then only live sessions are lost — no member records existed in it. - [ ] (story 15) Given the sign-in page, then it wears the full brand kit natively (no override.css machinery). - [ ] (story 16, Netbird row) Given Netbird's OIDC flows, when verified against the bridge, then authorization-code (and device-code if used) complete. ## Blocked by - #771 — idip:keri-stack-nix - #773 — idip:credential-schemas - #772 — idip:keri-client-core - bootstrap:brandkit-seam (#27) (done — satisfied) ## Task manifest ```yaml task: idip:idss-idp-bridge interface: 'the idss-idp core service at id.<apex>: OIDC discovery/auth-code+PKCE/refresh over zitadel-oidc op; KERI challenge/response + ACDC presentation sign-in; claims sub=AID + ACDC profile + kanidm-mirroring groups; 1h/30d-rotating-with-IsIssued-recheck/12h; brand-native sign-in page; clients in Nix' seam: 'the OIDC-over-HTTP smoke (smoke-idp pattern) against the real packaged stack: discovery, code+PKCE, claims/groups content, credential-less refusal, refresh-after-revoke refused; IsIssued via the port fake (slice-map ruling — the e2e drive joins the real adapter)' acceptance: - given: an active member with their phrase when: sign-in at id.<apex> then: challenge/response + ACDC check + issuer-side check complete the code flow - given: an AID without a membership credential when: sign-in attempted then: honest refusal, no token - given: a revoked credential when: next refresh then: refused — IsIssued re-check - given: a wiped bridge re-provisioned when: members return then: only live sessions were lost depends_on: - keri-stack-nix - credential-schemas - keri-client-core - bootstrap:brandkit-seam out_of_scope: - the real IsIssued binding — keria-adapter-core (joined at idip-e2e-drive) - mail / app passwords (spec Out of Scope, ADR 0199) - passkeys (ADR 0195) needs_human_decision: [] ```

swarm-claim host=elitebook-distributed-server-03 run=10057
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=elitebook-distributed-server-03 run=10057 (automated multi-host claim — lowest live claim id works this ticket)

close-report for #776 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 776,
  "status": "success",
  "commits": [
    "3f4e26178f60df44963e78178dd9eed10f73ce99"
  ],
  "changed_files": [
    "STATUS.md",
    "control-plane/cmd/idss-idp/main.go",
    "go.mod",
    "go.sum",
    "go.work",
    "internal/clan/idssidp.go",
    "internal/clan/idssidp_test.go",
    "internal/idp/brand.go",
    "internal/idp/client.go",
    "internal/idp/config.go",
    "internal/idp/config_test.go",
    "internal/idp/device.go",
    "internal/idp/fake_verifier_test.go",
    "internal/idp/provider.go",
    "internal/idp/requests.go",
    "internal/idp/seam_test.go",
    "internal/idp/signin.go",
    "internal/idp/storage.go",
    "internal/idp/verifier.go"
  ],
  "tests": [
    {
      "command": "nix develop .#go-ci -c go test ./...",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c go build ./...",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c go vet ./...",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c golangci-lint run ./...",
      "exit_code": 0
    },
    {
      "command": "cd broker && nix develop .#go-ci -c go test ./...",
      "exit_code": 0
    }
  ],
  "criteria": {
    "story 12 — active member: challenge/response + ACDC + issuer-side check complete the code flow; repeat holds credential runs only the challenge": "internal/idp/seam_test.go TestSeam_ActiveMember_CodeFlowAndClaims (full authorize->verify->callback->token) + TestSeam_RepeatSignIn_OnlyChallenge (second sign-in with NO presentation still completes via the held-credential cache); signin.go handleVerify + storage.go held cache",
    "story 14 — AID without a membership credential: honest waiting-state refusal, no token": "internal/idp/seam_test.go TestSeam_NoMembership_RefusedNoToken asserts no 302/redirect (no token) and the honest 'membership credential' wording; signin.go writeVerifyError ErrNoMembership branch",
    "story 16 — sub=AID prefix, profile from the membership ACDC, groups members/operators/committee:<slug> mirroring kanidm 1:1": "internal/idp/seam_test.go TestSeam_ActiveMember_CodeFlowAndClaims decodes the id_token and asserts sub==AID, preferred_username/name from the ACDC, and exactly {members,operators,committee:taiao}; verifier.go Identity.Groups + storage.go setUserinfo",
    "story 17 — revoked credential refused on the next refresh (IsIssued re-check); lifetimes + PKCE S256 hold": "internal/idp/seam_test.go TestSeam_RefreshAfterRevoke_Refused (pre-revoke refresh rotates+succeeds, post-revoke refresh refused) + TestSeam_PKCE_S256_Required; storage.go TokenRequestByRefreshToken IsIssued re-check + CreateAuthRequest S256 enforcement; client.go 1h/30d lifetimes",
    "story 18 — wiped and re-provisioned bridge loses only live sessions; no member records existed": "internal/idp/seam_test.go TestSeam_WipedBridge_LosesOnlySessions (old refresh token invalid on a fresh bridge, member re-signs-in with no member record); storage.go store holds only auth-code/refresh/session state, no member store",
    "story 15 — the sign-in page wears the full brand kit natively (no override.css)": "internal/idp/seam_test.go TestSeam_SignInPage_WearsBrandKitNatively (data-field community-logo/welcome-line/recovery-phrase, data-action sign-in, matou accent #619793, community name, NO override.css) + config_test.go brand fallback; brand.go compiles the kit via brandkit.PortalSurface tokens.css; internal/clan/idssidp.go IDSS_IDP_BRAND_FILE wiring (TestRenderIdssIdp_BrandFileForNativeSignIn)",
    "story 16 (Netbird row) — authorization-code (and device-code if used) complete against the bridge": "internal/idp/seam_test.go TestSeam_Netbird_AuthCodeAndDeviceServed (public netbird client completes auth-code+PKCE; discovery advertises the device-code grant + device_authorization endpoint mints device/user codes); client.go GrantTypes incl device_code; device.go op.DeviceAuthorizationStorage. Full device-approval UI is filed as #795"
  },
  "summary": "Built the idss-idp OIDC bridge (control-plane/cmd/idss-idp + internal/idp) wrapping zitadel/oidc's op, gating sign-in on a KERI challenge/ACDC Verifier port with a fail-closed default and a seam fake, serving 1h/30d-rotating-with-IsIssued-recheck tokens + kanidm-mirroring groups + a brand-native sign-in page, verified by an OIDC-over-HTTP seam.",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #776 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 776, "status": "success", "commits": [ "3f4e26178f60df44963e78178dd9eed10f73ce99" ], "changed_files": [ "STATUS.md", "control-plane/cmd/idss-idp/main.go", "go.mod", "go.sum", "go.work", "internal/clan/idssidp.go", "internal/clan/idssidp_test.go", "internal/idp/brand.go", "internal/idp/client.go", "internal/idp/config.go", "internal/idp/config_test.go", "internal/idp/device.go", "internal/idp/fake_verifier_test.go", "internal/idp/provider.go", "internal/idp/requests.go", "internal/idp/seam_test.go", "internal/idp/signin.go", "internal/idp/storage.go", "internal/idp/verifier.go" ], "tests": [ { "command": "nix develop .#go-ci -c go test ./...", "exit_code": 0 }, { "command": "nix develop .#go-ci -c go build ./...", "exit_code": 0 }, { "command": "nix develop .#go-ci -c go vet ./...", "exit_code": 0 }, { "command": "nix develop .#go-ci -c golangci-lint run ./...", "exit_code": 0 }, { "command": "cd broker && nix develop .#go-ci -c go test ./...", "exit_code": 0 } ], "criteria": { "story 12 — active member: challenge/response + ACDC + issuer-side check complete the code flow; repeat holds credential runs only the challenge": "internal/idp/seam_test.go TestSeam_ActiveMember_CodeFlowAndClaims (full authorize->verify->callback->token) + TestSeam_RepeatSignIn_OnlyChallenge (second sign-in with NO presentation still completes via the held-credential cache); signin.go handleVerify + storage.go held cache", "story 14 — AID without a membership credential: honest waiting-state refusal, no token": "internal/idp/seam_test.go TestSeam_NoMembership_RefusedNoToken asserts no 302/redirect (no token) and the honest 'membership credential' wording; signin.go writeVerifyError ErrNoMembership branch", "story 16 — sub=AID prefix, profile from the membership ACDC, groups members/operators/committee:<slug> mirroring kanidm 1:1": "internal/idp/seam_test.go TestSeam_ActiveMember_CodeFlowAndClaims decodes the id_token and asserts sub==AID, preferred_username/name from the ACDC, and exactly {members,operators,committee:taiao}; verifier.go Identity.Groups + storage.go setUserinfo", "story 17 — revoked credential refused on the next refresh (IsIssued re-check); lifetimes + PKCE S256 hold": "internal/idp/seam_test.go TestSeam_RefreshAfterRevoke_Refused (pre-revoke refresh rotates+succeeds, post-revoke refresh refused) + TestSeam_PKCE_S256_Required; storage.go TokenRequestByRefreshToken IsIssued re-check + CreateAuthRequest S256 enforcement; client.go 1h/30d lifetimes", "story 18 — wiped and re-provisioned bridge loses only live sessions; no member records existed": "internal/idp/seam_test.go TestSeam_WipedBridge_LosesOnlySessions (old refresh token invalid on a fresh bridge, member re-signs-in with no member record); storage.go store holds only auth-code/refresh/session state, no member store", "story 15 — the sign-in page wears the full brand kit natively (no override.css)": "internal/idp/seam_test.go TestSeam_SignInPage_WearsBrandKitNatively (data-field community-logo/welcome-line/recovery-phrase, data-action sign-in, matou accent #619793, community name, NO override.css) + config_test.go brand fallback; brand.go compiles the kit via brandkit.PortalSurface tokens.css; internal/clan/idssidp.go IDSS_IDP_BRAND_FILE wiring (TestRenderIdssIdp_BrandFileForNativeSignIn)", "story 16 (Netbird row) — authorization-code (and device-code if used) complete against the bridge": "internal/idp/seam_test.go TestSeam_Netbird_AuthCodeAndDeviceServed (public netbird client completes auth-code+PKCE; discovery advertises the device-code grant + device_authorization endpoint mints device/user codes); client.go GrantTypes incl device_code; device.go op.DeviceAuthorizationStorage. Full device-approval UI is filed as #795" }, "summary": "Built the idss-idp OIDC bridge (control-plane/cmd/idss-idp + internal/idp) wrapping zitadel/oidc's op, gating sign-in on a KERI challenge/ACDC Verifier port with a fail-closed default and a seam fake, serving 1h/30d-rotating-with-IsIssued-recheck tokens + kanidm-mirroring groups + a brand-native sign-in page, verified by an OIDC-over-HTTP seam.", "reason": "", "blockers": [], "no_code_change": "" } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Matou/idss#776
No description provided.