- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用 Spring 的 LDAP 包对 Activity 目录进行身份验证,但我一直收到一条错误消息,提示我指定了错误的 baseDN(Ldap 错误代码 32):
org.springframework.ldap.NameNotFoundException: [LDAP: error code 32 - 0000208D: NameErr: DSID-031001E4, problem 2001 (NO_OBJECT), data 0, best match of:
[testng] 'OU=People,DC=example,DC=com'
[testng] ]; nested exception is javax.naming.NameNotFoundException: [LDAP: error code 32 - 0000208D: NameErr: DSID-031001E4, problem 2001 (NO_OBJECT), data 0, best match of:
[testng] 'OU=People,DC=example,DC=com'
[testng] ]; remaining name 'ou=people,dc=example,dc=com'
奇怪的是 ldapsearch 命令使用了精确的 basedn,而且它起作用了:
ldapsearch -V -x -H ldap://ad.example.com:389 -b 'ou=people,dc=example,dc=com' -D '<user>' -w '<password>' (sAMAccountName=<user>)
以下代码设置 DN(ldapContextSource 以编程方式设置):
AndFilter filter = new AndFilter();
filter.and(new EqualsFilter("sAMAccountName", user));
DistinguishedName dn = new DistinguishedName("ou=people,dc=example,dc=com");
boolean in = ldapTemplate.authenticate(dn, filter.toString(), password);
不确定这是否有帮助,但这些是其他字段:
userDN = <myusername>@example.com
url = ldap://ad.example.com:389
password = <mypassword>
baseDN = ou=people,dc=example,dc=com
编辑:我更改了用户 DN:cn=username,out=people,dc=example,dc=com这仍然会给出错误 32 代码。
最佳答案
谢谢大家,您的线索确实阐明了问题。
首先,userDN确实是错误的。我解决了这个问题(请参阅原始帖子中的编辑)。
其次,由于我已经在ldapContextSource 中指定了baseDN,因此在调用authenticate() 时无需再次指定。所以使用 DistinguishedName.EMPTY_PATH
解决了这个问题。
第三,我的 equals 过滤器不正确。当我更改 userDN 时,我忘记了 sAMAccountName
需要更改为实际的登录名,而不是最初设置的 userDN。
ldapTemplate.authenticate() 现在返回 true,这意味着我已经通过身份验证。
关于java - 为什么在执行 ldapTemplate.authenticate() 时 baseDN 不正确?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13692048/
我在尝试使用 spring-ldap 并行搜索在 LDAP 上搜索组时遇到问题。 我正在进行批处理以将数据从 SQL 数据库加载到 LDAP。我使用 spring-boot 和 spring-ldap
我正在尝试将 Spring webapp 从 Websphere Application Server 迁移到 JBoss AS,但在部署时遇到了这个问题: org.springframework.b
我有一个使用 Spring LDAP 1.3.1 的应用程序。它正在创建 LdapTemplate在启动时的 Spring 上下文中,将其传递给我的应用程序。我连接到的 LDAP 字符串实际上是一个
我需要从名为 pwdAccountLockedTime 的策略覆盖中删除操作属性 我关注了this Q&A建议方式2: 使用LdapTemplate#modifyAttributes(Name, Mo
我想读取用户的所有组并将它们放入列表中。 这是 ldap 查询: ldapsearch -h [server_name] -p [port] -s sub -b "ou=people,ou=foo,o
在公司 Active Directory 中具有以下组织结构; DC=foo,DC=bar,DC=com OU=employees CN=employee1 CN=employee2 OU=inter
我正在尝试为所有人员对象查询 Activity 目录。有超过 700,000 个结果,太多了无法读入 List。我当前的解决方案是使用分页来获取所有结果,但我更愿意使用 Java-8 Stream-A
我正在尝试获取用户的详细信息。提供 SearchControls 时,它返回一个空列表。 @Override public User getUserDetails(String userName) {
关闭 Tomcat 后,我们看到许多有关可能内存泄漏的错误,因为 Tomcat 未能停止线程。根据 Tomcat 的说法,我们有大约 2600 个守护线程正在 com.sun.jndi.ldap.
我已经在 Spring Security LDAP 上苦苦挣扎了一段时间,就在我最终认为我已经被打败了的时候,它又把我绊倒了。 场景:我让用户使用他们的组织凭据登录,然后我检查内部用户数据库。如果它们
我有一个像这样的 Spring Data LDAP 存储库: package x.y.z.repository; import org.springframework.data.ldap.reposi
我正在尝试使用 Spring 的 LDAP 包对 Activity 目录进行身份验证,但我一直收到一条错误消息,提示我指定了错误的 baseDN(Ldap 错误代码 32): org.springfr
在spring ,如何嵌入ldap可以与 spring-ldap 一起使用模板。目前,我的配置是 -
对于一个 Spring Boot 应用程序,我使用 annotations 成功配置了一个 Spring LdapTemplate,包括 LdapContextSource 依赖与 @Values 来
我有一个使用 LDAP 对用户进行身份验证的 Spring Boot 应用程序。对于用户,我正在映射来自 AD 的属性并填充用户的名字、姓氏、部门、电子邮件、电话以及图像等值。但是,我无法从属性中获取
我在 Grails 应用程序中使用 Spring LDAP ( docs ) 库。我有一个用 @Entry 注释注释的类,因此它被映射到 LDAP 服务器。这一切都非常漂亮。 但是,当我添加 Grai
有人在 Ldap 中创建 posixAccount 时遇到过这个错误吗? javax.naming.directory.SchemaViolationException: [LDAP: error
我正在使用 spring-ldap-core-2.3.1.RELEASE.jar在 JDK 1.8 & Tomcat 8.0通过LdapTemplate访问AD信息. title等属性, depart
很长的问题,但简而言之,我想知道如何使用 Spring Java Config 设置 org.springframework.ldap.core.LdapTemplate#ignorePartialR
当我查找 DN 时带 Spring ldapTemplate , 我必须省略配置的基本 DN。 例如,当基本 DN 配置为 dc=company,dc=com 时,工作查找就像 ldapTemplat
我是一名优秀的程序员,十分优秀!