当我尝试通过 Microsoft Graph 和 oAuth 从 Azure AD 检索 sAMAccountName 时,不会返回该属性。
我正在尝试通过 oAuth 从 Azure AD 租户上的 Microsoft Graph 检索 onPremisesSamAccountName。我的本地域与 Azure 同步,并且我选择了 sAMAccountName 目录扩展进行同步。但是,当我向 Graph REST URI 发出 GET 请求时,我得到了正确的用户对象,但没有得到 onPremisesSamAccountName。
这是我的要求:
https://graph.windows.net/myorganization/users/user@domain.com?api_version=1.6
Run Code Online (Sandbox Code Playgroud)
该请求返回带有大量属性的用户对象。当我尝试以下操作时(希望“$select”该字段,Microsoft 返回元数据 URL - 它实际上包含 onPremisesSamAccountName 属性定义。
https://graph.windows.net/myorganization/users/user@somain.com?api-version=1.6&$select=onPremisesSamAccountName
Run Code Online (Sandbox Code Playgroud)
我的查询格式是否正确?在 Azure AD 门户中,我指定了以下 API 权限: