While trying to login to an ldap server with an expired password an exception is thrown in the logging.
javax.naming.AuthenticationException: [LDAP: error code 49 - 80090308: LdapErr: DSID-0C0903A9, comment: AcceptSecurityContext error, data 773, v1db0
I want to give the user a corresponding message, but i'm not able to catch that exception. (how can i get the exception that's shown in the logging ? because data 773 means the password is expired
CallbackHandler handler = new UsernamePasswordHandler(
username, password);
LoginContext lc = new LoginContext(applicationPolicyName,
handler);
try {
lc.login();
} catch (Exception){
log.warn(e.getMessage());
}