【发布时间】:2019-07-07 03:45:11
【问题描述】:
我们在 GCP 中托管了一个应用程序,它使用 GSuite API 将用户从 GSuite 同步到我们的应用程序,反之亦然,使用服务帐户。它过去一直运行良好,直到最近我们的一些客户开始面临问题。
我们开始得到
401 未经授权。 “客户端未授权使用此方法检索访问令牌,或者客户端未授权任何请求的范围。”
我们的应用程序没有变化,授予的权限列表也没有变化。以下是授予的 api 访问权限列表:-
https://apps-apis.google.com/a/feeds/domain,
https://www.googleapis.com/auth/activity,
https://www.googleapis.com/auth/admin.directory.group,
https://www.googleapis.com/auth/admin.directory.orgunit,
https://www.googleapis.com/auth/admin.directory.user,**
https://www.googleapis.com/auth/admin.directory.user.readonly,
https://www.googleapis.com/auth/drive,
https://www.googleapis.com/auth/drive.appdata,
https://www.googleapis.com/auth/drive.file,
https://www.googleapis.com/auth/drive.metadata,
https://www.googleapis.com/auth/drive.metadata.readonly,
https://www.googleapis.com/auth/admin.directory.rolemanagement.readonly,
https://www.googleapis.com/auth/admin.directory.rolemanagement,
https://www.googleapis.com/auth/admin.directory.device.chromeos.readonly,
https://www.googleapis.com/auth/admin.directory.device.chromeos,
https://www.googleapis.com/auth/drive.apps.readonly,
https://www.googleapis.com/auth/drive.photos.readonly,
https://www.googleapis.com/auth/drive.scripts
直到昨天,受影响的 GSuite 域都运行良好。还有一些域仍然可以正常工作。
有人可以提出问题可能是什么。最近 API 有什么变化吗?任何帮助将不胜感激。
【问题讨论】:
-
这里突然发生了同样的事情。 6 年来一切正常。今天整个应用程序因为这个错误而停止工作。恐慌随之而来。任何解决方案将不胜感激。应用在 1 年内未更新(代码库/逻辑)。
-
重新创建服务帐户密钥 (.json)、重新分配 API 权限和重新执行 DWD 并不能解决问题。试过重启服务器,还是不行。
-
有完全相同的问题。没有代码更改,没有权限更改。应用程序在运行良好 3 年后刚刚停止工作。
标签: google-api service-accounts google-workspace google-directory-api