Java Code Examples for org.springframework.social.connect.web.ProviderSignInController

The following examples show how to use org.springframework.social.connect.web.ProviderSignInController. 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: 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 2
@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 3
Source Project: Spring-Security-Third-Edition   Source File: SocialConfig.java    License: MIT License 5 votes vote down vote up
/**
 * Configuring a {@link ProviderSignInController} to intercept OAuth2
 * requests that will be used to initiate an OAuth2 handshake with the specified
 * OAuth2 provider.
 * @return
 */
@Bean
public ProviderSignInController providerSignInController() {

    ((JdbcUsersConnectionRepository) usersConnectionRepository)
            .setConnectionSignUp(providerConnectionSignup);

    return new ProviderSignInController(
            connectionFactoryLocator,
            usersConnectionRepository,
            authSignInAdapter());
}
 
Example 4
Source Project: Spring-Security-Third-Edition   Source File: SocialConfig.java    License: MIT License 5 votes vote down vote up
@Bean
public ProviderSignInController providerSignInController() {
    ((JdbcUsersConnectionRepository) usersConnectionRepository)
            .setConnectionSignUp(providerConnectionSignup);

    return new ProviderSignInController(
            connectionFactoryLocator,
            usersConnectionRepository,
            authSignInAdapter());
}
 
Example 5
Source Project: Spring-Security-Third-Edition   Source File: SocialConfig.java    License: MIT License 5 votes vote down vote up
@Bean
public ProviderSignInController providerSignInController() {
    ((JdbcUsersConnectionRepository) usersConnectionRepository)
            .setConnectionSignUp(providerConnectionSignup);

    return new ProviderSignInController(
            connectionFactoryLocator,
            usersConnectionRepository,
            authSignInAdapter());
}
 
Example 6
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 7
Source Project: lolibox   Source File: SocialConfig.java    License: Apache License 2.0 4 votes vote down vote up
@Bean
public ProviderSignInController providerSignInController(ConnectionFactoryLocator connectionFactoryLocator, UsersConnectionRepository usersConnectionRepository) {
    return new ProviderSignInController(connectionFactoryLocator, usersConnectionRepository, new SimpleSignInAdapter(new HttpSessionRequestCache()));
}