Skip to content

Commit bdf3a50

Browse files
committed
JWTBroker: move error message
This change moves the `LOGGER.error` call when a token cannot be verified from `verify()` to `generateFromToken()`. On the token generation path, this should be a no-op; however, on the authentication path, this log message was excessive, especially when using mixed authentication since a failure to decode a token is perfectly normal when the token is from an external IDP.
1 parent d7f15a2 commit bdf3a50

File tree

1 file changed

+1
-1
lines changed
  • runtime/service/src/main/java/org/apache/polaris/service/auth

1 file changed

+1
-1
lines changed

runtime/service/src/main/java/org/apache/polaris/service/auth/JWTBroker.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ public String getScope() {
8989
};
9090

9191
} catch (JWTVerificationException e) {
92-
LOGGER.error("Failed to verify the token with error", e);
9392
throw new NotAuthorizedException("Failed to verify the token");
9493
}
9594
}
@@ -115,6 +114,7 @@ public TokenResponse generateFromToken(
115114
try {
116115
decodedToken = verify(subjectToken);
117116
} catch (NotAuthorizedException e) {
117+
LOGGER.error("Failed to verify the token", e.getCause());
118118
return new TokenResponse(Error.invalid_client);
119119
}
120120
EntityResult principalLookup =

0 commit comments

Comments
 (0)