Socket
Book a DemoInstallSign in
Socket

jwks-rsa-promisified

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jwks-rsa-promisified

Promisified version of auth0/node-jwks-rsa, retrieve RSA public keys from a JWKS endpoint

1.0.2
latest
Source
npmnpm
Version published
Weekly downloads
81
35%
Maintainers
1
Weekly downloads
 
Created
Source

jwks-rsa-promisified

Add promisified methods to auth0/node-jwks-rsa

Install

npm install jwks-rsa-promisified

Example

const jwksClient = require('jwks-rsa-promisified');

const client = jwksClient({
  strictSsl: true, // Default value
  jwksUri: 'https://sandrino.auth0.com/.well-known/jwks.json'
});

async function retrieveKey() {
  const kid = 'RkI5MjI5OUY5ODc1N0Q4QzM0OUYzNkVGMTJDOUEzQkFCOTU3NjE2Rg';
  const key = await client.getSigningKeyAsync(kid);
  return key.publicKey || key.rsaPublicKey;
}

Additional methods

// type Jwk {
//   kid: string;
//   nbf?: number;
//   publicKey?: string;
//   rsaPublicKey?: string;
// }
client.getSigningKeyAsync(key); // => Promise<Jwk>
client.getSigningKeysAsync(); // => Promise<Jwk[]>
client.getKey(); // => Promise<Jwk>

FAQs

Package last updated on 16 Apr 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.