Google范围列出域中的用户?

发布于 2025-01-19 13:57:16 字数 1069 浏览 3 评论 0原文

I've been using the users.list method to get a list of all users in a domain. The docs say, we need one of theses scopes:

With try & error I found that (at least for me) it is only working with these (all!):

Do I have missed something? Or am I in the wrong context?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

柠檬色的秋千 2025-01-26 13:57:16

https://www.googleapis.com/auth/admin.directory.domain 可能已被代码中的其他内容使用。 User.list 只需要 https://www.googleapis.com/auth/admin.directory.user

我认为可能的罪魁祸首是您的授权代码。如果您选中Directory API:授权请求,您就会看到它说

在此处输入图像描述

这可能意味着为了授权用户,您需要该范围。这与列表方法使用的 https://www.googleapis.com/auth/admin.directory.user 范围无关。

https://www.googleapis.com/auth/admin.directory.domain is probably used by something else in your code. User.list only needs https://www.googleapis.com/auth/admin.directory.user

Imo the likely culprit would be your authorization code. If you check Directory API: Authorize Requests you will see it says

enter image description here

Which may mean that in order to authorize a user you need that scope. Which would be unrelated to the https://www.googleapis.com/auth/admin.directory.user scope used for the list method.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文