How to Sign a jwt token with just a string and not publicKey and privateKey #1104
Replies: 2 comments
-
You can't (at least not for a RSA family algorithms). I think the documentation is pretty explicit saying that the key needs to be one of (1) a raw key (*rsa.PrivateKey, et al), (2) a crypto.Signer, or (3) a jwk.Key https://pkg.go.dev/github.com/lestrrat-go/jwx/[email protected]/jws#WithKey
I can only guess what's store in the |
Beta Was this translation helpful? Give feedback.
-
Thank you. I made a mistake using a wrong algo. |
Beta Was this translation helpful? Give feedback.
-
After calling the build, why is it failing with error *error signing token: failed to serialize token at step #2: failed to generate signature for signer #0 (alg=RS256): failed to sign payload: failed to retrieve rsa.PrivateKey out of string: keyconv: expected rsa.PrivateKey or rsa.PrivateKey, got string
`
b := setDefaultBuilder(user, twitter.AccessTokenLifetime, s.Conf)
`
Beta Was this translation helpful? Give feedback.
All reactions