本文整理汇总了Java中org.springframework.social.security.provider.SocialAuthenticationService类的典型用法代码示例。如果您正苦于以下问题:Java SocialAuthenticationService类的具体用法?Java SocialAuthenticationService怎么用?Java SocialAuthenticationService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SocialAuthenticationService类属于org.springframework.social.security.provider包,在下文中一共展示了SocialAuthenticationService类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: addConnection
import org.springframework.social.security.provider.SocialAuthenticationService; //导入依赖的package包/类
public void addConnection(Connection<?> connection) {
//check cardinality
SocialAuthenticationService<?> socialAuthenticationService =
this.socialAuthenticationServiceLocator.getAuthenticationService(connection.getKey().getProviderId());
if (socialAuthenticationService.getConnectionCardinality() == ConnectionCardinality.ONE_TO_ONE ||
socialAuthenticationService.getConnectionCardinality() == ConnectionCardinality.ONE_TO_MANY){
List<UserSocialConnection> storedConnections =
this.userSocialConnectionRepository.findByProviderIdAndProviderUserId(
connection.getKey().getProviderId(), connection.getKey().getProviderUserId());
if (storedConnections.size() > 0){
//not allow one providerId/providerUserId connect to multiple userId
throw new DuplicateConnectionException(connection.getKey());
}
}
UserSocialConnection userSocialConnection = this.userSocialConnectionRepository
.findByUserIdAndProviderIdAndProviderUserId(userId, connection.getKey().getProviderId(),
connection.getKey().getProviderUserId());
if (userSocialConnection == null) {
ConnectionData data = connection.createData();
userSocialConnection = new UserSocialConnection(userId, data.getProviderId(), data.getProviderUserId(), 0,
data.getDisplayName(), data.getProfileUrl(), data.getImageUrl(), encrypt(data.getAccessToken()),
encrypt(data.getSecret()), encrypt(data.getRefreshToken()), data.getExpireTime());
this.userSocialConnectionRepository.save(userSocialConnection);
} else {
throw new DuplicateConnectionException(connection.getKey());
}
}
开发者ID:jiwhiz,项目名称:JiwhizBlogWeb,代码行数:29,代码来源:MongoConnectionRepositoryImpl.java
示例2: getAuthenticationServiceClass
import org.springframework.social.security.provider.SocialAuthenticationService; //导入依赖的package包/类
@Override
protected Class<? extends SocialAuthenticationService<?>> getAuthenticationServiceClass() {
return DiscordAuthenticationService.class;
}
开发者ID:quanticc,项目名称:sentry,代码行数:5,代码来源:DiscordConfigBeanDefinitionParser.java
示例3: getAuthenticationServiceClass
import org.springframework.social.security.provider.SocialAuthenticationService; //导入依赖的package包/类
@Override
protected Class<? extends SocialAuthenticationService<?>> getAuthenticationServiceClass() {
return NaverConnectionFactory.NaverAuthenticationService.class;
}
开发者ID:mornya,项目名称:spring-social-naver,代码行数:5,代码来源:NaverConfigBeanDefinitionParser.java
示例4: getAuthenticationServiceClass
import org.springframework.social.security.provider.SocialAuthenticationService; //导入依赖的package包/类
@Override
protected Class<? extends SocialAuthenticationService<?>> getAuthenticationServiceClass() {
return StravaAuthenticationService.class;
}
开发者ID:pivotal,项目名称:spring-social-strava,代码行数:5,代码来源:StravaConfigBeanDefinitionParser.java
示例5: getAuthenticationServiceClass
import org.springframework.social.security.provider.SocialAuthenticationService; //导入依赖的package包/类
@Override
protected Class<? extends SocialAuthenticationService<?>> getAuthenticationServiceClass() {
return TencentWeiboAuthenticationService.class;
}
开发者ID:avidoggy,项目名称:spring-social-tencent-weibo,代码行数:5,代码来源:TencentWeiboProviderConfigRegistrar.java
示例6: getAuthenticationServiceClass
import org.springframework.social.security.provider.SocialAuthenticationService; //导入依赖的package包/类
@Override
protected Class<? extends SocialAuthenticationService<?>> getAuthenticationServiceClass() {
return Auth0AuthenticationService.class;
}
开发者ID:cpitman,项目名称:spring-social-auth0,代码行数:5,代码来源:Auth0ProviderConfigRegistrar.java
示例7: getAuthenticationServiceClass
import org.springframework.social.security.provider.SocialAuthenticationService; //导入依赖的package包/类
/**
* @see org.springframework.social.config.support.ProviderConfigurationSupport#getAuthenticationServiceClass()
*/
@Override
protected Class<? extends SocialAuthenticationService<?>> getAuthenticationServiceClass() {
return AmazonAuthenticationService.class;
}
开发者ID:mkhelif,项目名称:spring-social-amazon,代码行数:8,代码来源:AmazonConfigBeanDefinitionParser.java
注:本文中的org.springframework.social.security.provider.SocialAuthenticationService类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论