I try to use LDAP authentication.
public boolean login(String username, String password){
AndFilter filter = new AndFilter();
filter.and(new EqualsFilter("objectclass", "person")).and(new EqualsFilter("uid", username));
return ldapTemplate.authenticate(DistinguishedName.EMPTY_PATH, filter.toString(), password);
}
Because I used ActiveDirectory server, I have this exception:
javax.naming.NamingException: [LDAP: error code 1 - 000020D6: SvcErr: DSID-03100754, problem 5012 (DIR_ERROR), data 0]; remaning name = '/'
In my opinion, this exception showed, because I use DistinguishedName.EMPTY_PATH.
How I can to fix this problem?
uidin active directory bu onlysAMAccountName.