拥有一个Spring网络应用。必须更改具有LDAP访问权限的帐户的密码。从那以后,它为每个用户登录提供了密码错误。
安全配置文件:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:security="http://www.springframework.org/schema/security"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-3.2.xsd">
<security:global-method-security pre-post-annotations="enabled" />
<security:http create-session="always" pattern="/**" disable-url-rewriting="true">
<security:intercept-url pattern="/img/*" access="IS_AUTHENTICATED_ANONYMOUSLY" />
<security:intercept-url pattern="/favicon.ico" access="IS_AUTHENTICATED_ANONYMOUSLY" />
<security:intercept-url pattern="/fonts/*" access="IS_AUTHENTICATED_ANONYMOUSLY" />
<security:intercept-url pattern="/#/login" access="IS_AUTHENTICATED_ANONYMOUSLY"/>
<security:intercept-url pattern="/rest/user/authenticated" access="IS_AUTHENTICATED_ANONYMOUSLY"/>
<security:intercept-url pattern="/rest/user/clusterMgrAuthenticated" access="IS_AUTHENTICATED_FULLY"/>
<security:intercept-url pattern="/rest/user/getResearchData" access="IS_AUTHENTICATED_FULLY"/>
<security:intercept-url pattern="/rest/admin/**" access="IS_AUTHENTICATED_FULLY"/>
<security:intercept-url pattern="/rest/ui/**" access="IS_AUTHENTICATED_FULLY"/>
<security:access-denied-handler error-page="/#/login"/>
<security:http-basic entry-point-ref="unauthorizedEntryPoint" />
<security:http-basic/>
</security:http>
<security:ldap-server url="ldap://ldap.us.org:389"
manager-dn="foo"
manager-password="bar"/>
<security:authentication-manager>
<security:ldap-authentication-provider
group-search-filter="(cn={0})"
group-search-base="OU=Groups,OU=MCR,DC=mfad,DC=mfroot,DC=org"
user-search-base="OU=Users,OU=MCR,DC=mfad,DC=mfroot,DC=org"
user-search-filter="(cn={0})" />
</security:authentication-manager>
</beans>
使用相同的ldap设置创建不同的应用,但安全性4.2而不是3.2。它的查找工作。