wallet-signs-in: idss-idp binds the ADR 0212 unbound verifier — IDSS_IDP_SIGNIN_URL unset #1667

Closed
opened 2026-09-20 17:09:10 +00:00 by matou-build-agent · 3 comments

The failure

wallet-signs-in is the only red of 40 legs (verdict.json: "green": 39, "red": 1, "skip": 0, "firstRedLeg": "wallet-signs-in"). This is not the drive's KNOWN frontier — pair is green (4057 ms) and legs.json carries no skip reasons at all. It is a fresh red on the leg commit 43d856fe added.

The headless wallet presented at the app door and was refused for a bad signature:

"error": "the door verifies the wallet's presentation — it said {\"status\":\"refused\",\"refusal\":\"signature\"}"
Expected: "verified"  Received: "refused"

artifacts/wallet-signs-in.json shows the ask it signed and the verdict it got:

"ask": { "challenge_id": "SrZONd2llnlGYR_ZLu9JqXPovO4W7HkkyXWU3OWRYBo",
         "door": "https://id.rehearsal-f.idss.nz/login" },
"verdict": { "status": 200, "body": { "status": "refused", "refusal": "signature" } }

The key, the KEL and the credential are all fine. Seconds earlier the same AID with the same signing key was verified by the control plane's space-ID door (logs/droplet-journal.txt):

17:05:13 idss-control-plane-start[4133]: msg="keriauth: challenge legs" aid=EBNff6AWBKUZXpDkLuEp653Qr90MAcjmdvvr8efQHlFG legs_ms="map[challenge_sig:0 signer_kel:20]"
17:05:13 idss-control-plane-start[4133]: msg="community space-ID door: steward credential verified" credential=EECMqatmR34X2XNAsgQS1Bpy-m8sCB7Vz4i1nyJMBOmA

(wallet-records-spaces green, 4257 ms.) So only the idp door refuses it.

Why — the two halves sign different bytes

The live box names the bound verifier in its own startup line (journalctl -u idss-idp, and droplet-journal.txt:986):

17:01:56 gateway idss-idp[10980]: msg="idss-idp sign-in verifier bound: challenge/response against the KEL door, membership from the control plane's roster (ADR 0212)" keystate_url=http://127.0.0.1:3902/oobi/{aid} control_plane_url=http://127.0.0.1:8080

That is internal/idp/bind.go:66 — the ADR 0212 KeriVerifier, not the ADR 0236 ledger verifier. KeriVerifier checks the unbound message (internal/idp/keri_verifier.go:89):

ok, err := keriauth.VerifySignature(keys[0], keriauth.SignedMessage(s.AID, s.ChallengeID), s.Response)
// internal/keriauth/challenge.go:22 → "idss-idp:" + aid + ":" + nonce   (no door)

But the app door minted an ask naming a door, and the wallet signed the ADR 0236 §5 door-bound form (app/tests/e2e/fixtures/headlessWallet.ts:69):

const boundMessage = (door, aid, nonce) => `idss-idp:${door}:${aid}:${nonce}`;

Ed25519 over idss-idp:https://id.rehearsal-f.idss.nz/login:EBNff6…:SrZONd… against a verifier expecting idss-idp:EBNff6…:SrZONd… → false → ErrChallengeFailed → refusalKind returns "signature" (internal/idp/appdoor.go:375). HTTP 200, exactly the recorded body.

The specific defect

BindVerifier gates the ADR 0236 path on three inputs (internal/idp/bind.go:41):

