【发布时间】:2015-05-10 04:27:11
【问题描述】:
我们有一个使用谷歌应用引擎(我们也使用云端点)托管的项目(包含一个网络后端和一个移动 API 后端)。
我们为 web 应用程序、mvc 和安全性使用 spring 框架。
现在的问题是,一旦我在 security.xml 中启用 <csrf/>,云端点项目也将因为此设置需要令牌。
<http auto-config="true">
<intercept-url pattern="/" access="ROLE_USER" />
<form-login
login-page="/login"
default-target-url="/welcome"
authentication-failure-url="/login?error"
username-parameter="email"
password-parameter="password" />
<logout logout-success-url="/login?logout" />
<!-- enable csrf protection -->
<!-- <csrf/> -->
</http>
是否可以仅配置某些文件夹或某些控制器需要此<csrf/> 保护?因为我只是想要这个csrf 设置来保护我的网络后端。
【问题讨论】:
标签: google-app-engine spring-security google-cloud-endpoints