當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。