if provider := orgIdentityTrustProvider(...); provider != nil && cfg.SignInURL != "" && cfg.KeyStateURL != "" {

On the live box two of the three are satisfied and the third is absent. systemctl cat idss-idp renders:

Environment="IDSS_IDP_KEYSTATE_URL=http://127.0.0.1:3902/oobi/{aid}"
Environment="IDSS_IDP_ORG_IDENTITY_FILE=/srv/idss/config/idss/org-identity.json"

…and there is no IDSS_IDP_SIGNIN_URL — confirmed in the unit and in /proc/10980/environ. The trust half is genuinely armed: /srv/idss/config/idss/org-identity.json landed at founding (16:59, 447 bytes, "aid": "EEpszSOEMSaxyUV07Vuoq6iwxznpD8mYPiJFTwVgkA9w" + oobi + registry), and idss-idp restarted at 17:01:56 after it. Only cfg.SignInURL == "" sends it down the 0212 branch.

The module is the source: internal/clan/idssidp.go renders IDSS_IDP_ISSUER, IDSS_IDP_KEYSTATE_URL, IDSS_IDP_CONTROL_PLANE_URL, IDSS_IDP_ORG_IDENTITY_FILE (lines 254–297) — and never IDSS_IDP_SIGNIN_URL. grep -rn IDSS_IDP_SIGNIN_URL across the repo hits only internal/idp/config.go:259 (the reader) and STATUS.md:174, which states the contract plainly: "BindVerifier binds the ledger verifier whenever IDSS_IDP_TRUST_ISSUER + IDSS_IDP_SIGNIN_URL + the KEL door are seeded (else today's roster/DeniedVerifier)". #1653 late-bound the trust half onto the org-identity file and the module was updated for that; the sign-in-address half was never added.

The empty value is silently papered over on the ask side, which is what turns a config gap into a crypto mismatch instead of an honest refusal — internal/idp/provider.go:154:

doorURL := cfg.SignInURL
if doorURL == "" {
    doorURL = strings.TrimRight(cfg.Issuer, "/") + loginPath   // → https://id.rehearsal-f.idss.nz/login
}

So the door asks for bytes bound to an address it will not check. The ask's door field and bind.go's gate read from the same config field but disagree about what empty means.

Suspected layer

Product — the gateway's own NixOS module plus the bind/ask split. Not harness: the leg's expectation (verified) is correct per ADR 0236 §5 and DDR 0246, and the wallet fixture signs the form the ask asks for. Not infra: the droplet is healthy, idss-idp is up and listening on 127.0.0.1:8465, systemctl --failed is empty, and the KEL door answers 200 for the AID (curl http://127.0.0.1:3902/oobi/EBNff6… returns the icp with k:["DGG9-vu0v9syomc9sRgjTCpSL4AnbDdnaDxWFJkjDVJh"]).

What plugging it needs

  1. Render the missing env var. In internal/clan/idssidp.go, beside IDSS_IDP_ORG_IDENTITY_FILE (~line 285), emit IDSS_IDP_SIGNIN_URL = "https://<IdLabel>.<apex>/login" — the same address provider.go falls back to, so the ask and the verifier name one door. That alone flips BindVerifier to NewLateBoundLedgerVerifier and makes the verified bytes match the signed bytes. Pin it with a module test in internal/clan/idssidp_test.go (which today asserts the signing-key generator but not this).
  2. Close the silent-fallback seam so this cannot recur as a crypto error: provider.go:155's derive-from-issuer fallback and bind.go:41's cfg.SignInURL != "" gate must read one resolved value. Either resolve the door address once at boot and hand it to both (so an unseeded door still arms bound), or, if it cannot be resolved, have the app door refuse honestly rather than mint an ask naming a door nothing checks.
  3. Re-drive the other idp legs. Binding the ledger verifier also moves membership off the control-plane roster onto the witnessed ledger + TEL re-check. member-sign-in, oidc-admin, suspend-readmit, credential-claim-gone and restricted-* are green today on the ADR 0212 path and will exercise the 0236 path after the fix — that is ADR 0236's intended destination, not a new decision, but it is a real behaviour change and must be re-driven, not assumed.

Notes on evidence

The live box was reachable and answered every read-only probe; it is the primary source above. One absence worth recording: idss-idp logs nothing per request — journalctl -u idss-idp --since "17:02:00" is -- No entries -- even though the challenge mint and the refusal both happened at ~17:05:17. The refusal reason is discarded at the port boundary (refusalKind collapses it to "signature" by design, DDR 0246 decision 7), but KeriVerifier also never logs the verify failure — only key-state and undecodable-signature faults get a log.Warn. A one-line Debug/Warn on a failed VerifySignature naming the door it bound over would have made this diagnosable from the harvested logs alone, without the live box.

drive 20260920T164135Z red at wallet-signs-in: the door verifies the wallet's presentation — it said {"status":"refused","refusal":"signature"} expect(received).toBe(expected) // Object.is equality Expected: "verified" Received: "refused"
evidence: /home/swarm/session-runner/idss/test-results/drive-idip/20260920T164135Z on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured

## The failure `wallet-signs-in` is the only red of 40 legs (`verdict.json`: `"green": 39, "red": 1, "skip": 0`, `"firstRedLeg": "wallet-signs-in"`). This is **not** the drive's KNOWN frontier — `pair` is green (4057 ms) and `legs.json` carries no skip reasons at all. It is a fresh red on the leg commit `43d856fe` added. The headless wallet presented at the app door and was refused for a bad signature: ``` "error": "the door verifies the wallet's presentation — it said {\"status\":\"refused\",\"refusal\":\"signature\"}" Expected: "verified" Received: "refused" ``` `artifacts/wallet-signs-in.json` shows the ask it signed and the verdict it got: ```json "ask": { "challenge_id": "SrZONd2llnlGYR_ZLu9JqXPovO4W7HkkyXWU3OWRYBo", "door": "https://id.rehearsal-f.idss.nz/login" }, "verdict": { "status": 200, "body": { "status": "refused", "refusal": "signature" } } ``` The key, the KEL and the credential are all fine. Seconds earlier the **same AID with the same signing key** was verified by the control plane's space-ID door (`logs/droplet-journal.txt`): ``` 17:05:13 idss-control-plane-start[4133]: msg="keriauth: challenge legs" aid=EBNff6AWBKUZXpDkLuEp653Qr90MAcjmdvvr8efQHlFG legs_ms="map[challenge_sig:0 signer_kel:20]" 17:05:13 idss-control-plane-start[4133]: msg="community space-ID door: steward credential verified" credential=EECMqatmR34X2XNAsgQS1Bpy-m8sCB7Vz4i1nyJMBOmA ``` (`wallet-records-spaces` green, 4257 ms.) So only the **idp door** refuses it. ## Why — the two halves sign different bytes The live box names the bound verifier in its own startup line (`journalctl -u idss-idp`, and `droplet-journal.txt:986`): ``` 17:01:56 gateway idss-idp[10980]: msg="idss-idp sign-in verifier bound: challenge/response against the KEL door, membership from the control plane's roster (ADR 0212)" keystate_url=http://127.0.0.1:3902/oobi/{aid} control_plane_url=http://127.0.0.1:8080 ``` That is `internal/idp/bind.go:66` — the **ADR 0212 `KeriVerifier`**, not the ADR 0236 ledger verifier. `KeriVerifier` checks the *unbound* message (`internal/idp/keri_verifier.go:89`): ```go ok, err := keriauth.VerifySignature(keys[0], keriauth.SignedMessage(s.AID, s.ChallengeID), s.Response) // internal/keriauth/challenge.go:22 → "idss-idp:" + aid + ":" + nonce (no door) ``` But the app door minted an ask naming a door, and the wallet signed the ADR 0236 §5 **door-bound** form (`app/tests/e2e/fixtures/headlessWallet.ts:69`): ```ts const boundMessage = (door, aid, nonce) => `idss-idp:${door}:${aid}:${nonce}`; ``` Ed25519 over `idss-idp:https://id.rehearsal-f.idss.nz/login:EBNff6…:SrZONd…` against a verifier expecting `idss-idp:EBNff6…:SrZONd…` → false → `ErrChallengeFailed` → `refusalKind` returns `"signature"` (`internal/idp/appdoor.go:375`). HTTP 200, exactly the recorded body. ## The specific defect `BindVerifier` gates the ADR 0236 path on three inputs (`internal/idp/bind.go:41`): ```go if provider := orgIdentityTrustProvider(...); provider != nil && cfg.SignInURL != "" && cfg.KeyStateURL != "" { ``` On the live box two of the three are satisfied and the third is **absent**. `systemctl cat idss-idp` renders: ``` Environment="IDSS_IDP_KEYSTATE_URL=http://127.0.0.1:3902/oobi/{aid}" Environment="IDSS_IDP_ORG_IDENTITY_FILE=/srv/idss/config/idss/org-identity.json" ``` …and there is **no `IDSS_IDP_SIGNIN_URL`** — confirmed in the unit and in `/proc/10980/environ`. The trust half is genuinely armed: `/srv/idss/config/idss/org-identity.json` landed at founding (16:59, 447 bytes, `"aid": "EEpszSOEMSaxyUV07Vuoq6iwxznpD8mYPiJFTwVgkA9w"` + oobi + registry), and idss-idp restarted at 17:01:56 *after* it. Only `cfg.SignInURL == ""` sends it down the 0212 branch. The module is the source: `internal/clan/idssidp.go` renders `IDSS_IDP_ISSUER`, `IDSS_IDP_KEYSTATE_URL`, `IDSS_IDP_CONTROL_PLANE_URL`, `IDSS_IDP_ORG_IDENTITY_FILE` (lines 254–297) — and never `IDSS_IDP_SIGNIN_URL`. `grep -rn IDSS_IDP_SIGNIN_URL` across the repo hits only `internal/idp/config.go:259` (the reader) and `STATUS.md:174`, which states the contract plainly: *"`BindVerifier` binds the ledger verifier whenever `IDSS_IDP_TRUST_ISSUER` + `IDSS_IDP_SIGNIN_URL` + the KEL door are seeded (else today's roster/DeniedVerifier)"*. #1653 late-bound the trust half onto the org-identity file and the module was updated for that; the sign-in-address half was never added. The empty value is silently papered over on the *ask* side, which is what turns a config gap into a crypto mismatch instead of an honest refusal — `internal/idp/provider.go:154`: ```go doorURL := cfg.SignInURL if doorURL == "" { doorURL = strings.TrimRight(cfg.Issuer, "/") + loginPath // → https://id.rehearsal-f.idss.nz/login } ``` So the door **asks** for bytes bound to an address it will **not** check. The ask's `door` field and `bind.go`'s gate read from the same config field but disagree about what empty means. ## Suspected layer **Product** — the gateway's own NixOS module plus the bind/ask split. Not harness: the leg's expectation (`verified`) is correct per ADR 0236 §5 and DDR 0246, and the wallet fixture signs the form the ask asks for. Not infra: the droplet is healthy, `idss-idp` is up and listening on `127.0.0.1:8465`, `systemctl --failed` is empty, and the KEL door answers 200 for the AID (`curl http://127.0.0.1:3902/oobi/EBNff6…` returns the `icp` with `k:["DGG9-vu0v9syomc9sRgjTCpSL4AnbDdnaDxWFJkjDVJh"]`). ## What plugging it needs 1. **Render the missing env var.** In `internal/clan/idssidp.go`, beside `IDSS_IDP_ORG_IDENTITY_FILE` (~line 285), emit `IDSS_IDP_SIGNIN_URL = "https://<IdLabel>.<apex>/login"` — the same address `provider.go` falls back to, so the ask and the verifier name one door. That alone flips `BindVerifier` to `NewLateBoundLedgerVerifier` and makes the verified bytes match the signed bytes. Pin it with a module test in `internal/clan/idssidp_test.go` (which today asserts the signing-key generator but not this). 2. **Close the silent-fallback seam** so this cannot recur as a crypto error: `provider.go:155`'s derive-from-issuer fallback and `bind.go:41`'s `cfg.SignInURL != ""` gate must read one resolved value. Either resolve the door address once at boot and hand it to both (so an unseeded door still arms bound), or, if it cannot be resolved, have the app door refuse honestly rather than mint an ask naming a door nothing checks. 3. **Re-drive the other idp legs.** Binding the ledger verifier also moves membership off the control-plane roster onto the witnessed ledger + TEL re-check. `member-sign-in`, `oidc-admin`, `suspend-readmit`, `credential-claim-gone` and `restricted-*` are green today *on the ADR 0212 path* and will exercise the 0236 path after the fix — that is ADR 0236's intended destination, not a new decision, but it is a real behaviour change and must be re-driven, not assumed. ## Notes on evidence The live box was reachable and answered every read-only probe; it is the primary source above. One absence worth recording: **idss-idp logs nothing per request** — `journalctl -u idss-idp --since "17:02:00"` is `-- No entries --` even though the challenge mint and the refusal both happened at ~17:05:17. The refusal reason is discarded at the port boundary (`refusalKind` collapses it to `"signature"` by design, DDR 0246 decision 7), but `KeriVerifier` also never logs the *verify* failure — only key-state and undecodable-signature faults get a `log.Warn`. A one-line Debug/Warn on a failed `VerifySignature` naming the door it bound over would have made this diagnosable from the harvested logs alone, without the live box. drive `20260920T164135Z` red at `wallet-signs-in`: `the door verifies the wallet's presentation — it said {"status":"refused","refusal":"signature"} expect(received).toBe(expected) // Object.is equality Expected: "verified" Received: "refused"` evidence: `/home/swarm/session-runner/idss/test-results/drive-idip/20260920T164135Z` on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured <!-- rehearsal-sig: 2895537061f3 -->
Author
Member

swarm-claim host=matou-dev-server-01 run=28537
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=matou-dev-server-01 run=28537 (automated multi-host claim — lowest live claim id works this ticket)
Author
Member

close-report for #1667 — status success

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

envelope
{
  "issue": 1667,
  "status": "success",
  "commits": [
    "13c26b4c"
  ],
  "changed_files": [
    "STATUS.md",
    "internal/clan/idssidp.go",
    "internal/clan/idssidp_test.go",
    "internal/idp/bind.go",
    "internal/idp/config.go",
    "internal/idp/config_test.go",
    "internal/idp/provider.go"
  ],
  "tests": [
    {
      "command": "go test ./internal/idp/ ./internal/clan/",
      "exit_code": 0
    },
    {
      "command": "go build ./...",
      "exit_code": 0
    },
    {
      "command": "go vet ./internal/idp/ ./internal/clan/",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Render the missing env var (IDSS_IDP_SIGNIN_URL) in internal/clan/idssidp.go beside IDSS_IDP_ORG_IDENTITY_FILE, pinned by a module test": "idssidp.go now emits IDSS_IDP_SIGNIN_URL = \"https://id.<apex>/login\" (issuer + /login); pinned by TestRenderIdssIdp_SignInURLBindsTheLedgerVerifier in internal/clan/idssidp_test.go",
    "Close the silent-fallback seam so provider.go's derive-from-issuer fallback and bind.go's gate read one resolved value": "cfg.ResolvedSignInURL() (internal/idp/config.go) resolves the door address once; provider.go's ask (doorURL) and bind.go's gate + NewLateBoundLedgerVerifier both read it, so ask and verifier can never sign different bytes; pinned by TestResolvedSignInURL_OneDoorForAskAndVerifier",
    "Re-drive the other idp legs (member-sign-in, oidc-admin, suspend-readmit, credential-claim-gone, restricted-*)": "runtime obligation for the next IDIP drive, not code — recorded in the commit and STATUS.md as the carried behaviour change (membership moves off the roster onto the witnessed ledger + TEL re-check)"
  },
  "summary": "The gateway renders IDSS_IDP_SIGNIN_URL and the door's ask + verifier now read one resolved door address, arming the ADR 0236 ledger verifier so the wallet's door-bound signature verifies.",
  "reason": "",
  "blockers": []
}
**close-report** for #1667 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1667, "status": "success", "commits": [ "13c26b4c" ], "changed_files": [ "STATUS.md", "internal/clan/idssidp.go", "internal/clan/idssidp_test.go", "internal/idp/bind.go", "internal/idp/config.go", "internal/idp/config_test.go", "internal/idp/provider.go" ], "tests": [ { "command": "go test ./internal/idp/ ./internal/clan/", "exit_code": 0 }, { "command": "go build ./...", "exit_code": 0 }, { "command": "go vet ./internal/idp/ ./internal/clan/", "exit_code": 0 } ], "criteria": { "Render the missing env var (IDSS_IDP_SIGNIN_URL) in internal/clan/idssidp.go beside IDSS_IDP_ORG_IDENTITY_FILE, pinned by a module test": "idssidp.go now emits IDSS_IDP_SIGNIN_URL = \"https://id.<apex>/login\" (issuer + /login); pinned by TestRenderIdssIdp_SignInURLBindsTheLedgerVerifier in internal/clan/idssidp_test.go", "Close the silent-fallback seam so provider.go's derive-from-issuer fallback and bind.go's gate read one resolved value": "cfg.ResolvedSignInURL() (internal/idp/config.go) resolves the door address once; provider.go's ask (doorURL) and bind.go's gate + NewLateBoundLedgerVerifier both read it, so ask and verifier can never sign different bytes; pinned by TestResolvedSignInURL_OneDoorForAskAndVerifier", "Re-drive the other idp legs (member-sign-in, oidc-admin, suspend-readmit, credential-claim-gone, restricted-*)": "runtime obligation for the next IDIP drive, not code — recorded in the commit and STATUS.md as the carried behaviour change (membership moves off the roster onto the witnessed ledger + TEL re-check)" }, "summary": "The gateway renders IDSS_IDP_SIGNIN_URL and the door's ask + verifier now read one resolved door address, arming the ADR 0236 ledger verifier so the wallet's door-bound signature verifies.", "reason": "", "blockers": [] } ``` </details>
Owner

Follow-up from Ben's session: this fix bound ADR 0236's ledger verifier over the WHOLE bridge. The browser words door still signs the UNBOUND message and presents no credential (app/src/keriweb/main.ts), so a gateway built from 13c26b4c refuses every browser sign-in — the founder locked out of the control panel. It reached no community. Ben ruled #1666 option B; 9d29e9b5 binds per door (words door = roster verifier, app door = ledger verifier) and keeps this commit's rendered address + ResolvedSignInURL(). Lesson recorded as GOTCHAS #292: what a sign-in door verifies is never a two-way door under ADR 0174.

Follow-up from Ben's session: this fix bound ADR 0236's ledger verifier over the WHOLE bridge. The browser words door still signs the UNBOUND message and presents no credential (`app/src/keriweb/main.ts`), so a gateway built from `13c26b4c` refuses every browser sign-in — the founder locked out of the control panel. It reached no community. Ben ruled #1666 option B; `9d29e9b5` binds per door (words door = roster verifier, app door = ledger verifier) and keeps this commit's rendered address + `ResolvedSignInURL()`. Lesson recorded as GOTCHAS #292: what a sign-in door verifies is never a two-way door under ADR 0174.
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#1667
No description provided.