【问题标题】:How to get friend list from Google Plus by using Passport如何使用 Passport 从 Google Plus 获取好友列表
【发布时间】:2016-03-09 17:39:09
【问题描述】:

我可以通过 Passport 获取 Facebook 好友列表:

new FacebookStrategy({
        // pull in our app id and secret from our auth.js file
        clientID        : config.facebook.clientID,
        clientSecret    : config.facebook.clientSecret,
        callbackURL     : config.facebook.callbackURL,
        profileFields   : ["id", "birthday", "email", "first_name", "friends", "last_name"]
    }

我很好奇 Google Plus 是否有类似的方式?

new GoogleplusStrategy({
        clientID     : configAuth.googleAuth.clientID,
        clientSecret  : configAuth.googleAuth.clientSecret,
        callbackURL     : configAuth.googleAuth.callbackURL
    }

我正在为策略使用“passport-google-oauth”模块。

谢谢

德里克

【问题讨论】:

    标签: passport.js google-plus-signin passport-google-oauth


    【解决方案1】:

    间接方式是:

    GET www.googleapis.com/plus/v1/people/userid/people/connected?access_token=accessToken
    

    使用查询字符串或 https 可以完成这项工作。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-04-17
      • 1970-01-01
      • 2012-06-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多