title: Spring remember-me with custom authentication provider
body: <p>I want to implement remember me services for my application. The main problem I am facing is I am using a custom authentication provider . which uses a third party application for authentication. I dont have direct access to their DB.</p>
  
  <p>I checked this <a href="https://stackoverflow.com/questions/7331784/spring-security-remember-me-with-custom-authentication-provider">Link</a> and It tells implementation of UserDetailService is Mandatory for userauthenticxation service. Unfortunately in my case I cant do this.</p>
  
  <p>I checked this <a href="https://stackoverflow.com/questions/8734484/spring-security-config-error-while-server-startup">Link</a> as well and it says you may also implement a <code>customRememberMeServices</code> . But I am not sure how this is done. It just passes a request and a response which doesn't have the credentials. </p>
  
  <p>With the limited understanding I have; spring stores userName and password in the token</p>
  
  <pre><code> base64(username + ":" + expirationTime + ":" +
           md5Hex(username + ":" + expirationTime + ":" password + ":" + key))
  
  username:          As identifiable to the UserDetailsService
  password:          That matches the one in the retrieved UserDetails
  expirationTime:    The date and time when the remember-me token expires,
                     expressed in milliseconds
  key:               A private key to prevent modification of the remember-me token
  </code></pre>
  
  <p>Is there a way I can retrieve password from this token ? if not how else I can achieve the same ?</p>