示例#1
0
 @Override
 protected void configure(AuthenticationManagerBuilder auth) throws Exception {
   DaoAuthenticationProvider authenticationProvider = new DaoAuthenticationProvider();
   authenticationProvider.setUserDetailsService(userDetailsService());
   authenticationProvider.setPasswordEncoder(NoOpPasswordEncoder.getInstance());
   auth.authenticationProvider(authenticationProvider);
 }
 @Bean
 public DaoAuthenticationProvider authProvider() {
   DaoAuthenticationProvider authProvider = new DaoAuthenticationProvider();
   authProvider.setUserDetailsService(userDetailsService);
   authProvider.setPasswordEncoder(passwordEncoder());
   return authProvider;
 }
  @Bean
  protected AuthenticationProvider authenticationProviderBean() throws Exception {
    DaoAuthenticationProvider authenticationProvider = new DaoAuthenticationProvider();
    authenticationProvider.setPasswordEncoder(passwordEncoder());
    authenticationProvider.setUserDetailsService(userDetailsServiceBean());

    return authenticationProvider;
  }
 @Autowired
 @Qualifier("userDetailsService")
 @Override
 public void setUserDetailsService(UserDetailsService userDetailsService) {
   super.setUserDetailsService(userDetailsService);
 }