Search in sources :

Example 1 with GoogleConnectionFactory

use of org.springframework.social.google.connect.GoogleConnectionFactory in project ORCID-Source by ORCID.

the class SocialConfig method connectionFactoryLocator.

@Bean
public ConnectionFactoryLocator connectionFactoryLocator() {
    logger.info("getting connectionFactoryLocator");
    ConnectionFactoryRegistry registry = new ConnectionFactoryRegistry();
    registry.addConnectionFactory(new FacebookConnectionFactory(fb_key, fb_secret));
    registry.addConnectionFactory(new GoogleConnectionFactory(gg_key, gg_secret));
    return registry;
}
Also used : GoogleConnectionFactory(org.springframework.social.google.connect.GoogleConnectionFactory) FacebookConnectionFactory(org.springframework.social.facebook.connect.FacebookConnectionFactory) ConnectionFactoryRegistry(org.springframework.social.connect.support.ConnectionFactoryRegistry) InitializingBean(org.springframework.beans.factory.InitializingBean) Bean(org.springframework.context.annotation.Bean)

Example 2 with GoogleConnectionFactory

use of org.springframework.social.google.connect.GoogleConnectionFactory in project nixmash-blog by mintster.

the class SocialConfig method addConnectionFactories.

@Override
public void addConnectionFactories(ConnectionFactoryConfigurer cfConfig, Environment env) {
    cfConfig.addConnectionFactory(new TwitterConnectionFactory(appSettings.getTwitterAppId(), appSettings.getTwitterAppSecret()));
    cfConfig.addConnectionFactory(new FacebookConnectionFactory(appSettings.getFacebookAppId(), appSettings.getFacebookAppSecret()));
    cfConfig.addConnectionFactory(new GoogleConnectionFactory(appSettings.getGoogleAppId(), appSettings.getGoogleAppSecret()));
}
Also used : TwitterConnectionFactory(org.springframework.social.twitter.connect.TwitterConnectionFactory) GoogleConnectionFactory(org.springframework.social.google.connect.GoogleConnectionFactory) FacebookConnectionFactory(org.springframework.social.facebook.connect.FacebookConnectionFactory)

Example 3 with GoogleConnectionFactory

use of org.springframework.social.google.connect.GoogleConnectionFactory in project FuryViewer by TheDoctor-95.

the class SocialConfiguration method addConnectionFactories.

@Override
public void addConnectionFactories(ConnectionFactoryConfigurer connectionFactoryConfigurer, Environment environment) {
    // Google configuration
    String googleClientId = environment.getProperty("spring.social.google.client-id");
    String googleClientSecret = environment.getProperty("spring.social.google.client-secret");
    if (googleClientId != null && googleClientSecret != null) {
        log.debug("Configuring GoogleConnectionFactory");
        connectionFactoryConfigurer.addConnectionFactory(new GoogleConnectionFactory(googleClientId, googleClientSecret));
    } else {
        log.error("Cannot configure GoogleConnectionFactory id or secret null");
    }
    // Facebook configuration
    String facebookClientId = environment.getProperty("spring.social.facebook.client-id");
    String facebookClientSecret = environment.getProperty("spring.social.facebook.client-secret");
    if (facebookClientId != null && facebookClientSecret != null) {
        log.debug("Configuring FacebookConnectionFactory");
        connectionFactoryConfigurer.addConnectionFactory(new FacebookConnectionFactory(facebookClientId, facebookClientSecret));
    } else {
        log.error("Cannot configure FacebookConnectionFactory id or secret null");
    }
    // Twitter configuration
    String twitterClientId = environment.getProperty("spring.social.twitter.client-id");
    String twitterClientSecret = environment.getProperty("spring.social.twitter.client-secret");
    if (twitterClientId != null && twitterClientSecret != null) {
        log.debug("Configuring TwitterConnectionFactory");
        connectionFactoryConfigurer.addConnectionFactory(new TwitterConnectionFactory(twitterClientId, twitterClientSecret));
    } else {
        log.error("Cannot configure TwitterConnectionFactory id or secret null");
    }
// jhipster-needle-add-social-connection-factory
}
Also used : TwitterConnectionFactory(org.springframework.social.twitter.connect.TwitterConnectionFactory) GoogleConnectionFactory(org.springframework.social.google.connect.GoogleConnectionFactory) FacebookConnectionFactory(org.springframework.social.facebook.connect.FacebookConnectionFactory)

Example 4 with GoogleConnectionFactory

use of org.springframework.social.google.connect.GoogleConnectionFactory in project dubion by valsamiq.

the class SocialConfiguration method addConnectionFactories.

@Override
public void addConnectionFactories(ConnectionFactoryConfigurer connectionFactoryConfigurer, Environment environment) {
    // Google configuration
    String googleClientId = environment.getProperty("spring.social.google.client-id");
    String googleClientSecret = environment.getProperty("spring.social.google.client-secret");
    if (googleClientId != null && googleClientSecret != null) {
        log.debug("Configuring GoogleConnectionFactory");
        connectionFactoryConfigurer.addConnectionFactory(new GoogleConnectionFactory(googleClientId, googleClientSecret));
    } else {
        log.error("Cannot configure GoogleConnectionFactory id or secret null");
    }
    // Facebook configuration
    String facebookClientId = environment.getProperty("spring.social.facebook.client-id");
    String facebookClientSecret = environment.getProperty("spring.social.facebook.client-secret");
    if (facebookClientId != null && facebookClientSecret != null) {
        log.debug("Configuring FacebookConnectionFactory");
        connectionFactoryConfigurer.addConnectionFactory(new FacebookConnectionFactory(facebookClientId, facebookClientSecret));
    } else {
        log.error("Cannot configure FacebookConnectionFactory id or secret null");
    }
    // Twitter configuration
    String twitterClientId = environment.getProperty("spring.social.twitter.client-id");
    String twitterClientSecret = environment.getProperty("spring.social.twitter.client-secret");
    if (twitterClientId != null && twitterClientSecret != null) {
        log.debug("Configuring TwitterConnectionFactory");
        connectionFactoryConfigurer.addConnectionFactory(new TwitterConnectionFactory(twitterClientId, twitterClientSecret));
    } else {
        log.error("Cannot configure TwitterConnectionFactory id or secret null");
    }
// jhipster-needle-add-social-connection-factory
}
Also used : TwitterConnectionFactory(org.springframework.social.twitter.connect.TwitterConnectionFactory) GoogleConnectionFactory(org.springframework.social.google.connect.GoogleConnectionFactory) FacebookConnectionFactory(org.springframework.social.facebook.connect.FacebookConnectionFactory)

Aggregations

FacebookConnectionFactory (org.springframework.social.facebook.connect.FacebookConnectionFactory)4 GoogleConnectionFactory (org.springframework.social.google.connect.GoogleConnectionFactory)4 TwitterConnectionFactory (org.springframework.social.twitter.connect.TwitterConnectionFactory)3 InitializingBean (org.springframework.beans.factory.InitializingBean)1 Bean (org.springframework.context.annotation.Bean)1 ConnectionFactoryRegistry (org.springframework.social.connect.support.ConnectionFactoryRegistry)1