Spring security WAS 6.1上具有Spring安全性的LDAP SSL
我已经成功地设置了基于LDAPS容器的身份验证,现在正试图让它与spring security一起工作,因为我还需要执行查找/查询 在WAS中,我拥有使用正确密钥库的所有端点(除了WC_DefaulHost)。此外,我还为LDAP、主机和端口设置了动态端点配置 当我尝试登录时,我得到的只是“spring\u security\u login?login\u error”,没有system.out异常 我错过什么了吗?端点配置还不够吗?有什么办法可以让我得到更多的信息来解决问题吗Spring security WAS 6.1上具有Spring安全性的LDAP SSL,spring-security,ldap,websphere,websphere-6.1,Spring Security,Ldap,Websphere,Websphere 6.1,我已经成功地设置了基于LDAPS容器的身份验证,现在正试图让它与spring security一起工作,因为我还需要执行查找/查询 在WAS中,我拥有使用正确密钥库的所有端点(除了WC_DefaulHost)。此外,我还为LDAP、主机和端口设置了动态端点配置 当我尝试登录时,我得到的只是“spring\u security\u login?login\u error”,没有system.out异常 我错过什么了吗?端点配置还不够吗?有什么办法可以让我得到更多的信息来解决问题吗 <?xml
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/security"
xmlns:beans="http://www.springframework.org/schema/beans" 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-3.0.xsd http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd">
<authentication-manager>
<authentication-provider ref="ldapAuthProvider" />
</authentication-manager>
<beans:bean id="contextSource"
class="org.springframework.security.ldap.DefaultSpringSecurityContextSource">
<!-- AD authenticator -->
<beans:constructor-arg value="ldaps://host:port/DC=" />
<beans:property name="userDn" value="CN=,OU=,DC=" />
<beans:property name="password" value="" />
</beans:bean>
<beans:bean id="ldapAuthProvider"
class="org.springframework.security.ldap.authentication.LdapAuthenticationProvider">
<beans:constructor-arg>
<beans:bean id="wimLdapAuthenticator"
class="org.springframework.security.ldap.authentication.BindAuthenticator">
<beans:constructor-arg ref="contextSource" />
<beans:property name="userSearch">
<beans:bean id="userSearch"
class="org.springframework.security.ldap.search.FilterBasedLdapUserSearch">
<beans:constructor-arg index="0" value="" />
<beans:constructor-arg index="1" value="CN={0}" />
<beans:constructor-arg index="2" ref="contextSource" />
</beans:bean>
</beans:property>
</beans:bean>
</beans:constructor-arg>
</beans:bean>
<http auto-config="true" pattern="/**">
<!-- Security zones -->
<intercept-url pattern="/**" access="IS_AUTHENTICATED_FULLY" />
<intercept-url pattern="/spring_security_login" access="IS_AUTHENTICATED_ANONYMOUSLY" />
</http>
</beans:beans>
它正在工作。。似乎这不是SSL问题。。。我改变了截取url的顺序,因此/**是最后一个,并添加了一个自定义登录表单
<form-login login-page="/login" default-target-url="/viewAllTeams" authentication-failure-url="/loginfailed" />
<logout logout-success-url="/logout" />
<form-login default-target-url="/viewAllTeams"/>
<intercept-url pattern="/login" access="IS_AUTHENTICATED_ANONYMOUSLY" />
<intercept-url pattern="/loginfailed" access="IS_AUTHENTICATED_ANONYMOUSLY" />
<intercept-url pattern="/**" access="IS_AUTHENTICATED_FULLY" />
我还发现,您可以使用以下命令显示异常:
<div class="errorblock">
Your login attempt was not successful, try again.<br /> Caused :
${sessionScope["SPRING_SECURITY_LAST_EXCEPTION"].message}
</div>
您的登录尝试未成功,请重试。
导致:
${sessionScope[“SPRING\u SECURITY\u LAST\u EXCEPTION”].message}