查询Azure AD图以获取B2C SignInName [英] Query Azure AD Graph for B2C SignInName

查看:82
本文介绍了查询Azure AD图以获取B2C SignInName的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何查询Azure AD图以获得

How do I query Azure AD Graph for a SignInName? i.e. I want to take the user's login-name and find the user object in the Azure AD Graph.

我假设我应该使用

I would assume I'm supposed to use $filter, right?

我尝试过:https://graph.windows.net/myB2Ctenant.onmicrosoft.com/users?api-version=1.6&$filter=signInNames eq spottedmahn

然后我得到了

二进制运算符'Equal'的操作数不是单个值.二进制运算符要求 两个操作数都是单个值.

The operand for a binary operator 'Equal' is not a single value. Binary operators require both operands to be single values.


好,所以也许我支持使用any运算符,所以我尝试了:https://graph.windows.net/myB2Ctenant.onmicrosoft.com/users?api-version=1.6&$filter=signInNames/any(c:c eq 'spottedmahn')


Ok, so maybe I'm suppoed to use the any operator so then I tried: https://graph.windows.net/myB2Ctenant.onmicrosoft.com/users?api-version=1.6&$filter=signInNames/any(c:c eq 'spottedmahn')

检测到类型不兼容的二进制运算符.找到的操作数类型 运算符类型等于"的"Microsoft.DirectoryServices.SignlnName"和"Edm.String".

A binary operator with incompatible types was detected. Found operand types 'Microsoft.DirectoryServices.SignlnName' and 'Edm.String' for operator kind 'Equal'.


我认为c:c是lambda,然后尝试使用:https://graph.windows.net/myB2Ctenant.onmicrosoft.com/users?api-version=1.6&$filter=signInNames/any(c:c.value eq 'spottedmahn')


Thinking that c:c is a lambda I then tried: https://graph.windows.net/myB2Ctenant.onmicrosoft.com/users?api-version=1.6&$filter=signInNames/any(c:c.value eq 'spottedmahn')

强制类型转换中的子类型"c.value"不是实体类型.只能对实体类型执行强制转换.

The child type 'c.value' in a cast was not an entity type. Casts can only be performed on entity types.

参考:用户实体

推荐答案

您很亲密.

您必须通过signInNames数组进行过滤,并通过每个数组项的value属性进行匹配:

You must filter by the signInNames array and match by the value property of each array item:

https://graph.windows.net/{tenant}/users?api-version=1.6&$filter=signInNames/any(x:x/value eq '{emailAddressOrUserName}')

这篇关于查询Azure AD图以获取B2C SignInName的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