nov/json-jwt

Algorithm autodetection does not consider JWK

bdewater opened this issue · 2 comments

Ran into this while upgrading an app from 1.8.3 to 1.9.3: JSON::JWS::UnexpectedAlgorithm: Signature algorithm auto-detection failed in the following test helper:

def test_token(claims)
  jwt = JSON::JWT.new(claims).sign(jwk)
end

def jwk
  @jwk ||= JSON::JWK.new(private_key)
end

def private_key
  @private_key ||= OpenSSL::PKey::RSA.new(2048)
end

After digging in the commits, I noticed 4708f7d meant previously it was autodetected as :RS256.

nov commented

good catch.
I’ll fix this issue shortly.

nov commented

thanks for your continuous contributions!