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
In cases where a JwtParser is built using b64Url() to provide a custom base64 decoder, the expectation is that all base64 decoding will use the custom decoder:
Jwts.parser()
.verifyWith(publicKey)
.b64Url(decoder) // expect this decoder to be used for all base64 operations of parseSignedClaims()
.build()
.parseSignedClaims(jwt);
This violates the expectation that the custom base64 decoder will be used for all decoding. This behavior has changed somewhere between 0.11.5 and 0.12.5 which in turn breaks our application if we update our jjwt dependency version to the latest.
The text was updated successfully, but these errors were encountered:
While I agree we should correct this, it's not clear to me how this could 'break' an application.
The only thing the DefaultJws constructor does is take a Base64URL string and decodes it to a raw digest byte array so that array is then available via jws.getDigest(). And that DefaultJws instance is only returned from the parser if the signature is verified successfully first.
So as long as the signature string is actually Base64URL, JJWT's default decoder will accurately obtain the digest byte array, even if your specified Decoder isn't used.
So yes, we should change the implementation to decode using the specified Decoder, but I don't see how this could cause something to break in the application. Could you please explain how this occurs? Thanks!
In cases where a JwtParser is built using b64Url() to provide a custom base64 decoder, the expectation is that all base64 decoding will use the custom decoder:
However due to
jjwt/impl/src/main/java/io/jsonwebtoken/impl/DefaultJwtParser.java
Line 644 in 7543248
jjwt/impl/src/main/java/io/jsonwebtoken/impl/DefaultJws.java
Line 30 in 7543248
This violates the expectation that the custom base64 decoder will be used for all decoding. This behavior has changed somewhere between 0.11.5 and 0.12.5 which in turn breaks our application if we update our jjwt dependency version to the latest.
The text was updated successfully, but these errors were encountered: