title: How to replace UsernamePasswordAuthenticationFilter in Spring Security
body: <p>Using XML configuration would be like </p>
  
  <pre><code>&lt;custom-filter position="FORM_LOGIN_FILTER" ref="SCAAuthenticationFilter" /&gt;.  
  </code></pre>
  
  <p>Without XML would be like:</p>
  
  <pre><code>httpSecurity.addFilter(new SCAAthenticationFilter())
  </code></pre>
  
  <p>It seems that spring doesn't replace <strong>UsernamePasswordAuthenticationFilter</strong>, but adds my filter before.</p>