相关疑难解决方法(0)

通过电子邮件地址查找用户

我正在尝试查找我的Azure AD B2C目录中是否已经使用了电子邮件地址.

var token = await this.GetTokenAsync();

var client = new HttpClient();

var id = HttpUtility.UrlEncode("adrian_mydomain.com#EXT#@xxxxxxxxx.onmicrosoft.com");
////var id = HttpUtility.UrlEncode("adrian@mydomain.com"); // This also fails.
////var id = HttpUtility.UrlEncode("adrian_mydomain.com#EXT#"); // This also fails.
////var id = "xxxx-xxxx-xxxxxxxx-xxxxxxxxxx"; // This also fails (user object id).

var resource = $"{this.graphConfig.GraphUri}/{this.graphConfig.Tenant}/users/{id}?api-version=1.6";
//// This line below works, it returns all the users, so I do know the token is good and the resource URI is valid, etc.
////var resource = $"{this.graphConfig.GraphUri}/{this.graphConfig.Tenant}/users?api-version=1.6";

var request = …
Run Code Online (Sandbox Code Playgroud)

azure azure-ad-graph-api azure-ad-b2c

6
推荐指数
3
解决办法
5714
查看次数

标签 统计

azure ×1

azure-ad-b2c ×1

azure-ad-graph-api ×1