Skip to content

Commit

Permalink
[Kerberos] Add debug log statement for exceptions (#32663)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bizybot authored and Yogesh Gaikwad committed Aug 11, 2018
1 parent 9283f92 commit 03e4d45
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,15 @@ protected String maybeRemoveRealmName(final String principalName) {

private void handleException(Exception e, final ActionListener<AuthenticationResult> listener) {
if (e instanceof LoginException) {
logger.debug("failed to authenticate user, service login failure", e);
listener.onResponse(AuthenticationResult.terminate("failed to authenticate user, service login failure",
unauthorized(e.getLocalizedMessage(), e)));
} else if (e instanceof GSSException) {
logger.debug("failed to authenticate user, gss context negotiation failure", e);
listener.onResponse(AuthenticationResult.terminate("failed to authenticate user, gss context negotiation failure",
unauthorized(e.getLocalizedMessage(), e)));
} else {
logger.debug("failed to authenticate user", e);
listener.onFailure(e);
}
}
Expand Down

0 comments on commit 03e4d45

Please sign in to comment.