public static SearchRequest newLdaptiveSearchRequest(final String baseDn,
                                                         final FilterTemplate filter,
                                                         final String[] binaryAttributes,
                                                         final String[] returnAttributes) {
        val sr = new SearchRequest(baseDn, filter);
        sr.setBinaryAttributes(binaryAttributes);
        sr.setReturnAttributes(returnAttributes);
        sr.setSearchScope(SearchScope.SUBTREE);
        return sr;
    }
Builds a new request.

@param baseDn           the base dn
@param filter           the filter
@param binaryAttributes the binary attributes
@param returnAttributes the return attributes
@return the search request
support/cas-server-support-ldap-core/src/main/java/org/apereo/cas/util/LdapUtils.java