Search in sources :

Example 1 with TwitterConnectionFactory

use of org.springframework.social.twitter.connect.TwitterConnectionFactory 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 2 with TwitterConnectionFactory

use of org.springframework.social.twitter.connect.TwitterConnectionFactory 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 3 with TwitterConnectionFactory

use of org.springframework.social.twitter.connect.TwitterConnectionFactory in project syndesis by syndesisio.

the class TwitterCredentialProviderFactory method createCredentialProvider.

static CredentialProvider createCredentialProvider(final SocialProperties properties) {
    final TwitterConnectionFactory twitter = new TwitterConnectionFactory(properties.getAppId(), properties.getAppSecret());
    final OAuth1Applicator applicator = new OAuth1Applicator(properties);
    applicator.setConsumerKeyProperty("consumerKey");
    applicator.setConsumerSecretProperty("consumerSecret");
    applicator.setAccessTokenSecretProperty("accessTokenSecret");
    applicator.setAccessTokenValueProperty("accessToken");
    return new OAuth1CredentialProvider<>("twitter", twitter, applicator);
}
Also used : TwitterConnectionFactory(org.springframework.social.twitter.connect.TwitterConnectionFactory) OAuth1Applicator(io.syndesis.server.credential.OAuth1Applicator) OAuth1CredentialProvider(io.syndesis.server.credential.OAuth1CredentialProvider)

Example 4 with TwitterConnectionFactory

use of org.springframework.social.twitter.connect.TwitterConnectionFactory 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

TwitterConnectionFactory (org.springframework.social.twitter.connect.TwitterConnectionFactory)4 FacebookConnectionFactory (org.springframework.social.facebook.connect.FacebookConnectionFactory)3 GoogleConnectionFactory (org.springframework.social.google.connect.GoogleConnectionFactory)3 OAuth1Applicator (io.syndesis.server.credential.OAuth1Applicator)1 OAuth1CredentialProvider (io.syndesis.server.credential.OAuth1CredentialProvider)1