Skip to content

Commit 4f9c33f

Browse files
authored
Improve jwt logging on failed auth (#122247) (#122784)
Update docs/changelog/122247.yaml
1 parent 244fd4c commit 4f9c33f

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

docs/changelog/122247.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 122247
2+
summary: Improve jwt logging on failed auth
3+
area: Authentication
4+
type: bug
5+
issues: []

x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/jwt/JwtRealm.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,12 +263,10 @@ public void authenticate(final AuthenticationToken authenticationToken, final Ac
263263
+ tokenPrincipal
264264
+ "] with header ["
265265
+ jwtAuthenticationToken.getSignedJWT().getHeader()
266-
+ "] and claimSet ["
267-
+ jwtAuthenticationToken.getJWTClaimsSet()
268266
+ "]";
269267

270268
if (logger.isTraceEnabled()) {
271-
logger.trace(msg, ex);
269+
logger.trace(msg + " and claimSet [" + jwtAuthenticationToken.getJWTClaimsSet() + "]", ex);
272270
} else {
273271
logger.debug(msg + " Cause: " + ex.getMessage()); // only log the stack trace at trace level
274272
}

0 commit comments

Comments
 (0)