本文整理汇总了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());
}
示例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验证
}
示例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);
}
示例4: configAuthentication
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; //导入方法依赖的package包/类
@Autowired
public void configAuthentication(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(userDetailsService);
}
示例5: configureGlobal
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; //导入方法依赖的package包/类
@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(converterUserDetailsServices);
}
示例6: configure
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; //导入方法依赖的package包/类
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(userDetailsService);
}
示例7: configure
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; //导入方法依赖的package包/类
@Override
protected void configure(AuthenticationManagerBuilder auth)
throws Exception {
auth.userDetailsService(userDetailsService);
}
示例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());
}
示例9: init
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; //导入方法依赖的package包/类
@Autowired
// @Override
public void init(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(userDetailsService());
}
示例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);
}
示例11: configure
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; //导入方法依赖的package包/类
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(userDetailsService);
}
示例12: configure
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; //导入方法依赖的package包/类
@Override
public void configure(AuthenticationManagerBuilder auth) throws Exception{
auth.userDetailsService(authSecurity);
}
示例13: configure
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; //导入方法依赖的package包/类
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(users);
}
示例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);
}
示例15: registerAuthentication
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; //导入方法依赖的package包/类
@Autowired
protected void registerAuthentication(
final AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(userDetailsService);
}