本文整理汇总了Java中org.springframework.security.authentication.dao.DaoAuthenticationProvider.setUserDetailsService方法的典型用法代码示例。如果您正苦于以下问题:Java DaoAuthenticationProvider.setUserDetailsService方法的具体用法?Java DaoAuthenticationProvider.setUserDetailsService怎么用?Java DaoAuthenticationProvider.setUserDetailsService使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.security.authentication.dao.DaoAuthenticationProvider
的用法示例。
在下文中一共展示了DaoAuthenticationProvider.setUserDetailsService方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: clientAuthenticationProvider
import org.springframework.security.authentication.dao.DaoAuthenticationProvider; //导入方法依赖的package包/类
@Bean(name = "clientAuthenticationProvider")
public AuthenticationProvider clientAuthenticationProvider() {
DaoAuthenticationProvider provider = new DaoAuthenticationProvider();
provider.setPasswordEncoder(new BCryptPasswordEncoder());
provider.setUserDetailsService(new ClientDetailsUserDetailsService(clientAuthenticationService));
return provider;
}
示例2: configure
import org.springframework.security.authentication.dao.DaoAuthenticationProvider; //导入方法依赖的package包/类
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
DaoAuthenticationProvider authenticationProvider = new DaoAuthenticationProvider();
authenticationProvider.setUserDetailsService(detailsService);
authenticationProvider.setPasswordEncoder(new PlaintextPasswordEncoder() {
@Override
public boolean isPasswordValid(String encPass, String rawPass, Object salt) {
try {
return new PasswordManager().validatePassword(rawPass, encPass);
} catch (NoSuchAlgorithmException | InvalidKeySpecException e) {
LOGGER.error(e.getMessage(), e);
return false;
}
}
});
auth.authenticationProvider(authenticationProvider);
}
示例3: configure
import org.springframework.security.authentication.dao.DaoAuthenticationProvider; //导入方法依赖的package包/类
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
CustomJdbcUserDetailsService customJdbcUserDetailsService = new CustomJdbcUserDetailsService();
customJdbcUserDetailsService.setDataSource(dataSource);
DaoAuthenticationProvider customJdbcProvider = new DaoAuthenticationProvider();
customJdbcProvider.setUserDetailsService(customJdbcUserDetailsService);
CustomLdapAuthoritiesPopulator customLdapAuthoritiesPopulator = new CustomLdapAuthoritiesPopulator(customJdbcUserDetailsService);
auth.jdbcAuthentication().dataSource(dataSource);
auth.inMemoryAuthentication().withUser("memdemo").password("secret").roles("USER").and().withUser("memadmin").password("53cr37").roles("ADMIN");
auth.authenticationProvider(customJdbcProvider);
auth.ldapAuthentication().userDnPatterns("uid={0},ou=users").groupSearchBase("ou=groups").groupRoleAttribute("ou").contextSource()
.ldif("classpath:com/iampfac/howto/spring/security/users.ldif").root("dc=example,dc=org");
auth.ldapAuthentication().ldapAuthoritiesPopulator(customLdapAuthoritiesPopulator).userDnPatterns("uid={0},ou=users").contextSource()
.ldif("classpath:com/iampfac/howto/spring/security/mix.ldif").root("dc=example,dc=org");
}
示例4: configure
import org.springframework.security.authentication.dao.DaoAuthenticationProvider; //导入方法依赖的package包/类
@Override
protected void configure(AuthenticationManagerBuilder auth)
{
try
{
DaoAuthenticationProvider authenticationProvider = new DaoAuthenticationProvider();
authenticationProvider.setPasswordEncoder(passwordEncoder());
authenticationProvider.setUserDetailsService(userDetailsServiceBean());
authenticationProvider.setPreAuthenticationChecks(userDetailsChecker());
auth.authenticationProvider(authenticationProvider);
}
catch (Exception e)
{
throw new RuntimeException(e);
}
}
示例5: daoAuthenticationProvider
import org.springframework.security.authentication.dao.DaoAuthenticationProvider; //导入方法依赖的package包/类
@Bean
public DaoAuthenticationProvider daoAuthenticationProvider(UserDetailsService userDetailsService,
PasswordEncoder passwordEncoder) {
DaoAuthenticationProvider provider = new DaoAuthenticationProvider();
provider.setUserDetailsService(userDetailsService);
provider.setPasswordEncoder(passwordEncoder);
return provider;
}
示例6: 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;
}
示例7: authenticationProvider
import org.springframework.security.authentication.dao.DaoAuthenticationProvider; //导入方法依赖的package包/类
@Bean
DaoAuthenticationProvider authenticationProvider() {
DaoAuthenticationProvider authProvider = new DaoAuthenticationProvider();
authProvider.setUserDetailsService(userDetailsService);
authProvider.setPasswordEncoder(passwordEncoder());
return authProvider;
}
示例8: authenticationProvider
import org.springframework.security.authentication.dao.DaoAuthenticationProvider; //导入方法依赖的package包/类
@Bean
DaoAuthenticationProvider authenticationProvider() {
DaoAuthenticationProvider provider = new DaoAuthenticationProvider();
provider.setUserDetailsService(userDetailsService);
provider.setPasswordEncoder(passwordEncoder());
return provider;
}
示例9: authenticationProvider
import org.springframework.security.authentication.dao.DaoAuthenticationProvider; //导入方法依赖的package包/类
@Bean
public AuthenticationProvider authenticationProvider(UserRepository repository) {
DaoAuthenticationProvider provider = new DaoAuthenticationProvider();
provider.setUserDetailsService(userDetailsService(repository));
provider.setPasswordEncoder(passwordEncoder());
return provider;
}
示例10: authenticationProvider
import org.springframework.security.authentication.dao.DaoAuthenticationProvider; //导入方法依赖的package包/类
@Bean
public DaoAuthenticationProvider authenticationProvider() {
DaoAuthenticationProvider provider = new DaoAuthenticationProvider();
provider.setPasswordEncoder( passwordEncoder );
provider.setUserDetailsService( userDetailsService() );
return provider;
}
示例11: authenticationProvider
import org.springframework.security.authentication.dao.DaoAuthenticationProvider; //导入方法依赖的package包/类
@Bean
public DaoAuthenticationProvider authenticationProvider() {
DaoAuthenticationProvider provider = new DaoAuthenticationProvider();
provider.setPasswordEncoder( passwordEncoder );
provider.setUserDetailsService(userDetailsService());
return provider;
}
开发者ID:tinmegali,项目名称:Oauth2-Stateless-Authentication-with-Spring-and-JWT-Token,代码行数:8,代码来源:SecurityConfig.java
示例12: userAuthenticationProvider
import org.springframework.security.authentication.dao.DaoAuthenticationProvider; //导入方法依赖的package包/类
@Bean
public AuthenticationProvider userAuthenticationProvider() {
DaoAuthenticationProvider provider = new DaoAuthenticationProvider();
provider.setPasswordEncoder(new BCryptPasswordEncoder());
provider.setUserDetailsService(accountAuthenticationService);
return provider;
}
示例13: configure
import org.springframework.security.authentication.dao.DaoAuthenticationProvider; //导入方法依赖的package包/类
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
DaoAuthenticationProvider provider = new DaoAuthenticationProvider();
provider.setUserDetailsService(userService);
provider.setPasswordEncoder(encryption());
auth.authenticationProvider(provider);
auth.userDetailsService(userService);
}
示例14: authenticationProvider
import org.springframework.security.authentication.dao.DaoAuthenticationProvider; //导入方法依赖的package包/类
@Bean
public DaoAuthenticationProvider authenticationProvider() {
DaoAuthenticationProvider authProvider = new DaoAuthenticationProvider();
authProvider.setUserDetailsService(userDetailsService);
authProvider.setPasswordEncoder(passwordEncoder());
return authProvider;
}
示例15: clientAuthenticationManager
import org.springframework.security.authentication.dao.DaoAuthenticationProvider; //导入方法依赖的package包/类
@Bean
public AuthenticationManager clientAuthenticationManager() {
DaoAuthenticationProvider clientAuthenticationProvider = new DaoAuthenticationProvider();
clientAuthenticationProvider.setUserDetailsService(clientDetailsUserDetailsService());
clientAuthenticationProvider.setHideUserNotFoundExceptions(false);
return new ProviderManager(Collections.singletonList(clientAuthenticationProvider));
}
开发者ID:gravitee-io,项目名称:graviteeio-access-management,代码行数:8,代码来源:AuthorizationServerConfiguration.java