jwtgen
jwtgen copied to clipboard
How to use jwtgen with RS256
I tried this:
jwtgen -a "RS256" -p app/var/jwt/private.pem -c "[email protected]"
I got it:
crypto.js:283
var ret = this._handle.sign(toBuf(key), null, passphrase);
^
Error: error:0906A068:PEM routines:PEM_do_header:bad password read
at Error (native)
at Sign.sign (crypto.js:283:26)
at sign (/usr/local/lib/node_modules/jwtgen/node_modules/jwt-simple/lib/jwt.js:170:57)
at Object.jwt_encode [as encode] (/usr/local/lib/node_modules/jwtgen/node_modules/jwt-simple/lib/jwt.js:133:17)
at Object.<anonymous> (/usr/local/lib/node_modules/jwtgen/jwtgen.js:138:17)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
Crypto.js need passphrase ! But how pass passphrase in jwtgen
?
Unfortunately, the library that we're using (jwt-simple
) does not allow the use passphrases. I'll contact the author and see if we can fork and suggest a patch for such functionality.
Thanks @richardhyatt ! Linked to: https://github.com/hokaccha/node-jwt-simple/issues/51
Are there still news on this?