title: Spring Security permitall denies access when sending authorization header
body: <p>My security configuration is as follows:</p>
  
  <pre><code>http.authorizeRequests().antMatchers("/authenticate").fullyAuthenticated().anyRequest().permitAll().and().httpBasic();
  </code></pre>
  
  <p>It works and all the endpoints but <code>/authenticate</code> are not secured. But when the client sends <code>Authorization</code> header to any of the unsecured endpoints then Spring Security returns <code>401</code>.</p>
  
  <pre><code>curl -s -u asdf:asdf http://127.0.0.1:22000/info
  {"timestamp":1511348485989,"status":401,"error":"Unauthorized","message":"Bad credentials","path":"/info"}
  </code></pre>
  
  <p>How I must to configure security to ignore <code>Authorization</code> header on unsecured endpoints <strong>if it is sent</strong>?</p>
  
  <p>Thanks in advance</p>