简体   繁体   English

Spring LDAP LDAP:错误代码 32 - 0000208D

[英]Spring Ldap LDAP: error code 32 - 0000208D

I am working on application to authenticate with the LDAP .我正在开发使用 LDAP 进行身份验证的应用程序。 Am using the spring LDAP template for authenticating but am getting the below response正在使用 spring LDAP 模板进行身份验证,但收到以下响应

{
    "message": "[LDAP: error code 32 - 0000208D: NameErr: DSID-031001E5, problem 2001 (NO_OBJECT), data 0, best match of:\n\t''\n\u0000]; nested exception is javax.naming.NameNotFoundException: [LDAP: error code 32 - 0000208D: NameErr: DSID-031001E5, problem 2001 (NO_OBJECT), data 0, best match of:\n\t''\n\u0000]; remaining name '/'"
}

below are the configuration for spring下面是spring的配置

<beans:bean id="contextSource"
    class="org.springframework.ldap.core.support.LdapContextSource">
    <beans:property name="base" value="" />
    <beans:property name="url" value="<LDAP-URL>" />
    <beans:property name="userDn" value="<USER-DN>" />
    <beans:property name="password" value="<PASSWORD>" />
</beans:bean>

<beans:bean id="ldapTemplate" class="org.springframework.ldap.core.LdapTemplate">
    <beans:constructor-arg ref="contextSource" />
</beans:bean>

Java Code: Java代码:

AndFilter filter = new AndFilter();
filter.and(new EqualsFilter("objectclass", "person")).and(new       EqualsFilter("sAMAccountName", username));
boolean result = ldapTemplate.authenticate(LdapUtils.emptyLdapName(),               filter.toString(), password);

I am new to LDAP and anyhelp or example would be really great.我是 LDAP 的新手,任何帮助或示例都非常棒。

You don't need to specify the full dn in further operations when you've already set the base.当您已经设置了基数时,您不需要在进一步的操作中指定完整的 dn。 Are you sure you have the correct specs for the server?你确定你有正确的服务器规格吗? Error 32 is usually screwing up the prefixes or directory configs!错误 32 通常是搞砸了前缀或目录配置!

Based on the previous correct answer the searchBase must be empty.根据之前的正确答案,searchBase 必须为空。 My correct filter is:我的正确过滤器是:

FilterBasedLdapUserSearch userSearch = new FilterBasedLdapUserSearch("", "(&(CN={0})(memberOf=cn=Group-BioBank,OU=HyperV,OU=Services,DC=bob,DC=uk))", contextSource);

This filter works like a charm.这个过滤器就像一个魅力。 (Spring4.x) (Spring4.x)

Filters explained: https://confluence.atlassian.com/kb/how-to-write-ldap-search-filters-792496933.html过滤器解释: https : //confluence.atlassian.com/kb/how-to-write-ldap-search-filters-7924​​96933.html

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 [LDAP:错误代码 32 - 0000208D:NameErr:DSID-03100241,问题 2001 (NO_OBJECT),数据 0,最佳匹配: - [LDAP: error code 32 - 0000208D: NameErr: DSID-03100241, problem 2001 (NO_OBJECT), data 0, best match of: LDAP的春季安全性问题 错误代码32-没有这样的对象 - spring security issue with LDAP | error code 32 - No Such Object Spring LDAP 错误代码 32 - 无此类对象]; 剩下的名字'/'" - Spring LDAP error code 32 - No Such Object]; remaining name '/'" 将用户添加到 ldap 时出现 LDAP 错误代码 32 - Ldap error code 32 while adding user to ldap 使用Spring错误代码32,使用Spring Data LdapRepository创建新用户失败 - Creating new users with Spring Data LdapRepository fails with LDAP error code 32 spring LDAP不抛出具体错误码 - spring LDAP does not throw specific error code 无法使用 LDAP 连接从 Java 后端检索 Active Directory 用户 [LDAP:错误代码 32 – 无此类对象] - Unable to retrieve Active Directory users from Java backend using LDAP connection [LDAP: error code 32 – No Such Object] Tomcat 8 - LDAP:NameNotFoundException错误代码32,剩余名称为空字符串 - Tomcat 8 - LDAP: NameNotFoundException error code 32, remaining name empty string 在Spring Boot中使用LDAP进行身份验证时出错,原因:[LDAP:错误代码50-访问权限不足] - Error authenticating with LDAP in Spring Boot Reason: [LDAP: error code 50 - Insufficient Access Rights] Spring boot ldap 身份验证错误 [LDAP: 错误代码 49 - 凭据无效] - Spring boot ldap Authentication Error [LDAP: error code 49 - Invalid Credentials]
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM