Java Code Examples for org.springframework.social.connect.UsersConnectionRepository

The following examples show how to use org.springframework.social.connect.UsersConnectionRepository. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: cola   Source File: AcAuthenticationProvider.java    License: MIT License 5 votes vote down vote up
public AcAuthenticationProvider(SocialUserDetailsService userDetailsService,
								ConnectionFactoryLocator connectionFactoryLocator,
								UsersConnectionRepository usersConnectionRepository) {
	this.userDetailsService = userDetailsService;
	this.connectionFactoryLocator = connectionFactoryLocator;
	this.usersConnectionRepository = usersConnectionRepository;
}
 
Example 2
Source Project: cola   Source File: SocialAutoConfiguration.java    License: MIT License 5 votes vote down vote up
@Override
public UsersConnectionRepository getUsersConnectionRepository(ConnectionFactoryLocator connectionFactoryLocator) {
	JpaUsersConnectRepository repository = new JpaUsersConnectRepository(userConnectionRepository,
			connectionFactoryLocator, Encryptors.noOpText());
	if (connectionSignUp != null) {
		repository.setConnectionSignUp(connectionSignUp);
	}
	return repository;
}
 
Example 3
Source Project: pre   Source File: SocialConfig.java    License: GNU General Public License v3.0 5 votes vote down vote up
@Override
public UsersConnectionRepository getUsersConnectionRepository(ConnectionFactoryLocator connectionFactoryLocator) {
    PreJdbcUsersConnectionRepository repository = new PreJdbcUsersConnectionRepository(dataSource,
            connectionFactoryLocator, Encryptors.noOpText());
    repository.setTablePrefix("social_");
    return repository;
}
 
Example 4
@Autowired
public OpenIdAuthenticationSecurityConfig(AuthenticationSuccessHandler pcAuthenticationSuccessHandler, AuthenticationFailureHandler pcAuthenticationFailureHandler, SocialUserDetailsService userDetailsService, UsersConnectionRepository usersConnectionRepository) {
	this.pcAuthenticationSuccessHandler = pcAuthenticationSuccessHandler;
	this.pcAuthenticationFailureHandler = pcAuthenticationFailureHandler;
	this.userDetailsService = userDetailsService;
	this.usersConnectionRepository = usersConnectionRepository;
}
 
Example 5
Source Project: paascloud-master   Source File: SocialConfig.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Gets users connection repository.
 *
 * @param connectionFactoryLocator the connection factory locator
 *
 * @return the users connection repository
 */
@Override
public UsersConnectionRepository getUsersConnectionRepository(ConnectionFactoryLocator connectionFactoryLocator) {
	JdbcUsersConnectionRepository repository = new JdbcUsersConnectionRepository(dataSource, connectionFactoryLocator, Encryptors.noOpText());
	repository.setTablePrefix("pc_uac_");
	if (connectionSignUp != null) {
		repository.setConnectionSignUp(connectionSignUp);
	}
	return repository;
}
 
Example 6
@Bean
@ConditionalOnBean(SignInAdapter.class)
@ConditionalOnMissingBean
public ProviderSignInController signInController(
        ConnectionFactoryLocator factoryLocator,
        UsersConnectionRepository usersRepository, SignInAdapter signInAdapter) {
    ProviderSignInController controller = new ProviderSignInController(
            factoryLocator, usersRepository, signInAdapter);
    if (!CollectionUtils.isEmpty(this.signInInterceptors)) {
        controller.setSignInInterceptors(this.signInInterceptors);
    }
    return controller;
}
 
Example 7
Source Project: spring-social-wechat-sample   Source File: Application.java    License: Apache License 2.0 5 votes vote down vote up
@Bean
public ProviderSignInController providerSignInController(ConnectionFactoryLocator connectionFactoryLocator,
		UsersConnectionRepository usersConnectionRepository, WechatSignInAdapter wechatSignInAdapter) {
	((InMemoryUsersConnectionRepository) usersConnectionRepository)
			.setConnectionSignUp((Connection<?> connection) -> connection.getKey().getProviderUserId());
	return new ProviderSignInController(connectionFactoryLocator, usersConnectionRepository, wechatSignInAdapter);
}
 
