当前位置: 首页>>代码示例>>Java>>正文


Java FacebookConnectionFactory.setScope方法代码示例

本文整理汇总了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);
  }
 
开发者ID:eduyayo,项目名称:gamesboard,代码行数:22,代码来源:SocialContext.java

示例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);
}
 
开发者ID:music-for-all,项目名称:music-for-all-application,代码行数:22,代码来源:SocialConfig.java

示例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;
}
 
开发者ID:esutoniagodesu,项目名称:egd-web,代码行数:9,代码来源:SocialConfig.java

示例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);
}
 
开发者ID:DmitriyLy,项目名称:travel_portal,代码行数:23,代码来源:SocialConfig.java

示例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;
}
 
开发者ID:qcri-social,项目名称:AIDR,代码行数:7,代码来源:FacebookProviderConfig.java


注:本文中的org.springframework.social.facebook.connect.FacebookConnectionFactory.setScope方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。