{"id":13555736,"url":"https://github.com/linkeddata/node-webid","last_synced_at":"2025-04-03T08:31:58.293Z","repository":{"id":25597303,"uuid":"29032189","full_name":"linkeddata/node-webid","owner":"linkeddata","description":"WebID node.js library","archived":false,"fork":true,"pushed_at":"2021-06-01T12:57:45.000Z","size":437,"stargazers_count":37,"open_issues_count":4,"forks_count":9,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-09T10:33:25.440Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"magnetik/node-webid","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/linkeddata.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-09T19:42:17.000Z","updated_at":"2021-06-01T12:57:48.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/linkeddata/node-webid","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkeddata%2Fnode-webid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkeddata%2Fnode-webid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkeddata%2Fnode-webid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkeddata%2Fnode-webid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linkeddata","download_url":"https://codeload.github.com/linkeddata/node-webid/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246965996,"owners_count":20861978,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T12:03:23.094Z","updated_at":"2025-04-03T08:31:53.280Z","avatar_url":"https://github.com/linkeddata.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","others"],"sub_categories":[],"readme":"# node-webid\n\n[![Build Status](https://travis-ci.org/linkeddata/node-webid.svg?branch=master)](https://travis-ci.org/linkeddata/node-webid)\n[![NPM Version](https://img.shields.io/npm/v/webid.svg?style=flat)](https://npm.im/webid)\n[![Gitter chat](https://img.shields.io/badge/gitter-join%20chat%20%E2%86%92-brightgreen.svg?style=flat)](http://gitter.im/linkeddata/node-webid)\n\nNode.js module with tools to help using [WebID](http://linkeddata.github.io/SoLiD/#identity-management-based-on-webid).\n\n## Installation\n\n```\n$ npm install webid --save\n```\n\n## Features\n\n- [x] Retrieve a WebID\n- [x] Verify a WebID+TLS\n- [x] Generate a WebID+TLS\n\n## Usage\n\nTo verify a WebID / certificate:\n\n```javascript\n// Self-signed certificate parsed by Express\nvar validCert = {\n  subject: { O: 'WebID', CN: 'Nicola Greco (test) [on test_nicola.databox.me]' },\n  issuer: { O: 'WebID', CN: 'Nicola Greco (test) [on test_nicola.databox.me]' },\n  subjectaltname: 'URI:https://test_nicola.databox.me/profile/card#me',\n  modulus: 'C62AE4CE77A8D915527F79EE1B5365099A35A3BF8E4AA68ED7CBF4D6B966ACE0FCAD79DE66A0EA89FF5EF8DAB2619F51E2F28227C9AA594BA3A4176723BA00813D8F8C738359F6240DF8FADD1A7AE56F2B24E7329A189E1065E3E7C2CEC96CC57CD9D3BF782DC15C11FBEFD24E536C46E8E1285BEC27CB3CC6C295595F18BC564A6ACA45ABCB8AD0C6617F42F5151DDB1A42513BE7AA9E2593DFDBB03938C15136C202C61E59DFE7C563F56301B5B29F91C03A9C92458BA26918E22CB137B998FF76EC85E97D16424078A949F491E348D9E33A43C9D5D938C6E12B2F2015FA2C1A950E28C6ECC6DD70CE228275DBB4C085BC4063DA24178F5B13601E3E6CE17F',\n  exponent: '10001',\n  valid_from: 'Jan  1 00:00:00 2000 GMT',\n  valid_to: 'Dec 31 23:59:59 2049 GMT',\n  fingerprint: '17:09:CB:F5:8D:D7:49:BB:36:45:B8:96:01:C9:0F:0D:E7:56:5B:C0',\n  serialNumber: '2A'\n}\n\n// Using the TLS webid strategy\nvar webid = require('webid')('tls')\n\nvar agentWebId = 'https://corysabol.databox.me/profile/card#me'\nwebid.verify(validCert, callback)\n```\n\nTo generate a WebID / certificate.\n\n```javascript\nvar forge = require('node-forge')\nvar asn1 = forge.asn1\nvar pki = forge.pki\n\nvar webid = require('webid')('tls')\n\n// Sample Express handler for the account /register endpoint\n// This is what a form containing a `\u003ckeygen\u003e` element will POST to\napp.post('/register', bodyParser(), function (req, res) {\n  var options = {\n    // \u003ckeygen name=spkack\u003e\n    spkac: Buffer.from(req.body.spkac),\n    agent: req.session.userWebId\n  }\n  webid.generate(options, function(err, cert) {\n    // Some browsers only accept DER formatted certificates\n    var der = asn1.toDer(pki.certificateToAsn1(cert)).getBytes()\n    // Send back the generated certificate with a WebID URI in the subjectAltName\n    res.set('Content-Type', 'application/x-x509-user-cert')\n    res.send(Buffer.from(der, 'binary'))\n  })\n})\n```\n\n### Options\n\n```javascript\nvar options = {\n  // \u003ckeygen name=spkack\u003e\n  spkac: Buffer.from(req.body.spkac),\n  agent: req.session.userWebId,\n  commonName: '',\n  organizationName: '',\n  issuer: {\n    commonName: '',\n    organizationName: ''\n  }\n}\n```\n\n## History\n\nOriginally forked from [magnetik/node-webid](https://github.com/magnetik/node-webid)\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinkeddata%2Fnode-webid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinkeddata%2Fnode-webid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinkeddata%2Fnode-webid/lists"}