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>
但是,我现在有个要求就是通过用户密码登录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>
<property name="userDn" value="xxxx" />
<property name="password" value="xxxxx" />
自己实现一个AuthenticationSource,注入到contextSource,来实现用户密码登陆