Spring LDAP 1.3.0 澄清

发布于 2024-09-12 03:33:22 字数 5103 浏览 10 评论 0原文

我有这个错误,这是什么意思?

org.springframework.ldap.NameNotFoundException: [LDAP: error code 32 - 0000208D: NameErr: DSID-031001A8, problem 2001 (NO_OBJECT), data 0, best match of:
    ''
]; nested exception is javax.naming.NameNotFoundException: [LDAP: error code 32 - 0000208D: NameErr: DSID-031001A8, problem 2001 (NO_OBJECT), data 0, best match of:
    ''
]; remaining name '/'
    org.springframework.ldap.support.LdapUtils.convertLdapException(LdapUtils.java:172)
    org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:306)
    org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:237)
    org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:624)
    org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:535)
    org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:462)
    org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:483)
    org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:503)
    org.springframework.ldap.core.LdapTemplate.authenticate(LdapTemplate.java:1424)
    org.springframework.ldap.core.LdapTemplate.authenticate(LdapTemplate.java:1386)
    com.spsetia.iss.services.ISSServiceImpl.login(ISSServiceImpl.java:92)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    java.lang.reflect.Method.invoke(Method.java:597)
    org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
    org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
    org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
    org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
    org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
    $Proxy55.login(Unknown Source)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    java.lang.reflect.Method.invoke(Method.java:597)
    org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
    org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
    org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
    org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
    org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
    $Proxy56.login(Unknown Source)
    com.spsetia.iss.services.UserDetailsServiceImpl.loadUserByUsername(UserDetailsServiceImpl.java:70)
    com.spsetia.iss.services.UserDetailsAuthenticationProvider.retrieveUser(UserDetailsAuthenticationProvider.java:26)
    org.springframework.security.providers.dao.AbstractUserDetailsAuthenticationProvider.authenticate(AbstractUserDetailsAuthenticationProvider.java:121)
    org.springframework.security.providers.ProviderManager.doAuthentication(ProviderManager.java:188)
    org.springframework.security.AbstractAuthenticationManager.authenticate(AbstractAuthenticationManager.java:46)
    org.springframework.security.ui.webapp.AuthenticationProcessingFilter.attemptAuthentication(AuthenticationProcessingFilter.java:82)
    org.springframework.security.ui.AbstractProcessingFilter.doFilterHttp(AbstractProcessingFilter.java:258)
    org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
    org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
    org.springframework.security.context.HttpSessionContextIntegrationFilter.doFilterHttp(HttpSessionContextIntegrationFilter.java:235)
    org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
    org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
    org.springframework.security.util.FilterChainProxy.doFilter(FilterChainProxy.java:175)
    org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
    org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)

我试图这样做

 filter.and(new EqualsFilter("objectclass", "user")).and(new EqualsFilter("mail", username));
  return ldapTemplate.authenticate(DistinguishedName.EMPTY_PATH, filter.toString(), password);

I have this error, what does it mean?

org.springframework.ldap.NameNotFoundException: [LDAP: error code 32 - 0000208D: NameErr: DSID-031001A8, problem 2001 (NO_OBJECT), data 0, best match of:
    ''
]; nested exception is javax.naming.NameNotFoundException: [LDAP: error code 32 - 0000208D: NameErr: DSID-031001A8, problem 2001 (NO_OBJECT), data 0, best match of:
    ''
]; remaining name '/'
    org.springframework.ldap.support.LdapUtils.convertLdapException(LdapUtils.java:172)
    org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:306)
    org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:237)
    org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:624)
    org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:535)
    org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:462)
    org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:483)
    org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:503)
    org.springframework.ldap.core.LdapTemplate.authenticate(LdapTemplate.java:1424)
    org.springframework.ldap.core.LdapTemplate.authenticate(LdapTemplate.java:1386)
    com.spsetia.iss.services.ISSServiceImpl.login(ISSServiceImpl.java:92)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    java.lang.reflect.Method.invoke(Method.java:597)
    org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
    org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
    org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
    org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
    org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
    $Proxy55.login(Unknown Source)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    java.lang.reflect.Method.invoke(Method.java:597)
    org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
    org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
    org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
    org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
    org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
    $Proxy56.login(Unknown Source)
    com.spsetia.iss.services.UserDetailsServiceImpl.loadUserByUsername(UserDetailsServiceImpl.java:70)
    com.spsetia.iss.services.UserDetailsAuthenticationProvider.retrieveUser(UserDetailsAuthenticationProvider.java:26)
    org.springframework.security.providers.dao.AbstractUserDetailsAuthenticationProvider.authenticate(AbstractUserDetailsAuthenticationProvider.java:121)
    org.springframework.security.providers.ProviderManager.doAuthentication(ProviderManager.java:188)
    org.springframework.security.AbstractAuthenticationManager.authenticate(AbstractAuthenticationManager.java:46)
    org.springframework.security.ui.webapp.AuthenticationProcessingFilter.attemptAuthentication(AuthenticationProcessingFilter.java:82)
    org.springframework.security.ui.AbstractProcessingFilter.doFilterHttp(AbstractProcessingFilter.java:258)
    org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
    org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
    org.springframework.security.context.HttpSessionContextIntegrationFilter.doFilterHttp(HttpSessionContextIntegrationFilter.java:235)
    org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
    org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
    org.springframework.security.util.FilterChainProxy.doFilter(FilterChainProxy.java:175)
    org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
    org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)

I trying to do this

 filter.and(new EqualsFilter("objectclass", "user")).and(new EqualsFilter("mail", username));
  return ldapTemplate.authenticate(DistinguishedName.EMPTY_PATH, filter.toString(), password);

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

沐歌 2024-09-19 03:33:22

我有两个版本的代码,一个使用 Spring LDAP 1.2.1,另一个使用 1.3.0。
1.2.1 版本有效,1.3.0 版本出现上述错误。

两个版本之间存在细微差别。
1.3.0 版本禁用连接池并使用 SingleContextSource。
(也避免 ldap 连接池,这会扰乱 Active Directory 中分页结果的检索)

所以我认为 1.3.0 引入了一个错误。

I have two versions of code, one using Spring LDAP 1.2.1, the other using 1.3.0.
The 1.2.1 version works, the 1.3.0 version gives that error above.

There are small differences between the two versions.
The 1.3.0 version disables connection pooling and uses a SingleContextSource.
( too avoid ldap connection pooling, which messes up the retrieval of paged results in Active Directory )

So I think 1.3.0 introduced a bug.

活泼老夫 2024-09-19 03:33:22

LDAP 32 就像 eDirectory -601 和 AD 的(啊我忘了代码)。

基本上没有找到对象。我想知道您提供的绑定DN是否不正确?由于您正在进行搜索,并且在搜索中找不到对象实际上应该只返回空搜索结果。

LDAP 32 is like eDirectory -601 and AD's (ah I forget the code).

Basically object not found. I wonder if the DN you provided to bind with is not correct? Since you are doing a search, and object not found in a search should really just return an empty search result.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文