cloudflare-worker-jwt icon indicating copy to clipboard operation
cloudflare-worker-jwt copied to clipboard

HMAC "jwk" key import requires a JSON Web Key with Key Type parameter ("kty") equal to "oct" (encountered "RSA")

Open martior opened this issue 1 year ago • 3 comments

I started getting these today. My tokens are from auth0, I checked that the token is ok on https://jwt.io/ and that it is verified there with the same key.

Stack trace from sentry:

DataError: HMAC "jwk" key import requires a JSON Web Key with Key Type parameter ("kty") equal to "oct" (encountered "RSA").
  at importJwk(index.js:15470:30)
  at importKey(index.js:15480:12)
  at Object.verify(index.js:15540:23)

Looks like this is a cloudflare problem and the error is returned from crypto.subtle.importKey("jwk"

martior avatar Nov 23 '23 13:11 martior

How can I reproduce this issue?

tsndr avatar Dec 05 '23 10:12 tsndr

@tsndr I use auth0 and their react package, the jwk is from there. If you I can give you a key from my test account if you send me an email (email in bio).

martior avatar Dec 18 '23 19:12 martior

Maybe we should develop a test case for that.

tsndr avatar Feb 21 '24 20:02 tsndr