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


Java AuthenticationNameUserIdSource类代码示例

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


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

示例1: userIdSource

import org.springframework.social.security.AuthenticationNameUserIdSource; //导入依赖的package包/类
@Bean
public UserIdSource userIdSource() {
    return new AuthenticationNameUserIdSource();
}
 
开发者ID:xm-online,项目名称:xm-uaa,代码行数:5,代码来源:SocialConfiguration.java

示例2: getUserIdSource

import org.springframework.social.security.AuthenticationNameUserIdSource; //导入依赖的package包/类
@Override
public UserIdSource getUserIdSource() {
    return new AuthenticationNameUserIdSource();
}
 
开发者ID:Microsoft,项目名称:MTC_Labrat,代码行数:5,代码来源:SocialConfiguration.java

示例3: getUserIdSource

import org.springframework.social.security.AuthenticationNameUserIdSource; //导入依赖的package包/类
@Override
public UserIdSource getUserIdSource() {
	return new AuthenticationNameUserIdSource();
}
 
开发者ID:PacktPublishing,项目名称:OAuth-2.0-Cookbook,代码行数:5,代码来源:GoogleConfigurerAdapter.java

示例4: getUserIdSource

import org.springframework.social.security.AuthenticationNameUserIdSource; //导入依赖的package包/类
/**
 * The UserIdSource determines the account ID of the user. The example application
 * uses the username as the account ID.
 */
@Override
public UserIdSource getUserIdSource() {
    return new AuthenticationNameUserIdSource();
}
 
开发者ID:eduyayo,项目名称:gamesboard,代码行数:9,代码来源:SocialContext.java

示例5: getUserIdSource

import org.springframework.social.security.AuthenticationNameUserIdSource; //导入依赖的package包/类
@Override
public UserIdSource getUserIdSource() {
  return new AuthenticationNameUserIdSource();
}
 
开发者ID:cs71-caffeine,项目名称:awesome-agile,代码行数:5,代码来源:SocialConfig.java

示例6: getUserIdSource

import org.springframework.social.security.AuthenticationNameUserIdSource; //导入依赖的package包/类
public UserIdSource getUserIdSource() {
    log.debug("New instance of " + AuthenticationNameUserIdSource.class);
    return new AuthenticationNameUserIdSource();
}
 
开发者ID:esutoniagodesu,项目名称:egd-web,代码行数:5,代码来源:SocialConfig.java

示例7: userIdSource

import org.springframework.social.security.AuthenticationNameUserIdSource; //导入依赖的package包/类
@Bean
public UserIdSource userIdSource() {
	return new AuthenticationNameUserIdSource();
}
 
开发者ID:markoradinovic,项目名称:Vaadin4Spring-MVP-Sample-SpringSecuritySocial,代码行数:5,代码来源:SecurityConfig.java

示例8: configure

import org.springframework.social.security.AuthenticationNameUserIdSource; //导入依赖的package包/类
@Override
	public void configure(HttpSecurity http) throws Exception {		
		ApplicationContext applicationContext = http.getSharedObject(ApplicationContext.class);
		UsersConnectionRepository usersConnectionRepository = getDependency(applicationContext, UsersConnectionRepository.class);
		SocialAuthenticationServiceLocator authServiceLocator = getDependency(applicationContext, SocialAuthenticationServiceLocator.class);
		SocialUserDetailsService socialUsersDetailsService = getDependency(applicationContext, SocialUserDetailsService.class);
		
		SocialAuthenticationFilter filter = new SocialAuthenticationFilter(
				http.getSharedObject(AuthenticationManager.class), 
				userIdSource != null ? userIdSource : new AuthenticationNameUserIdSource(), 
				usersConnectionRepository, 
				authServiceLocator);
		
		RememberMeServices rememberMe = http.getSharedObject(RememberMeServices.class);
		if (rememberMe != null) {
			filter.setRememberMeServices(rememberMe);
		}
		
		if (postLoginUrl != null) {
			filter.setPostLoginUrl(postLoginUrl);
			filter.setAlwaysUsePostLoginUrl(alwaysUsePostLoginUrl);
		}
		
		if (postFailureUrl != null) {
			/*
			 * This is throwing 
			 * java.lang.IllegalStateException: 
			 * can't set postFailureUrl on unknown failureHandler, type is org.springframework.social.security.SocialAuthenticationFailureHandler 
			 */
//			filter.setPostFailureUrl(postFailureUrl);
			filter.setDefaultFailureUrl(postFailureUrl);
		}
		
		if (signupUrl != null) {
			filter.setSignupUrl(signupUrl);					
		}
		
		http.authenticationProvider(
				new SocialAuthenticationProvider(usersConnectionRepository, socialUsersDetailsService))
			.addFilterBefore(postProcess(filter), AbstractPreAuthenticatedProcessingFilter.class);
	}
 
开发者ID:markoradinovic,项目名称:Vaadin4Spring-MVP-Sample-SpringSecuritySocial,代码行数:42,代码来源:VaadinSpringSocialConfigurer.java


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