0
我正在开发一个在Spring上开发的应用程序,并尝试与LDAP Direcotory建立连接。 我有一个服务帐户可以访问LDAP目录,但是我的配置有问题。使用服务帐户对LDAP目录进行Spring身份验证
我的服务帐户:登录/密码>>服务/ servcicepass LDAP目录
一个用户帐户registred:登录/密码>>
用户1/PASS1
当我尝试使用登录界面上的用户帐户登录时出现错误,但通过输入登录名/密码E服务账户我登录
我用户coontext.xml文件是:
> <!-- LDAP --> <security:ldap-server
> url="ldap://192.168.1.68:389/o=digital" /> <bean
> id="ldapAuthProvider"
> class="org.springframework.security.ldap.authentication.LdapAuthenticationProvider">
> <constructor-arg> <bean
> class="org.springframework.security.ldap.authentication.BindAuthenticator">
> <constructor-arg ref="contextSource" />
> <property name="userDnPatterns">
> <list>
> <value>uid={0}</value>
> </list>
> </property> </bean> </constructor-arg> <constructor-arg> <bean
> class="edu.mit.kit.userdetails.MappedLdapAuthoritiesPopulator">
> <property name="admins">
> <set>
> <!-- list admin usernames here -->
> </set>
> </property> </bean> </constructor-arg> </bean>
> <bean id="contextSource" class="org.springframework.ldap.core.support.LdapContextSource">
> <property name="url" value="ldap://192.168.1.68:389/"> <property
> name="base" value="o=digital,ou=TechnicalAccount,ou=Comp" /> </bean>
>
> <bean id="ldapTemplate"
> class="org.springframework.ldap.core.LdapTemplate"> <constructor-arg
> name="contextSource" ref="contextSource" /> </bean> <bean
> id="ldapUserInfoRepository" primary="true"
> class="edu.mit.kit.repository.impl.LdapUserInfoRepository">
> <property name="ldapTemplate" ref="ldapTemplate" /> </bean>
><!-- end LDAP -->
你能帮忙吗?