本文整理匯總了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);
}