Announcement Announcement Module
No announcement yet.
Get LDAP error codes with LDAPTemplate.authenticate Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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.

    Sample code:
    AndFilter filter = new AndFilter();
    filter.and(new EqualsFilter("uid", userDn));
    boolean isAuth = ldapTemplate.authenticate(DistinguishedName.EMPTY_ PATH, filter
    .toString(), password);

    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.