Original sources · POC — architecture & contracts
POC architecture (entry point)
Summarised in: Glossary · Architecture · Proof of possession · itsme integration · Revocation & audit · Local tool · Threat model · POC overview · Status & testing · Demo · Decision log · Open questions · Known inconsistencies
POC architecture — the entry point
Status, corrected 2026-09-26 (stale since before build step 1 — see
CLAUDE.md's own repo-status note for the same class of miss): steps 1–8 of the build order are done and live-verified end-to-end (a real mandate → real PDS-signed account-link assertion → real DPoP-signed MCP tool call → correct data back); only step 9 (E2E dry run) remains. Checkcontracts.md§0 for the authoritative build-order table before assuming anything here is still design-only. This document is the narrative entry point for thepoc-code/folder. The exact wire (JWT, DPoP, seed data, addresses, build order) lives incontracts.md; each module has its ownspec.md(pds/spec.md,platform/spec.md,outil-local/spec.md,deploy/spec.md,demo/script.md). It explains what we build for the demo, how the pieces fit together, and how the presentation runs. It derives from../analysis/synthese/specification-v1-authentification.md(the reference flow) and invents no new rule — it only picks a demonstrable subset of that spec and lists the deliberate shortcuts taken to keep a laptop demo robust. French actor names from the spec are kept verbatim (Prestataire / PDS, Outil Local, Notre Plateforme) with English glosses.
1. What the POC demonstrates
One end-to-end flow, in front of a client, in about six minutes:
- A PDS registers on Notre Plateforme, live. Its integration admin declares the
PDS's MCP endpoint; our platform calls
tools/list, parses the tool schema deterministically (no AI model anywhere in this pipeline), and shows a review screen; the admin clicks "J'accepte"; the confirmed schema is cached and a non-guessableprovider_idlink is produced for the PDS to hand to its customers. (The PDS-side code changes — MCP route + isolated filter — are pre-built; the registration workflow is what runs on stage.) - A realistic PDS — a service that already exists, with its own OAuth2 / Spring Security layer, its own REST API, and its own Keycloak — carries our mandate layer as an isolated MCP route, without changing its core security.
- A human "authenticates" (a fake Sign in with itsme screen) on Notre Plateforme, arrives via the PDS's link, and issues a scoped, signed mandate (a JWT) authorizing one specific agent key to use one specific tool of that PDS.
- The agent (Claude Desktop) calls the PDS's tool through the Outil Local,
which sends the JWT plus a per-request DPoP proof (Proof of Possession). The PDS
verifies the JWT against our JWKS, verifies the DPoP proof against the
cnfkey, checks revocation, applies its own rules, executes, and logs. - The human clicks Revoke on Notre Plateforme; the next call is refused.
- Two independent audit trails (Trace Plateforme + Trace Prestataire) exist,
correlated only by
jti.
Framing line for the pitch: we demonstrate integration feasibility on a representative stack — not a drop-in for any bank. Each real PDS has its own IdP, filter chain, and legacy backends; the spec already says the integration pattern is the PDS's choice, not ours to mandate.
2. What the POC deliberately does NOT do
These are guardrails, not omissions — each keeps a legal/patent item off the critical path
(see ../analysis/synthese/README.md §6, §7/#6):
| Not done | Why |
|---|---|
No write action — get_balance only, read-only | Stays clear of PSD2 (no payment execution path) and of Daon patent claim 1 |
| Static JWT, no per-call behavioral / fidelity scoring | Daon claim 1 needs a per-call dynamically generated delegation artifact + behavioral signal — we stay outside its literal reading |
| No amount caps / account numbers on screen in v0 | Keeps the disclosed_scope.max_amount/allowed_accounts liability-wording legal review off the critical path (README §7/#6) — unchanged. disclosed_scope now also carries an optional, narrower tool_constraints (added 2026-10-12, contracts §1.1): per-tool caps on that tool's own request parameters (e.g. list_transactions' period/max_results), enforced by the PDS's tool handler. Not an amount/account cap, so the liability concern this row exists for doesn't apply to it |
| We do not claim to prove the tool call itself happened | Phase 4 never transits Notre Plateforme; the demo shows two logs linked by jti, and says so out loud |
| No multi-hop agent→agent delegation, no live step-up auth | Known V1 gaps (README §5) — not POC concerns |
3. Topology — who calls whom
Two things to get right:
- Claude Desktop never talks to the PDS directly. It talks to the Outil Local over stdio; the Outil Local is the MCP client toward the PDS.
- Notre Plateforme is a browser SPA plus a deliberately tiny stub. The stub exists only for the handful of endpoints a real downstream process (the PDS) genuinely verifies — a signed JWT, a JWKS URL, a revocation state that flips. Everything else is UI with stateful mock services in the SPA (§6).
graph TB
subgraph client["Client machine (laptop on stage)"]
CD["Claude Desktop<br/>(the LLM / agent)"]
OL["Outil Local<br/>(TypeScript MCP proxy)<br/>holds agent private key + JWT"]
CD -- "stdio / native MCP" --> OL
end
subgraph us["Notre Plateforme (we host & operate)"]
SPA["Angular SPA<br/>all platform UI + stateful mock services<br/>incl. fake 'Sign in with itsme' screen"]
STUB["Minimal Node stub · ~100 lines · in-memory state"]
JWKS["GET /jwks.json"]
SIGN["POST /mandates → signs JWT (jose)"]
REV["GET /introspect/:jti<br/>POST /mandates/:jti/revoke"]
DISC["GET /discover → tools/list proxy (dodges CORS)"]
SPA -- "browser calls" --> STUB
STUB --- JWKS
STUB --- SIGN
STUB --- REV
STUB --- DISC
end
subgraph pdsbox["PDS container(s) (one podman compose)"]
PDS["PDS service<br/>(cloned-in MIT Spring Boot repo)<br/>REST + new MCP route · H2"]
FILTER["Isolated security filter on /mcp/**<br/>verifies OUR JWT + DPoP proof only"]
KC["PDS Keycloak<br/>(its own IdP, its own customers)"]
PDS --- FILTER
PDS --- KC
end
H["Human (browser)"] -- "1. registration & mandate UI" --> SPA
DISC -- "Phase 0: tools/list" --> PDS
OL -- "HTTP MCP: Authorization: DPoP <JWT><br/>+ DPoP: <proof>" --> FILTER
FILTER -- "verify JWT signature" --> JWKS
FILTER -- "per-call revocation check" --> REV4. Mapping to the reference spec
Every POC step traces back to a numbered phase in
specification-v1-authentification.md.
The POC covers all six phases, some in simplified form:
| Spec phase | In the POC | Simplified? |
|---|---|---|
Phase 0 — PDS registration (0.1) + tools/list discovery (0.2) + deterministic parsing (0.3) + review/accept screen (0.4) + confirmed schema cache (0.5) | Demonstrated live at the start of the presentation. The PDS-side code changes (MCP route + isolated filter) are pre-built, but the whole registration workflow on our platform runs on stage. Discovery endpoint left public (spec allows it) to skip the API-key detour | No periodic re-polling / drift detection (0.6–0.8); "who may click J'accepte" = a simple named account (spec option A) |
| Phase 1 — agent Ed25519 keypair generated locally, private key to a restricted file, public key printed | outil-local init — kept as designed | No |
| Phase 2 — human auth via itsme + mandate form + JWT issuance signed with our private key + ready-to-use config returned | Mandate form is Angular UI; the Node stub signs the JWT (jose, demo key) and returns JWT + endpoint | itsme is a fake screen (no OIDC); token-exchange plumbing skipped (see §6) |
| Phase 3 — human pastes the ready-to-use config (JWT + endpoint) into the Outil Local | Kept as designed | No |
Phase 4 — tool call: Outil Local builds the DPoP proof + sends Authorization: DPoP <JWT> + DPoP: <proof> → PDS verifies JWKS, exp, revocation, aud, DPoP proof (htm/htu/iat/jti + bsha body hash + key thumbprint vs cnf), resolves provider_account_ref, applies its own rules, logs | Kept as designed on the isolated route variant (spec §Phase 4, Option B). provider_account_ref carries a real PDS-signed assertion, re-verified by the PDS (contracts §8, §2 steps 14–18) | aud = canonical MCP URI, checked at 4.6c-bis; /introspect unreachable → fail-closed; DPoP server-nonce challenge skipped for v0 (jti replay cache instead); account-link assertion re-verified against the PDS's own key |
| Phase 5 — human revokes on Notre Plateforme; next call refused at 4.6c | Kept as designed | No |
5. The running components (plus Claude Desktop)
| # | Component | Stack | Role in the POC | Spec component |
|---|---|---|---|---|
| 1 | PDS (Prestataire de Service) | IAMDevBox/keycloak-spring-boot-oauth2 cloned in (MIT — see §9) + our additions; Java 17 / Spring Boot 3.2.3 → bump to 3.3+/3.4; Spring AI MCP server starter (webmvc), Streamable HTTP; its own Keycloak 26; add JPA + H2 | The "service that already exists". We add: an accounts domain with a get_balance REST endpoint, an MCP server route (tools/list + get_balance tool) over the same data, and a second @Order-ed SecurityFilterChain on /mcp/** that verifies our JWT + the DPoP proof (Nimbus). Its existing Keycloak-protected REST endpoints stay untouched | The Prestataire Tiers (verifier) |
| 2a | Web Platform — SPA | Angular | All platform UI: provider registration + deterministic-parse review/accept screen (Phase 0, shown live); fake Sign in with itsme screen (pick a test identity); mandate form; human dashboard (view / revoke). UI-only state lives in stateful Angular services / fixtures | Component A — Plateforme Web (cloud) = "Notre Plateforme" |
| 2b | Web Platform — stub | Node / Express + jose; in-memory Map, no DB | The ~100 lines that a real downstream process actually calls: GET /jwks.json; POST /mandates → sign the JWT (cnf.jwk = agent pubkey, aud = canonical PDS MCP URI, sub, exp = iat + 1h, jti, disclosed_scope = {allowed_tools:["get_balance"], tool_constraints:{...} (optional, per-tool request-param caps, contracts §1.1), binding:false}) + store jti → valid; GET /introspect/:jti; POST /mandates/:jti/revoke → flip state; GET /discover → proxy the PDS tools/list (also dodges browser CORS) | Same — the machine-facing half of "Notre Plateforme" |
| 3 | Outil Local | TypeScript + official MCP SDK (@modelcontextprotocol/sdk, Streamable HTTP client); jose / oauth4webapi for DPoP; @noble/ed25519 or Node crypto for keygen | init mode: generate Ed25519 keypair, write private key to a restricted file, print public key. Runtime: stdio MCP server toward Claude Desktop + HTTP MCP client toward the PDS; discovers the PDS's tools at startup; on each call builds a DPoP proof (htm, htu, iat, jti, bsha = sha256 of body) signed with the agent key and sends Authorization: DPoP <JWT> + DPoP: <proof> | Component B — Serveur MCP local = "Outil Local". Component C (SDK) is out of scope for the POC |
| — | Claude Desktop | Off-the-shelf | The agent. Configured with one MCP server: the Outil Local (stdio). Never sees the PDS directly | The Agent IA |
There is no itsme-sim container — nothing real verifies the itsme token except our
own stub, so the "login" is a fake screen in the SPA that yields a test sub string
(see §6). The real itsme OIDC integration is documented in
itsme-integration.md for later.
The agent private key lives on the same machine as Claude Desktop (the Outil Local is its stdio subprocess) — the intended product topology, not a shortcut. Why the "AI brain" can't reach the key file here: §10.
5.1 Proposed folder layout for poc-code/
poc-code/
architecture.md <- this file (narrative entry point)
contracts.md <- frozen cross-module wire: JWT, DPoP, seed data, addresses, build order
pds/
spec.md <- PDS implementation spec
<cloned-in MIT repo (no .git) + our additions + NOTICE>
platform/
spec.md <- stub + SPA implementation spec
spa/ <- Angular: all platform UI + state services
stub/ <- Node/Express + jose: jwks, discover, sign, introspect, revoke, audit
outil-local/
spec.md <- init + runtime implementation spec
deploy/
spec.md <- compose + realm + key provisioning + address wiring
compose.yaml <- podman compose: pds + pds-keycloak + web-platform-stub
gen-keys.sh <- one-time platform signing key (git-ignored output)
keys/ <- generated signing key (git-ignored)
(realm import reuses pds/docker/realm-export.json directly —
no separate copy, see deploy/spec.md §4)
demo/
script.md <- the ~6-minute run sheet(This supersedes the earlier web-platform/ name — the folder is now platform/, with each
module carrying its own spec.md.)
The Angular SPA runs via ng serve on the host; the Outil Local as a native node dist/index.js
process launched by Claude Desktop's config (§12.0), not npx/a published package; Claude Desktop
is the desktop app. Only three containers are in compose.yaml.
6. Deliberate simplifications vs the target architecture
Written down so nobody mistakes the POC for the product. Each row is a conscious choice, consistent with how the spec treats assumed deviations.
| Target architecture (spec / CLAUDE.md) | POC v0 | Why the shortcut is acceptable | Revisit when |
|---|---|---|---|
| itsme — real eIDAS-qualified OIDC | A fake Sign in with itsme screen in the SPA — pick from 2–3 test identities, no OIDC round-trip at all, no IdP container | Nothing real verifies the itsme token except our own stub; itsme onboarding needs a contract + KYB, timeline outside our control | Real itsme sandbox access obtained — run that as a parallel business track now |
| Web Platform backend = Spring Boot 3 + Spring Security, acting as Keycloak Identity Broker doing RFC 8693 Token Exchange | A ~100-line Node/Express stub signs the JWT with jose from a demo key; state is an in-memory Map | What the PDS actually consumes is the token shape + JWKS + a revocation state that flips. A browser SPA cannot serve those to another process; everything else is UI. The real backend is a separate later build | Building the real platform; when multi-IdP or an act delegation chain matters |
| PDS folds our issuer into its core resource-server trust (multi-issuer) | PDS uses the isolated-route variant (spec §Phase 4, Option B): a dedicated filter on /mcp/** that verifies our JWT + the DPoP proof only, leaving the real Keycloak realm config alone | Simpler to show and to reason about; doesn't put risk in the core system; spec already lists it as a legitimate pattern | A pilot PDS chooses the multi-issuer variant |
provider_account_ref via silent OIDC handoff (spec 2.0ter, recommended variant; 🔶 legally unvalidated) | Front-channel signed assertion (liaison… Variante 2, contracts §8): PDS signs → stub verifies vs PDS JWKS → PDS re-verifies its own signature at call time. Mocked: PDS-customer auth (espace-client dropdown), front-channel transport (stub→PDS fetch), browser-binding | The crypto chain (sign/verify/re-verify) is worth prototyping now; the legal question is untouched by building the transport | Legal validation done (liaison… §9/#10); real prompt=none OIDC (Variante 1); a real PDS |
| Revocation = per-call introspection | Kept — simple, demos well | — | — |
| PoP mechanism | Real DPoP (RFC 9449) + one extra claim bsha (body hash) to keep spec hypothesis 6's body binding; jti + iat window + server-side replay cache instead of the DPoP-Nonce challenge; key bound via jkt thumbprint of cnf.jwk | DPoP is the standard for exactly this; the nonce challenge adds a round-trip with no demo value; body hash is a one-line addition on both ends. bsha is a sanctioned DPoP extension (RFC 9449 §11.2 — "additional information can be added into DPoP proofs"), non-standard: every verifier implements the body-hash check by hand, no generic DPoP middleware enforces it | Add the DPoP-Nonce challenge if the real product needs it (tokens §9/#11) |
| Agent Delegation Token lifetime ~15 min + refresh (CLAUDE.md security model, spec hypothesis 3) | ttl_seconds: 3600 (1 h), no refresh flow | A 1 h token outlives the ~6-min demo, so a mid-demo refresh never interrupts it; revocation is still shown live via per-call introspection | Real product — drop to ~15 min + refresh (tokens §9/#6) |
All traffic over HTTPS/TLS with endpoint authentication — the mandate is a JWS, not encrypted (JWE), so RFC 7519 §12 makes privacy-sensitive claims rely on the transport. TLS only covers the wire, though: a signed-not-encrypted JWT is plaintext to anything that captures it after TLS termination (app logs, APM/error tracking, browser history), which is the realistic leak path, not wire interception. Any relying-party deployment must therefore also redact Authorization/DPoP headers from logs and APM traces — TLS alone does not cover this | Everything on http://localhost — no TLS anywhere, no log-redaction policy | Single machine, no network hop to protect; nothing privacy-sensitive is disclosed to a third party in the demo | Any non-localhost deployment — HTTPS is then mandatory, not optional, and claim minimisation (above) + log redaction is what keeps a leaked token low-impact. A provider with a contractual/regulatory requirement that even a compromised log pipeline must never see plaintext claims can additionally request nested JWE (sign-then-encrypt, addressed to that provider's key) as a per-provider opt-in — not a default, since it adds real key-management cost for a risk only some providers carry |
sub = itsme pseudonymous, sector-specific identifier (never name / e-mail — itsme-integration.md); act.sub (= agent_label, contracts §9.4) treated as potentially identifying free text, never assumed safe to log or display beyond the owning human | sub = readable itsme:be:<firstname>.<lastname> test string; act.sub/agent_label is whatever the human types on the mandate form (often a name, e.g. claude-desktop-sofie), with no minimization | Demo legibility (the presenter points at "Sofie Maes" on screen); no real itsme sub exists without sandbox access. Localhost-only, no TLS hop and no third party ever sees these claims in the POC, so the identifying value never leaves the demo machine | Real itsme integration — use the actual pairwise sub; keep names out of the token. agent_label is user free text by design (it's a human-facing label, contracts §9.4) so it can never be assumed non-identifying — treat it the same as sub for logging/redaction purposes rather than trying to sanitize it at input |
Full MCP protocol surface — tools, resources, prompts | tools only — tools/list/tools/call everywhere (JWT allowed_tools, PDS filter step 13, SPA review screen, Outil Local discovery); resources/*/prompts/* never implemented, not even stubbed | Deliberate, not an oversight: mandate-scoping and PoP exist to authorize actions with consequences (a tool call can move money); a resource is read-only static data and a prompt is a reusable template — neither needs the same cryptographic-authorization story, and a real banking PDS has no realistic resource/prompt to expose this way. Adding them would also mean renaming allowed_tools to a type-tagged allowed_capabilities across the JWT/filter/SPA for zero demo-narrative payoff in front of a largely non-technical audience | Only if a future PDS integration has a genuine read-only-document or prompt-template use case that itself needs mandate-level scoping — not expected for banking |
| Periodic schema re-polling + drift reconfirmation (Phase 0.6–0.8) | Registration + tools/list discovery + review/accept screen (0.1–0.5) shown live; no polling afterward | Drift detection isn't part of the demo narrative | Post-POC |
| PostgreSQL (production datasource) | PDS uses embedded H2 (jdbc:h2:file:); the platform stub keeps state in an in-memory Map (no DB); Keycloak dev-mode H2 | POC state is small, single-node, and disposable; H2 removes a container and all connection/volume config; the stub's state is re-created by re-clicking two steps | Productionization — real datasources; PDS JPA-only code keeps its switch a config change |
| Setup-code redemption (contracts §9) rate-limited + persisted, so a brute-forced/replayed code attempt is detectable | In-memory Map, no rate limiting, no alerting on repeated unknown_code/code_expired | POC has one demo operator and no attacker; the 600 s TTL + single-use + 128-bit entropy already make guessing infeasible for the demo's threat model | Any real deployment — add rate limiting + logging on the redeem endpoint before it's internet-facing |
| POC doubles as the seed of the real platform (earlier rationale for Spring Boot + Angular) | Only the Angular SPA is potentially kept and grown; the platform backend is throwaway | Speed for the presentation is the goal; the real backend (broker, RFC 8693, persistence, real itsme) gets built from scratch afterwards | After the presentation, when the real build starts |
Outil Local distributed as npx @<real-scope>/mcp-server — no local checkout, no manual build, any machine | A Windows-native checkout of poc-code/outil-local/ (npm install && npm run build, then Claude Desktop runs node dist\index.js) — outil-local §4.5 | package.json is already shaped for this ("bin": {"mcp-server": "dist/index.js"} — npx @scope/pkg <args> would just work), but publishing needs a decided product name (synthese §4/#9 — decided 2026-11-30: Veritia) and an npm scope/org that owns it (@veritia — availability not yet verified); today the package is private: true and genuinely 404s on the registry (confirmed live 2026-10-09). No network dependency is also arguably a feature for a live demo | Name decided + ready to publish. Then: flip private, npm publish --access public (or a private registry, at the cost of end-users needing an .npmrc token); Claude Desktop's config becomes "command":"npx","args":["-y","@<scope>/mcp-server"] (the -y is required — an unconfirmed install prompt would hang the stdio channel); decide whether to pin an exact version in that config (unpinned = a registry check on every Claude Desktop launch, i.e. a new hard network dependency) |
7. Technology decisions
Answering the open points from the earlier draft:
- Notre Plateforme = Angular SPA + a throwaway Node stub — no real backend. The SPA
carries every screen (registration, review/accept, fake itsme login, mandate form,
dashboard) with stateful Angular services for UI-only state. The stub is ~100 lines of
Node/Express +
jose, existing only for the endpoints the PDS genuinely verifies (/jwks.json,/mandatessigning,/introspect/:jti,/mandates/:jti/revoke) plus a/discoverproxy for the Phase 0tools/listcall (also dodges browser CORS). Chosen over a ~100-line Spring Boot controller purely because it's throwaway and one language with the SPA; the real Spring Boot backend (broker, RFC 8693, persistence, real itsme) is a later, separate build. The Angular SPA can be kept and grown. - Outil Local = TypeScript — confirmed, it's the right call. The official MCP SDK is
first-class in TypeScript, stdio transport to Claude Desktop is the well-trodden path,
and it matches the eventual
npx @veritia/mcp-serverdistribution in CLAUDE.md. - No mock IdP. The "Sign in with itsme" screen is a fake in the SPA that yields a test
sub; there is noitsme-simKeycloak. One fewer container, and nothing downstream cares because only our own stub ever reads that identity. - Orchestration = a single
podman composefile with three containers (pds,pds-keycloak,web-platform-stub). The PDS Keycloak realm is seeded from a realm-export JSON imported at startup,healthcheck+depends_onordering, so the stack comes up with one command and zero manual clicking. The Angular SPA runs viang serve, the Outil Local as a nativenode dist/index.jsprocess (§12.0), notnpx. - PDS discovery endpoint left public for the POC (spec permits it), so neither the stub nor the Outil Local needs a PDS-issued API key.
- Persistence. The PDS uses embedded H2 in file mode (
jdbc:h2:file:) — state survives a mid-demo restart; guardrail for the eventual PostgreSQL switch: JPA / Hibernate only, no native SQL, no Postgres-specific types (JSON asTEXT, notjsonb). The platform stub keeps state in an in-memoryMap— no DB; a restart just means re-running the registration + mandate steps. Keycloak runs instart-devwith its own embedded H2. The Outil Local persists only the private-key file and the JWT config on disk. All persisted data is disposable — wiped at project close viapodman compose down -vplus deleting anydata/files.
8. Demo script (≈6 minutes) — to be detailed in demo/script.md
Two human personas: a PDS integration admin (steps 1–2) and the human mandant (from step 3). Switch context explicitly on stage.
- (30s) Hit the PDS's existing REST endpoint with a normal PDS-Keycloak token. "This service already exists, with its own security. We change none of it."
- (90s) — PDS registration, live. As the PDS admin, log into Notre Plateforme and
declare the PDS's MCP endpoint → our platform calls
tools/list→ show the deterministic parse (no AI): one toolget_balance,readOnlyHint: true, no monetary parameter → the review screen shows the tool and no governance-ceiling field (read-only PDS) → click "J'accepte" → confirmed schema cached, a non-guessableprovider_idlink is issued for the PDS to hand to its customers. - (80s) As the human mandant: open the PDS-provided link → click Sign in with itsme
(fake screen, pick a test identity, e.g. Sofie Maes) →
/mandate/newstep 1 (real UI, not narration): a short screen prompting a first-time user to download Outil Local and runoutil-local initonce, locally (one-time per machine, generates the agent keypair and prints its public key) — with "already installed? skip ahead" copy, since the platform has no way to verify what's on the user's machine, so this screen is shown on every visit (the real gate, "does this human already have a mandate," is server-side and out of scope for the demo); going back is a click on the step-indicator's own "1" tab → step 2, the mandate form: paste the agent public key from thatinitrun, purpose "consultation de solde", expiry, tickget_balance→ the stub signs the JWT → receive a ready-to-use config (JWT + endpoint). - (30s) Paste the config into the Outil Local. Claude Desktop now lists the PDS's tools.
- (60s) Ask Claude Desktop "what's my balance?" → Outil Local sends
Authorization: DPoP <JWT>+DPoP: <proof>→ PDS isolated route verifies the JWT (our JWKS), the DPoP proof (key thumbprint vscnf,htm/htu/bsha/jti), revocation,aud, applies its own rules, returns € 12 802,50, logs it (mcp_call_audit). (Corrected 2026-11-30: this used to say "show the PDS log line" — no such stdout line ever existed; since step 9b the provider's row is shown on the SPA dashboard, beat 8 —demo/script.mdis the authoritative run sheet.) - (45s) Copy the JWT alone into another shell, replay it without the agent private key → no valid DPoP proof can be built → refused. "A stolen token alone is useless."
- (30s) Human clicks Revoke on Notre Plateforme → ask Claude Desktop again → refused at 4.6c.
- (15s) Show both logs side by side — Trace Plateforme and Trace Prestataire — same
jti, two owners.
9. PDS base repo — evaluation result (2026-09-07): use it
IAMDevBox/keycloak-spring-boot-oauth2
was reviewed file by file. Verdict: use it, do not start from start.spring.io. It is
thin (3 Java files) but the wiring it hands you — a modern Spring Security 6 resource
server + Keycloak + a working docker-compose + Testcontainers tests — is exactly the
annoying-to-get-right part.
Not a GitHub fork — just clone it in. MIT lets you copy freely; a fork only helps if
you want to send PRs upstream or merge upstream changes (irrelevant — 2-commit tutorial
companion repo, we diverge hard). Do:
git clone --depth 1 https://github.com/IAMDevBox/keycloak-spring-boot-oauth2 poc-code/pds && rm -rf poc-code/pds/.git,
keep LICENSE, add poc-code/pds/NOTICE with the upstream commit hash, commit into our repo.
| Checklist item | Finding |
|---|---|
| Stack currency | ✅ Spring Boot 3.2.3, Java 17, Maven, Spring Security 6.x OAuth2 resource server (spring-boot-starter-oauth2-resource-server) via JWKS auto-discovery. No EOL spring-security-oauth2, no Keycloak adapter. Bump the parent to 3.3.x/3.4.x for Spring AI 1.0 compatibility — the one real risk, folded into the §11 spike |
| Keycloak wiring | ✅ Plain resource server, issuer-uri only; custom KeycloakRoleConverter (realm_access.roles → authorities); a clean single SecurityFilterChain in SecurityConfig.java — trivial to add a second @Order-ed chain with securityMatcher("/mcp/**") for our JWT + DPoP (= spec Option B, isolated route) |
| Domain | ⚠️ None — 4 demo endpoints (/api/profile, /api/admin/users, /api/token-info, /public/health), no model. Expected; we add the accounts domain + get_balance + spring-boot-starter-data-jpa + h2 |
nimbus-jose-jwt | ✅ Already a direct dependency — what we need for DPoP verification |
| Compose / Keycloak | ✅ docker/docker-compose.yml: Keycloak 26.0, start-dev --import-realm, healthcheck, realm-JSON volume mount. Adapt into our podman compose.yaml; replace the demo realm with our bqt realm (§11.4) |
| Demo step 1 | ✅ Comes for free — /api/profile + a password-grant token (demo-app client, directAccessGrantsEnabled) already models "a service that exists with its own security" |
| Ports | Keycloak 8080, the PDS app 8081 (server.port in application.yml, issuer-uri → realms/demo) — MCP route is http://localhost:8081/mcp (§11.3) |
| Tests | ⚠️ Only UserControllerUnitTest.java is present (the README's Testcontainers integration test file is not in the repo, though pom.xml declares the deps). Do not assume ./mvnw test is green — see the two upstream bugs below |
| Licence | ✅ MIT — LICENSE kept; poc-code/pds/NOTICE records the upstream commit 223cde71 (2026-03-22) |
Clone verified 2026-09-07: poc-code/pds/ has no .git, all files present, NOTICE
added. Two pre-existing upstream bugs to fix (or ignore — we replace this security layer
anyway) when standing it up in build step 3:
SecurityConfig.jwtDecoder()callsJwtDecoders.fromIssuerLocation(...)at bean creation → the context needs Keycloak reachable at startup, soUserControllerUnitTest("no Keycloak required") will not load a context as written.UserControllermaps health at/api/public/health(class-level@RequestMapping("/api")), butSecurityConfigonly permits/public/**— so that endpoint actually requires a role, and thepublicHealth_WithoutToken_Returns200test contradicts the config.
Also: .idea/ appeared at the repo root after opening the project in an IDE — add it to
.gitignore.
10. Decisions and remaining open questions
Decided (2026-09-07)
- Fake itsme screen — a list of 2–3 test identities is fine for a POC; the presenter states out loud that itsme is mocked.
- Who may click "J'accepte" on the PDS side (spec 0.4) — a plain named account on our platform (spec option A). Nothing in the flow demo depends on how the PDS admin authenticated. (Option D — itsme on the PDS side too — is the more on-narrative choice for a later version, not the POC.)
disclosed_scopeon screen —allowed_tools, plus an optional, per-tooltool_constraintsfor request-shaping caps likelist_transactions'period/max_results(added 2026-10-12, contracts §1.1);binding: false; still no amounts or account numbers anywhere in the UI or the token (as in §2) —tool_constraintsonly caps a tool's own existing request parameters, it never introduces a new amount/account field.audclaim — the canonical MCP server URI of the PDS (spec 4.6c-bis, RFC 8707), i.e. the PDS's MCP endpoint URL as the compose stack exposes it. Checked at 4.6c-bis.- Revocation unreachable → fail-closed (the PDS refuses when it cannot confirm validity). Not a talking point — everything is on localhost so it never triggers — but implemented so a network hiccup mid-demo fails safe.
- Outil Local runs on the same machine as Claude Desktop — the real Claude Desktop app, the Outil Local as its stdio subprocess. Not a shortcut — this is the product's intended topology, and the most production-realistic component of the POC (real MCP stdio transport, real keypair on disk, real per-request signing, nothing mocked). The spec §6 reserve (can the "AI brain" read the agent private key?) is satisfied here: Claude Desktop runs each MCP server as a separate subprocess and the LLM can only invoke the tools a configured server exposes — with only the Outil Local wired up there is no file-read or shell tool in reach, so no path to the key file, and the key bytes never return to the LLM. Only caveat: don't also add a filesystem/shell MCP server on that machine during the demo. (Claude Code, which has built-in shell/read tools, would be the "needs care" case the spec meant — not this demo.) This is absence of a capability, not a sandbox: a compromised host still yields the key — already spec §8's "machine compromise after Phase 3" row, and true of the real product too.
- One PDS in the demo, not two. The second PDS only illustrated "same mandate across unrelated organisations" — a value-proposition point, not part of the flow. The stolen-token-replay and revocation beats (§8 steps 6–7) stay — they're the payoff of the flow, run on the one machine, cost nothing extra.
provider_account_ref— un-mocked (decided 2026-09-09). Built as a real PDS-signed assertion, front-channel signed-assertion variant (liaison-compte-prestataire.mdVariante 2, contracts §8): the PDS signs a short-lived assertion with its own key, the stub verifies it against the PDS JWKS and embeds the raw JWS in the token, the PDS re-verifies its own signature at call time. Still mocked: the PDS authenticating its own customer (a dropdown in a fake espace-client screen) and the front-channel redirect (a stub→PDS fetch). Browser-binding and the 🔶 legal validation stay out of scope.
Still open
- Angular UI-only state: stateful services vs a local
json-servervs hardcoded fixtures — decide per screen when building. Registration list and dashboard want a stateful service; the review/accept screen is computed live from thetools/listresponse the stub proxies back.
11. Before writing PDS code — contracts to freeze
Items 1–3 are cross-component: the Outil Local (signer / client) and the PDS (verifier / server) must implement the identical thing, so they cannot be discovered mid-build.
11.1 PoP wire format — DPoP (RFC 9449) (decided 2026-09-07)
- Request headers:
Authorization: DPoP <delegation JWT>(DPoP scheme, not Bearer) +DPoP: <proof JWT>. - Proof JWT:
typ: dpop+jwt,alg: EdDSA, headerjwk= agent public key; claimsjti(unique),htm(method),htu(request URI, no query/fragment),iat, plusbsha=base64url(sha256(body))— the one non-standard claim, added to keep spec hypothesis 6's body binding (plain DPoP does not cover the body). - Key binding: the delegation JWT keeps
cnf.jwk(per spec). The PDS computes the RFC 7638 JWK thumbprint ofcnf.jwkand checks it equals the thumbprint of the proof header'sjwk. - Replay:
jti+ a shortiatwindow (e.g. 60 s) + a server-sidejticache. The RFC 9449DPoP-Nonceserver-challenge is skipped for v0 (a round-trip with no demo value). - Libraries: Nimbus OAuth2 SDK (
DPoPProtectedResourceRequestVerifier,DefaultDPoPSingleUseChecker) on the PDS;jose/oauth4webapion the Outil Local. The spike must confirm the MCP TS SDK lets us attach these two headers to each request.
11.2 PDS MCP library + transport — Spring AI MCP server starter (webmvc), Streamable HTTP (decided 2026-09-07)
Version caveat for the spike: Streamable HTTP support depends on the MCP Java SDK / Spring
AI versions pulled (older builds are SSE-only); confirm the TS
@modelcontextprotocol/sdk StreamableHTTPClientTransport matches.
11.3 aud string
aud is an identifier of the MCP server as a resource, not a routing address
(RFC 8707 / MCP Authorization spec: canonical URI — lowercase scheme+host, include the
path, no trailing slash, no query/fragment).
- POC value:
http://localhost:8081/mcp— the PDS app runs on 8081 (Keycloak is on 8080 in the base repo); this is the exact URL the Outil Local connects to. - One config value in two places: stub
PDS_MCP_URI(written into every JWT'saud) and PDSMCP_CANONICAL_URI(compared to incomingaudat 4.6c-bis → 403 on mismatch). - It does not need to match the container's internal bind address
(
http://pds:8080/mcpon the podman network) — identity, not address. - Distinct from the DPoP proof's
htu:aud= the server's identity (same for every call);htu= the concrete URL of this request. - Production would use the real
https://…canonical URL.
11.4 Seed data (decided 2026-09-07)
Fake itsme identities (the login screen picks one):
sub | Display name |
|---|---|
itsme:be:pieter.janssens | Pieter Janssens |
itsme:be:sofie.maes | Sofie Maes |
itsme:be:noah.dubois | Noah Dubois |
PDS = fictional "Banque Test" (BQT). Customers / accounts (IBANs illustrative, checksum not enforced by the POC):
Superseded by contracts §4 — that table now carries the
provider_account_ref.value(pacr_bqt_*) column and the PDS assertion key. Thesub ↔ customerpairing below is the demo-intended pairing only; since 2026-09-09 the human picks the customer in the fake espace-client screen and the PDS vouches for it via a signed assertion (contracts §8) — it is not resolved fromsub.
PDS customer id (= account_link.customer_id) | Demo-paired sub | Account | Balance |
|---|---|---|---|
cust-001 | itsme:be:pieter.janssens | BE68 5390 0754 7034 | € 4 231,17 |
cust-002 | itsme:be:sofie.maes | BE71 0961 2345 6769 | € 12 802,50 |
cust-003 | itsme:be:noah.dubois | BE62 5100 0754 7061 | € 318,04 |
get_balancetakes no parameters — returns the caller's own account ({ iban, currency, balance, as_of }), resolvedprovider_account_ref.value(from the verified PDS assertion, contracts §8) →account_link→ customer → account; never fromsub. Zero params keeps thetools/listdeterministic-parse story clean (one tool,readOnlyHint: true, no fields on the review screen).- PDS Keycloak realm
bqt— one test user for demo step 1:pieter/demo, used to hit the existing/accounts/meREST endpoint with a normal bank-issued token. - Platform (SPA) PDS-admin account (spec option A):
admin@bqt.example/demo. - Registration output:
provider_id= a fresh UUIDv4; link…/mandate/new?provider=<uuid>. - Mandate:
purpose="consultation de solde";disclosed_scope={ allowed_tools: ["get_balance"], binding: false };exp=iat + 1h.
11.5 Cross-container addresses
The PDS reads /jwks.json and calls /introspect at a compose-network name (e.g.
http://web-platform-stub:3000), not localhost. The Outil Local, on the host, uses
localhost.
Spike first (1 day, timeboxed): (a) check the fork's stack against the §9 checklist; (b) stand up a trivial Spring Boot MCP server on the chosen transport and connect the TS MCP SDK client to it, calling one dummy tool. If (b) is not clean, the transport risk is known now, not in week 3.
12. Build order
12.0 Environment (install once)
The containerized stack (PDS, PDS Keycloak, platform stub) runs inside WSL2 (the Ubuntu
distro) — Podman is Linux-only, so this side doesn't move. Outil Local + Claude Desktop run
natively on Windows (revised 2026-09-25; was previously "launch via wsl.exe, Node stays
Linux-side", now kept only as a documented alternative, not the default — see below). Keep the
poc-code repo itself on WSL2's Linux filesystem (/workspace/... or /home/...), never
/mnt/c/... (slow, breaks file watchers), for everything built/edited there. Services in WSL2
are reachable from Windows on localhost (WSL2 forwards it), so :8080 / :8081 / :3000 /
:4200 all just work from a Windows browser or a Windows-native Outil Local process.
| Tool | Version | Where | Notes |
|---|---|---|---|
| JDK | 21 (LTS), Temurin | WSL2 | Repo is Java 17; Spring Boot 3.3/3.4 + Spring AI 1.0 need 17+, 21 is the better carry-forward default. No non-LTS. |
| Maven | 3.9.x | WSL2 | The base repo's ./mvnw wrapper is not committed — install Maven, or run mvn wrapper:wrapper once. |
| Podman | ≥ 4.4 (Ubuntu 24.04 ships 4.9) | WSL2 | Ubuntu 22.04's 3.4 is too old — upgrade the distro. Do not run podman machine inside WSL2; Podman is native there. |
| compose | podman-compose (apt / pipx) | WSL2 | Or podman compose backed by a docker-compose v2 binary. |
| Node | 20 LTS+ | WSL2 (dev) and Windows (runtime) | WSL2 Node builds every module, incl. Outil Local (npm run build → dist/). A second, separate Node 20 LTS+ install on Windows is what actually runs Outil Local at demo time — see the Claude Desktop row. |
| Claude Desktop | current | Windows | Primary (2026-09-25): launches Outil Local as a native Windows process — "command": "node", "args": ["C:\\Users\\<you>\\outil-local\\dist\\index.js"] — pointing at a Windows-native copy of poc-code/outil-local/ (its own npm install && npm run build, run with Windows Node, not the WSL2 one; simplest as a separate checkout/copy rather than reading the WSL2 filesystem over \\wsl.localhost\..., which works but adds UNC-path latency/locking quirks for no benefit once dist/ is just being executed). NP_HOME/agent.key/every mandate's config.json then live under the Windows-side homedir (C:\Users\<you>\.veritia), not WSL2's — simpler to reason about, one less cross-filesystem hop. Removes the wsl.exe indirection entirely; still reaches the WSL2-hosted PDS/stub at localhost:8081/:3000 (WSL2 forwards it). Alternative, kept as a fallback: "command": "wsl.exe", "args": ["-d","Ubuntu","--","node","/home/…/outil-local/dist/index.js"], keeping Node + the agent key file Linux-side instead — still supported, just no longer the default; fall back to it only if the native-Windows path hits something unexpected (e.g. a Windows-side npm install issue) close to the demo. Live dry run under way 2026-10-09 (step 9, Raul's own demo machine) — found and fixed one real bug the first time this actually ran natively on Windows: outil-local's key-permission check (agent-key.ts) assumed POSIX mode bits (mode & 0o077), which Windows/NTFS doesn't have — fs.stat() reports a uniform 0666 there regardless of real ACLs, so the check refused to start on every launch. Fixed by skipping it on win32 and relying on the %USERPROFILE%-inherited NTFS ACL instead (see outil-local/spec.md O-3). WSL2 localhost-forwarding and the containerized PDS/stub stack (step 8) both confirmed working from the Windows side at this point; the full balance-returned happy path through Claude Desktop is still being verified. |
WSL2 prep: enable systemd (/etc/wsl.conf → [boot]\nsystemd=true, then wsl --shutdown)
for rootless Podman's socket; sudo apt install uidmap. Raise the memory cap in
C:\Users\<you>\.wslconfig ([wsl2]\nmemory=8GB) — Keycloak + Spring Boot + a Maven build
together is heavy. SDKMAN installs JDK + Maven in one go; nvm for Node (both sides — WSL2 and
Windows are two independent Node installs, not shared).
12.1 Order
Steps 1–2 are the shared prerequisite. The PDS track (3–6) and the SPA track (7) then run in parallel with two people. The riskiest work — fork evaluation and MCP transport — is front-loaded.
| # | Step | Depends on | Notes |
|---|---|---|---|
| 0 | Freeze the §11 contracts (no code) | — | §11.1 / 11.2 / 11.4 decided; §11.3 and §11.5 are pick-a-value |
| 1 | Platform stub (Node): /jwks.json, /mandates (sign), /introspect/:jti, /mandates/:jti/revoke, /discover | §11.3, §11.4 | Small; unblocks everyone. Hand-craft a throwaway agent keypair to sign against until step 2 |
| 2 | Outil Local — init only (Ed25519 keygen, print public key) | — | Trivial; produces a real agent keypair for real test JWTs |
| 3 | PDS — clone in + stand up: clone the base repo (no .git) into poc-code/pds/, add NOTICE, bump Spring Boot to 3.3+/3.4, get it building; add spring-boot-starter-data-jpa + h2 + the accounts domain + get_balance REST; swap the demo realm for bqt (§11.4) | spike, §11.4 | §9 evaluation done — this is execution |
| 4 | PDS — MCP route: tools/list + get_balance tool over the same data, on Streamable HTTP | 3, §11.2 | Test with a raw MCP client before the Outil Local exists |
| 4b | PDS — mirror list_transactions: real Java equivalent of the SPA's fake-stub demo prop, same pattern as get_balance | 4 | Demo-prop-first: validate the review-screen UX cheaply before spending Java+test effort |
| 5 | Outil Local — runtime: stdio server ↔ Claude Desktop, HTTP MCP client ↔ PDS, discovery, DPoP proof + Authorization: DPoP injection | 1, 2, 4, §11.1 | Wire to the real Claude Desktop |
| 5b | Platform — one-time setup code + mandate-replace check + Outil Local — setup subcommand — ✅ done 2026-09-25, full real end-to-end smoke test (mandate → real PDS assertion → setup → runtime → real tools/call) green: mint a short-lived single-use code at mandate-issuance (SPA first checks for an existing active mandate under the same label and offers to replace it); redeem the code once to write ${NP_HOME}/<agent_label>/config.json — one shared agent.key per machine, one named folder per mandate | 1, 5, contracts §9, implementation checklist | Keeps every per-client onboarding recipe (platform §B5bis) secret-free — no AI client's own config file ever needs the raw token, and no two AI clients silently share a live grant |
| 6 | PDS — isolated filter on /mcp/**: JWT vs stub JWKS, exp/aud, introspect (fail-closed), DPoP proof (thumbprint vs cnf, htm/htu/bsha/jti, iat window + replay cache) | 1, 4, 5, §11.1, implementation checklist | Where the §11.1 contract is exercised end to end |
| 7 | Angular SPA: registration + review/accept screen, fake itsme, mandate form, dashboard | 1 | Independent of the PDS track; can start right after step 1 |
| 8 | compose.yaml + Keycloak realm seed; fix cross-container networking (§11.5) and the aud string | 3, 6 | Bring pds + pds-keycloak + web-platform-stub up together |
| 9 | End-to-end dry run + finalize demo/script.md, including the replay-fails and revoke beats | all | Rehearse on the actual demo machine |
13. Related documents
../analysis/synthese/README.md— living synthesis, decisions, open backlog../analysis/synthese/specification-v1-authentification.md— the reference flow this POC subsets../analysis/synthese/tokens-et-acces-prestataire.md— every token / key / credential, and how PDS access is really granted../analysis/synthese/liaison-pds-platforme/liaison-compte-prestataire.md— the account-linking flow (provider_account_ref); front-channel variant (§4.2) now built in the POC (contracts §8); legal validation still 🔶../analysis/synthese/itsme-integration.md— the real itsme OIDC integration the mock stands in for../CLAUDE.md— product + architecture summary