springboot security csrf拒绝post请求

2017-09-05  本文已影响0人  wangzaiplus

项目框架:springboot+spring security4+thmyeleaf

解决security拒绝post请求方法:
<head></head>中添加:

 <meta name="_csrf" th:content="${_csrf.token}"/>
 <meta name="_csrf_header" th:content="${_csrf.headerName}"/>

同时注意,form表单应该使用th:action,而不是action

上一篇 下一篇

猜你喜欢

热点阅读