Logout link with Spring and Thymeleaf

后端 未结 6 1272
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-03 23:23

According with the official example (Secure Web Content), I have to use a form and a button with the aim to perform a logout with Spring Security. Is there a way to use a li

6条回答
  •  别那么骄傲
    2021-01-03 23:54

    "In order to help protect against CSRF attacks, by default, Spring Security Xml Configuration log out requires:

    • the HTTP method must be a POST
    • the CSRF token must be added to the request. You can access it on the ServletRequest using the attribute _csrf as illustrated above."

    Hello Spring Security Xml Config

    LOGOUT

提交回复
热议问题