gpt4 book ai didi

azure - AAD B2C : Returning value: [] when trying to filter by identities

转载 作者:行者123 更新时间:2023-12-03 06:24:39 25 4
gpt4 key购买 nike

我正在将 Microsoft AAD B2C 与用户流结合使用。

我有一个返回这些身份对象的用户:

        "identities": [
{
"signInType": "phoneNumber",
"issuer": "ourtenant.onmicrosoft.com",
"issuerAssignedId": "+55444444444"
},
{
"signInType": "userPrincipalName",
"issuer": "ourtenant.onmicrosoft.com",
"issuerAssignedId": "ausdhas<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="196c7d6c786a7d59766c6b6d7c7778776d37767774707a6b766a767f6d377a7674" rel="noreferrer noopener nofollow">[email protected]</a>"
}
],

我正在尝试过滤:

https://graph.microsoft.com/beta/tenant.onmicrosoft.com/users?$filter=(identities/any(i:i/issuer eq 'ourtenant.onmicrosoft.com' and i/issuerAssignedId eq '55444444444'))
https://graph.microsoft.com/v1.0/users?$select=id,displayName,identities&$filter=identities/any(c:c/issuerAssignedId eq '+55444444444' and c/issuer eq 'ourtenant.onmicrosoft.com')

但它只返回:

{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#users",
"value": []
}

我也尝试过将i换成c、x、过滤顺序,不带select,但是不起作用,只返回值:[]。

租户正确,用户号码正确。我尝试使用 beta 版和 v1.0。尝试在phoneNumber上使用“startsWith”进行过滤,但它不会返回任何内容。

最佳答案

我尝试在我的环境中重现相同的结果,并得到如下结果:

我获取了用户的身份:

https://graph.microsoft.com/beta/users/UserId/identities

enter image description here

当我尝试过滤身份时,我遇到了与下面相同的问题:

https://graph.microsoft.com/v1.0/users?$select=displayName,id&$filter=identities/any(c:c/issuerAssignedId eq 'xxx' and c/issuer eq 'xxx')

enter image description here

如果您在调用 API 时传递了错误的值,通常会出现此问题。

  • 尝试在传递电话号码时添加 +,如下所示:
https://graph.microsoft.com/v1.0/tenant.onmicrosoft.com/users?$filter=(identities/any(i:i/issuer eq 'ourtenant.onmicrosoft.com' and i/issuerAssignedId eq '+55444444444'))
  • 如果问题仍然存在,请尝试获取其他用户并检查该用户帐户是否有足够的权限来执行该操作。

我能够成功执行查询,如下所示:

https://graph.microsoft.com/v1.0/users?$select=displayName,Identities&$filter=identities/any(c:c/issuerAssignedId eq 'xxx' and c/issuer eq 'xxx')

enter image description here

引用文献:

List users - Microsoft Graph v1.0

User query $filter ignores identities/issuer - MS Graph API and Azure B2C by Andrew Campbell

关于azure - AAD B2C : Returning value: [] when trying to filter by identities,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/75631104/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com