title: Spring Security CSRF Training mode
body: <p>I have an existing Spring WebMVC application with spring security enabled. Now I want to enable Spring-Security CSRF check.</p>
  
  <p>But I want to let it run in a training-mode. So the CSRF-Filter should only log any missing CSRF-Token so that it can be implemented from time to time.</p>
  
  <p>Is there such a training mode in Spring-Security for CSRF-Handling?</p>
  
  <p>I tried to implement a custom <code>org.springframework.security.web.access.AccessDeniedHandler</code> and set it in the <code>WebSecurityConfigurerAdapter</code>:</p>
  
  <pre><code>http.exceptionHandling().accessDeniedHandler(new MyCustomAccessDeniedHandler());
  </code></pre>
  
  <p>But unfortunately the Request does not suceed because the filter-chain stops.</p>
  
  <p>I think I have to implement a custom <code>CsrfFilter</code>, but how can i set it?</p>
  
  <p>Is there a easy way to implement a training mode?
  Any suggestions or pointers in the right direction?</p>