public static PooledConnectionFactory newPooledConnectionFactory(final AbstractLdapProperties l) {
        val cc = newConnectionConfig(l);
        val cf = new PooledConnectionFactory(cc);
        cf.setBlockWaitTime(newDuration(l.getBlockWaitTime()));
        cf.setMinPoolSize(l.getMinPoolSize());
        cf.setMaxPoolSize(l.getMaxPoolSize());
        cf.setValidateOnCheckOut(l.isValidateOnCheckout());
        cf.setValidatePeriodically(l.isValidatePeriodically());

        val strategy = new IdlePruneStrategy();
        strategy.setIdleTime(newDuration(l.getIdleTime()));
        strategy.setPrunePeriod(newDuration(l.getPrunePeriod()));
        cf.setPruneStrategy(strategy);

        cf.setFailFastInitialize(l.isFailFast());

        val validator = new SearchConnectionValidator();
        validator.setValidatePeriod(newDuration(l.getValidatePeriod()));
        cf.setValidator(validator);

        if (StringUtils.isNotBlank(l.getPoolPassivator())) {
            val pass =
                AbstractLdapProperties.LdapConnectionPoolPassivator.valueOf(l.getPoolPassivator().toUpperCase());
            switch (pass) {
                case CLOSE -> {
                    // TODO: provide a property to disable pooling which return a DefaultConnectionFactory
                    // TODO: this is preferable to a pool of closed connections
                    cf.setPassivator(conn -> {
                        conn.close();
                        return true;
                    });
                }
                case BIND -> {
                    LOGGER.debug("Creating a bind passivator instance for the connection pool");
                    val bindRequest = new SimpleBindRequest(l.getBindDn(), new Credential(l.getBindCredential()));
                    cf.setPassivator(new BindConnectionPassivator(bindRequest));
                }
                default -> {}
            }
        }

        LOGGER.debug("Initializing ldap connection pool for {} and bindDn {}", l.getLdapUrl(), l.getBindDn());
        cf.initialize();
        return cf;
    }
New pooled connection factory.

@param l the ldap properties
@return the pooled connection factory
pac4j-config/src/main/java/org/pac4j/config/ldaptive/LdaptiveAuthenticatorBuilder.java