Closed jmtovarf closed 8 years ago
This library doesn't actually contain the code to do the verification of the JWT. passport-jwt depends on jsonwebtoken to do the verification. This module is really a lot of glue logic to handle parsing of the JWT from the request and integrate with passport.
To first start debugging this I would run your data through the verify method of jsonwebtoken (see that modules readme for documentation). If its passing verification directly through jsonwebtoken but not through passport-jwt then that would indicate that there might be a problem with the way passport-jwt is handling the interaction. Let me know what you find.
Since I haven't heard anything on this I'm going to go ahead and close. Let me know if you have any further info from debugging.
I ran into this problem myself this afternoon. The google service account key needs to be converted to the public PEM format, for which you can use node-rsa. Detailed instructions: http://stackoverflow.com/a/38187086/3421050
@mhuebert Thanks for the solution. Closing.
Hi, I'm using the new version from firebase to generate a custon token using jwt, it's using the private key of the google service account to sign the token, but when I'm using JwtStrategy to verify the token it is returning
Error: PEM_read_bio_PUBKEY failed
.the structure of the key is:
-----BEGIN PRIVATE KEY-----\n ...... ..... .... -----END PRIVATE KEY-----\n