anchor.diff:  @Configuration
   @EnableWebSecurity
   public class SecurityConfig {
  -
       @Bean
       SecurityFilterChain securityFilterChain(HttpSecurity http, RememberMeServices rememberMeServices) throws Exception {
           http
  
positive.code: [[servlet-opt-in-sha256-rememberme]]
  === Use SHA-256 in Remember Me
  
  The `TokenBasedRememberMeServices` implementation now supports SHA-256 for the Remember Me token and this is the default in Spring Security 6.
  This change makes the implementation more secure by default since MD5 is already proven to be a weak hashing algorithm and vulnerable against collision attacks and modular differential attacks.
  
  The new generated tokens now have the information of which algorithm was used to generate the token and that information is used in order to match it.
  If the algorithm name is not present, then the `matchingAlgorithm` property is used to check the token.
  This allows for a smooth transition from MD5 to SHA-256.
  
  To opt into the new Spring Security 6 default to encode the tokens while still being able to decode tokens encoded with MD5, you can set the `encodingAlgorithm` property to SHA-256 and the `matchingAlgorithm` property to MD5.
  See the xref:servlet/authentication/rememberme.adoc#_tokenbasedremembermeservices[reference documentation] and the {security-api-url}org/springframework/security/web/authentication/rememberme/TokenBasedRememberMeServices.html[API docs] for more information.
  
  [[servlet-opt-in-sha256-sha256-encoding]]
  .Use Spring Security 6 defaults for encoding, SHA-256 for encoding and MD5 for matching
  ====
  .Java
  [source,java,role="primary"]
  
negative.code:                 );
          return http.build();
      }
      @Bean
      RememberMeServices rememberMeServices(UserDetailsService userDetailsService) {
          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"/>
  </bean>
  ----
  ====
  