{"id":19163214,"url":"https://github.com/oada/oada-trusted-jws-js","last_synced_at":"2026-06-17T13:30:17.493Z","repository":{"id":29841050,"uuid":"33385800","full_name":"OADA/oada-trusted-jws-js","owner":"OADA","description":"Check if a JWS was signed by an OADA trusted party","archived":false,"fork":false,"pushed_at":"2023-06-21T15:23:39.000Z","size":29,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-02-12T20:44:32.189Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OADA.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-04-03T22:29:42.000Z","updated_at":"2019-11-13T05:32:04.000Z","dependencies_parsed_at":"2024-10-21T17:47:25.337Z","dependency_job_id":null,"html_url":"https://github.com/OADA/oada-trusted-jws-js","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OADA%2Foada-trusted-jws-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OADA%2Foada-trusted-jws-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OADA%2Foada-trusted-jws-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OADA%2Foada-trusted-jws-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OADA","download_url":"https://codeload.github.com/OADA/oada-trusted-jws-js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240245887,"owners_count":19771029,"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-11-09T09:14:30.630Z","updated_at":"2026-06-17T13:30:17.435Z","avatar_url":"https://github.com/OADA.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/OADA/oada-trusted-jws-js.svg?branch=master)](https://travis-ci.org/OADA/oada-trusted-jws-js)\n[![Coverage Status](https://coveralls.io/repos/OADA/oada-trusted-jws-js/badge.svg?branch=master)](https://coveralls.io/r/OADA/oada-trusted-jws-js?branch=master)\n[![Dependency Status](https://david-dm.org/oada/oada-trusted-jws-js.svg)](https://david-dm.org/oada/oada-trusted-jws-js)\n[![License](http://img.shields.io/:license-Apache%202.0-green.svg)](http://www.apache.org/licenses/LICENSE-2.0.html)\n\n# oada-trusted-jws #\n\nTHIS LIBRARY IS DEPRECATED.  WE USE OADA-CERTS NOW INSTEAD.\n\n## Installation ##\n```shell\nnpm install oada-trusted-jws\n```\n\n## Usage ##\n```javascript\nvar check = require('oada-trusted-jws');\n\nvar signature = /* Get there from somewhere like jwt.sign */;\n\n// As a promise\ncheck(signature).spread(function(trusted, payload) {\n    // trusted is true/false if signature is trusted/untrusted\n    // payload is the payload of signature\n});\n\n// With a callback\ncheck(signtaure, function(err, trusted, payload) {\n   // err is an Error or falsy\n});\n\n// options: {\n//   timeout: 1000, // ms\n//   trustedListCacheTime: 3600, // seconds\n//   additionalTrustedListURIs: [ 'https://somewhere.com/client-registration.json' ],\n// }\n// Using additional trusted lists\ncheck(signature, { \n  additionalTrustedListURIs: [ 'https://somewhere.com/thelist.json' ]\n})\n\n## Trusted Lists ##\nThere are two types of external requests that this library will make.  First,\nit will get a copy of the core \"trusted list\" and any additional ones passed\nin the options.  It will cache these for default 1 hour.  The body returned\nto the `GET` request should be an array of strings, with each string representing\na trusted URI that contains a set of json web keys (jwks = jwk set = json web key set).\nThese URI's are all the valid json web key uri `jku` that can be used in any given\nJWT's header to indicate where to find the public key (`jwk`) that signed it.\n\n*Example Trusted List:*\n```javascript\nrequest.get('https://sometrustedlist.com/list.json').then(result =\u003e {\n  console.log('Request body for trusted list = ', result.body);\n});\n// Prints to the console:\n// Request body for trusted list = \n// [\n//   'https://somewhere.com/jwkset.json',\n//   'https://somewhereelse.com/oursetofjsonwebkeys.json'\n// ]\n```\n\n## JSON Web Key Set ##\nThe second type of external request that this library will make is to get the \nset of approved json web keys from all the URL's listed in all of the trusted\nlists.  Abbreviated as `jwks` in the standard, a jwks is a valid JSON object \nthat contains a key named \"keys\", at which is an array of valid keys.\n\n*Example JWKS:*\n```javascript\nrequest.get('https://sometrustedlist.com/jwks.json').then(result =\u003e {\n  console.log('Request body for jwks = ', result.body);\n});\n// Prints to the console:\n// Request body for jwks = \n// {\n//   \"keys\": [\n//     {\n//       \"alg\": \"RS256\",\n//       \"use\": \"sig\",\n//       \"kid\": \"kjcScjc32dwJXXLJDs3r124sa1\",\n//       \"kty\": \"RSA\",\n//       \"n\": \"359ZykLITko_McOOKAtpJRVkjS5itwZxzjQidW2X6tBEOYCH4LZbwfj8fGGvlUtzpyuwnYuIlNX8TvZLTenOk45pphXr5PMCMKi7YZgkhd6_t_oeHnXY-4bnDLF1r9OUFKwj6C-mFFM-woKc-62tuK6QJiuc-5bFfn9wRL15K1E\",\n//       \"e\": \"AQAB\"\n//     }\n//   ]\n// }\n```\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foada%2Foada-trusted-jws-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foada%2Foada-trusted-jws-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foada%2Foada-trusted-jws-js/lists"}