0.0.10 • Published 8 years ago

dorongrinstein-jwt-generator v0.0.10

Weekly downloads
-
License
MIT
Repository
-
Last release
8 years ago

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.

0.0.10

8 years ago

0.0.9

8 years ago

0.0.8

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.4

8 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago