jwt-keysource
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

jwt-keysource

npm

(Work In Progress)

A library to provide keys for JWT verification.

npm install --save jwt-keysource

Example

var signingKeyUrls = [
    'https://www.googleapis.com/robot/v1/metadata/x509/securetoken@system.gserviceaccount.com',
    'https://www.googleapis.com/oauth2/v1/certs'
];
 
/*
* For inclusion in middleware:
*
* Is a function taking arguments (req, header, payload, cb)
*/
var signingKeyProvider = require('jwt-keysource').buildKeyProvider(signingKeyUrls);
 
 
/*
 * Raw key source:
 * Exposes 'getVerificationKeys()' which returns a promise of keys JSON. 
 */
var UriKeySource = require('jwt-keysource').UriKeySource;
var myKeySource = new UriKeySource(/* URI to JSON of keys mapped by key ID*/)

Showing Trace Logs

To show trace logs you can set the following environment variable:

DEBUG=jwt-keysource

License

ISC

Acknowledgements

Readme

Keywords

Package Sidebar

Install

npm i jwt-keysource

Weekly Downloads

3

Version

0.2.0

License

ISC

Unpacked Size

7.9 kB

Total Files

9

Last publish

Collaborators

  • beaulac