Logout is not working in Spring Security

前端 未结 3 622
一向
一向 2020-12-22 01:39

I am writing a security application with Spring Security 4.0. As part of that I want to make a logout call. It is simply giving Request method \'POST\' not supported. Here i

3条回答
  •  自闭症患者
    2020-12-22 02:16

    You can also try this in your JSP because I think your JSP is incorrect. Replace your given code with the following code:

    In your case you are not submitting a form, you are simply making a get request to j_spring_security_logout but it requires a CSRF token with a POST request, so it will return the error message you're getting.

    Edit: undo the changes you have made from the previous answer because this is just a modification to what you already have.

提交回复
热议问题