我正在使用 Spring 3.2 + primefaces 3.5 + hibernate 4.1.9 安全上下文是:
<http auto-config='false' use-expressions="true" >
<intercept-url pattern="/**/login" access="permitAll" requires-channel="https"/>
<intercept-url pattern="/**/registration" access="permitAll" requires-channel="https" />
<intercept-url pattern="/**/cart" access="permitAll" requires-channel="https" />
<intercept-url pattern="/**/cart/**" access="hasAnyRole('USER','ADMIN')" requires-channel="https" />
<intercept-url pattern="/pages/adm/**" access="hasRole('ADMIN')" requires-channel="https" />
<intercept-url pattern="/*/account**" access="hasAnyRole('USER','ADMIN')" requires-channel="https" />
<intercept-url pattern="/**" requires-channel="any" />
<form-login login-page="/loginRedirect"
authentication-failure-handler-ref="pennyUrlAuthenticationFailureHandler"
authentication-success-handler-ref="pennyAuthSuccessHandler"
default-target-url="/pages/account/orders.xhtml" />
<logout logout-success-url="/" invalidate-session="true"/>
</http>
如果我转到需要 HTTPS 的页面,在会话的其余部分,它将使用 HTTPS 协议,即使用户未通过身份验证。如果我去 https://mystite/en/cart,HTTPS 将用于所有浏览会话。
我不想永远将 HTTPS 切换到 HTTP,但前提是用户未经过身份验证。我可以强制未经身份验证的用户使用 HTTP 吗?