Spring Security CSRF Token not working with AJAX

前端 未结 3 1011
南方客
南方客 2020-12-15 12:18

I have a problem in my spring boot app with the csrf token.

I have a form where I can edit a Person. A Person can have

Let us now imagine that the person has

3条回答
  •  误落风尘
    2020-12-15 12:54

    1. I suggest you first check if a valid csrf token and the header have been generated using chrome debugger. If not, then have you added the in the ?(you will need to import the spring security taglibs). If using Apache tiles, you will have to add this at the section of the template file being used for the view.

    2. If the token is not empty, then in your security-context/configuration file, check if you have disabled csrf security by any chance. By default it is enabled and needs to be for this process to work.

提交回复
热议问题