Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use jwtgen with RS256 #1

Open
AlexandreHagen opened this issue Nov 4, 2016 · 3 comments
Open

How to use jwtgen with RS256 #1

AlexandreHagen opened this issue Nov 4, 2016 · 3 comments
Assignees

Comments

@AlexandreHagen
Copy link

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 ?

@richardhyatt
Copy link
Contributor

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.

@richardhyatt richardhyatt self-assigned this Nov 4, 2016
@AlexandreHagen
Copy link
Author

AlexandreHagen commented Nov 6, 2016

Thanks @richardhyatt !
Linked to: hokaccha/node-jwt-simple#51

@datenwort
Copy link

Are there still news on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants