title: Spring Security: What is the UserDetailsManager interface used for? And more!
body: <p>I'm curious about the <a href="http://static.springframework.org/spring-security/site/apidocs/index.html" rel="noreferrer">UserDetailsManager</a> interface. It's not mentioned in the reference guide and in the JavaDoc it's described as:</p>
  
  <blockquote>
    <p>An extension of the 
    <a href="http://static.springframework.org/spring-security/site/apidocs/org/springframework/security/userdetails/UserDetailsService.html" rel="noreferrer">UserDetailsService</a> which provides the
    ability to create new users and update
    existing ones.</p>
  </blockquote>
  
  <p>When implementing the <a href="http://static.springframework.org/spring-security/site/apidocs/index.html" rel="noreferrer">UserDetailsManager</a> interface you have to implement five methods of its own and one which it inherits from the UserDetailsService which it extends.</p>
  
  <p>These methods are: createUser, updateUser, deleteUser, changePassword, userExists and the inherited method loadUserByUsername.</p>
  
  <p>In the Spring Security framework v2.0.4 there are two concrete implementations of UserDetailsManager: <a href="http://static.springframework.org/spring-security/site/apidocs/org/springframework/security/userdetails/jdbc/JdbcUserDetailsManager.html" rel="noreferrer">JdbcUserDetailsManager</a> and <a href="http://static.springframework.org/spring-security/site/apidocs/org/springframework/security/userdetails/ldap/LdapUserDetailsManager.html" rel="noreferrer">LdapUserDetailsManager</a>.</p>
  
  <p>Both the interface and the concrete implementations are implemented by Luke Taylor.</p>
  
  <p>It seems the Spring Security framework never uses the concrete implementations.</p>
  
  <p>My conclusion is that the interface is included purely as a convenience interface which the user of the framework may or may not decide to use. Perhaps there were some thought that later on more concrete implementations would exist and take out some of the work for the framework users?</p>
  
  <p>What I'm looking for is more information. For the information to be of value it has to come directly or <strong>indirectly</strong> (I guess this is most likely) from someone with insight into the framework development process. Anyone else can just make guesses, like I just did above.</p>
  
  <p>If it's just a convenience interface. <strong>Are there more such interfaces and classes which doesn't appear in the reference guide as well?</strong> I'm interested in knowing as it might be helpful to me during development.</p>
  
  <p>Looking through all interfaces and classes to see which ones are actually used inside the framework is a bit tideous and it could also be error prone if reflection is involved (so calls are made which my IDE can't figure out). </p>