Advertisement
Guest User

Untitled

a guest
Oct 7th, 2016
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. AndFilter filter = new AndFilter();
  2. filter.and(new EqualsFilter("objectclass", "person")).and(
  3. new EqualsFilter("uid", authentication.getPrincipal()
  4. .toString()));
  5.  
  6. boolean authenticatedUser = ldapTemplate.authenticate(<DN>, filter.encode(),<password>);
  7.  
  8. dn: uid=test ,ou=people,dc=springframework,dc=org
  9. objectclass: top
  10. objectclass: person
  11. objectclass: organizationalPerson
  12. objectclass: inetOrgPerson
  13. cn: Rod Johnson
  14. sn: Johnson
  15. uid: test
  16. userPassword: {SHA}a94a8fe5ccb19ba61c4c0873d391e987982fbbd3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement