You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A JWKS that contains two keys, one with a supported curve, one unsupported, should result in the valid key being output.
That is the clear intention of the code here in __init__ of PyJWKSet:
for key in keys:
try:
self.keys.append(PyJWK(key))
except PyJWKError:
# skip unusable keys
continue
Actual Result
An jwt.exceptions.InvalidKeyError is thrown to the top level.
I think the issue is that it is PyJWKError that is being caught but that InvalidKeyError extends PyJWTError. I don't know the codebase at all really, but suspect catching the broader exception would resolve the issue.
Reproduction Steps
We saw this with a JWKS containing a key with crv "X25519".
Summary.
Expected Result
A JWKS that contains two keys, one with a supported curve, one unsupported, should result in the valid key being output.
That is the clear intention of the code here in
__init__
of PyJWKSet:Actual Result
An jwt.exceptions.InvalidKeyError is thrown to the top level.
I think the issue is that it is PyJWKError that is being caught but that InvalidKeyError extends PyJWTError. I don't know the codebase at all really, but suspect catching the broader exception would resolve the issue.
Reproduction Steps
We saw this with a JWKS containing a key with
crv
"X25519".System Information
The text was updated successfully, but these errors were encountered: