2017-03-08 37 views
0

我想从我的中央身份验证服务(CAS)建立连接以验证用户在活动目录上的身份。 但我发现自己有以下错误:LDAP绑定身份验证处理程序

[LDAP: error code 1 - 000004DC: LdapErr: DSID-0C0906E8, how: In order to perform this operation a successful bind must be completed on the connection., Data 0, v1db1]; Remaining name 'cn = Users, dc = aimed, dc = local' 

如果有人知道这个问题,请大家帮帮我。 这里是我的代码:

<!-- LDAP bind Authentication Handler +--> 
<bean class="org.jasig.cas.adaptors.ldap.BindLdapAuthenticationHandler"> 
<property name="filter" value="uid=%u" /> 
<property name="searchBase" value="cn=Users,dc=aimed,dc=local" /> 
<property name="contextSource" ref="LDAPcontextSource" /> 
<property name="ignorePartialResultException" value="yes" /> <!-- fix because of how AD returns results +--> 
</bean> 
</list> 
</property> 
</bean> 

<bean id="LDAPcontextSource" class="org.springframework.ldap.core.support.LdapContextSource"> 
<property name="pooled" value="false"/> 
<property name="urls"> 
<list> 
<value>ldap://server.aimed.local/ </value> 
</list> 
</property> 
<property name="userDn" value="uid=AIMED\aimed, dc=aimed, dc=local"/> 
<property name="password" value="system_123"/> 
<property name="baseEnvironmentProperties"> 
<map> 
<entry> 
<key> 
<value>java.naming.security.authentication</value> 
</key> 
<value>simple</value> 
</entry> 
</map> 
</property> 
</bean> 

回答

0

BindLdapAuthenticationHandler实现了两相(查找&绑定)认证,但Active Directory中不允许对每个默认匿名访问。首先,您必须先使用服务帐户进行绑定。或者,如果您的用户都是baseDN的直接子项,则可以切换到FastBindLdapAuthenticationHandler