title: No AuthenticationProvider found for UsernamePasswordAuthenticationToken
body: <p>my web.xml config is</p>
  
  <pre><code>&lt;filter&gt;
          &lt;filter-name&gt;springSecurityFilterChain&lt;/filter-name&gt;
          &lt;filter-class&gt;org.springframework.web.filter.DelegatingFilterProxy&lt;/filter-class&gt;
      &lt;/filter&gt;
  
      &lt;filter-mapping&gt;
          &lt;filter-name&gt;springSecurityFilterChain&lt;/filter-name&gt;
          &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
      &lt;/filter-mapping&gt;
  </code></pre>
  
  <p>here is my security config</p>
  
  <p></p>
  
  <pre><code>    &lt;intercept-url pattern="/*" access="ROLE_USER" /&gt;
      &lt;intercept-url pattern="/*.ico"  filters="none" /&gt;
  
  
  &lt;/http&gt;
  
   &lt;beans:bean id="customAuthenticationProvider" class="net.spring3.provider.MyAuthProvider"  /&gt;
  
      &lt;authentication-manager&gt;
  
          &lt;authentication-provider ref="customAuthenticationProvider" /&gt; 
  
      &lt;/authentication-manager&gt;
  </code></pre>
  
  <p>Here is my customAuthProvider class</p>
  
  <pre><code>public class MyAuthProvider implements AuthenticationProvider  {
  
  
      @Override
      public boolean supports(Class&lt;? extends Object&gt; arg0) {
          // TODO Auto-generated method stub
          return false;
      }
  
  
       @SuppressWarnings("serial")
          private static Map&lt;String, String&gt; SIMPLE_USERS = new HashMap&lt;String, String&gt;(2) {{
              put("joe", "joe");
              put("bob", "bob");
          }};
  
          @SuppressWarnings("serial" )
          private static List&lt;GrantedAuthority&gt; AUTHORITIES = new ArrayList&lt;GrantedAuthority&gt;(1) {{
              add(new GrantedAuthorityImpl("ROLE_USER"));
          }};
  
          @Override
          public Authentication authenticate(Authentication auth) throws AuthenticationException
          {
              // All your user authentication needs
              System.out.println("==Authenticate Me==");
              if (SIMPLE_USERS.containsKey(auth.getPrincipal()) 
                  &amp;&amp; SIMPLE_USERS.get(auth.getPrincipal()).equals(auth.getCredentials()))
              {
                  return new UsernamePasswordAuthenticationToken(auth.getName(), auth.getCredentials(), AUTHORITIES);
              }
              throw new BadCredentialsException("Username/Password does not match for " + auth.getPrincipal());
          }
  
  
  
  
  }
  </code></pre>
  
  <p>The page shows the login form and when I enter bob and bob as login , it throws up the following error.</p>
  
  <pre><code>Your login attempt was not successful, try again.
  
  Reason: No AuthenticationProvider found for org.springframework.security.authentication.UsernamePasswordAuthenticationToken
  </code></pre>
  
  <p>I checked the logs at debug level ALL and here is what I get.</p>
  
  <pre><code>FINE: Request is to process authentication
  Nov 17, 2011 5:37:36 AM org.springframework.context.support.AbstractApplicationContext publishEvent
  FINEST: Publishing event in Root WebApplicationContext: org.springframework.security.authentication.event.AuthenticationFailureProviderNotFoundEvent[source=org.springframework.security.authentication.UsernamePasswordAuthenticationToken@ffff8dfd: Principal: sd; Credentials: [PROTECTED]; Authenticated: false; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@fffe3f86: RemoteIpAddress: 127.0.0.1; SessionId: x4lg4vtktpw9; Not granted any authorities]
  Nov 17, 2011 5:37:36 AM org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter unsuccessfulAuthentication
  FINE: Authentication request failed: org.springframework.security.authentication.ProviderNotFoundException: No AuthenticationProvider found for org.springframework.security.authentication.UsernamePasswordAuthenticationToken
  </code></pre>
  
  <p>Any help on this..what am I doing wrong here ?</p>