May 26th, 2009, 03:56 PM
Get LDAP error codes with LDAPTemplate.authenticate
I am using ldapTemplate.authenticate method to authenticate a user. I can happily do most of the functions.
However, when I pass in an invalid password or a password that has expired, I just get a "false" back. I do not get a handle back to know what exactly is the problem. I want to find out programatically, what the root cause is.
AndFilter filter = new AndFilter();
filter.and(new EqualsFilter("uid", userDn));
boolean isAuth = ldapTemplate.authenticate(DistinguishedName.EMPTY_ PATH, filter
Basically, if false, I want to get some error code to know what the problem is.
I have spent some time on it, wondering if I should be using some other api other than authenticate.
Tags for this Thread