Azure Active Directory - 图 API 请求附加字段

Azure Active Directory - Graph API request additional field

我正在使用图表 API 提取有关我组织中特定用户的信息。这很好用,但是我需要的一条信息是来自其 Active Directory 帐户的用户 "Security Groups"。

我使用以下 URL 来请求给定 Active Directory objectID 的图表 API 信息。

https://graph.windows.net/[domain]/users/[objectID]?api-version=1.5

这给了我一个 JSON 结果,其中包含用户信息,例如他们的部门、职位、userPrincipalName 等。

我怎样才能同时请求用户安全组成员资格?这可能吗?

它们在 memberOf 导航 属性 上可用。所以你可以打电话给这个:

https://graph.windows.net/[domain]/users/[objectID]/memberOf?api-version=1.5

User entity documentation