0
我已經使用ldap實現了Spring安全,並且它在ldif文件中使用純文本密碼時工作正常,但是當我在ldap文件中使用散列{SHA}密碼時,它會引發我「未授權」如何在ldap文件中實現編碼(SHA)密碼ldap
代碼:
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
什麼是落實ldapTemplate.authenticate正確的方法是什麼?