概览
- csrf防护组件,支持referer验证、双重cookie验证,支持多种验证方式
使用指南
- Github源码:https://github.com/guanyang/spring-base-parent
- 最新Maven坐标
1 | <dependency> |
配置说明
1 | csrf: |
- 在需要csrf验证的Controller方法加上@CsrfCheck注解
1
2
3
4
5@GetMapping("/api")
@CsrfCheck
public Response test(@Valid TestRequestDTO dto) {
return testService.test(dto);
}
...
...
00:00
00:00
If you like this blog or find it useful for you, you are welcome to comment on it. You are also welcome to share this blog, so that more people can participate in it. If the images used in the blog infringe your copyright, please contact the author to delete them. Thank you !