Title: auth: LWS10-CID JWT verifier with ES256K (#397) by melvincarvalho · Pull Request #398 · JavaScriptSolidServer/JavaScriptSolidServer · GitHub
Open Graph Title: auth: LWS10-CID JWT verifier with ES256K (#397) by melvincarvalho · Pull Request #398 · JavaScriptSolidServer/JavaScriptSolidServer
X Title: auth: LWS10-CID JWT verifier with ES256K (#397) by melvincarvalho · Pull Request #398 · JavaScriptSolidServer/JavaScriptSolidServer
Description: Closes #397. Pairs with JavaScriptSolidServer/doctor#3. Implements the verifier side of the LWS 1.0 SSI-via-CID FPWD (2026-04-23). An incoming Bearer JWT whose kid references a verificationMethod in the subject's WebID profile authenticates as that WebID once the JWT signature checks against the VM's publicKeyJwk. What's new src/auth/lws-cid.js — new module: hasLwsCidAuth() (cheap header detector) + verifyLwsCidAuth() (full verifier) Wired into getWebIdFromRequestAsync between Solid-OIDC and NIP-98 17 unit tests in test/lws-cid.test.js — happy path + 10 distinct rejection cases Algorithm story ES256K (RFC8812 — ECDSA-secp256k1, registered JWS alg) is the focus, because it lets a Nostr user reuse their existing secp256k1 private key as an LWS-CID auth credential — same key, ECDSA signature instead of Schnorr. Server-side verification uses @noble/curves (already in tree from NIP-98), so no new dep. ES256, ES384, EdDSA, RS256 also accepted via jose for non-Nostr keys. Detection vs existing IDP JWTs Unambiguous: LWS-CID kid is a URL with a fragment (the VM's id), while IDP-issued JWTs use opaque fingerprints. Routing on header shape avoids any conflict with the existing Bearer fallback that calls verifyJwtFromIdp. What it enforces FPWD §4: sub === iss === client_id (all the same WebID URI), aud includes server origin, exp not past, iat recent CID 1.0 §3.3: kid resolves to a VM whose id matches; that VM is referenced from authentication Self-control: VM controller agrees with profile.controller (with @id fallback) — same rule the doctor's client-side validator uses, normalized through the same JSON-LD shape helper (string / {@id} / {id} / array) Cross-document protection: kid's document URL must equal sub's document URL — can't use a key from someone else's profile Test plan Happy path: valid ES256K JWT against a CID-shaped profile → authenticated none alg rejected sub/iss/client_id divergence rejected kid in different document than sub rejected Expired JWT rejected Unknown VM id rejected VM not in authentication rejected aud not matching server origin rejected Tampered signature rejected Profile-VM-key vs JWT-signing-key mismatch rejected Profile fetch failure rejected Full suite: 655/655 pass — no regressions Manual end-to-end against JavaScriptSolidServer/doctor#3 once that lands Refs LWS10-CID FPWD: https://www.w3.org/TR/2026/WD-lws10-authn-ssi-cid-20260423/ W3C Controlled Identifiers v1.0: https://www.w3.org/TR/cid-1.0/ RFC8812 (ES256K): https://www.rfc-editor.org/rfc/rfc8812 #386 — overall convergence tracker (this is Phase 3a, server side) #319 — broader LWS auth alignment tracker (this is the #3 CID sub-bullet) #306 — auth-method preference order (LWS-CID slots between OIDC and NIP-98)
Open Graph Description: Closes #397. Pairs with JavaScriptSolidServer/doctor#3. Implements the verifier side of the LWS 1.0 SSI-via-CID FPWD (2026-04-23). An incoming Bearer JWT whose kid references a verificationMethod i...
X Description: Closes #397. Pairs with JavaScriptSolidServer/doctor#3. Implements the verifier side of the LWS 1.0 SSI-via-CID FPWD (2026-04-23). An incoming Bearer JWT whose kid references a verificationMethod i...
Opengraph URL: https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/pull/398
X: @github
Domain: github.com
IPv4 address: 140.82.113.3
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:bab280cb-1fa5-5909-d545-c98888d4fcf3 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | D6C6:12AC18:2982E6C:36E1F24:6B038BE5 |
| html-safe-nonce | 058e8375bcd24b47a144bcf9a3f1578e1fde20fe852ce219b62f86507f7dead6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENkM2OjEyQUMxODoyOTgyRTZDOjM2RTFGMjQ6NkIwMzhCRTUiLCJ2aXNpdG9yX2lkIjoiODE1MDc0MzQ3NDQ2ODI2MDgzNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 864c4d5026142ba82cf2442293e5308d3f27acc484b72f4c5b822a1d3531701b |
| hovercard-subject-tag | pull_request:3654381539 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/pull/398/files |
| twitter:image | https://avatars.githubusercontent.com/u/65864?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/65864?s=400&v=4 |
| og:image:alt | Closes #397. Pairs with JavaScriptSolidServer/doctor#3. Implements the verifier side of the LWS 1.0 SSI-via-CID FPWD (2026-04-23). An incoming Bearer JWT whose kid references a verificationMethod i... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/JavaScriptSolidServer/JavaScriptSolidServer git https://github.com/JavaScriptSolidServer/JavaScriptSolidServer.git |
| octolytics-dimension-user_id | 205442424 |
| octolytics-dimension-user_login | JavaScriptSolidServer |
| octolytics-dimension-repository_id | 958025407 |
| octolytics-dimension-repository_nwo | JavaScriptSolidServer/JavaScriptSolidServer |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 958025407 |
| octolytics-dimension-repository_network_root_nwo | JavaScriptSolidServer/JavaScriptSolidServer |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | no-cache |
Viewport: width=device-width