本文整理汇总了Java中org.springframework.security.authentication.dao.DaoAuthenticationProvider.setSaltSource方法的典型用法代码示例。如果您正苦于以下问题:Java DaoAuthenticationProvider.setSaltSource方法的具体用法?Java DaoAuthenticationProvider.setSaltSource怎么用?Java DaoAuthenticationProvider.setSaltSource使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.security.authentication.dao.DaoAuthenticationProvider
的用法示例。
在下文中一共展示了DaoAuthenticationProvider.setSaltSource方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: authProvider
import org.springframework.security.authentication.dao.DaoAuthenticationProvider; //导入方法依赖的package包/类
@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;
}
示例2: daoAuthenticationProvider
import org.springframework.security.authentication.dao.DaoAuthenticationProvider; //导入方法依赖的package包/类
private DaoAuthenticationProvider daoAuthenticationProvider(){
DaoAuthenticationProvider bean = new DaoAuthenticationProvider();
bean.setUserDetailsService(jdbcDaoImpl());
bean.setPasswordEncoder(new Md5PasswordEncoder());
SystemWideSaltSource saltSource = new SystemWideSaltSource();
saltSource.setSystemWideSalt("ABC123XYZ789");
bean.setSaltSource(saltSource);
return bean;
}
示例3: configure
import org.springframework.security.authentication.dao.DaoAuthenticationProvider; //导入方法依赖的package包/类
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
DaoAuthenticationProvider provider = new DaoAuthenticationProvider();
provider.setUserDetailsService(this.getUserService());
provider.setPasswordEncoder(this.getShaPasswordEncoder());
provider.setSaltSource(this.getSaltSource());
auth.authenticationProvider(provider);
}