[英]Spring CSRF Token & API Resource
I'm having some trouble understanding CSRF tokens. 我在理解CSRF令牌时遇到了一些麻烦。 I'm building a simple HATEOAS service with no front end. 我正在构建一个没有前端的简单HATEOAS服务。
Spring Java config enables CSRF by default. Spring Java配置默认情况下启用CSRF。 Where in the documentation can I find details on how to get the token? 在文档中的哪里可以找到有关如何获取令牌的详细信息?
If you don't want csrf protection (normally you don't for an API resource) you can set http.csrf().disable()
. 如果您不想使用csrf保护(通常不需要API资源),则可以设置http.csrf().disable()
。 (Standard Spring Security. I'm sure it's in the docs.) (标准Spring Security。我确定它在文档中。)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.