【发布时间】:2015-05-14 13:52:27
【问题描述】:
我在 Azure AD 中有 2 个用户
- Microsoft 帐户用户
- Microsoft Azure Active Directory 用户
用户 2 总是在图形 API 调用中工作,但不是用户 1。
https://graph.windows.net/tenantid/users/testmail@hotmail.com?api-version=2013-04-05
(电子邮件实际上是 url 编码为 testmail%40hotmail.com)。 这给出了以下错误 "{\"odata.error\":{\"code\":\"Request_ResourceNotFound\",\"message\":{\"lang\":\"en\",\"value\":\"资源 'testmail@hotmail.com' 不存在或其查询的引用属性对象之一不存在。\"}}}"
有谁知道如何解决这个问题?
编辑: 我想出的东西试图解决这个问题。我在上面的查询中使用了 UserPrincipal 名称(..users/testmail@hotmail.com?..)。对于内置域帐户 userPricipal 名称是 testmail@domain.com(这有效),但对于 Microsoft 帐户 userPrincipal 名称是 testmail_hotmail.com#EXT#@domain.com。这是在所有用户列表 (https://graph.windows.net/tenantid/users?api-version=2013-04-05) 中给出的。但是,即使我在 url 编码(testmail_hotmail.com%23EXT%23%40domain.com)之后将查询更改为“..users/testmail_hotmail.com#EXT#@domain.com?..”,它仍然不起作用. Objectid 始终适用于所有帐户(..users/objectId?..) 。
还尝试了其他邮件。可能是 api 错误,因为 otherMails 是一个数组。 "https://graph.windows.net/tenantId/Users?$filter=otherMails eq 'testmail%40hotmail.com'&api-version=2013-04-05"
所以问题仍然存在。如果在拨打电话时只有电子邮件可用于 MS 帐户(而不是 objectid),如何获取用户详细信息?
【问题讨论】:
标签: azure azure-active-directory