【发布时间】:2017-07-24 01:16:45
【问题描述】:
我想获取从我的应用登录的用户的所有 google 私人连接。 我启用了 Google People 和 Google Plus API。我设置了凭据 API 密钥、客户端 ID 和客户端密码。我试图获取用户连接的 url 是
https://people.googleapis.com/v1/people/me/connections?fields=connections&key=api_key&access_token=access_token
另外,我正在使用库 passport-google-oauth 来获取用户 access_token。我在上面的 URL 中有什么遗漏的吗?
我的谷歌验证码是
// send to google to do the authentication
// profile gets us their basic information including their name
// email gets their emails
app.get('/auth/google', passport.authenticate('google', {
scope: ['profile', 'email','https://www.googleapis.com/auth/contacts.readonly', 'https://www.googleapis.com/auth/contacts']
}));
// the callback after google has authenticated the user
app.get('/auth/google/callback',
passport.authenticate('google', {
successRedirect: '/profile',
failureRedirect: '/'
}));
【问题讨论】:
标签: google-api google-api-nodejs-client google-people-api passport-google-oauth