如何从Azure Ad graph api获取联系人

问题描述 投票:0回答:1

我正在尝试使用Azure AD Graph API获取联系人列表,但不知道如何授予应用程序读取联系人的权限。 Azure AD Graph API仅对这些对象提供操作

“应用程序,设备,目录,域,会员,政策“

[请让我知道如何授予应用读取联系人的权限。

c# active-directory azure-active-directory microsoft-graph azure-ad-graph-api
1个回答
0
投票

据我所知,Microsoft graph api已经取代了azure广告图(现在Microsoft建议使用Microsoft graph而不是azure广告图)。因此,您可以使用Microsoft图形api(List contacts)。

[您只需要在azure广告中转到您的应用,然后单击“ API权限”按钮,然后按照以下步骤操作:enter image description here

然后将tutorial中提到的权限添加到您的应用程序。enter image description here

[之后,我们还需要单击按钮“ *授予管理员同意”。enter image description here

现在您可以从您的应用程序请求访问令牌,并使用该令牌请求图形api。

更新:

[如果要请求Azure广告图api,则只需添加Directory.Read.All权限。如果将“密码”用作grant_type,请在“委派权限”下添加Directory.Read.All。如果将“ client_credentials”用作grant_type,请在“应用程序权限”下添加Directory.Read.Allenter image description here

之后,您可以请求azure广告图api成功获取联系人。

© www.soinside.com 2019 - 2024. All rights reserved.