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

The following examples show how to use org.springframework.social.connect.web.ProviderSignInController. 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 File: Application.java    From spring-social-wechat-sample with 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
Source File: SocialWebAutoConfiguration.java    From spring-security-oauth2-boot with Apache License 2.0 5 votes vote down vote up
@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 File: SocialConfig.java    From Spring-Security-Third-Edition with 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 File: SocialConfig.java    From Spring-Security-Third-Edition with 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 File: SocialConfig.java    From Spring-Security-Third-Edition with 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 File: SecurityConfig.java    From tutorials with 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 File: SocialConfig.java    From lolibox with 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()));
}