什么是“客户端未经授权使用此方法检索访问令牌”?

时间:2019-01-07 10:47:05

标签: service-accounts google-drive-realtime-api google-directory-api

我有G西装帐户,并且已经添加了本文档中提到的范围:https://developers.google.com/identity/protocols/OAuth2ServiceAccount#delegatingauthority

我正在使用Google API的NodeJS客户端进行用户模拟。

 let {google} = require('googleapis');
 let jwtClient = new google.auth.JWT(
   id,
   null,
   key,
   [
     'https://www.googleapis.com/auth/drive',
     'https://www.googleapis.com/auth/admin.directory.user'
   ],
   account_name

);
//authenticate request
jwtClient.authorize(function (err, res) {
if (err) {
 console.log(err);
 } else {
  console.log(res);
 }
});

我在运行此代码时收到此错误消息:

  

错误:未经授权的客户端:客户端未经授权使用此方法检索访问令牌

0 个答案:

没有答案
相关问题