在收到访问令牌之后,无法向NodeJs中的Google OAuth 2发出authentication请求

我真的很讨厌打败这个死马,但是我找不到使用node-oauth的节点的明确答案。 从Passport收到Oauth舞曲中的用户访问令牌后,我似乎无法真正执行成功的GET:

function(accessToken, callback) { var request = require('https').request( { host: 'www.google.com', port: 443, path: '/m8/feeds/contacts/default/full?alt=json', method: 'GET', headers: { Authorization: 'Oauth ' + accessToken } }, function (res) { console.log(res.statusCode); callback(JSON.parse(res)); }); request.end(); } 

我得到了401.我知道accessToken是有效的。 我使用的标题与我在Google Oauth Playground中看到的完全一样。 非常感谢你的帮助!

现在杀了我:

错误

 Authorization: 'Oauth ' + accessToken 

 Authorization: 'OAuth ' + accessToken