【发布时间】:2017-11-09 14:16:32
【问题描述】:
我有一个使用 Google API 的许多范围的应用程序。最初它仅限于我域内的用户(我们称之为lordshark.com,它运行良好)......但现在我被要求接受任何 GMail 用户,主要问题是:
考虑到我使用某人@gmail.com 登录,我想使用 Javascript 检索 lordshark.com 域中的所有用户:
gapi.client.directory.users.list({
'viewType': 'domain_public',
'customer': 'my_customer',
'maxResults': 100,
'orderBy': 'email',
'domain': 'lordshark.com'
})
我已授权我的 API 客户端 (https://admin.google.com/lordshark.com/AdminHome?chromeless=1#OGX:ManageOauthClients),已启用联系人共享 (https://admin.google.com/lordshark.com/AdminHome?chromeless=1#AppDetails:service=Directory&flyout=sharing) 但仍收到此响应:
{
"error": {
"code": 403,
"errors": [
{
"domain": "global",
"message": "Not Authorized to access this resource/api",
"reason": "forbidden"
}
],
"message": "Not Authorized to access this resource/api"
}
}
谁能帮我看看我错过了什么?
【问题讨论】:
标签: javascript google-directory-api