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


Java AuthenticationManagerBuilder.userDetailsService方法代码示例

本文整理汇总了Java中org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder.userDetailsService方法的典型用法代码示例。如果您正苦于以下问题:Java AuthenticationManagerBuilder.userDetailsService方法的具体用法?Java AuthenticationManagerBuilder.userDetailsService怎么用?Java AuthenticationManagerBuilder.userDetailsService使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder的用法示例。


在下文中一共展示了AuthenticationManagerBuilder.userDetailsService方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: globalUserDetails

import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; //导入方法依赖的package包/类
@Autowired
public void globalUserDetails(AuthenticationManagerBuilder auth) throws Exception {
	// auth.inMemoryAuthentication()
	// .withUser("user").password("password").roles("USER")
	// .and()
	// .withUser("app_client").password("nopass").roles("USER")
	// .and()
	// .withUser("admin").password("password").roles("ADMIN");
	//配置用户来源于数据库
	auth.userDetailsService(userDetailsService());
}
 
开发者ID:leftso,项目名称:demo-spring-boot-security-oauth2,代码行数:12,代码来源:SecurityConfiguration.java

示例2: configure

import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; //导入方法依赖的package包/类
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
    auth.userDetailsService(customUserService());   //user Details Service验证
}
 
开发者ID:realxujiang,项目名称:itweet-boot,代码行数:5,代码来源:WebSecurityConfig.java

示例3: init

import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; //导入方法依赖的package包/类
/**
 * Initializes the {@link AuthenticationManagerBuilder}. Creates an
 * {@link InMemoryUserDetailsManager} with the provided {@link FileAuthenticationConfiguration#getUsers()}.
 * {@link FileAuthenticationConfiguration#getUsers()} must contain at least 1 user.
 *
 * @throws IllegalArgumentException if {@link FileAuthenticationConfiguration#getUsers()} is empty.
 */
@Override
public void init(AuthenticationManagerBuilder auth) throws Exception {

	Assert.notEmpty(this.users,
		String.format("No user specified. Please specify at least 1 user (e.g. via '%s')",
			CONFIGURATION_PROPERTIES_PREFIX + ".users"));

	final InMemoryUserDetailsManager inMemory = new InMemoryUserDetailsManager(getUsers());
	auth.userDetailsService(inMemory);
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-dashboard,代码行数:18,代码来源:FileAuthenticationConfiguration.java

示例4: configAuthentication

import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; //导入方法依赖的package包/类
@Autowired
public void configAuthentication(AuthenticationManagerBuilder auth) throws Exception {
    auth.userDetailsService(userDetailsService);
}
 
开发者ID:xSzymo,项目名称:Spring-web-shop-project,代码行数:5,代码来源:SecurityConfig.java

示例5: configureGlobal

import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; //导入方法依赖的package包/类
@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
    auth.userDetailsService(converterUserDetailsServices);
}
 
开发者ID:Vedenin,项目名称:RestAndSpringMVC-CodingChallenge,代码行数:5,代码来源:SpringSecurityConfiguration.java

示例6: configure

import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; //导入方法依赖的package包/类
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
    auth.userDetailsService(userDetailsService);
}
 
开发者ID:mingzuozhibi,项目名称:mzzb-server,代码行数:4,代码来源:SecurityConfig.java

示例7: configure

import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; //导入方法依赖的package包/类
@Override
protected void configure(AuthenticationManagerBuilder auth)
        throws Exception {
    auth.userDetailsService(userDetailsService);
}
 
开发者ID:PacktPublishing,项目名称:OAuth-2.0-Cookbook,代码行数:6,代码来源:SecurityConfiguration.java

示例8: configureGlobalSecurity

import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; //导入方法依赖的package包/类
@Autowired
public void configureGlobalSecurity(AuthenticationManagerBuilder auth) throws Exception {
    auth.userDetailsService(userDetailsService);
    auth.authenticationProvider(authenticationProvider());
}
 
开发者ID:mustafamym,项目名称:FeedbackCollectionAndMgmtSystem,代码行数:6,代码来源:SecurityConfiguration.java

示例9: init

import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; //导入方法依赖的package包/类
@Autowired
//	@Override
public void init(AuthenticationManagerBuilder auth) throws Exception {
	auth.userDetailsService(userDetailsService());
}
 
开发者ID:marrow16,项目名称:Nasapi,代码行数:6,代码来源:AuthenticationAdapter.java

示例10: configure

import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; //导入方法依赖的package包/类
@Override
protected void configure(final AuthenticationManagerBuilder auth) throws Exception {
    auth.userDetailsService(userDetailsService);
    auth.authenticationProvider(accountAuthenticationProvider);
}
 
开发者ID:zeldan,项目名称:spring-boot-oauth2-password-flow,代码行数:6,代码来源:WebSecurityConfiguration.java

示例11: configure

import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; //导入方法依赖的package包/类
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
    auth.userDetailsService(userDetailsService);
}
 
开发者ID:PacktPublishing,项目名称:OAuth-2.0-Cookbook,代码行数:5,代码来源:SecurityConfiguration.java

示例12: configure

import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; //导入方法依赖的package包/类
@Override
public void configure(AuthenticationManagerBuilder auth) throws Exception{
    auth.userDetailsService(authSecurity);
}
 
开发者ID:cuiods,项目名称:WIFIProbe,代码行数:5,代码来源:SecurityConfig.java

示例13: configure

import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; //导入方法依赖的package包/类
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
    auth.userDetailsService(users);
}
 
开发者ID:PacktPublishing,项目名称:OAuth-2.0-Cookbook,代码行数:5,代码来源:SecurityConfiguration.java

示例14: configure

import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; //导入方法依赖的package包/类
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
    ClientDetailsUserDetailsService userDetailsService
        = new ClientDetailsUserDetailsService(clientDetailsService);
    auth.userDetailsService(userDetailsService);
}
 
开发者ID:PacktPublishing,项目名称:OAuth-2.0-Cookbook,代码行数:7,代码来源:CustomPathsConfigurer.java

示例15: registerAuthentication

import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; //导入方法依赖的package包/类
@Autowired
protected void registerAuthentication(
		final AuthenticationManagerBuilder auth) throws Exception {
	auth.userDetailsService(userDetailsService);
}
 
开发者ID:kflauri2312lffds,项目名称:Android_watch_magpie,代码行数:6,代码来源:OAuth2SecurityConfiguration.java


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