我们正试图在应用程序中防止会话固定攻击。这意味着我们预计每次用户登录应用程序时都会生成新的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标签。此选项卡将显示其更改的值。 –