Java Code Examples for org.springframework.social.config.annotation.ConnectionFactoryConfigurer

The following examples show how to use org.springframework.social.config.annotation.ConnectionFactoryConfigurer. 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
@Override
    public void addConnectionFactories(ConnectionFactoryConfigurer config, Environment env) {
        super.addConnectionFactories(config, env);

        // Configured through AutoConfiguration:
//        config.addConnectionFactory(new TwitterConnectionFactory(
//            env.getProperty("spring.social.twitter.appId"),
//            env.getProperty("spring.social.twitter.appSecret")));
//        config.addConnectionFactory(new FacebookConnectionFactory(
//            env.getProperty("spring.social.facebook.appId"),
//            env.getProperty("spring.social.facebook.appSecret")));
//        config.addConnectionFactory(new LinkedInConnectionFactory(
//            env.getProperty("spring.social.linkedin.appId"),
//            env.getProperty("spring.social.linkedin.appSecret")));

        // Adding GitHub Connection with properties from application.yml
        config.addConnectionFactory(new GitHubConnectionFactory(
            env.getProperty("spring.social.github.appId"),
            env.getProperty("spring.social.github.appSecret")));

        // Adding Google Connection with properties from application.yml
        config.addConnectionFactory(new GoogleConnectionFactory(
            env.getProperty("spring.social.google.appId"),
            env.getProperty("spring.social.google.appSecret")));
    }
 
Example 2
@Override
public void addConnectionFactories(ConnectionFactoryConfigurer connectionFactoryConfigurer, Environment environment) {
    connectionFactoryConfigurer.addConnectionFactory(new FacebookConnectionFactory(
        environment.getProperty("spring.social.facebook.appId"),
        environment.getProperty("spring.social.facebook.appSecret")));
    connectionFactoryConfigurer.addConnectionFactory(new TwitterConnectionFactory(
        environment.getProperty("twitter.consumerKey"),
        environment.getProperty("twitter.consumerSecret")));
    connectionFactoryConfigurer.addConnectionFactory(new LinkedInConnectionFactory(
        environment.getProperty("spring.social.linkedin.appId"),
        environment.getProperty("spring.social.linkedin.appSecret")));
    connectionFactoryConfigurer.addConnectionFactory(new GoogleConnectionFactory(
        environment.getProperty("spring.social.google.appId"),
        environment.getProperty("spring.social.google.appSecret")));
    connectionFactoryConfigurer.addConnectionFactory(new GitHubConnectionFactory(
        environment.getProperty("spring.social.github.appId"),
        environment.getProperty("spring.social.github.appSecret")));
    connectionFactoryConfigurer.addConnectionFactory(new LiveConnectionFactory(
        environment.getProperty("spring.social.live.appId"),
        environment.getProperty("spring.social.live.appSecret")));
}
 
Example 3
Source Project: OAuth-2.0-Cookbook   Source File: GoogleConfigurerAdapter.java    License: MIT License 5 votes vote down vote up
@Override
public void addConnectionFactories(
		final ConnectionFactoryConfigurer configurer,
		final Environment environment) {
	final GoogleConnectionFactory factory = new GoogleConnectionFactory(
			this.properties.getAppId(), this.properties.getAppSecret());
	configurer.addConnectionFactory(factory);
}
 
Example 4
Source Project: pre   Source File: GithubAutoAuthConfig.java    License: GNU General Public License v3.0 4 votes vote down vote up
@Override
public void addConnectionFactories(ConnectionFactoryConfigurer configurer,Environment environment) {
    configurer.addConnectionFactory(createConnectionFactory());
}
 
Example 5
Source Project: pre   Source File: GiteeAutoAuthConfig.java    License: GNU General Public License v3.0 4 votes vote down vote up
@Override
public void addConnectionFactories(ConnectionFactoryConfigurer configurer,Environment environment) {
    configurer.addConnectionFactory(createConnectionFactory());
}
 
Example 6
Source Project: pre   Source File: QQAutoConfig.java    License: GNU General Public License v3.0 4 votes vote down vote up
@Override
public void addConnectionFactories(ConnectionFactoryConfigurer configurer, Environment environment) {
    configurer.addConnectionFactory(createConnectionFactory());
}
 
Example 7
public void addConnectionFactories(ConnectionFactoryConfigurer configurer, Environment environment) {
    configurer.addConnectionFactory(this.createConnectionFactory());
}
 
Example 8
Source Project: pre   Source File: WeixinAuthConfig.java    License: GNU General Public License v3.0 4 votes vote down vote up
@Override
public void addConnectionFactories(ConnectionFactoryConfigurer configurer, Environment environment) {
    configurer.addConnectionFactory(createConnectionFactory());
}
 
Example 9
@Override
public void addConnectionFactories(ConnectionFactoryConfigurer configurer, Environment environment) {
	configurer.addConnectionFactory(createConnectionFactory());
}
 
Example 10
@Override
public void addConnectionFactories(ConnectionFactoryConfigurer config, Environment env) {
    super.addConnectionFactories(config, env);
}
 
Example 11
@Override
public void addConnectionFactories(ConnectionFactoryConfigurer config, Environment env) {
    super.addConnectionFactories(config, env);
}
 
Example 12
@Override
public void addConnectionFactories(ConnectionFactoryConfigurer connectionFactoryConfigurer, Environment environment) {
    // Google configuration
    String googleClientId = environment.getProperty("spring.social.google.clientId");
    String googleClientSecret = environment.getProperty("spring.social.google.clientSecret");
    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.clientId");
    String facebookClientSecret = environment.getProperty("spring.social.facebook.clientSecret");
    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.clientId");
    String twitterClientSecret = environment.getProperty("spring.social.twitter.clientSecret");
    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
}
 
Example 13
Source Project: boot-stateless-social   Source File: StatelessSocialConfig.java    License: MIT License 4 votes vote down vote up
@Override
public void addConnectionFactories(ConnectionFactoryConfigurer cfConfig, Environment env) {
	cfConfig.addConnectionFactory(new FacebookConnectionFactory(
			env.getProperty("facebook.appKey"),
			env.getProperty("facebook.appSecret")));
}
 
Example 14
Source Project: lolibox   Source File: SocialConfig.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void addConnectionFactories(ConnectionFactoryConfigurer cfConfig, Environment env) {
}
 
Example 15
Source Project: JiwhizBlogWeb   Source File: SocialConfig.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void addConnectionFactories(ConnectionFactoryConfigurer configurer, Environment environment) {
    configurer.addConnectionFactory(new GoogleConnectionFactory(
            environment.getProperty("spring.social.google.appId"), environment.getProperty("spring.social.google.appSecret")));
}
 
Example 16
@Override
public void addConnectionFactories(ConnectionFactoryConfigurer connectionFactoryConfigurer, Environment environment) {
	super.addConnectionFactories(connectionFactoryConfigurer, environment);

	connectionFactoryConfigurer.addConnectionFactory(createConnectionFactory());

}
 
Example 17
@Override
public void addConnectionFactories(ConnectionFactoryConfigurer connectionFactoryConfigurer, Environment environment) {
	super.addConnectionFactories(connectionFactoryConfigurer, environment);

	connectionFactoryConfigurer.addConnectionFactory(createConnectionFactory());

}