gpt4 book ai didi

Azure AD B2C Graph API 检索用户是否具有 MFA

转载 作者:行者123 更新时间:2023-12-03 02:31:51 27 4
gpt4 key购买 nike

我想使用 Azure Graph API 来检索给定用户(如果该用户具有 MFA 设置)。我在 API 文档中找不到此信息,但它似乎是您想要检索的内容。

你们中有人知道这是否可能吗?如果可以,如何实现?

最佳答案

这可以通过 MS Graph API 实现,

要获取已注册和未注册 MFA 的用户信息,我们可以使用 credentialUserRegistrationDetails 中的 isMfaRegistered 属性.

credentialUserRegistrationDetails help us to get the details of theusage of self-service password reset and multi-factor authentication(MFA) for all registered users. Details include user information,status of registration, and the authentication method used.This is possible programmatically with MS Graph where you will get a JSON reports an can be plugged into other reports or can be represented programmatically itself

示例:

GET https://graph.microsoft.com/beta/reports/credentialUserRegistrationDetails

示例输出:

{
"id": "****************************",
"userPrincipalName": "<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f1bfbaa2b19f988299909f8582989f9699df9d988794" rel="noreferrer noopener nofollow">[email protected]</a>",
"userDisplayName": "Nishant Singh",
"isRegistered": false,
"isEnabled": true,
"isCapable": false,
"isMfaRegistered": true,
"authMethods": [
"mobilePhone"
]
}

用 C# 编写的示例代码,

 GraphServiceClient graphClient = new GraphServiceClient( authProvider );

var credentialUserRegistrationDetails = await
graphClient.Reports.CredentialUserRegistrationDetails
.Request()
.GetAsync();

关于Azure AD B2C Graph API 检索用户是否具有 MFA,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64753245/

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