public void tryBuildLdapAuthenticator(final Map<String, Authenticator> authenticators) {
        for (var i = 0; i <= MAX_NUM_AUTHENTICATORS; i++) {
            val type = getProperty(LDAP_TYPE, i);
            if (StringUtils.isNotBlank(type)) {
                val ldapProp = buildLdapProperties(i);
                val ldaptiveAuthenticator = LdaptiveAuthenticatorBuilder.getAuthenticator(ldapProp);

                val authenticator = new LdapProfileService(ldaptiveAuthenticator, getProperty(LDAP_ATTRIBUTES, i));
                val connectionFactoryManager =
                    (ConnectionFactoryManager) ldaptiveAuthenticator.getAuthenticationHandler();
                authenticator.setConnectionFactory(connectionFactoryManager.getConnectionFactory());
                authenticator.setUsersDn(getProperty(LDAP_USERS_DN, i));
                if (containsProperty(LDAP_PRINCIPAL_ATTRIBUTE_ID, i)) {
                    authenticator.setUsernameAttribute(getProperty(LDAP_PRINCIPAL_ATTRIBUTE_ID, i));
                }
                if (containsProperty(LDAP_PRINCIPAL_ATTRIBUTE_PASSWORD, i)) {
                    authenticator.setPasswordAttribute(getProperty(LDAP_PRINCIPAL_ATTRIBUTE_PASSWORD, i));
                }

                authenticators.put(concat("ldap", i), authenticator);
            }
        }
    }
<p>tryBuildLdapAuthenticator.</p>

@param authenticators a {@link Map} object
pac4j-config/src/main/java/org/pac4j/config/builder/LdapAuthenticatorBuilder.java