本文整理匯總了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);
}