我需要什么权限才能调用 google Directory API?

时间:2021-07-21 07:55:37

标签: google-cloud-platform

我正在 GCP 中设置一个服务帐户,以便call the Directory API

但我总是收到权限错误:Not Authorized to access this resource/api

我已经设置了这个角色,但没有运气。我怎么知道我需要配置什么权限才能调用 API?

enter image description here

1 个答案:

答案 0 :(得分:0)

Google Directory API 不是 GCP 的一部分 - 因此您分配给服务帐户的任何角色/权限都不起作用。

您必须向用户create a roleassign it 才能使用此 API。

您的服务帐户不是域管理员,因此无权访问。但是,您可以启用 domain-wide-delegation 并设置为 service account impersonate 域管理员,以便您的请求被接受;

<块引用>

本页面介绍了如何允许成员和资源模拟或充当身份和访问管理 (IAM) 服务帐户。它还解释了如何查看哪些成员能够模拟给定的 IAM 服务帐号。

看看可能对您有用的 this answer。另一个可能对您有帮助的文档是“Authorising your request”。

相关问题