private static Authenticator getAuthenticatorViaDnFormat(final AbstractLdapAuthenticationProperties properties,
                                                             final ConnectionFactory factory) {
        val resolver = new FormatDnResolver(properties.getDnFormat());
        val authenticator = new Authenticator(resolver, getBindAuthenticationHandler(newLdaptiveConnectionFactory(properties)));

        if (properties.isEnhanceWithEntryResolver()) {
            authenticator.setEntryResolver(newLdaptiveSearchEntryResolver(properties, factory));
        }
        return authenticator;
    }
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