private static AuthenticationHandler getCompareAuthenticationHandler(final AbstractLdapAuthenticationProperties properties,
                                                                         final ConnectionFactory factory) {
        val handler = new CompareAuthenticationHandler(factory);
        handler.setPasswordAttribute(properties.getPrincipalAttributePassword());
        return handler;
    }
Gets authenticated authenticator.

@param properties the lDAP properties
@return the authenticated or anon search authenticator
support/cas-server-support-ldap-core/src/main/java/org/apereo/cas/util/LdapUtils.java