Преглед изворни кода

Improve jwt logging on failed auth (#122247)

Update docs/changelog/122247.yaml
Johannes Fredén пре 8 месеци
родитељ
комит
1f4f5ddca9

+ 5 - 0
docs/changelog/122247.yaml

@@ -0,0 +1,5 @@
+pr: 122247
+summary: Improve jwt logging on failed auth
+area: Authentication
+type: bug
+issues: []

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

@@ -263,12 +263,10 @@ public class JwtRealm extends Realm implements CachingRealm, ReloadableSecurityC
                     + tokenPrincipal
                     + "] with header ["
                     + jwtAuthenticationToken.getSignedJWT().getHeader()
-                    + "] and claimSet ["
-                    + jwtAuthenticationToken.getJWTClaimsSet()
                     + "]";
 
                 if (logger.isTraceEnabled()) {
-                    logger.trace(msg, ex);
+                    logger.trace(msg + " and claimSet [" + jwtAuthenticationToken.getJWTClaimsSet() + "]", ex);
                 } else {
                     logger.debug(msg + " Cause: " + ex.getMessage()); // only log the stack trace at trace level
                 }