我已要求 IT 管理员添加一个名为EmployeeId
以 Azure Active Directory 的目录扩展的形式,与我们的现场 AD 同步。当给定用户登录我的 Android 应用程序时,我试图检索该值。
我已经关注了this https://github.com/OfficeDev/Unified-API-Getting-Started-Labs/tree/master/Android指南允许我从 URL 检索数据graph.microsoft.com
当前登录的用户,即名字、姓氏等。
问题是,当我运行架构扩展的 get 请求时(https://graph.microsoft.com/beta/schemaExtensions
)尝试检索value of EmployeeId
它只返回有关属性的一些元数据,而不是属性本身:
{
"id": "exti1rcdc4h_Employee",
"description": "Baker is testing extension",
"targetTypes": [
"user"
],
"status": "Available",
"owner": "XXXXXXXXXXXXXXXXXX",
"properties": [
{
"name": "EmployeeId",
"type": "Integer"
}
]
}
经过一些研究后,我发现我可以使用this https://graphexplorer.azurewebsites.net/图形浏览器可以轻松检索值(通过使用 get 请求https://graph.windows.net/mydomain.com/users/[email protected] /cdn-cgi/l/email-protection
).
但问题是 URLgraph.explorer.net
似乎与上面提到的指南不兼容。
有更好的方法来解决这个问题吗?
--EDIT--
只是为了澄清我只能检索到的值extension_980f32feca7d475f9e1b90a410dbee63_employeeID
成功地使用了Azure AD 图形浏览器 https://graphexplorer.azurewebsites.net/当我访问 /users 端点时,未返回该值微软图形浏览器 https://developer.microsoft.com/en-us/graph/graph-explorer
GET 中为每个用户返回的数据https://graph.microsoft.com/v1.0/users
要求:
"id": "d0be2ebd-0c7b-4c10-aebe-9db4c90a9594",
"businessPhones": [],
"displayName": "username",
"givenName": "Jhon",
"jobTitle": null,
"mail": "[email protected] /cdn-cgi/l/email-protection",
"mobilePhone": null,
"officeLocation": null,
"preferredLanguage": null,
"surname": "Smith",
"userPrincipalName": "[email protected] /cdn-cgi/l/email-protection"