Skip to content

Commit c4cde75

Browse files
bizybotYogesh Gaikwad
authored andcommitted
[Kerberos] Add debug log statement for exceptions (#32663)
This commit adds missing debug log statements for exceptions that occur during ticket validation. I thought these get logged somewhere else in authentication chain but even after enabling trace logs I could not see them logged. As the Kerberos exception messages are cryptic adding full stack trace would help debugging faster.
1 parent 9b76e6f commit c4cde75

File tree

1 file changed

+3
-0
lines changed
  • x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/kerberos

1 file changed

+3
-0
lines changed

x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/kerberos/KerberosRealm.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,12 +179,15 @@ protected String maybeRemoveRealmName(final String principalName) {
179179

180180
private void handleException(Exception e, final ActionListener<AuthenticationResult> listener) {
181181
if (e instanceof LoginException) {
182+
logger.debug("failed to authenticate user, service login failure", e);
182183
listener.onResponse(AuthenticationResult.terminate("failed to authenticate user, service login failure",
183184
unauthorized(e.getLocalizedMessage(), e)));
184185
} else if (e instanceof GSSException) {
186+
logger.debug("failed to authenticate user, gss context negotiation failure", e);
185187
listener.onResponse(AuthenticationResult.terminate("failed to authenticate user, gss context negotiation failure",
186188
unauthorized(e.getLocalizedMessage(), e)));
187189
} else {
190+
logger.debug("failed to authenticate user", e);
188191
listener.onFailure(e);
189192
}
190193
}

0 commit comments

Comments
 (0)