我在Azure的AD用户Azure的AD图形API无法访问Microsoft帐户
- 微软帐户用户
- 微软Azure Active Directory的用户
用户2始终工作在图形API调用,但不是用户1
https://graph.windows.net/tenantid/users/[email protected]?api-version=2013-04-05
(电子邮件实际上是URL编码为testmail%40hotmail.com)。 这给出了以下错误 “{\”odata.error \“:{\”code \“:\”Request_ResourceNotFound \“,\”message \“:{\”lang \“:\”en \ “value \”:\“Resource'[email protected]'不存在或其查询的引用属性对象不存在。”}}}“
有谁知道如何解决这个问题?
编辑: 我想通了,试图解决这个问题。我在上面的查询中使用UserPrincipal名称(.. users/[email protected]?..)。对于内置域帐户,userPricipal名称为[email protected](此工作方式),但对于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?'ofcourse时,它仍然不起作用。 Objectid总是适用于所有帐户(.. users/objectId?..)。
也尝试过其他的mails。可能是api错误,因为其他的mails是一个数组。 “https://graph.windows.net/tenantId/Users?$ filter = otherMails eq'testmail%40hotmail.com'& api-version = 2013-04-05”
所以问题依然存在。如果只有电子邮件在拨打电话时可用于MS账户(并非objectid),如何获取用户详细信息?
一些如何在我添加到此页面时消失。更正 –
我明白了。你仍然没有正确地浏览图表。我会更新我的答案。 –
因此无法以这种方式检索MS帐户(userPrincipalName)? https://graph.windows.net/tenantid/users/[email protected]?api-version=2013-04-05。因为打电话时我只有电子邮件ID。没有objectid –