anchor.diff:                  );
           return http.build();
       }
  -
       @Bean
       RememberMeServices rememberMeServices(UserDetailsService userDetailsService) {
  -        RememberMeTokenAlgorithm encodingAlgorithm = RememberMeTokenAlgorithm.SHA256;
  -        TokenBasedRememberMeServices rememberMe = new TokenBasedRememberMeServices(myKey, userDetailsService, encodingAlgorithm);
  -        rememberMe.setMatchingAlgorithm(RememberMeTokenAlgorithm.SHA256);
  -        return rememberMe;
  +        return new TokenBasedRememberMeServices(myKey, userDetailsService);
       }
  -
   }
   ----
  -
   .XML
   [source,xml,role="secondary"]
   ----
   <http>
     <remember-me services-ref="rememberMeServices"/>
   </http>
  -
   <bean id="rememberMeServices" class=
   "org.springframework.security.web.authentication.rememberme.TokenBasedRememberMeServices">
       <property name="userDetailsService" ref="myUserDetailsService"/>
       <property name="key" value="springRocks"/>
  -    <property name="matchingAlgorithm" value="SHA256"/>
  -    <property name="encodingAlgorithm" value="SHA256"/>
  -</bean>
  -----
  -====
  -
  -If you are having problems with the Spring Security 6 defaults, you can explicitly opt into 5.8 defaults using the following configuration:
  -
  -.Use MD5 for both encoding and matching algorithms
  -====
  -.Java
  -[source,java,role="primary"]
  -----
  -@Configuration
  -@EnableWebSecurity
  -public class SecurityConfig {
  -
  -    @Bean
  -    SecurityFilterChain securityFilterChain(HttpSecurity http, RememberMeServices rememberMeServices) throws Exception {
  -        http
  -                // ...
  -                .rememberMe((remember) -> remember
  -                    .rememberMeServices(rememberMeServices)
  -                );
  -        return http.build();
  -    }
  -
  -    @Bean
  -    RememberMeServices rememberMeServices(UserDetailsService userDetailsService) {
  -        RememberMeTokenAlgorithm encodingAlgorithm = RememberMeTokenAlgorithm.MD5;
  -        TokenBasedRememberMeServices rememberMe = new TokenBasedRememberMeServices(myKey, userDetailsService, encodingAlgorithm);
  -        rememberMe.setMatchingAlgorithm(RememberMeTokenAlgorithm.MD5);
  -        return rememberMe;
  -    }
  -
  -}
  -----
  -
  -.XML
  -[source,xml,role="secondary"]
  -----
  -<http>
  -  <remember-me services-ref="rememberMeServices"/>
  -</http>
  -
  -<bean id="rememberMeServices" class=
  -"org.springframework.security.web.authentication.rememberme.TokenBasedRememberMeServices">
  -    <property name="userDetailsService" ref="myUserDetailsService"/>
  -    <property name="key" value="springRocks"/>
  -    <property name="matchingAlgorithm" value="MD5"/>
  -    <property name="encodingAlgorithm" value="MD5"/>
   </bean>
   ----
   ====
  
positive.code: @Configuration
  @EnableWebSecurity
  public class SecurityConfig {
  
      @Bean
      SecurityFilterChain securityFilterChain(HttpSecurity http, RememberMeServices rememberMeServices) throws Exception {
          http
  
negative.code: @Configuration
  @EnableWebSecurity
  public class SecurityConfig {
      @Bean
      SecurityFilterChain securityFilterChain(HttpSecurity http, RememberMeServices rememberMeServices) throws Exception {
          http
  