我們正試圖在應用程序中防止會話固定攻擊。這意味着我們預計每次用戶登錄應用程序時都會生成新的JSESSIONID
。Spring安全性中的會話固定
當前場景不會生成新的JSESSIONID
使用ADFS(Active Directory)進行後驗證。因此我們希望達到同樣的效果。你能告訴我們,如何解決這種攻擊?
我們在我們的應用程序中使用了Spring,Primefaces和Spring Security。我們嘗試在我們的Spring security.xml file
中實施以下標籤。但是,它似乎沒有生成新的JSESSIONID
後驗證與ADFS成功。這個spring-security.xml
已被添加到web.xml
。你能讓我們知道下面的使用有什麼問題嗎?我們在項目中使用Spring Security 3.2.10。
<sec:http create-session="always" use-expressions="true">
<sec:intercept-url pattern="/*" />
<sec:http-basic />
<sec:session-management invalid-session-url="/"
session-fixation-protection="newSession">
<sec:concurrency-control max-sessions="150"
expired-url="/" />
</sec:session-management>
<sec:csrf/>
</sec:http>
<sec:authentication-manager alias="authenticationManager">
<sec:authentication-provider>
<sec:user-service>
<sec:user name="abc" password="abc" authorities="ROLE_USER" />
</sec:user-service>
</sec:authentication-provider>
</sec:authentication-manager>
你可以看到在任何瀏覽器中的cookies標籤。此選項卡將顯示其更改的值。 –