GitHub API 申请列表非 public 组织成员

GitHub API Application list non public org members

我想编写一个小应用程序来验证 GitHub 组织的成员。

该应用程序应将具体的 GitHub 组织成员与数据库相匹配。当某人不在数据库中时,应将其从 GitHub 组织等中删除。

我在使用 GitHub API 时遇到的问题是,以下请求仅列出 public 成员资格(因为我没有以用户身份进行身份验证,但我不想).

https://api.github.com/orgs/_orgname_/members?client_id=_client_id_&client_secret=_client_secret_

其中 orgname、_client_id_ 和 _client_secret_ 替换为实际组织名称和在该组织上注册的一对客户端 id/secret。

如何在不以用户身份验证的情况下访问私有成员(仅作为应用程序 (server2server))?

您不能 -- 您需要以用户身份进行身份验证并拥有正确的权限。当您提供 client_id 和 client_secret 时,您仍在发出未经身份验证的请求:

https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications

未经身份验证的请求只能用于读取公开信息。