Skip to content

Commit f169137

Browse files
akohli96jzheaux
authored andcommitted
Closes gh-10222
1 parent 1cfe849 commit f169137

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

oauth2/oauth2-jose/src/main/java/org/springframework/security/oauth2/jwt/NimbusJwtDecoder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ private Jwt createJwt(String token, JWT parsedJwt) {
164164
catch (RemoteKeySourceException ex) {
165165
this.logger.trace("Failed to retrieve JWK set", ex);
166166
if (ex.getCause() instanceof ParseException) {
167-
throw new JwtException(String.format(DECODING_ERROR_MESSAGE_TEMPLATE, "Malformed Jwk set"));
167+
throw new JwtException(String.format(DECODING_ERROR_MESSAGE_TEMPLATE, "Malformed Jwk set"), ex);
168168
}
169169
throw new JwtException(String.format(DECODING_ERROR_MESSAGE_TEMPLATE, ex.getMessage()), ex);
170170
}
@@ -175,7 +175,7 @@ private Jwt createJwt(String token, JWT parsedJwt) {
175175
catch (Exception ex) {
176176
this.logger.trace("Failed to process JWT", ex);
177177
if (ex.getCause() instanceof ParseException) {
178-
throw new BadJwtException(String.format(DECODING_ERROR_MESSAGE_TEMPLATE, "Malformed payload"));
178+
throw new BadJwtException(String.format(DECODING_ERROR_MESSAGE_TEMPLATE, "Malformed payload"), ex);
179179
}
180180
throw new BadJwtException(String.format(DECODING_ERROR_MESSAGE_TEMPLATE, ex.getMessage()), ex);
181181
}

0 commit comments

Comments
 (0)