jwtDecrypt returns protected header, but payload is undefined #479
Unanswered
brandonwind
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Please provide a reproduction code example. Always provide minimal reproduction samples if you're asking for help. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm attempting to use jwtDecrypt per the example here. The protected header is returned as expected, but the payload is undefined.
I assume I'm doing something wrong with the key I'm using? I've been given a string and am supposed to use its SHA256 hash to decrypt.
Sample JWT:
The protected header returned looks like:
{ alg: 'A256GCMKW', enc: 'A256GCM', iv: '2-_wx-RPWDQR02Ry', tag: 'PwLz9nI2qxZEZOB2ttefIA' }
Here is a sample of how I'm currently attempting to decrypt:
Am I correct to assume that the reason I'm not receiving any errors and am just getting undefined is because there is an issue with my key? If so, what is the best way to use a SHA256 hash of a string as a key for decryption?
Beta Was this translation helpful? Give feedback.
All reactions