Title: Login with did:nostr · Issue #37 · JavaScriptSolidServer/JavaScriptSolidServer · GitHub
Open Graph Title: Login with did:nostr · Issue #37 · JavaScriptSolidServer/JavaScriptSolidServer
X Title: Login with did:nostr · Issue #37 · JavaScriptSolidServer/JavaScriptSolidServer
Description: Summary Enable authentication via did:nostr:
Open Graph Description: Summary Enable authentication via did:nostr:
X Description: Summary Enable authentication via did:nostr:<pubkey> resolution, bridging Nostr identity to Solid WebID. How It Works nostr.social runs nostr-beacon which already supports alsoKnownAs in DID ...
Opengraph URL: https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/37
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Login with did:nostr","articleBody":"## Summary\n\nEnable authentication via `did:nostr:\u003cpubkey\u003e` resolution, bridging Nostr identity to Solid WebID.\n\n## How It Works\n\nnostr.social runs [nostr-beacon](https://github.com/nostr-labs/nostr-beacon) which already supports `alsoKnownAs` in DID documents:\n\n```\nhttps://nostr.social/.well-known/did/nostr/\u003cpubkey\u003e.json\n```\n\n### Step 1: User links Nostr → WebID\n\nAdd `alsoKnownAs` to Nostr profile (kind 0 event):\n```json\n{\n \"name\": \"alice\",\n \"alsoKnownAs\": [\"https://solid.social/alice/profile/card#me\"]\n}\n```\n\n### Step 2: User links WebID → Nostr\n\nAdd `owl:sameAs` to WebID profile:\n```json\n{\n \"@id\": \"#me\",\n \"owl:sameAs\": \"did:nostr:\u003cpubkey\u003e\"\n}\n```\n\n### Step 3: JSS verifies bidirectional link\n\n```\n1. Request arrives with NIP-98 header\n2. Extract pubkey from Nostr event signature\n3. Fetch: nostr.social/.well-known/did/nostr/\u003cpubkey\u003e.json\n4. Get alsoKnownAs → WebID URL\n5. Fetch WebID profile\n6. Check owl:sameAs === did:nostr:\u003cpubkey\u003e\n7. Bidirectional match? → Authenticated as WebID\n```\n\n## Implementation\n\n```javascript\n// src/auth/did-nostr.js (~50 lines)\nexport async function resolveNostrToWebId(pubkey) {\n // Fetch DID document\n const res = await fetch(`https://nostr.social/.well-known/did/nostr/${pubkey}.json`);\n const didDoc = await res.json();\n \n // Get WebID from alsoKnownAs\n const webid = didDoc.alsoKnownAs?.[0];\n if (!webid) return null;\n \n // Verify backlink in WebID profile\n const profile = await fetch(webid, {\n headers: {'Accept': 'application/ld+json'}\n }).then(r =\u003e r.json());\n \n const sameAs = profile['owl:sameAs'] || profile['sameAs'];\n if (sameAs === `did:nostr:${pubkey}`) {\n return webid;\n }\n return null;\n}\n```\n\n## Benefits\n\n- No passwords, cryptographic signatures only\n- Bridges Nostr ↔ Solid identity\n- Works with existing NIP-07 browser extensions\n- Uses existing NIP-98 auth in JSS\n- Decentralized identity resolution via nostr.social\n\n## Related\n\n- [nostr-beacon](https://github.com/nostr-labs/nostr-beacon) - DID resolver running on nostr.social\n- NIP-07: Browser extension signing\n- NIP-98: HTTP Auth (already in JSS)\n- Existing Nostr auth: `src/auth/nostr.js`","author":{"url":"https://github.com/melvincarvalho","@type":"Person","name":"melvincarvalho"},"datePublished":"2026-01-03T23:07:39.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/37/JavaScriptSolidServer/issues/37"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:40d284e3-188f-0414-5125-7be5110cd79e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BA14:14B12A:28F0A89:35782FB:6976FE01 |
| html-safe-nonce | 7becd610c05a75caec0ae150d258ef11a73fd75e0bc24e991c46ccb7431b6159 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQTE0OjE0QjEyQToyOEYwQTg5OjM1NzgyRkI6Njk3NkZFMDEiLCJ2aXNpdG9yX2lkIjoiMzgzODk4MTI4NDM1Njg4MTkyMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | c68c47209be2b3128de0313967dc70f8bd7a61da9eb7a103914421f299cf5352 |
| hovercard-subject-tag | issue:3778576232 |
| github-keyboard-shortcuts | repository,issues,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/_view_fragments/issues/show/JavaScriptSolidServer/JavaScriptSolidServer/37/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c2936d2486ac4644226003cc1a94c8e95fda7e716617f64bdb6e3efd340c26ae/JavaScriptSolidServer/JavaScriptSolidServer/issues/37 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c2936d2486ac4644226003cc1a94c8e95fda7e716617f64bdb6e3efd340c26ae/JavaScriptSolidServer/JavaScriptSolidServer/issues/37 |
| og:image:alt | Summary Enable authentication via did:nostr: |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | melvincarvalho |
| hostname | github.com |
| expected-hostname | github.com |
| None | 01d198479908d09a841b2febe8eb105a81af2af7d81830960fe0971e1f4adc09 |
| turbo-cache-control | no-preview |
| 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 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f752335dbbea672610081196a1998e39aec5e14b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width