Spring-security <intercept-url requires-channel =“https”> </intercept-url>

时间:2012-08-06 06:41:35

标签: https spring-security

您好。在登录成功后的Spring-Security中,要将intercept-url重定向为https我正在使用属性required-channel="https"。它工作正常,但在此之后每个网址都继续使用https。但我只希望通过https重定向拦截网址。

<security:http  auto-config='true'>

    <security:intercept-url  pattern="/member/**"  access="ROLE_USER" requires-channel="https"/>

    <security:access-denied-handler ref="accessDeninedHandler"/>

    <security:form-login login-page="/login.htm?form" 
         authentication-success-handler-ref="/"
        authentication-failure-url="/login.htm?form" /> 

    <security:logout invalidate-session="true" logout-url="/logout.htm" logout-success-url="/"/>

    <security:remember-me key="remembermekey" services-ref="rememberMeServices" />

</security:http>

1 个答案:

答案 0 :(得分:0)

首先:您的模式可能包含许多网址。您应该检查您的网址是否不以/member/...

开头

第二次:如果选中此项并且不是问题,只需引入新的intercept-url并使用requires-channel="http"即可。

对其余网址使用< security:http pattern="Other Patterns" security="none" />