Skip to content

Trying to sign a JWT using RS256, but keep getting errors #160

Answered by panva
pingvinen asked this question in Q&A
Discussion options

You must be logged in to vote

Your first attempt with a protected header is correct. One must be present. Your problem is that you're passing a JWK object to .sign() where you should be passing the KeyLike key object representation (privateKey variable in your code).

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@pingvinen
Comment options

@panva
Comment options

panva Feb 1, 2021
Maintainer

Answer selected by pingvinen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants