如何将Spring安全性从ldap更改为ldap starttls.
我正在使用Spring Security和LDAP在Springs中编写一个项目.我一切正常,然后管理员用starttls将其更改为ldap.有人可以告诉我如何更新我的xml文件以使我的项目再次工作.
<?xml version="1.0" enCoding="UTF-8"?><beans:beans xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jdbc="http://www.springframework.org/schema/jdbc" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd" xmlns="http://www.springframework.org/schema/security" > <http auto-config="true" use-Expressions="true" > <intercept-url access="hasRole('RolE_MEMBER_INQUIRY')" pattern="/requests/**" /> </http> <authentication-manager > <ldap-authentication-provIDer user-search-base="ou=webusers" user-search-filter="(uID={0})" > <password-compare > <password-encoder ref="passwordEncoder" > </password-encoder> </password-compare> </ldap-authentication-provIDer> </authentication-manager> <beans:bean ID="passwordEncoder" > </beans:bean> <beans:bean ID="contextSource" > <beans:constructor-arg value="ldap://10.52.208.228:389/dc=xxxxx,dc=dev" /> <beans:property name="userDn" value="cn=Manager,dc=xxxxx,dc=dev" /> <beans:property name="password" value="secret" /> </beans:bean> <beans:bean ID="ldapAuthProvIDer" > <beans:constructor-arg > <beans:bean > <beans:constructor-arg ref="contextSource" /> <beans:property name="userDnPatterns" > <beans:List > <beans:value >uID={0},ou=webusers </beans:value> </beans:List> </beans:property> </beans:bean> </beans:constructor-arg> <beans:constructor-arg > <beans:bean > <beans:constructor-arg ref="contextSource" /> <beans:constructor-arg value="ou=groups" /> <beans:property name="groupRoleAttribute" value="ou" /> </beans:bean> </beans:constructor-arg> </beans:bean> <ldap-server url="ldap://10.52.208.228:389/dc=xxxxx,dc=dev" /> <beans:bean ID="propertyConfigurer" > <beans:property name="location" value="classpath:jdbc.propertIEs" /> </beans:bean> <beans:bean ID="dataSource" > <beans:property name="driverClassname" value="${database.driver}" /> <beans:property name="url" value="${database.url}" /> <beans:property name="username" value="${database.user}" /> <beans:property name="password" value="${database.password}" /> <beans:property name="initialSize" value="5" /> <beans:property name="maxActive" value="10" /> </beans:bean></beans:beans>
最佳答案您需要在配置中向ContextSource提供DirContextAuthenticationStrategy实现.看到:
http://static.springsource.org/spring-ldap/site/reference/html/configuration.html 总结
以上是内存溢出为你收集整理的如何将Spring Security从ldap更改为ldap starttls 全部内容,希望文章能够帮你解决如何将Spring Security从ldap更改为ldap starttls 所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)