diff --git a/runtime/service/src/main/java/org/apache/polaris/service/auth/JWTBroker.java b/runtime/service/src/main/java/org/apache/polaris/service/auth/JWTBroker.java index 48d5735a10..c591ca1232 100644 --- a/runtime/service/src/main/java/org/apache/polaris/service/auth/JWTBroker.java +++ b/runtime/service/src/main/java/org/apache/polaris/service/auth/JWTBroker.java @@ -89,8 +89,8 @@ public String getScope() { }; } catch (JWTVerificationException e) { - LOGGER.error("Failed to verify the token with error", e); - throw new NotAuthorizedException("Failed to verify the token"); + throw (NotAuthorizedException) + new NotAuthorizedException("Failed to verify the token").initCause(e); } } @@ -115,6 +115,7 @@ public TokenResponse generateFromToken( try { decodedToken = verify(subjectToken); } catch (NotAuthorizedException e) { + LOGGER.error("Failed to verify the token", e.getCause()); return new TokenResponse(Error.invalid_client); } EntityResult principalLookup =