如何使用Passport从Google Plus获取好友列表

时间:2015-12-04 17:40:51

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

我可以通过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"战略模块。

由于

德里克

1 个答案:

答案 0 :(得分:0)

间接方式是:

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

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