笔记簿
ᴄᴏᴅɪɴɢ ɪs ᴀʀᴛ
首页
关于
登录
注册
springboot安全问题之CSRF - springboot security CSRF问题
``` ##### thymeleaf使用表单提交 thymeleaf使用`th:action`标识表单提交时,会自动生成`input`标签在`form`表单中 ```html
``` ```html
提交
``` 配置类 ```java @EnableWebSecurity public class WebSecurityConfig extends WebSecurityConfigurerAdapter { @Override protected void configure(HttpSecurity http) throws Exception { http.csrf().csrfTokenRepository(CookieCsrfTokenRepository.withHttpOnlyFalse()); } } ```
加载中...