如何查询 Azure AD Graph 的SignInName https://msdn.microsoft.com/en-us/library/azure/ad/graph/api/entity-and-complex-type-reference#signinname-type?即我想获取用户的登录名并在 Azure AD 图形中查找用户对象。
我假设我应该使用$filter https://msdn.microsoft.com/en-us/library/azure/ad/graph/howto/azure-ad-graph-api-supported-queries-filters-and-paging-options#filter, right?
我试过:https://graph.windows.net/myB2Ctenant.onmicrosoft.com/users?api-version=1.6&$filter=signInNames eq spottedmahn
我得到了:
二元运算符“Equal”的操作数不是单个值。二元运算符要求
两个操作数均为单个值。
好吧,也许我应该使用any
运算符所以我尝试了:https://graph.windows.net/myB2Ctenant.onmicrosoft.com/users?api-version=1.6&$filter=signInNames/any(c:c eq 'spottedmahn')
检测到类型不兼容的二元运算符。找到的操作数类型
运算符类型“Equal”的“Microsoft.DirectoryServices.SignlnName”和“Edm.String”。
认为c:c
是一个 lambda 我然后尝试:https://graph.windows.net/myB2Ctenant.onmicrosoft.com/users?api-version=1.6&$filter=signInNames/any(c:c.value eq 'spottedmahn')
强制转换中的子类型“c.value”不是实体类型。只能对实体类型执行强制转换。
参考:用户实体 https://msdn.microsoft.com/en-us/library/azure/ad/graph/api/entity-and-complex-type-reference#user-entity
你很接近。
您必须按以下条件进行过滤signInNames
数组并匹配value
每个数组项的属性:
https://graph.windows.net/{tenant}/users?api-version=1.6&$filter=signInNames/any(x:x/value eq '{emailAddressOrUserName}')
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)