I'm using JNDI for authentication in a web app. On the OpenLDAP side I'm using ppolicy to (for example) block a user's account after three failed log in attempts.
My problem is that I need specific error messages (e.g. "Account locked") to let the user know what was the specific problem but right now I'm just getting an exception when executing:
InitialLdapContext ctx = new InitialLdapContext(env, null);
And the message in the exception is just [LDAP: error code 49 - Invalid Credentials]
.
I found a related post that shows an example of how to do just that; however, it is just confusing me more since I haven't been able to locate classes such as PasswordExpiringResponseControl
anywhere, plus I'm getting an exception right away so I wouldn't be able to execute respControls = ctx.getResponseControls()
.