有沒有一種方法可以實現僅使用spring安全性的CSRF保護,而不使用身份驗證和授權等其他功能?使用Spring Security的CSRF保護
我嘗試了以下配置,但它關閉了spring-security的所有功能。想知道是否有一種方法可以讓csrf功能開啓。
<beans:beans xmlns="http://www.springframework.org/schema/security"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-4.0.xsd">
<http auto-config="true" security="none"/>
<authentication-manager>
<authentication-provider>
<user-service>
<user name="user" password="Password1" authorities="ROLE_USER"/>
</user-service>
</authentication-provider>
</authentication-manager>
</beans:beans>
這個問題實際上並不符合本網站的準則,您需要問什麼具體問題。你已經搜索了一個結果嗎?如果是這樣,那麼你應該嘗試一些東西,並有具體的問題。 – JoeG