Example 8
@Bean
@ConditionalOnBean(SignInAdapter.class)
@ConditionalOnMissingBean
public ProviderSignInController signInController(ConnectionFactoryLocator factoryLocator,
		UsersConnectionRepository usersRepository, SignInAdapter signInAdapter) {
	ProviderSignInController controller = new ProviderSignInController(factoryLocator, usersRepository,
			signInAdapter);
	if (!CollectionUtils.isEmpty(this.signInInterceptors)) {
		controller.setSignInInterceptors(this.signInInterceptors);
	}
	return controller;
}
 
Example 9
Source Project: tutorials   Source File: SecurityConfig.java    License: MIT License 5 votes vote down vote up
@Bean
// @Primary
public ProviderSignInController providerSignInController() {
    ConnectionFactoryLocator connectionFactoryLocator = connectionFactoryLocator();
    UsersConnectionRepository usersConnectionRepository = getUsersConnectionRepository(connectionFactoryLocator);
    ((InMemoryUsersConnectionRepository) usersConnectionRepository).setConnectionSignUp(facebookConnectionSignup);
    return new ProviderSignInController(connectionFactoryLocator, usersConnectionRepository, new FacebookSignInAdapter());
}
 
Example 10
Source Project: AIDR   Source File: SocialConfig.java    License: GNU Affero General Public License v3.0 5 votes vote down vote up
@Bean
public UsersConnectionRepository usersConnectionRepository() {    	
	JdbcUsersConnectionRepository jdbcUsersConnectionRepository = new JdbcUsersConnectionRepository(dataSource, 
    		connectionFactoryLocator, 
    		textEncryptor());
	jdbcUsersConnectionRepository.setConnectionSignUp(userConnectionSignUp);
	return jdbcUsersConnectionRepository;
}
 
Example 11
Source Project: JiwhizBlogWeb   Source File: SocialConfig.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public UsersConnectionRepository getUsersConnectionRepository(ConnectionFactoryLocator connectionFactoryLocator) {
    MongoUsersConnectionRepositoryImpl repository = new MongoUsersConnectionRepositoryImpl(
            userSocialConnectionRepository, (SocialAuthenticationServiceLocator)connectionFactoryLocator, Encryptors.noOpText());
    repository.setConnectionSignUp(autoConnectionSignUp());
    return repository;
}
 
Example 12
Source Project: cola   Source File: OpenIdAuthenticationConfiguration.java    License: MIT License 4 votes vote down vote up
@Bean
public OpenIdAuthenticationProvider openIdAuthenticationProvider(SocialUserDetailsService socialUserDetailsService,
																 UsersConnectionRepository usersConnectionRepository) {
	return new OpenIdAuthenticationProvider(socialUserDetailsService, usersConnectionRepository);
}
 
Example 13
Source Project: cola   Source File: OpenIdAuthenticationProvider.java    License: MIT License 4 votes vote down vote up
public OpenIdAuthenticationProvider(SocialUserDetailsService userDetailsService, UsersConnectionRepository usersConnectionRepository) {
	this.userDetailsService = userDetailsService;
	this.usersConnectionRepository = usersConnectionRepository;
}
 
Example 14
Source Project: cola   Source File: AcAuthenticationConfiguration.java    License: MIT License 4 votes vote down vote up
@Bean
public AcAuthenticationProvider acAuthenticationProvider(SocialUserDetailsService socialUserDetailsService,
														 ConnectionFactoryLocator connectionFactoryLocator,
														 UsersConnectionRepository usersConnectionRepository) {
	return new AcAuthenticationProvider(socialUserDetailsService, connectionFactoryLocator, usersConnectionRepository);
}
 
Example 15
Source Project: cola   Source File: WechatConnectionConfiguration.java    License: MIT License 4 votes vote down vote up
@Override
public UsersConnectionRepository getUsersConnectionRepository(ConnectionFactoryLocator connectionFactoryLocator) {
	return null;
}
 
Example 16
Source Project: cola   Source File: QQConnectConfiguration.java    License: MIT License 4 votes vote down vote up
@Override
public UsersConnectionRepository getUsersConnectionRepository(ConnectionFactoryLocator connectionFactoryLocator) {
	return null;
}
 
Example 17
Source Project: cola   Source File: WechatMpConnectionConfiguration.java    License: MIT License 4 votes vote down vote up
@Override
public UsersConnectionRepository getUsersConnectionRepository(ConnectionFactoryLocator connectionFactoryLocator) {
	return null;
}
 
