【发布时间】:2022-01-29 10:57:43
【问题描述】:
将 Active Directory 与 Spring 用于 LDAP,如果我指定搜索的确切目录(基),例如 String base="CN=Administrators" search/authentication 会找到用户,但如果传递给方法 .authenticate(String base="", filter, password),其中基是空字符串,然后找不到它并给出错误
ldapTemplate.authenticate("", MessageFormat.format("(SamAccountName={0})", login), "password")
//error
org.springframework.ldap.PartialResultException: Unprocessed Continuation Reference(s);
nested exception is javax.naming.PartialResultException: Unprocessed Continuation Reference(s);
remaining name '/'
此外,如果我连接到 OpenLDAP 而不是 Active Directory,它允许我指定一个空字符串 LdapTemplate.authenticate(String base="", filter, password) 并找到用户。据我了解,OpenLDAP 允许搜索所有组,这正是我所需要的。
例如,我有几个 CN 组,如 CN=Administrators、CN=FreeUsers、CN=System 等,里面有很多 CN 用户。
如何在身份验证时允许 Active Directory 搜索所有这些?
【问题讨论】:
标签: java spring active-directory ldap