我想获取从我的应用程序登录的用户的所有谷歌私人连接。我启用了 Google People 和 Google Plus API。我设置了凭据 API 密钥、客户端 ID 和客户端密码。我试图获取用户连接的网址是
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: '/'
}));