Skip to content

Commit c25e990

Browse files
committedJun 24, 2017
docs: verifying with base64 encoded secrets
1 parent 2f36063 commit c25e990

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed
 

‎README.md

+2
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ jwt.sign({
111111
`secretOrPublicKey` is a string or buffer containing either the secret for HMAC algorithms, or the PEM
112112
encoded public key for RSA and ECDSA.
113113

114+
As mentioned in [this comment](https://github.com/auth0/node-jsonwebtoken/issues/208#issuecomment-231861138), there are other libraries that expect base64 encoded secrets (random bytes encoded using base64), if that is your case you can pass `new Buffer(secret, 'base64')`, by doing this the secret will be decoded using base64 and the token verification will use the original random bytes.
115+
114116
`options`
115117

116118
* `algorithms`: List of strings with the names of the allowed algorithms. For instance, `["HS256", "HS384"]`.

0 commit comments

Comments
 (0)
Please sign in to comment.