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

标签 azure azure-active-directory azure-ad-b2c

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

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

最佳答案

这可以通过 MS Graph API 实现,

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

credentialUserRegistrationDetails help us to get the details of the usage 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/

相关文章:

Azure 事件目录 B2C : Use conditional User Flow for Sign In based on Application Claim

.net - 如何触发 native Multi-Tenancy 应用程序的管理员同意流程?

c# - 如何从引用的 nuget 包加载 azure 事件函数

azure - azure 表中的逻辑表设计

同一应用程序中的 Azure AD B2B 和 B2C

azure-active-directory - JetBrains DataGrip - Azure SQL - 与 Active Directory 连接 - 密码

authentication - 如何在 Azure AD 身份验证后重定向到 ASP Net Core MVC 中的不同 Controller 操作

azure - 更新刷新 token 生命周期 Azure AD B2C 用户流是否会使当前刷新 token 过期

azure - 将 JSON 数据行转换为列

node.js - Azure AD B2C (NodeJS) : Unauthorized 401 error for a request with a valid token