title: Spring Security 3.0.3 and custom authentication processing filter
body: <p>I use Spring Security 3.0.3.RELEASE. I would like to create a custom authentication processing filter.</p>
  
  <p>I have created a filter like this:</p>
  
  <pre><code>// imports ommited
  public class myFilter extends AbstractAuthenticationProcessingFilter {
      @Override
      public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException, IOException, ServletException {
          // some code here
      }
  }
  </code></pre>
  
  <p>I configures my <code>security.xml</code> in the following way:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans:beans xmlns="http://www.springframework.org/schema/security"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:beans="http://www.springframework.org/schema/beans"
           xsi:schemaLocation="
           http://www.springframework.org/schema/beans
           http://www.springframework.org/schema/beans/spring-beans.xsd
           http://www.springframework.org/schema/security
           http://www.springframework.org/schema/security/spring-security-3.0.xsd"&gt;
  
      &lt;http auto-config="true"&gt;
          &lt;!--&lt;session-management session-fixation-protection="none"/&gt;--&gt;
          &lt;custom-filter ref="ipFilter" before="FORM_LOGIN_FILTER"/&gt;
          &lt;intercept-url pattern="/login.jsp*" filters="none"/&gt;
          &lt;intercept-url pattern="/**" access="ROLE_USER"/&gt;
          &lt;form-login login-page="/login.jsp" always-use-default-target="true"/&gt;
          &lt;logout logout-url="/logout" logout-success-url="/login.jsp" invalidate-session="true"/&gt;
      &lt;/http&gt;
  
      &lt;beans:bean id="ipFilter" class="myFilter"&gt;
          &lt;beans:property name="authenticationManager" ref="authenticationManager"/&gt;
      &lt;/beans:bean&gt;
  
      &lt;authentication-manager alias="authenticationManager" /&gt;
  &lt;/beans:beans&gt;
  </code></pre>
  
  <p>Everything seems to be right, but when I try to access to protected pages insted of <code>myFilter.attemptAuthentication</code> called <code>myFilter.doFilter</code>.</p>
  
  <p>Any ideas why?</p>