spring的ldap的配置都写好了,,也可以查询各个角色的用户等等 
但是,我现在有个要求就是通过用户密码登录active directory,但是在spring ldap的api中找不到一个判断用户密码登录是否正确的方法,,,汗死了。。 
希望有兄弟能帮忙 
配置如下: 
<bean id="contextSource"  
        class="org.springframework.ldap.core.support.LdapContextSource">   
        <property name="url" value="ldap://xx.x.x.xx:389" />   
        <property name="base" value="DC=xxx,DC=net" />   
        <property name="userDn" value="xxxx" />   
        <property name="password" value="xxxxx" />   
    </bean>   
    <bean id="ldapTemplate"  
        class="org.springframework.ldap.core.LdapTemplate">   
        <constructor-arg ref="contextSource"></constructor-arg>   
        <property name="ignorePartialResultException" value="true" />   
    </bean>  

解决方案 »

  1.   

    虽然不知道具体的,但是如果使用用户名密码可以获取context应该就是登陆成功,毕竟ad的密码没法读取
      

  2.   

    虽然不知道具体的,但是如果使用用户名密码可以获取context应该就是登陆成功,毕竟ad的密码没法读取
      

  3.   

    通过用户密码登录active directory 如何实现的
      

  4.   

    你配置的是使用已知的user连接LDAP,读取数据,
        <property name="userDn" value="xxxx" />   
            <property name="password" value="xxxxx" />   
    自己实现一个AuthenticationSource,注入到contextSource,来实现用户密码登陆