Skip to content

Commit

Permalink
Merge pull request #14 from dafortune/patch-1
Browse files Browse the repository at this point in the history
Update README.md
  • Loading branch information
sandrinodimattia committed Jun 20, 2017
2 parents 528e4ac + 2c424ca commit 42ad4cb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Integrations are also provided with:
In 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.

```js
const jwksClient = require('jwksClient');
const jwksClient = require('jwks-rsa');

const client = jwksClient({
cache: true,
Expand All @@ -56,7 +56,7 @@ client.getSigningKey(kid, (err, key) => {
Even 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).

```js
const jwksClient = require('jwksClient');
const jwksClient = require('jwks-rsa');

const client = jwksClient({
cache: true,
Expand Down

0 comments on commit 42ad4cb

Please sign in to comment.