title: SpringSecurity UserDetailsService get password
body: <p>I'm creating authentication service in Spring.</p>
  
  <p>I'm using UserDetailsService to get form variables, but i found that loadUserByUsername has only one variable - userName.</p>
  
  <p>How to get password ?</p>
  
  <pre><code>public class userAuthentication implements UserDetailsService{
  
      private @Autowired
      ASPWebServicesUtils aspWebServicesUtils;
  
      @Override
      public UserDetails loadUserByUsername(String name) throws UsernameNotFoundException {
  
          //how to get password ?
  
          User user = new User("test", "test", true, true, true, true, getAuthorities(true));
  
          return user;  
  
      }
  
      private List&lt;GrantedAuthority&gt; getAuthorities(boolean isAdmin){
  
          List&lt;GrantedAuthority&gt; authorityList = new ArrayList&lt;GrantedAuthority&gt;(2);
          authorityList.add(new SimpleGrantedAuthority("USER_ROLE"));
          if(isAdmin){
              authorityList.add(new SimpleGrantedAuthority("ADMIN_ROLE"));
          }
          return authorityList;
  
      }
  //...
  }
  </code></pre>
  
  <p>Thanks</p>