title: How to enable Spring Security POST redirect after log in with CSRF?
body: <p>I'm using Spring Security 3.2 with CSRF. My configuration includes this:</p>
  
  <pre><code>  &lt;csrf /&gt;
    &lt;form-login default-target-url="/defaultPage"/&gt;
  </code></pre>
  
  <p>When the user does a POST form submit (with a CSRF token) that requires authentication, he is redirected to the log in page. Afterwards, instead of submitting the request, the user is redirected to the <code>defaultPage</code> by Spring Security.</p>
  
  <p>I suspect the issue is that the CSRF token gets reset during log in.</p>
  
  <p>How can I get such a POST redirect after log in working?</p>
  
  <p><strong>Update</strong>: I tried to create a custom <code>SavedRequestAwareAuthenticationSuccessHandler</code> to redirect to the original POST request. However, I saw that the original request wasn't even being saved in the <code>requestCache</code>.</p>