Could not verify the CSRF token because your session was not found

0

I am using Spring security 4.2.3 and spring 4.2.5 when I run the login screen and the user registration screen works correctly when I ask to access the home screen. this error appears:

messageCould not verify the provided CSRF token because your session was not found.

descriptionAccess to the specified resource has been forbidden.
    
asked by anonymous 05.03.2018 / 14:22

1 answer

0

CSRF stands for Cross Site Request Forgery and is a kind of attack on websites. The Spring Security documentation discusses the subject this link . highly recommended that you read this documentation topic.

You can disable CSFR with the following code in your WebSecurityConfig:

  @Override
        protected void configure(HttpSecurity http) throws Exception {
            http
                .csrf().disable();
        }

This code and other details about the subject can be seen in the second link in the first paragraph.

    
05.03.2018 / 14:52