dorongrinstein-jwt-generator

0.0.10 • Public • Published

dorongrinstein-jwt-generator is a small library that generates JWTs which are Base64Url encoded.

Installation

npm install dorongrinstein-jwt-generator [--save]

Usage

// make sure you have a private key *.pem file 
// note that in lieu of a file name, you can provide the UTF-8 encoded private key string
// to the constructor below. It accepts either a file name or a string
 
let jwtGenerator = new (require('dorongrinstein-jwt-generator'))('./private_key.pem');
jwtGenerator.addClaim('name', 'doron');
jwtGenerator.addHeader('keyid', '1234'); // keyid is one special header that is valid. Not every header is acceptable 
let token = jwtGenerator.make();
console.log(token); // you've got a token buddy, enjoy..
 
 

Author

doron.grinstein@concur.com

License

This project is licensed under the MIT license. See the LICENSE file for more info.

Readme

Keywords

Package Sidebar

Install

npm i dorongrinstein-jwt-generator

Weekly Downloads

0

Version

0.0.10

License

MIT

Last publish

Collaborators

  • dorongrinstein