我使用以下代码从
Azure AD
检索用户。我想检索 authentication\emailmethods
和 email address
。我按照此页面所述设置了 API 权限。尽管我在查询中有 authentication
,但 API 调用会返回 null
进行身份验证。
我应该在查询中指定什么来返回
authentication\emailmethods
的值?
var users = await graphServiceClient.Users.GetAsync((requestConfiguration) =>
{
requestConfiguration.QueryParameters.Select = new string[]
{
"displayName",
"id",
"givenName",
"surName",
"streetAddress",
"city",
"state",
"postalCode",
"country",
"userPrincipalName",
"authentication"
};
});
您无法检索所有用户的身份验证详细信息。您需要为每个用户单独调用。
var result = await graphServiceClient
.Users["{user_id}"]
.Authentication.EmailMethods.GetAsync();
其他要求是有
UserAuthenticationMethod.Read.All
许可
对于管理员对另一用户执行操作的委派方案,管理员需要以下 Azure AD 角色之一。