我想在用戶單擊登錄/註冊頁面(/ user/add)時從http切換到https並保留https會話直到註銷。 主頁可用不使用https。 我在security.xml文件代碼:Spring Security HTTPS - 嘗試使用https登錄時出錯
<http auto-config="true">
<intercept-url pattern="/home*" access="ROLE_USER" />
<intercept-url pattern="/user/add*" access="ROLE_USER" requires-channel="https"/>
<form-login login-page="/user/add" default-target-url="/" authentication-failure-url="/user/add" />
<port-mappings>
<port-mapping http="8080" https="8181"/>
</port-mappings>
</http>
我使用Glassfish的4.0,Spring MVC和Spring Security的3.0
當我點擊按鈕,頁面/用戶/添加,我得到這個錯誤:
ERR_TOO_MANY_REDIRECTS
有什麼建議嗎?
您是否使用了一些工具查看服務器發送的真實響應(查看了重定向)? - 迴應是什麼? – Ralph
不,我簡單的想在登錄時得到https會話 –
所以使用這個工具進行調試。如果你仍然不知道發生了什麼,在調試完成後,然後在你的問題中發佈獲得的響應。 – Ralph