Example 18
Source Project: pre   Source File: GithubAutoAuthConfig.java    License: GNU General Public License v3.0 4 votes vote down vote up
@Override
public UsersConnectionRepository getUsersConnectionRepository(ConnectionFactoryLocator connectionFactoryLocator) {
    return null;
}
 
Example 19
Source Project: pre   Source File: GiteeAutoAuthConfig.java    License: GNU General Public License v3.0 4 votes vote down vote up
@Override
public UsersConnectionRepository getUsersConnectionRepository(ConnectionFactoryLocator connectionFactoryLocator) {
    return null;
}
 
Example 20
Source Project: pre   Source File: QQAutoConfig.java    License: GNU General Public License v3.0 4 votes vote down vote up
@Override
public UsersConnectionRepository getUsersConnectionRepository(ConnectionFactoryLocator connectionFactoryLocator) {
    return null;
}
 
Example 21
Source Project: pre   Source File: WeixinAuthConfig.java    License: GNU General Public License v3.0 4 votes vote down vote up
@Override
public UsersConnectionRepository getUsersConnectionRepository(ConnectionFactoryLocator connectionFactoryLocator) {
    return null;
}
 
Example 22
Source Project: FEBS-Security   Source File: FebsSocialConfig.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public UsersConnectionRepository getUsersConnectionRepository(ConnectionFactoryLocator connectionFactoryLocator) {
    JdbcUsersConnectionRepository jdbcUsersConnectionRepository = new JdbcUsersConnectionRepository(dataSource, connectionFactoryLocator, Encryptors.noOpText());
    jdbcUsersConnectionRepository.setTablePrefix("t_");
    return jdbcUsersConnectionRepository;
}
 
Example 23
Source Project: OAuth-2.0-Cookbook   Source File: GoogleConfigurerAdapter.java    License: MIT License 4 votes vote down vote up
@Override
public UsersConnectionRepository getUsersConnectionRepository(
		ConnectionFactoryLocator connectionFactoryLocator) {
	return new InMemoryUsersConnectionRepository(connectionFactoryLocator);
}
 
Example 24
/**
 *
 * @param connectionFactoryLocator
 * @return
 */
@Override
public UsersConnectionRepository getUsersConnectionRepository(ConnectionFactoryLocator connectionFactoryLocator) {
    TextEncryptor textEncryptor = Encryptors.noOpText();
    return new JdbcUsersConnectionRepository(dataSource, connectionFactoryLocator, textEncryptor);
}
 
Example 25
@Override
public UsersConnectionRepository getUsersConnectionRepository(ConnectionFactoryLocator connectionFactoryLocator) {
    TextEncryptor textEncryptor = Encryptors.noOpText();
    return new JdbcUsersConnectionRepository(dataSource, connectionFactoryLocator, textEncryptor);
}
 
Example 26
@Override
public UsersConnectionRepository getUsersConnectionRepository(ConnectionFactoryLocator connectionFactoryLocator) {
    TextEncryptor textEncryptor = Encryptors.noOpText();
    return new JdbcUsersConnectionRepository(dataSource, connectionFactoryLocator, textEncryptor);
}
 
Example 27
Source Project: lemonaid   Source File: DatabaseSocialConfigurer.java    License: MIT License 4 votes vote down vote up
@Override
public UsersConnectionRepository getUsersConnectionRepository(ConnectionFactoryLocator connectionFactoryLocator) {
    TextEncryptor textEncryptor = Encryptors.noOpText();
    return new JdbcUsersConnectionRepository(dataSource, connectionFactoryLocator, textEncryptor);
}
 
Example 28
@Override
public UsersConnectionRepository getUsersConnectionRepository(ConnectionFactoryLocator connectionFactoryLocator) {
    return new CustomSocialUsersConnectionRepository(socialUserConnectionRepository, connectionFactoryLocator);
}
 
Example 29
@Bean
public ProviderSignInUtils getProviderSignInUtils(ConnectionFactoryLocator connectionFactoryLocator, UsersConnectionRepository usersConnectionRepository) {
    return new ProviderSignInUtils(connectionFactoryLocator, usersConnectionRepository);
}
 
Example 30
@Override
public UsersConnectionRepository getUsersConnectionRepository(ConnectionFactoryLocator connectionFactoryLocator) {
    JdbcUsersConnectionRepository repository = new JdbcUsersConnectionRepository(dataSource,connectionFactoryLocator, Encryptors.noOpText());
    repository.setConnectionSignUp(new AccountConnectionSignUpService(usersDao));
    return repository;
}