当前位置: 首页>>代码示例>>Java>>正文


Java DaoAuthenticationProvider.setUserDetailsService方法代码示例

本文整理汇总了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;
}
 
开发者ID:PatternFM,项目名称:tokamak,代码行数:8,代码来源:AuthorizationServerConfiguration.java

示例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);
}
 
开发者ID:KonkerLabs,项目名称:konker-platform,代码行数:18,代码来源:SecurityConfig.java

示例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");
}
 
开发者ID:pfac,项目名称:demo-spring-security,代码行数:20,代码来源:SecurityConfiguration.java

示例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);
	}
}
 
开发者ID:molgenis,项目名称:molgenis,代码行数:17,代码来源:MolgenisWebAppSecurityConfig.java

示例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;
}
 
开发者ID:xm-online,项目名称:xm-uaa,代码行数:9,代码来源:UaaConfiguration.java

示例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;
}
 
开发者ID:PacktPublishing,项目名称:Spring-5.0-Cookbook,代码行数:11,代码来源:AppSecurityModelG.java

示例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;
}
 
开发者ID:Azanx,项目名称:Smart-Shopping,代码行数:8,代码来源:WebSecurityConfig.java

示例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;
}
 
开发者ID:BakkerTom,项目名称:happy-news,代码行数:8,代码来源:WebSecurityConfig.java

示例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;
}
 
开发者ID:AlexIvchenko,项目名称:markdown-redactor,代码行数:8,代码来源:RootSecurityConfig.java

示例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;
}
 
开发者ID:tinmegali,项目名称:Using-Spring-Oauth2-to-secure-REST,代码行数:8,代码来源:SecurityConfig.java

示例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;
}
 
开发者ID:PatternFM,项目名称:tokamak,代码行数:8,代码来源:AuthorizationServerConfiguration.java

示例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);
   }
 
开发者ID:francisco-gcd,项目名称:spring-security-rest,代码行数:10,代码来源:SecurityConfiguration.java

示例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;
}
 
开发者ID:csokafor,项目名称:spring-security-angularjs,代码行数:8,代码来源:SecurityConfig.java

示例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


注:本文中的org.springframework.security.authentication.dao.DaoAuthenticationProvider.setUserDetailsService方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。