使用 Graph API getObjectsByObjectIds 方法从 Azure 租户检索用户

Retrieving the users from Azure tenant using Graph API getObjectsByObjectIds method

我转到 Azure 门户 -> Active Directory -> 应用程序注册来创建一个应用程序。我几乎没有授予 Microsoft Graph API 和 Azure 活动目录 API

权限

然后我尝试从 Azure 租户检索用户。我正在使用图 API 检索用户。 PFB 是我正在使用的URL

https://graph.windows.net/AzureTenantIdhere/getObjectsByObjectIds?api-version=1.6

我收到 403:禁止错误 当我在上面尝试 URL 时。我知道这个错误是由于应用程序的权限(上面创建的)

能否请一些人告诉我我需要授予该应用程序的所有权限。

您的应用程序需要 Microsoft Graph 所需的权限,称为 Directory.Read.All,请参阅此 article

AAD中的Display String调用Read directory data,给权限即可。 你可以参考这个 article.