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


Java DaoAuthenticationProvider类代码示例

本文整理汇总了Java中org.springframework.security.authentication.dao.DaoAuthenticationProvider的典型用法代码示例。如果您正苦于以下问题:Java DaoAuthenticationProvider类的具体用法?Java DaoAuthenticationProvider怎么用?Java DaoAuthenticationProvider使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DaoAuthenticationProvider类属于org.springframework.security.authentication.dao包,在下文中一共展示了DaoAuthenticationProvider类的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: configureGlobal

import org.springframework.security.authentication.dao.DaoAuthenticationProvider; //导入依赖的package包/类
@Autowired
  public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
      // Uso un PostProcessor per chiamare setHideUserNotFoundExceptions
      auth.userDetailsService(userDetailsService).addObjectPostProcessor(new ObjectPostProcessor<DaoAuthenticationProvider>() {
	@Override
	public DaoAuthenticationProvider postProcess(DaoAuthenticationProvider processor) {
		processor.setHideUserNotFoundExceptions(false); // Permette alla UsernameNotFoundException di arrivare al FailureHandler
		if (yadaConfiguration.encodePassword()) {
			processor.setPasswordEncoder(passwordEncoder(yadaConfiguration));
		}
		return processor;
	}
});
  }
 
开发者ID:xtianus,项目名称:yadaframework,代码行数:15,代码来源:YadaSecurityConfig.java

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

示例15: daoAuthenticationProvider

import org.springframework.security.authentication.dao.DaoAuthenticationProvider; //导入依赖的package包/类
@Bean
public DaoAuthenticationProvider daoAuthenticationProvider() {
    final OneTimePasswordAuthenticationProvider provider = new OneTimePasswordAuthenticationProvider();
    provider.setUserDetailsService(userDetailsService());
    provider.setPasswordEncoder(passwordEncoder());
    return provider;
}
 
开发者ID:suomenriistakeskus,项目名称:oma-riista-web,代码行数:8,代码来源:SecurityConfig.java


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