使用spring进行ldap调用

使用spring进行ldap调用,spring,ldap,spring-ldap,Spring,Ldap,Spring Ldap,我正在尝试使用管理员帐户搜索用户,但管理员用户无法“查看”常规用户组中的用户。我的ldapTemplate正在正确地进行身份验证,我可以查询和查看管理帐户上下文中的所有人,但我无法查看需要搜索的实际组中的对象,该组称为“用户”。以下是我的ldapTemplate调用: private void testLookup(String username) { AndFilter andFilter = new AndFilter(); andFilter.and(new EqualsF

我正在尝试使用管理员帐户搜索用户,但管理员用户无法“查看”常规用户组中的用户。我的ldapTemplate正在正确地进行身份验证,我可以查询和查看管理帐户上下文中的所有人,但我无法查看需要搜索的实际组中的对象,该组称为“用户”。以下是我的ldapTemplate调用:

private void testLookup(String username) {
    AndFilter andFilter = new AndFilter();
    andFilter.and(new EqualsFilter("objectclass", "person"));
    // andFilter.and(new EqualsFilter("memberOf", "Users"));
    andFilter.and(new EqualsFilter("mail", <usernameInUsersGroup));

    final SearchControls controls = new SearchControls(); //
    controls.setSearchScope(SearchControls.SUBTREE_SCOPE);
    ldapTemplate.setIgnorePartialResultException(true);
    List<String> list =
        ldapTemplate.search("",
                List<String> list2 = ldapTemplate.search("", andFilter.encode(), controls, new EmailAttributesMapper());
                controls,
                new EmailAttributesMapper());
}
private void testLookup(字符串用户名){
AndFilter AndFilter=新建AndFilter();
andFilter.and(新的EqualFilter(“对象类”、“人”));
//和(新的EqualFilter(“成员”、“用户”));

andFilter.and(新的EqualFilter(“邮件”),你发布的代码甚至没有编译成AIK。你在搜索中有一个搜索。请修复代码。修复了剪切粘贴问题。有人有任何指导吗?这是管理员帐户的设置问题吗?