{"_id":"@apptentive/jwks-rsa","_rev":"12-e6a06e23f26173a30e9423cde18c518d","name":"@apptentive/jwks-rsa","dist-tags":{"latest":"1.3.2"},"versions":{"1.3.0":{"name":"@apptentive/jwks-rsa","version":"1.3.0","description":"Library to retrieve RSA public keys from a JWKS endpoint","main":"lib/index.js","types":"index.d.ts","dependencies":{"@types/express-jwt":"0.0.34","debug":"^2.2.0","limiter":"^1.1.0","lru-memoizer":"^1.6.0","ms":"^2.0.0","request":"^2.73.0"},"devDependencies":{"babel-cli":"^6.9.0","babel-core":"^6.9.0","babel-eslint":"^6.0.4","babel-preset-es2015":"^6.9.0","babel-preset-stage-0":"^6.5.0","chai":"^3.5.0","eslint":"^2.10.2","eslint-plugin-babel":"^3.2.0","express-jwt":"^3.4.0","jsonwebtoken":"^7.1.7","koa":"^2.2.0","koa-jwt":"^3.2.0","mocha":"^2.5.3","nock":"^8.0.0","rimraf":"^2.5.2","supertest":"^3.0.0"},"scripts":{"clean":"rimraf lib/","compile":"babel -d lib/ src/","prepublish":"npm run clean && npm run compile","test":"NODE_ENV=test mocha --compilers js:babel-core/register --timeout 5000 $(find ./tests -name *.tests.js)","test-watch":"NODE_ENV=test mocha --compilers js:babel-core/register --timeout 5000 $(find ./tests -name *.tests.js) --watch","release":"git tag $npm_package_version && git push && git push --tags && npm publish"},"repository":{"type":"git","url":"git+https://github.com/auth0/node-jwks-rsa.git"},"keywords":["jwks","rsa","jwt"],"author":{"name":"Auth0"},"license":"MIT","bugs":{"url":"https://github.com/auth0/node-jwks-rsa/issues"},"homepage":"https://github.com/auth0/node-jwks-rsa#readme","directories":{"example":"examples","lib":"lib","test":"tests"},"gitHead":"13982d309aeac0b519ce43a41b547872257dab60","_id":"@apptentive/jwks-rsa@1.3.0","_npmVersion":"6.5.0","_nodeVersion":"10.13.0","_npmUser":{"name":"dvonlehman","email":"david.vonlehman@gmail.com"},"dist":{"integrity":"sha512-GVYPCeDzymCqkZuxVYeVf0YfYlDDwazRYJLqg0i5XMFB5ECEuL88UKIOoxa/oIe6rj7rRYZikAQ0XxSKnbiuVg==","shasum":"7d74fbd7c1c600b46a9bcb6539fa3635cf2a5acd","tarball":"https://registry.npmjs.org/@apptentive/jwks-rsa/-/jwks-rsa-1.3.0.tgz","fileCount":39,"unpackedSize":82198,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcS58gCRA9TVsSAnZWagAACLwP/1NTl5QjzuB9+wZ02Dsc\nG54SVA8XXgm6yxKVb+Ij7/vkjeiVjUUfkTDPa/thJDsAa4rsYBWkqpPZ9EjD\nxA7kkmJd6ElnMsU+iTnI0zEhZP02UJ1ysOA+HZpbA6VfjC5Ul1bX4qPS826+\nxFEZym+mubuTszbDRLmTYvXKhNOUW77N0ynhH4Ad2OuVLtewp2xQso0mLsQ/\nOp9GbsuTAMhTqLpPsMifYCo4Gv1NsnEJJJR3RsQpYFJ0tsoLDwi31YAHAwSA\n7fHwH5O/Q1um7+kQls5exENh2m39KeVT46JK3m5yjPeimbwJ5cuLk+zjmvwW\nEe40TvQsIBVjDdMIQ/Wsm8GRScRXjpyRMxw6ReC272EKIaHuM0tlg7BULObS\neSQx2dNQXHXmgZqBVMzPvduUa7Be0CGfkui2xdC0wJ7eOBzOHgoiR9C6u5Vr\nSuwU5U5dikv+vlO4EhnhqKUUczdyeRh203Ta2sxGe3tnJXvXnRCNiaj/RDOp\nZa0t+0VO8hxEOH4PWX4WiQmOVW/NWYTipWYVXGdYuuGPKefaSbo8KV/kn/pn\n4SmDVpwLs+6ljCUFO0oJCbd7Px1Joa3PBfETL6KD4a0FoUR7yzjbUkEwUQKp\nThqmf8CZWu889qdTijODh8U14ovPXG9hyYS1ACRn36tGCbP7XgMSx5LIDczJ\nhlWa\r\n=S04l\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFZGEmAZmViOgJ5Zd9ufrfbw5riQqCOGbhuvMcuEP1b9AiEAiewMQLVr7VdvCImxxRS959JH9NlbXWLIcqT5MEr4pJ8="}]},"maintainers":[{"name":"dvonlehman","email":"david.vonlehman@gmail.com"},{"name":"alementuev","email":"a.lementuev@gmail.com"},{"name":"frankus","email":"frank@frankschmitt.org"},{"name":"matthewcallis","email":"matthew.callis@gmail.com"},{"name":"byronsm","email":"byronsm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jwks-rsa_1.3.0_1548459808022_0.11681067434336745"},"_hasShrinkwrap":false},"1.3.1":{"name":"@apptentive/jwks-rsa","version":"1.3.1","description":"Library to retrieve RSA public keys from a JWKS endpoint","main":"lib/index.js","types":"index.d.ts","dependencies":{"@types/express-jwt":"0.0.34","debug":"^2.2.0","limiter":"^1.1.0","lru-memoizer":"^1.6.0","ms":"^2.0.0","request":"^2.73.0"},"devDependencies":{"babel-cli":"^6.9.0","babel-core":"^6.9.0","babel-eslint":"^6.0.4","babel-preset-es2015":"^6.9.0","babel-preset-stage-0":"^6.5.0","chai":"^3.5.0","eslint":"^2.10.2","eslint-plugin-babel":"^3.2.0","express-jwt":"^3.4.0","jsonwebtoken":"^7.1.7","koa":"^2.2.0","koa-jwt":"^3.2.0","mocha":"^2.5.3","nock":"^8.0.0","rimraf":"^2.5.2","supertest":"^3.0.0"},"scripts":{"clean":"rimraf lib/","compile":"babel -d lib/ src/","prepublish":"npm run clean && npm run compile","test":"NODE_ENV=test mocha --compilers js:babel-core/register --timeout 5000 $(find ./tests -name *.tests.js)","test-watch":"NODE_ENV=test mocha --compilers js:babel-core/register --timeout 5000 $(find ./tests -name *.tests.js) --watch","release":"git tag $npm_package_version && git push && git push --tags && npm publish"},"repository":{"type":"git","url":"git+https://github.com/auth0/node-jwks-rsa.git"},"keywords":["jwks","rsa","jwt"],"author":{"name":"Auth0"},"license":"MIT","bugs":{"url":"https://github.com/auth0/node-jwks-rsa/issues"},"homepage":"https://github.com/auth0/node-jwks-rsa#readme","directories":{"example":"examples","lib":"lib","test":"tests"},"gitHead":"13982d309aeac0b519ce43a41b547872257dab60","_id":"@apptentive/jwks-rsa@1.3.1","_npmVersion":"6.5.0","_nodeVersion":"10.13.0","_npmUser":{"name":"dvonlehman","email":"david.vonlehman@gmail.com"},"dist":{"integrity":"sha512-ij1Djzh6pdMZ0NfLvMFZt3hpg4/5HdTpMfsiY3jYf14AhNgjK0M27u0mtOrfQKdgx3pekR0537GQK9/EFHZpZg==","shasum":"2f5b38678c430d970c5d11a003674ee4772cbcca","tarball":"https://registry.npmjs.org/@apptentive/jwks-rsa/-/jwks-rsa-1.3.1.tgz","fileCount":39,"unpackedSize":82275,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcS6DbCRA9TVsSAnZWagAAmdMP+gPWr/l+hQ0d9MQLJRoV\nnGcrZopkkUsg9amUqKDiuTPui61/93tLn5nmpDowJfhfdWjqwJwCJ8h3tRYO\nrSN1Db3D47oiVPv1BEnCtyrHQp7C9zdC8Q+P53uvLPCZeaRqOWthDrxqBIlI\ndQxr58uUyv9EYPllnFa5djwq956FDXwWdwK/IEJ9WlJsyW6L4KItKQM+ASUX\nRGy3QWm//DVu2oCobYwKMbbLdZQgYmFQaCNp+v96b1mguQ6OuHA8JDi2fHFz\nOtVmGwNaPFFfnNeWb3S0z8wGCe7J05/l4Sfvyd1ndf7+xXwBgqhtC+eqRS+a\nj81XcL7H6af6rABFZUSmusxjzekjiAdtHc6iB+GS1ko3WgR7y6X+0b4hTjPq\nxZcqB7ze+udlwkxJIXTyuHFCz7IAl5irzp2duN0Ut67CuU7YYPRMhLPJguKP\nbCgpM2B9+fwr5COIHdovcgpPUMZbsplZ+B8XA9pEog98W7wQlke/IU5OmJBx\n5bFPYnJKDOWQNujsE0UracLOKDlaAZ5MvhXkfX0+eyOew8pdnpnq0tiGhLbC\n/jfAQyhNHA07sqW42m4gv1Gx+9A6uYz5OMgHkZHGl9WFVajhP5NC5QQKKiKk\nNd9mOqlgVT5qlh8lzHRl4e1iwxeE1b5n6mcBlKZSL7Xgcrj8YDaTSZ+wq02A\ncXak\r\n=i0EO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD1zEu7jJTW/kwVK7dQyjrrl6haOljejQyEIKDBHLJ91AIgdCl6/3SXu17Woot85KsSsnc/1iROR20QY4Iovb7kykg="}]},"maintainers":[{"name":"alementuev","email":"a.lementuev@gmail.com"},{"name":"byronsm","email":"byronsm@gmail.com"},{"name":"dvonlehman","email":"david.vonlehman@gmail.com"},{"name":"frankus","email":"frank@frankschmitt.org"},{"name":"matthewcallis","email":"matthew.callis@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jwks-rsa_1.3.1_1548460250904_0.4242511149375523"},"_hasShrinkwrap":false},"1.3.2":{"name":"@apptentive/jwks-rsa","version":"1.3.2","description":"Library to retrieve RSA public keys from a JWKS endpoint","main":"lib/index.js","types":"index.d.ts","dependencies":{"@types/express-jwt":"0.0.34","debug":"^2.2.0","limiter":"^1.1.0","lru-memoizer":"^1.6.0","ms":"^2.0.0","request":"^2.73.0"},"devDependencies":{"babel-cli":"^6.9.0","babel-core":"^6.9.0","babel-eslint":"^6.0.4","babel-preset-es2015":"^6.9.0","babel-preset-stage-0":"^6.5.0","chai":"^3.5.0","eslint":"^2.10.2","eslint-plugin-babel":"^3.2.0","express-jwt":"^3.4.0","jsonwebtoken":"^7.1.7","koa":"^2.2.0","koa-jwt":"^3.2.0","mocha":"^2.5.3","nock":"^8.0.0","rimraf":"^2.5.2","supertest":"^3.0.0"},"scripts":{"clean":"rimraf lib/","compile":"babel -d lib/ src/","prepublish":"npm run clean && npm run compile","test":"NODE_ENV=test mocha --compilers js:babel-core/register --timeout 5000 $(find ./tests -name *.tests.js)","test-watch":"NODE_ENV=test mocha --compilers js:babel-core/register --timeout 5000 $(find ./tests -name *.tests.js) --watch","release":"git tag $npm_package_version && git push && git push --tags && npm publish"},"repository":{"type":"git","url":"git+https://github.com/auth0/node-jwks-rsa.git"},"keywords":["jwks","rsa","jwt"],"author":{"name":"Auth0"},"license":"MIT","bugs":{"url":"https://github.com/auth0/node-jwks-rsa/issues"},"homepage":"https://github.com/auth0/node-jwks-rsa#readme","directories":{"example":"examples","lib":"lib","test":"tests"},"gitHead":"97ee0e28faa85e9c4182d58abbdbe4e725b01695","_id":"@apptentive/jwks-rsa@1.3.2","_npmVersion":"6.5.0","_nodeVersion":"10.13.0","_npmUser":{"name":"dvonlehman","email":"david.vonlehman@gmail.com"},"dist":{"integrity":"sha512-RwYlrNadMivIlUODC01hT3o+ysNfOjTFCEfX8bgzD1YjK6Vg2NMDOOPvXSKppM60MMjB4dxgTGOr483zyEVC2Q==","shasum":"338ad13ddcf339e7cc9aa092220ad4cb61ded12b","tarball":"https://registry.npmjs.org/@apptentive/jwks-rsa/-/jwks-rsa-1.3.2.tgz","fileCount":39,"unpackedSize":82310,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcUKlTCRA9TVsSAnZWagAA4MMP/igTNC6ARZDiNMsI4z4K\ncgjyHpfls6uUd8Zp94U1k4/YpgGhKpCAyHXrAw8M9jC8A+D1n/bEgehq/Z12\nNcV4aPSpcw6xS6nrVOKT1e1hm10tgJ4SpzFsKe0gOsfUxZDuPZgDqlxBsPY6\nmBt8H6ZgGsppIL5WNBhIAMz3LRShb++FZkhwIQHmMGhV6IfhYjMbVQ6eKErZ\nUZkEEjnC7adL/D1Redev//WGWsfcRXIhhlRo2ufaf9vg7MuDgFthFXcu17E1\nPNn8Kz7Uv8XqtTQ3nb9aqEZB0n3GczFtE+cvmu0kPC1jDio8gYi2JHfc4I/F\nhWIigKXOj/MKBOXX3dlPwvJHPOwdh0nccCQMUEq5NAKV562u+7PTOpjlsq2O\njLKhJCBzSgVZRTqx8jRE0eifTnNQb+urcttY3GeNpdbId2FQpbq8Es282LGn\ne823eppNfVP+Qzj2JRy12JquKZPNUCZi58xV9FOIFOpAZjQskqzDb+LutGWT\nVwGVPJdDilqxi/wWWJOAyVlBz5Q3WUMkt14TfIm7O5kLhAn7qsU/Hvx/1h4T\nwanhz1VjFeZqDMTPGgnxtJ7DGoCgIzAt+XY1CLZdLRkaTaJAi/o1/BU7yEpi\nIEYiYgsuz8ga5X2OZGfJeZgY0Ngk3HDLVbyTwH/5fBxc1xRMR9pq+HlP48PK\n3VwO\r\n=dRH7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDvAb9QaJbBiM7cwT99qTFt4ADiSkUaiPK03ynkAMTMsAIgJj8N85pi8V2QwBdvcHCOGo5L/AiFOkHld289yDt09QQ="}]},"maintainers":[{"name":"alementuev","email":"a.lementuev@gmail.com"},{"name":"byronsm","email":"byronsm@gmail.com"},{"name":"dvonlehman","email":"david.vonlehman@gmail.com"},{"name":"frankus","email":"frank@frankschmitt.org"},{"name":"matthewcallis","email":"matthew.callis@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jwks-rsa_1.3.2_1548790098430_0.2301644586415852"},"_hasShrinkwrap":false}},"time":{"created":"2019-01-25T23:43:27.848Z","1.3.0":"2019-01-25T23:43:28.197Z","modified":"2023-03-13T17:38:44.190Z","1.3.1":"2019-01-25T23:50:51.079Z","1.3.2":"2019-01-29T19:28:18.582Z"},"maintainers":[{"email":"chase.olson@apptentive.com","name":"chase.olson"},{"email":"poornima.nagarajan@apptentive.com","name":"poornima.nagarajan"},{"email":"frank@frankschmitt.org","name":"frankus"}],"description":"Library to retrieve RSA public keys from a JWKS endpoint","homepage":"https://github.com/auth0/node-jwks-rsa#readme","keywords":["jwks","rsa","jwt"],"repository":{"type":"git","url":"git+https://github.com/auth0/node-jwks-rsa.git"},"author":{"name":"Auth0"},"bugs":{"url":"https://github.com/auth0/node-jwks-rsa/issues"},"license":"MIT","readme":"# jwks-rsa\n\nA library to retrieve RSA signing keys from a JWKS (JSON Web Key Set) endpoint.\n\n> npm install --save jwks-rsa\n\n## Usage\n\nYou'll provide the client with the JWKS endpoint which exposes your signing keys. Using the `getSigningKey` you can then get the signing key that matches a specific `kid`.\n\n```js\nconst jwksClient = require('jwks-rsa');\n\nconst client = jwksClient({\n  strictSsl: true, // Default value\n  jwksUri: 'https://sandrino.auth0.com/.well-known/jwks.json'\n});\n\nconst kid = 'RkI5MjI5OUY5ODc1N0Q4QzM0OUYzNkVGMTJDOUEzQkFCOTU3NjE2Rg';\nclient.getSigningKey(kid, (err, key) => {\n  const signingKey = key.publicKey || key.rsaPublicKey;\n\n  // Now I can use this to configure my Express or Hapi middleware\n});\n```\n\nIntegrations are also provided with:\n\n - [express/express-jwt](examples/express-demo)\n - [hapi/hapi-auth-jwt2](examples/hapi-demo)\n - [koa/koa-jwt](examples/koa-demo)\n\n### Caching\n\nIn order to prevent a call to be made each time a signing key needs to be retrieved you can also configure a cache as follows. If a signing key matching the `kid` is found, this will be cached and the next time this `kid` is requested the signing key will be served from the cache instead of calling back to the JWKS endpoint.\n\n```js\nconst jwksClient = require('jwks-rsa');\n\nconst client = jwksClient({\n  cache: true,\n  cacheMaxEntries: 5, // Default value\n  cacheMaxAge: ms('10h'), // Default value\n  jwksUri: 'https://sandrino.auth0.com/.well-known/jwks.json'\n});\n\nconst kid = 'RkI5MjI5OUY5ODc1N0Q4QzM0OUYzNkVGMTJDOUEzQkFCOTU3NjE2Rg';\nclient.getSigningKey(kid, (err, key) => {\n  const signingKey = key.publicKey || key.rsaPublicKey;\n\n  // Now I can use this to configure my Express or Hapi middleware\n});\n```\n\n### Rate Limiting\n\nEven if caching is enabled the library will call the JWKS endpoint if the `kid` is not available in the cache, because a key rotation could have taken place. To prevent attackers to send many random `kid`s you can also configure rate limiting. This will allow you to limit the number of calls that are made to the JWKS endpoint per minute (because it would be highly unlikely that signing keys are rotated multiple times per minute).\n\n```js\nconst jwksClient = require('jwks-rsa');\n\nconst client = jwksClient({\n  cache: true,\n  rateLimit: true,\n  jwksRequestsPerMinute: 10, // Default value\n  jwksUri: 'https://sandrino.auth0.com/.well-known/jwks.json'\n});\n\nconst kid = 'RkI5MjI5OUY5ODc1N0Q4QzM0OUYzNkVGMTJDOUEzQkFCOTU3NjE2Rg';\nclient.getSigningKey(kid, (err, key) => {\n  const signingKey = key.publicKey || key.rsaPublicKey;\n\n  // Now I can use this to configure my Express or Hapi middleware\n});\n```\n\n## Running Tests\n\n```\nnpm run test\n```\n\n## Showing Trace Logs\n\nTo show trace logs you can set the following environment variable:\n\n```\nDEBUG=jwks\n```\n\nOutput:\n\n```\njwks Retrieving keys from http://my-authz-server/.well-known/jwks.json +5ms\njwks Keys: +8ms [ { alg: 'RS256',\n  kty: 'RSA',\n  use: 'sig',\n  x5c: [ 'pk1' ],\n  kid: 'ABC' },\n{ alg: 'RS256', kty: 'RSA', use: 'sig', x5c: [], kid: '123' } ]\n```\n","readmeFilename":"README.md"}