title: BadCredentialsException when migrating from Spring 3.0.x to 3.1.x
body: <p>We have migrated from 3.0.7 spring security to 3.1.2, and one of our tests that uses in-memory-config fails on bad credentials.</p>
  
  <p>We don't do anything special, just authenticate one of the users with plain text username and password. once authenticated, we populate our authorities.</p>
  
  <p>Code:</p>
  
  <pre><code>public Authentication authenticate(UserDetails userDetails)
          throws AuthenticationException {
      try {
          org.springframework.security.core.Authentication authenticate = authenticationManager.authenticate(createAuthenticationRequest(userDetails));
          if (!authenticate.isAuthenticated()) {
              throw new AuthenticationException("Authentication failed for user ["+userDetails.getUsername()+"]");
          }
  
          Collection&lt;? extends GrantedAuthority&gt; grantedAuthorities = authenticate.getAuthorities();
                      ...
               } catch(Exception exception) {
          throw new AuthenticationException(exception);
      }
  </code></pre>
  
  <p>Code:
      
      
          
              
                  
              
          
      </p>
  
  <pre><code>&lt;bean id="daoAuthenticationProvider" 
      class="org.springframework.security.authentication.dao.DaoAuthenticationProvider"&gt;
      &lt;property name="userDetailsService" ref="daoUserDetailsService" /&gt;
  &lt;/bean&gt;
  
  &lt;bean id="daoUserDetailsService" class="org.springframework.security.core.userdetails.memory.InMemoryDaoImpl"&gt;
      &lt;property name="userMap"&gt;
          &lt;value&gt;
              Edward = koala, READ_ONLY
          &lt;/value&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>
  We get the following exception on a call to authenticate:</p>
  
  <pre><code>Caused by: org.springframework.security.authentication.BadCre dentialsException: Bad credentials
  at org.springframework.security.authentication.dao.Da oAuthenticationProvider.additionalAuthenticationCh ecks(DaoAuthenticationProvider.java:67)
  at org.springframework.security.authentication.dao.Ab stractUserDetailsAuthenticationProvider.authentica te(AbstractUserDetailsAuthenticationProvider.java: 149)
  at org.springframework.security.authentication.Provid erManager.authenticate(ProviderManager.java:156)
  at org.openspaces.security.spring.SpringSecurityManag er.authenticate(SpringSecurityManager.java:117)
  ... 11 more
  </code></pre>
  
  <p>Any ideas how to workaround it or if there is a patch pending this issue?</p>