📜  节点谷歌客户端 api 以获取已获取令牌的用户配置文件 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:43.903000             🧑  作者: Mango

代码示例1
var google = require('googleapis').google;
var OAuth2 = google.auth.OAuth2;
var oauth2Client = new OAuth2();
oauth2Client.setCredentials({access_token: 'ACCESS TOKEN HERE'});
var oauth2 = google.oauth2({
  auth: oauth2Client,
  version: 'v2'
});
oauth2.userinfo.get(
  function(err, res) {
    if (err) {
       console.log(err);
    } else {
       console.log(res);
    }
});