protected String passwordAttrName = "userPassword";
protected boolean doVerify(Authentication auth) {
String userName = (String) auth.getPrincipal();
String password = (String) auth.getCredentials();
DistinguishedName dn = new DistinguishedName(nameAttrName + "=" + userName);
String ldapPassword = null;
try {
ldapPassword = (String) ldapTemplate.lookup(dn, new String[] { "userPassword" },
new ContextMapper() {
public Object mapFromContext(Object ctx) {