I am using JNDI for authentication in a web application. On the OpenLDAP side, I use ppolicy to (for example) lock my user account after three failed login attempts.
My problem is that I need specific error messages (for example, “Account is locked”), so that the user knows what the problem is, but right now I get an exception on execution:
InitialLdapContext ctx = new InitialLdapContext(env, null);
And the message in the exception is simple [LDAP: error code 49 - Invalid Credentials].
I found a related post that shows an example of how to do this; nonetheless, it just baffles me, as I could not find classes like PasswordExpiringResponseControlanywhere, plus I immediately get an exception, so I could not execute respControls = ctx.getResponseControls().
source
share