I have implemented Spring security with ldap and it's working fine while using plain-text password in ldif file, but when I use hashed {SHA} password in ldap file it throws me "Unauthorized"
code :
AndFilter filter = new AndFilter();
filter.and(new EqualsFilter("objectclass", "person")).and(
new EqualsFilter("uid", authentication.getPrincipal()
.toString()));
boolean authenticatedUser = ldapTemplate.authenticate(<DN>, filter.encode(),<password>);
test.ldif :
dn: uid=test ,ou=people,dc=springframework,dc=org
objectclass: top
objectclass: person
objectclass: organizationalPerson
objectclass: inetOrgPerson
cn: Rod Johnson
sn: Johnson
uid: test
userPassword: {SHA}a94a8fe5ccb19ba61c4c0873d391e987982fbbd3
What is the correct way to implement ldapTemplate.authenticate?