public static DnResolver buildAggregateDnResolver(final AbstractLdapAuthenticationProperties properties,
                                                      final ConnectionFactory connectionFactory) {
        var resolvers = Arrays.stream(StringUtils.split(properties.getBaseDn(), BASE_DN_DELIMITER))
            .map(baseDn -> {
                val resolver = new SearchDnResolver();
                resolver.setBaseDn(baseDn);
                resolver.setSubtreeSearch(properties.isSubtreeSearch());
                resolver.setAllowMultipleDns(properties.isAllowMultipleDns());
                resolver.setConnectionFactory(connectionFactory);
                resolver.setUserFilter(properties.getSearchFilter());
                resolver.setResolveFromAttribute(properties.getResolveFromAttribute());
                if (properties.isFollowReferrals()) {
                    resolver.setSearchResultHandlers(new FollowSearchReferralHandler());
                }
                if (StringUtils.isNotBlank(properties.getDerefAliases())) {
                    resolver.setDerefAliases(DerefAliases.valueOf(properties.getDerefAliases()));
                }
                return resolver;
            })
            .collect(Collectors.toList());
        return new ChainingLdapDnResolver(resolvers);
    }
Build aggregate dn resolver dn resolver.

@param properties        the LDAP properties
@param connectionFactory the connection factory
@return the dn resolver
support/cas-server-support-ldap-core/src/main/java/org/apereo/cas/util/LdapUtils.java