Spring Download using the Spring Google Social Provider

Any example of integrating Spring boot application with Spring social Google ( GabiAxel / spring-social-google ) provider? I found this project , but it seems unfinished. Spring Boot explains how to make it work with Spring Facebook, Twitter, but just like logging in with Google?

+6
source share
1 answer

As you mentioned in your question, you can use this project hosted on github.

You can use the dependency

In the configuration class, you have to extend the SocialConfigurerAdapter, override the addConnectionFactories method and add the GoogleConnectionFactory. For instance:

@Configuration @EnableSocial public class SocialConfig extends SocialConfigurerAdapter { @Override public void addConnectionFactories(ConnectionFactoryConfigurer connectionFactoryConfigurer, Environment environment) { GoogleConnectionFactory googleConnectionFactory = new GoogleConnectionFactory(environment.getProperty("spring.social.google.app-id"), environment.getProperty("spring.social.google.app-secret")); googleConnectionFactory.setScope("https://www.googleapis.com/auth/plus.login"); connectionFactoryConfigurer.addConnectionFactory(googleConnectionFactory); } @Bean @Scope(value = "request", proxyMode = ScopedProxyMode.INTERFACES) public Google google(ConnectionRepository repository) { Connection<Google> connection = repository.findPrimaryConnection(Google.class); return connection != null ? connection.getApi() : null; } } 

You can use this with Spring social examples.

+2
source

All Articles