我有一个使用struts2框架用Java编写的Web应用程序,只使用REST协议的后端API . 我'm not adding any Frontend code in it though it does use cookies to Authenticate and Authorise requests. I' ve为前端创建了另一个项目,该项目使用这些API并呈现UI .

我的问题是如何在我的后端应用程序中实现CSRF保护?因为我不在表单中使用struts' <s:token> ,因此我无法使用 TokenInterceptorTokenSessionStoreInterceptor .

有什么办法可以让我的应用CSRF证明吗?

如果此查询可能存在重复,请指出 .