本文整理汇总了Java中org.springframework.social.facebook.connect.FacebookConnectionFactory.setScope方法的典型用法代码示例。如果您正苦于以下问题:Java FacebookConnectionFactory.setScope方法的具体用法?Java FacebookConnectionFactory.setScope怎么用?Java FacebookConnectionFactory.setScope使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.social.facebook.connect.FacebookConnectionFactory
的用法示例。
在下文中一共展示了FacebookConnectionFactory.setScope方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addConnectionFactories
import org.springframework.social.facebook.connect.FacebookConnectionFactory; //导入方法依赖的package包/类
/**
* Configures the connection factories for Facebook and Twitter.
* @param cfConfig
* @param env
*/
@Override
public void addConnectionFactories(ConnectionFactoryConfigurer cfConfig, Environment env) {
cfConfig.addConnectionFactory(new TwitterConnectionFactory(
env.getProperty("twitter.consumer.key"),
env.getProperty("twitter.consumer.secret")
));
cfConfig.addConnectionFactory(new GoogleConnectionFactory(
env.getProperty("twitter.consumer.key"), //TODO !!!!!!!!!!
env.getProperty("twitter.consumer.secret") //TODO !!!!!!!!!!
));
FacebookConnectionFactory facebookFactory = new FacebookConnectionFactory(
env.getProperty("facebook.app.id"),
env.getProperty("facebook.app.secret"));
facebookFactory.setScope("public_profile,email,user_friends");
cfConfig.addConnectionFactory(facebookFactory);
}
示例2: addConnectionFactories
import org.springframework.social.facebook.connect.FacebookConnectionFactory; //导入方法依赖的package包/类
@Override
public void addConnectionFactories(ConnectionFactoryConfigurer configurer,
Environment env) {
final FacebookConnectionFactory facebook = new FacebookConnectionFactory(
env.getRequiredProperty("spring.social.facebook.appId"),
env.getRequiredProperty("spring.social.facebook.appSecret"));
facebook.setScope(EMAIL);
final TwitterConnectionFactory twitter = new TwitterConnectionFactory(
env.getRequiredProperty("spring.social.twitter.appId"),
env.getRequiredProperty("spring.social.twitter.appSecret"));
final GoogleConnectionFactory google = new GoogleConnectionFactory(
env.getRequiredProperty("spring.social.google.appId"),
env.getRequiredProperty("spring.social.google.appSecret"));
google.setScope(EMAIL);
configurer.addConnectionFactory(facebook);
configurer.addConnectionFactory(google);
configurer.addConnectionFactory(twitter);
}
示例3: facebookConnectionFactory
import org.springframework.social.facebook.connect.FacebookConnectionFactory; //导入方法依赖的package包/类
private FacebookConnectionFactory facebookConnectionFactory() {
log.debug("New instance of " + FacebookConnectionFactory.class);
String key = env.getProperty("spring.social.facebook.clientId");
String secret = env.getProperty("spring.social.facebook.clientSecret");
FacebookConnectionFactory result = new FacebookConnectionFactory(key, secret);
result.setScope("public_profile,email");
return result;
}
示例4: addConnectionFactories
import org.springframework.social.facebook.connect.FacebookConnectionFactory; //导入方法依赖的package包/类
@Override
public void addConnectionFactories(ConnectionFactoryConfigurer cfConfig, Environment env) {
// Facebook
FacebookConnectionFactory ffactory = new FacebookConnectionFactory(
env.getProperty("facebook.app.id"),
env.getProperty("facebook.app.secret"));
ffactory.setScope(env.getProperty("facebook.scope"));
cfConfig.addConnectionFactory(ffactory);
// Google
GoogleConnectionFactory gfactory = new GoogleConnectionFactory(
env.getProperty("google.client.id"),
env.getProperty("google.client.secret"));
gfactory.setScope(env.getProperty("google.scope"));
cfConfig.addConnectionFactory(gfactory);
}
示例5: createConnectionFactory
import org.springframework.social.facebook.connect.FacebookConnectionFactory; //导入方法依赖的package包/类
@Override
protected ConnectionFactory<Facebook> createConnectionFactory() {
FacebookConnectionFactory facebookConnectionFactory = new FacebookConnectionFactory(facebookConsumerKey, facebookConsumerSecret);
facebookConnectionFactory.setScope("email");
return facebookConnectionFactory;
}