Java Code Examples for org.springframework.security.authentication.dao.DaoAuthenticationProvider#setSaltSource()

The following examples show how to use org.springframework.security.authentication.dao.DaoAuthenticationProvider#setSaltSource() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AppSecurityModelG.java    From Spring-5.0-Cookbook with MIT License 5 votes vote down vote up
@Bean
public DaoAuthenticationProvider authProvider() {
 DaoAuthenticationProvider daoProvider = new DaoAuthenticationProvider();
	daoProvider.setPasswordEncoder(md5PasswordEncoder());
	daoProvider.setUserDetailsService(userDetailsService);
	ReflectionSaltSource saltHash = new ReflectionSaltSource();
	saltHash.setUserPropertyToUse("username");
	daoProvider.setSaltSource(saltHash);
    return daoProvider;
}
 
Example 2
Source File: AppSecurityModelE2.java    From Spring-5.0-Cookbook with MIT License 5 votes vote down vote up
@Bean
public DaoAuthenticationProvider authProvider() {
 DaoAuthenticationProvider daoProvider = new DaoAuthenticationProvider();
	daoProvider.setPasswordEncoder(md5PasswordEncoder());
	daoProvider.setUserDetailsService(userDetailsService);
	ReflectionSaltSource saltHash = new ReflectionSaltSource();
	saltHash.setUserPropertyToUse("username");
	daoProvider.setSaltSource(saltHash);
    return daoProvider;
}
 
Example 3
Source File: AppSecurityModelJ.java    From Spring-5.0-Cookbook with MIT License 5 votes vote down vote up
@Bean
public DaoAuthenticationProvider authProvider() {
 DaoAuthenticationProvider daoProvider = new DaoAuthenticationProvider();
	daoProvider.setPasswordEncoder(md5PasswordEncoder());
	daoProvider.setUserDetailsService(userDetailsService);
	ReflectionSaltSource saltHash = new ReflectionSaltSource();
	saltHash.setUserPropertyToUse("username");
	daoProvider.setSaltSource(saltHash);
    return daoProvider;
}
 
Example 4
Source File: AppSecurityModelE.java    From Spring-5.0-Cookbook with MIT License 5 votes vote down vote up
@Bean
public DaoAuthenticationProvider authProvider() {
 DaoAuthenticationProvider daoProvider = new DaoAuthenticationProvider();
	daoProvider.setPasswordEncoder(md5PasswordEncoder());
	daoProvider.setUserDetailsService(userDetailsService);
	ReflectionSaltSource saltHash = new ReflectionSaltSource();
	saltHash.setUserPropertyToUse("username");
	daoProvider.setSaltSource(saltHash);
    return daoProvider;
}
 
Example 5
Source File: AppSecurityModelF.java    From Spring-5.0-Cookbook with MIT License 5 votes vote down vote up
@Bean
public DaoAuthenticationProvider authProvider() {
 DaoAuthenticationProvider daoProvider = new DaoAuthenticationProvider();
	daoProvider.setPasswordEncoder(md5PasswordEncoder());
	daoProvider.setUserDetailsService(userDetailsService);
	ReflectionSaltSource saltHash = new ReflectionSaltSource();
	saltHash.setUserPropertyToUse("username");
	daoProvider.setSaltSource(saltHash);
    return daoProvider;
}
 
Example 6
Source File: AppSecurityModelG.java    From Spring-5.0-Cookbook with MIT License 5 votes vote down vote up
@Bean
public DaoAuthenticationProvider authProvider() {
 DaoAuthenticationProvider daoProvider = new DaoAuthenticationProvider();
	daoProvider.setPasswordEncoder(md5PasswordEncoder());
	daoProvider.setUserDetailsService(userDetailsService);
	ReflectionSaltSource saltHash = new ReflectionSaltSource();
	saltHash.setUserPropertyToUse("username");
	daoProvider.setSaltSource(saltHash);
    return daoProvider;
}
 
Example 7
Source File: AppSecurityModelE2.java    From Spring-5.0-Cookbook with MIT License 5 votes vote down vote up
@Bean
public DaoAuthenticationProvider authProvider() {
 DaoAuthenticationProvider daoProvider = new DaoAuthenticationProvider();
	daoProvider.setPasswordEncoder(md5PasswordEncoder());
	daoProvider.setUserDetailsService(userDetailsService);
	ReflectionSaltSource saltHash = new ReflectionSaltSource();
	saltHash.setUserPropertyToUse("username");
	daoProvider.setSaltSource(saltHash);
    return daoProvider;
}
 
Example 8
Source File: AppSecurityModelJ.java    From Spring-5.0-Cookbook with MIT License 5 votes vote down vote up
@Bean
public DaoAuthenticationProvider authProvider() {
 DaoAuthenticationProvider daoProvider = new DaoAuthenticationProvider();
	daoProvider.setPasswordEncoder(md5PasswordEncoder());
	daoProvider.setUserDetailsService(userDetailsService);
	ReflectionSaltSource saltHash = new ReflectionSaltSource();
	saltHash.setUserPropertyToUse("username");
	daoProvider.setSaltSource(saltHash);
    return daoProvider;
}
 
Example 9
Source File: AppSecurityModelE.java    From Spring-5.0-Cookbook with MIT License 5 votes vote down vote up
@Bean
public DaoAuthenticationProvider authProvider() {
 DaoAuthenticationProvider daoProvider = new DaoAuthenticationProvider();
	daoProvider.setPasswordEncoder(md5PasswordEncoder());
	daoProvider.setUserDetailsService(userDetailsService);
	ReflectionSaltSource saltHash = new ReflectionSaltSource();
	saltHash.setUserPropertyToUse("username");
	daoProvider.setSaltSource(saltHash);
    return daoProvider;
}
 
Example 10
Source File: AppSecurityModelF.java    From Spring-5.0-Cookbook with MIT License 5 votes vote down vote up
@Bean
public DaoAuthenticationProvider authProvider() {
 DaoAuthenticationProvider daoProvider = new DaoAuthenticationProvider();
	daoProvider.setPasswordEncoder(md5PasswordEncoder());
	daoProvider.setUserDetailsService(userDetailsService);
	ReflectionSaltSource saltHash = new ReflectionSaltSource();
	saltHash.setUserPropertyToUse("username");
	daoProvider.setSaltSource(saltHash);
    return daoProvider;
}
 
Example 11
Source File: WebSecurityConfig.java    From docs-manage with MIT License 5 votes vote down vote up
@Bean
public DaoAuthenticationProvider authenticationProvider() {
    DaoAuthenticationProvider provider = new DaoAuthenticationProvider();
    provider.setPasswordEncoder(passwordEncoder());
    provider.setUserDetailsService(userDetailsService);
    provider.setSaltSource(user -> ((User) user).getCredential());
    return provider;
}