title: scpting security requireCsrfProtectionMatcher with csrfTokenRepository
body: <p>I am trying to disable Csrf for specific url. here is what i have done so far:</p>
  
  <pre><code>public HttpSessionCsrfTokenRepository csrfTokenRepository() {
      final HttpSessionCsrfTokenRepository tokenRepository = new HttpSessionCsrfTokenRepository();
      tokenRepository.setHeaderName("X-XSRF-TOKEN");
      return tokenRepository;
  }
  
  @Override
  protected void configure(HttpSecurity http) throws Exception {
      RequestMatcher matcher = request -&gt; !("//j_spring_cas_security_check".equals(request.getRequestURI()));
      http.csrf()
              .requireCsrfProtectionMatcher(matcher)
              .csrfTokenRepository(csrfTokenRepository());
  </code></pre>
  
  <p>If i comment out <code>requireCsrfProtectionMatcher</code> or simply return false in all matchers there will be no errors, but with this config it gives me:</p>
  
  <pre><code>HTTP Status 403 - Invalid CSRF Token 'null' was found on the request parameter '_csrf' or header 'X-XSRF-TOKEN'.
  </code></pre>
  
  <p>I need to disable csrf on <code>j_spring_cas_security_check</code> so that single sign out works and <code>tokenRepository</code> to work with angularjs. Is there anything i am missing?</p>