title: from Spring Bean xml to Spring Bean Java classes
body: <p>How can I do this in Java classes?</p>
  <pre><code>    &lt;bean id=&quot;rememberMeFilter&quot; class=
       &quot;org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter&quot;&gt;
        &lt;property name=&quot;rememberMeServices&quot; ref=&quot;rememberMeServices&quot;/&gt;
        &lt;property name=&quot;authenticationManager&quot; ref=&quot;authenticationManager&quot; /&gt;
      &lt;/bean&gt;
  
      &lt;bean id=&quot;rememberMeServices&quot; class=
       &quot;org.springframework.security.web.authentication.rememberme.TokenBasedRememberMeServices&quot;&gt;
        &lt;property name=&quot;userDetailsService&quot; ref=&quot;userService&quot;/&gt;
        &lt;property name=&quot;key&quot; value=&quot;some-string&quot;/&gt;
      &lt;/bean&gt;
  
      &lt;bean id=&quot;rememberMeAuthenticationProvider&quot; class=
       &quot;org.springframework.security.authentication.RememberMeAuthenticationProvider&quot;&gt;
        &lt;property name=&quot;key&quot; value=&quot;some-string&quot;/&gt;
      &lt;/bean&gt;
  </code></pre>
  <p>And also disable auto-configuration in Java classes</p>
  <pre><code>    auto-config=&quot;false&quot;
  </code></pre>