When Nimbus throws a ParseException, NimbusJwtDecoder will simplify the error message in the wrapped exception. It should also preserve the caused by.

For example, when it does:

throw new JwtException(String.format(DECODING_ERROR_MESSAGE_TEMPLATE, "Malformed Jwk set"));

it should instead do:

throw new JwtException(String.format(DECODING_ERROR_MESSAGE_TEMPLATE, "Malformed Jwk set"), ex);

It should do this for both its "Malformed Jwk Set" and "Malformed payload" errors.

This is related to https://stackoverflow.com/questions/68865199/spring-boot-oauth2-openid-connect-client-an-error-occurred-while-attempting-to-d