首页 > 解决方案 > 找不到实体属性

问题描述

我正在与供应商合作,在 Azure AD 中为我们的 Office 365 租户设置自定义应用程序,并且我被要求使用 Azure AD 图提供以下实体属性:

extension_xxxxxxxxxxxxxx_sAMAccountName
extension_xxxxxxxxxxxxxx_userPrincipalName

通过阅读 Microsoft 的文档,我了解到 Azure AD 图形资源管理器已被弃用,因此我一直在阅读 Microsoft 的 Graph 文档以检索这些属性。

当我为https://graph.microsoft.com/v1.0/users/{id|UserPrincipalName}运行 GET 命令时,我得到以下数据集(用用户xxxx字符替换原始值):

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users/$entity",
    "businessPhones": [],
    "displayName": "user",
    "givenName": null,
    "jobTitle": null,
    "mail": null,
    "mobilePhone": null,
    "officeLocation": null,
    "preferredLanguage": null,
    "surname": null,
    "userPrincipalName": "user@domain.onmicrosoft.com",
    "id": "xxxxxxxxxxxxxxxxx-xxxx-xxxxx-xxxx-xxxxxxxxxxx"
}

我没有在这些类型的实体属性的文档中找到任何参考,我只是以错误的方式使用 Microsoft Graph,还是我在他们的文档中遗漏了一些明显的东西?

标签: azure-active-directorymicrosoft-graph-api

解决方案


要获取用户的分机详细信息,我们需要$select在用户查询中添加具有所需分机的语句。

例如:

https://graph.microsoft.com/v1.0/me?$select=id,extension_a95b06210ee248ed93fecf16c272a0d5_MyNewProperty

输出: 在此处输入图像描述


推荐阅读