René's URL Explorer Experiment


Title: Add WebID-TLS authentication support · Issue #67 · JavaScriptSolidServer/JavaScriptSolidServer · GitHub

Open Graph Title: Add WebID-TLS authentication support · Issue #67 · JavaScriptSolidServer/JavaScriptSolidServer

X Title: Add WebID-TLS authentication support · Issue #67 · JavaScriptSolidServer/JavaScriptSolidServer

Description: Summary Add WebID-TLS (mutual TLS / client certificate) authentication to JSS, enabling backend services, CLI tools, and automated agents to authenticate without user interaction. Background What is WebID-TLS? WebID-TLS is a decentralize...

Open Graph Description: Summary Add WebID-TLS (mutual TLS / client certificate) authentication to JSS, enabling backend services, CLI tools, and automated agents to authenticate without user interaction. Background What i...

X Description: Summary Add WebID-TLS (mutual TLS / client certificate) authentication to JSS, enabling backend services, CLI tools, and automated agents to authenticate without user interaction. Background What i...

Opengraph URL: https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/67

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.4


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add WebID-TLS authentication support","articleBody":"## Summary\n\nAdd WebID-TLS (mutual TLS / client certificate) authentication to JSS, enabling backend services, CLI tools, and automated agents to authenticate without user interaction.\n\n## Background\n\n### What is WebID-TLS?\n\nWebID-TLS is a decentralized authentication protocol that uses TLS client certificates:\n\n1. Client presents X.509 certificate during TLS handshake\n2. Certificate's `SubjectAlternativeName` (SAN) contains a WebID URI\n3. Server fetches the WebID profile document\n4. Server verifies the certificate's public key matches the one published in the profile\n\n```mermaid\nsequenceDiagram\n    participant C as Client\n    participant S as JSS Server\n    participant P as WebID Profile\n    \n    C->>S: TLS Handshake + Client Cert\n    Note over S: Extract WebID from SAN\n    S->>P: Fetch WebID Profile\n    P-->>S: Profile with cert:key\n    Note over S: Match modulus + exponent\n    S-->>C: Authenticated as WebID\n```\n\n### Why Now?\n\nThe W3C Linked Web Storage Use Cases group has [raised this need](https://github.com/w3c/lws-ucs/issues/40) for enterprise adoption:\n\n> *\"As a large tax advisory office, I want our existing backend services to authenticate themselves (without user interaction), such that these services can fetch and crunch private data from our clients.\"*\n\nKey drivers:\n- **Enterprise adoption**: Organizations with existing PKI/mTLS infrastructure want seamless LWS integration\n- **Backend services**: Server-to-server communication doesn't need browser UX\n- **IoT/Agents**: Automated systems need non-interactive authentication\n- **CLI tools**: Developers using `curl` or custom tools with client certs\n\n### Browser Support Note\n\nWhile browser support for in-browser certificate generation (`\u003ckeygen>`) has been [removed from Chrome](https://groups.google.com/a/chromium.org/g/blink-dev/c/pX5NbX0Xack/m/kmHsyMGJZAMJ) and deprecated in Firefox, this **does not affect server-side WebID-TLS**:\n\n- Server-to-server: Works perfectly with standard mTLS\n- CLI tools: `curl --cert` works fine\n- Browser workarounds: [YouID extension](https://vos.openlinksw.com/dataspace/owiki/wiki/VOS/WebIDTLSDelegationWhatWhyHow) available\n\n## Implementation Guide\n\n### Files to Create/Modify\n\n| File | Purpose |\n|------|---------|\n| `src/auth/webid-tls.js` | WebID-TLS authentication module |\n| `src/server.js` | Enable `requestCert` option on HTTPS server |\n| `src/config.js` | Add `--webid-tls` CLI flag |\n\n### Step 1: Server Configuration\n\nModify `src/server.js` to request client certificates:\n\n```javascript\n// In createServer, when SSL is enabled\nif (options.ssl && options.ssl.key && options.ssl.cert) {\n  const httpsOptions = {\n    key: options.ssl.key,\n    cert: options.ssl.cert,\n    // Enable WebID-TLS\n    requestCert: options.webidTls || false,  // Request client cert\n    rejectUnauthorized: false  // Don't reject self-signed (we verify via WebID)\n  };\n  // ... create HTTPS server\n}\n```\n\n### Step 2: Create WebID-TLS Auth Module\n\nCreate `src/auth/webid-tls.js`:\n\n```javascript\nimport { graph, SPARQLToQuery } from 'rdflib';\n\nconst SPARQL_QUERY = `\n  PREFIX cert: \u003chttp://www.w3.org/ns/auth/cert#>\n  SELECT ?webid ?m ?e WHERE {\n    ?webid cert:key ?key .\n    ?key cert:modulus ?m .\n    ?key cert:exponent ?e .\n  }\n`;\n\n/**\n * Extract WebID from client certificate's SubjectAlternativeName\n */\nexport function getWebIdFromCert(certificate) {\n  if (!certificate?.subjectaltname) return null;\n  \n  const match = certificate.subjectaltname.match(/URI:([^,\\s]+)/);\n  return match ? match[1] : null;\n}\n\n/**\n * Verify certificate public key matches WebID profile\n */\nexport async function verifyWebIdTls(certificate, webId) {\n  if (!certificate.modulus || !certificate.exponent) {\n    throw new Error('Certificate missing modulus or exponent');\n  }\n  \n  // Fetch WebID profile\n  const response = await fetch(webId, {\n    headers: { 'Accept': 'text/turtle, application/ld+json' }\n  });\n  \n  if (!response.ok) {\n    throw new Error(`Failed to fetch WebID profile: ${response.status}`);\n  }\n  \n  const body = await response.text();\n  const contentType = response.headers.get('content-type')?.split(';')[0];\n  \n  // Parse profile and find matching key\n  const g = graph();\n  // ... parse RDF and run SPARQL query\n  \n  const certModulus = certificate.modulus.toLowerCase();\n  const certExponent = parseInt(certificate.exponent, 16).toString();\n  \n  // Match modulus and exponent from profile\n  // Return true if match found, false otherwise\n}\n\n/**\n * Middleware to authenticate via WebID-TLS\n */\nexport async function webIdTlsAuth(request) {\n  const socket = request.raw?.socket || request.socket;\n  \n  if (!socket?.getPeerCertificate) {\n    return null; // Not a TLS connection\n  }\n  \n  const cert = socket.getPeerCertificate();\n  if (!cert || Object.keys(cert).length === 0) {\n    return null; // No client certificate\n  }\n  \n  const webId = getWebIdFromCert(cert);\n  if (!webId) {\n    return null; // No WebID in certificate\n  }\n  \n  const verified = await verifyWebIdTls(cert, webId);\n  return verified ? webId : null;\n}\n```\n\n### Step 3: Integrate with Auth Flow\n\nIn `src/auth/token.js`, add WebID-TLS as authentication method:\n\n```javascript\nimport { webIdTlsAuth } from './webid-tls.js';\n\nexport async function getWebIdFromRequestAsync(request) {\n  // Try bearer token first\n  let webId = await getWebIdFromToken(request);\n  \n  // Fall back to WebID-TLS\n  if (!webId) {\n    webId = await webIdTlsAuth(request);\n  }\n  \n  return { webId };\n}\n```\n\n### Step 4: CLI Configuration\n\nAdd to `src/config.js`:\n\n```javascript\n.option('--webid-tls', 'Enable WebID-TLS client certificate authentication')\n```\n\n## Testing\n\n### Manual Testing with curl\n\n```bash\n# Generate self-signed cert with WebID in SAN\nopenssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365 \\\n  -subj \"/CN=Test\" -addext \"subjectAltName=URI:https://example.com/profile/card#me\"\n\n# Test authentication\ncurl --cert cert.pem --key key.pem https://localhost:8443/private/resource\n```\n\n### Unit Tests\n\n```javascript\ndescribe('WebID-TLS Authentication', () => {\n  it('should extract WebID from certificate SAN', () => {\n    const cert = { subjectaltname: 'URI:https://alice.example/card#me' };\n    expect(getWebIdFromCert(cert)).toBe('https://alice.example/card#me');\n  });\n  \n  it('should verify certificate against WebID profile', async () => {\n    // Mock profile with matching cert:key\n    // Verify returns true\n  });\n  \n  it('should reject mismatched certificate', async () => {\n    // Mock profile with different key\n    // Verify returns false\n  });\n});\n```\n\n## WebID Profile Requirements\n\nFor WebID-TLS to work, the WebID profile must contain the certificate's public key:\n\n```turtle\n@prefix cert: \u003chttp://www.w3.org/ns/auth/cert#> .\n@prefix xsd: \u003chttp://www.w3.org/2001/XMLSchema#> .\n\n\u003c#me> cert:key [\n    a cert:RSAPublicKey;\n    cert:modulus \"abc123...\"^^xsd:hexBinary;\n    cert:exponent 65537\n] .\n```\n\n## Use Cases Enabled\n\n1. **Backend Services**: Tax advisors fetching client data (W3C use case)\n2. **CLI Tools**: Developers using `curl` or custom scripts\n3. **IoT Devices**: Sensors/actuators with embedded certificates\n4. **Automated Agents**: Bots and crawlers with verifiable identity\n5. **Legacy Integration**: Organizations with existing PKI infrastructure\n\n## References\n\n- [WebID-TLS Spec](https://dvcs.w3.org/hg/WebID/raw-file/tip/spec/tls-respec.html)\n- [W3C LWS-UCS Issue #40](https://github.com/w3c/lws-ucs/issues/40) - Enterprise use case\n- [Solid Protocol - WebID-TLS](https://solidproject.org/TR/protocol#webid-tls)\n- [NSS WebID-TLS Implementation](https://github.com/nodeSolidServer/node-solid-server/blob/main/lib/api/authn/webid-tls.mjs)\n- [YouID Browser Extension](https://vos.openlinksw.com/dataspace/owiki/wiki/VOS/WebIDTLSDelegationWhatWhyHow)\n\n## Related\n\n- Solid-OIDC (current default auth) remains primary for browser-based apps\n- WebID-TLS would be an additional authentication method, not a replacement","author":{"url":"https://github.com/melvincarvalho","@type":"Person","name":"melvincarvalho"},"datePublished":"2026-01-08T20:28:33Z","url":"https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/67"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:a4c20464-45ad-6b9c-cccb-2e8ca1f7b72e
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9C32:B4652:107B974:14EDF4F:6B0389D6
html-safe-nonce1a8dc4ce235ae425c0546032b2d246256f0c820331e6a75864fda5f81db57bc9
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QzMyOkI0NjUyOjEwN0I5NzQ6MTRFREY0Rjo2QjAzODlENiIsInZpc2l0b3JfaWQiOiIzOTY5NjE4MTU2NDE0Mjc0MDA2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac8330fd080a70d7a850ac0089aa4a9359c4194e7b31843ded2fd12458c33d560c
hovercard-subject-tagissue:3794327135
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/JavaScriptSolidServer/JavaScriptSolidServer/67/issue_layout
twitter:imagehttps://opengraph.githubassets.com/a8714eb5e0e6073f7d7ffd6088d58ccbbf1c1c5bb3ccdb199c8d21568c3c0377/JavaScriptSolidServer/JavaScriptSolidServer/issues/67
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/a8714eb5e0e6073f7d7ffd6088d58ccbbf1c1c5bb3ccdb199c8d21568c3c0377/JavaScriptSolidServer/JavaScriptSolidServer/issues/67
og:image:altSummary Add WebID-TLS (mutual TLS / client certificate) authentication to JSS, enabling backend services, CLI tools, and automated agents to authenticate without user interaction. Background What i...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamemelvincarvalho
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
go-importgithub.com/JavaScriptSolidServer/JavaScriptSolidServer git https://github.com/JavaScriptSolidServer/JavaScriptSolidServer.git
octolytics-dimension-user_id205442424
octolytics-dimension-user_loginJavaScriptSolidServer
octolytics-dimension-repository_id958025407
octolytics-dimension-repository_nwoJavaScriptSolidServer/JavaScriptSolidServer
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id958025407
octolytics-dimension-repository_network_root_nwoJavaScriptSolidServer/JavaScriptSolidServer
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/67#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FJavaScriptSolidServer%2FJavaScriptSolidServer%2Fissues%2F67
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FJavaScriptSolidServer%2FJavaScriptSolidServer%2Fissues%2F67
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=JavaScriptSolidServer%2FJavaScriptSolidServer
Reloadhttps://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/67
Reloadhttps://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/67
Reloadhttps://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/67
JavaScriptSolidServerhttps://github.com/JavaScriptSolidServer
JavaScriptSolidServerhttps://github.com/JavaScriptSolidServer/JavaScriptSolidServer
Codehttps://github.com/JavaScriptSolidServer/JavaScriptSolidServer
Issues165 (165)https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues
Pull requests14 (14)https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/pulls
Actionshttps://github.com/JavaScriptSolidServer/JavaScriptSolidServer/actions
Projectshttps://github.com/JavaScriptSolidServer/JavaScriptSolidServer/projects
Security and qualityhttps://github.com/JavaScriptSolidServer/JavaScriptSolidServer/security
Insightshttps://github.com/JavaScriptSolidServer/JavaScriptSolidServer/insights
https://github.com/JavaScriptSolidServer/JavaScriptSolidServer
New issuehttps://github.com/login?return_to=https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/67
New issuehttps://github.com/login?return_to=https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/67
Add WebID-TLS authentication supporthttps://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/67#top
enhancementNew feature or requesthttps://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues?q=state%3Aopen%20label%3A%22enhancement%22
stale-fixedOpen issue whose described problem no longer reproduces on current main; verify and closehttps://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues?q=state%3Aopen%20label%3A%22stale-fixed%22
https://github.com/melvincarvalho
melvincarvalhohttps://github.com/melvincarvalho
on Jan 8, 2026https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/67#issue-3794327135
raised this needhttps://github.com/w3c/lws-ucs/issues/40
removed from Chromehttps://groups.google.com/a/chromium.org/g/blink-dev/c/pX5NbX0Xack/m/kmHsyMGJZAMJ
YouID extensionhttps://vos.openlinksw.com/dataspace/owiki/wiki/VOS/WebIDTLSDelegationWhatWhyHow
WebID-TLS Spechttps://dvcs.w3.org/hg/WebID/raw-file/tip/spec/tls-respec.html
W3C LWS-UCS Issue #40https://github.com/w3c/lws-ucs/issues/40
Solid Protocol - WebID-TLShttps://solidproject.org/TR/protocol#webid-tls
NSS WebID-TLS Implementationhttps://github.com/nodeSolidServer/node-solid-server/blob/main/lib/api/authn/webid-tls.mjs
YouID Browser Extensionhttps://vos.openlinksw.com/dataspace/owiki/wiki/VOS/WebIDTLSDelegationWhatWhyHow
https://github.com/melvincarvalho
melvincarvalhohttps://github.com/melvincarvalho
on Jan 8, 2026https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/67#issuecomment-3725703200
RFC 8446 - TLS 1.3https://datatracker.ietf.org/doc/html/rfc8446
NIP-98https://github.com/nostr-protocol/nips/blob/master/98.md
https://github.com/melvincarvalho
melvincarvalhohttps://github.com/melvincarvalho
on May 9, 2026https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/67#issuecomment-4411362631
#386https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/386
melvincarvalhohttps://github.com/melvincarvalho
enhancementNew feature or requesthttps://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues?q=state%3Aopen%20label%3A%22enhancement%22
on May 12, 2026https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/67#event-25414634003
https://github.com/melvincarvalho
melvincarvalhohttps://github.com/melvincarvalho
on Jun 10, 2026https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/67#issuecomment-4674273940
#70https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/70
@idhttps://github.com/id
#70https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/70
melvincarvalhohttps://github.com/melvincarvalho
completedhttps://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Jun 10, 2026https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/67#event-26594337927
melvincarvalhohttps://github.com/melvincarvalho
stale-fixedOpen issue whose described problem no longer reproduces on current main; verify and closehttps://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues?q=state%3Aopen%20label%3A%22stale-fixed%22
on Jun 10, 2026https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/67#event-26594338758
Sign up for freehttps://github.com/signup?return_to=https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/67
Sign in to commenthttps://github.com/login?return_to=https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/67
enhancementNew feature or requesthttps://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues?q=state%3Aopen%20label%3A%22enhancement%22
stale-fixedOpen issue whose described problem no longer reproduces on current main; verify and closehttps://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues?q=state%3Aopen%20label%3A%22stale-fixed%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.