Example usage for org.springframework.security.authentication.dao DaoAuthenticationProvider setPasswordEncoder

List of usage examples for org.springframework.security.authentication.dao DaoAuthenticationProvider setPasswordEncoder

Introduction

In this page you can find the example usage for org.springframework.security.authentication.dao DaoAuthenticationProvider setPasswordEncoder.

Prototype

public void setPasswordEncoder(PasswordEncoder passwordEncoder) 

Source Link

Document

Sets the PasswordEncoder instance to be used to encode and validate passwords.

Usage

From source file:com.swordcode.webcore.security.server.SecurityConfig.java

@Bean
public AuthenticationProvider authenticationProvider() {
    DaoAuthenticationProvider ap = new DaoAuthenticationProvider();
    ap.setUserDetailsService(userDetailsService());
    ap.setPasswordEncoder(passwordEncoder());
    return ap;/*  w  ww.j a v a  2 s  .  c  om*/
}

From source file:ch.javaee.basicMvc.config.SecurityConfig.java

@Bean
public DaoAuthenticationProvider authenticationProvider() {
    DaoAuthenticationProvider authenticationProvider = new DaoAuthenticationProvider();
    authenticationProvider.setPasswordEncoder(passwordEncoder());
    authenticationProvider.setSaltSource(reflectionSaltSource());
    authenticationProvider.setUserDetailsService(myUserDetailsService);

    return authenticationProvider;

}

From source file:ru.mystamps.web.support.spring.security.SecurityConfig.java

@Bean
public AuthenticationProvider getAuthenticationProvider() {
    DaoAuthenticationProvider provider = new DaoAuthenticationProvider();
    provider.setPasswordEncoder(getPasswordEncoder());
    provider.setUserDetailsService(getUserDetailsService());
    provider.setMessageSource(messageSource);
    return provider;
}

From source file:com.itn.configuration.SecurityConfiguration.java

@Bean
public DaoAuthenticationProvider authenticationProvider() {
    DaoAuthenticationProvider authenticationProvider = new DaoAuthenticationProvider();
    authenticationProvider.setUserDetailsService(userDetailsService);
    authenticationProvider.setPasswordEncoder(passwordEncoder());
    return authenticationProvider;
}

From source file:com.juliuskrah.multipart.security.SecurityConfig.java

@Bean
public AuthenticationProvider authenticationProvider() {
    DaoAuthenticationProvider authenticationProvider = new DaoAuthenticationProvider();
    authenticationProvider.setUserDetailsService(userDetailsService);
    authenticationProvider.setPasswordEncoder(passwordEncoder);
    return authenticationProvider;
}

From source file:cn.cuizuoli.gotour.config.SecurityConfig.java

@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
    DaoAuthenticationProvider authenticationProvider = new DaoAuthenticationProvider();
    authenticationProvider.setUserDetailsService(userDetailsService());
    authenticationProvider.setPasswordEncoder(NoOpPasswordEncoder.getInstance());
    auth.authenticationProvider(authenticationProvider);
}

From source file:net.prasenjit.auth.config.OAuthConfig.java

private AuthenticationManager userAuthenticationManager() {
    DaoAuthenticationProvider provider = new DaoAuthenticationProvider();
    provider.setUserDetailsService(userService);
    provider.setPasswordEncoder(passwordEncoder);
    ProviderManager providerManager = new ProviderManager(Arrays.asList(provider));
    return providerManager;
}

From source file:com.toptal.conf.SecurityConfiguration.java

/**
 * Creates dao authentication provider./*w  w  w  . j av  a2  s  .  c  o m*/
 * @return Authentication provider.
 * @checkstyle DesignForExtensionCheck (10 lines)
 */
@Bean
public DaoAuthenticationProvider authenticationProvider() {
    final DaoAuthenticationProvider prov = new DaoAuthenticationProvider();
    prov.setUserDetailsService(this.userDetails());
    prov.setPasswordEncoder(this.passwordEncoder());
    return prov;
}

From source file:org.davidmendoza.esu.config.SecurityConfig.java

@Bean
public DaoAuthenticationProvider daoAuthenticationProvider() {
    DaoAuthenticationProvider authenticationProvider = new DaoAuthenticationProvider();
    authenticationProvider.setUserDetailsService(userDetailsService);
    authenticationProvider.setPasswordEncoder(passwordEncoder());
    authenticationProvider.setAuthoritiesMapper(new RoleHierarchyAuthoritiesMapper(roleHierarchy()));
    return authenticationProvider;
}

From source file:org.lightadmin.core.config.context.LightAdminSecurityConfiguration.java

@Bean
@Autowired//from w  w  w. j a  v  a  2  s . c  om
public AuthenticationProvider authenticationProvider(UserDetailsService usersService) throws Exception {
    DaoAuthenticationProvider provider = new DaoAuthenticationProvider();
    provider.setPasswordEncoder(new ShaPasswordEncoder());
    provider.setUserDetailsService(usersService);
    provider.afterPropertiesSet();
    return provider;
}