【问题标题】:How to reset password on Azure AD B2C user account using MSAL C#, .net core?如何使用 MSAL C#、.net 核心重置 Azure AD B2C 用户帐户的密码?
【发布时间】:2021-03-19 09:03:47
【问题描述】:

是否可以重置在我的 b2c 租户上创建的用户密码?

试图在https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-overview 的文档中找到一些东西,但我找不到。也许我是盲人,所以有人能指出怎么做吗?

【问题讨论】:

    标签: c# azure .net-core azure-ad-b2c msal


    【解决方案1】:

    您可以使用this Microsoft Graph API重置密码。

    更新 passwordProfile 属性时,需要以下权限:Directory.AccessAsUser.All

    GraphServiceClient graphClient = new GraphServiceClient( authProvider );
    
    var user = new User
    {
        BusinessPhones = new List<String>()
        {
            "+1 425 555 0109"
        },
        OfficeLocation = "18/2111"
    };
    
    // If authorize without user, you need to add application permission. graphClient.Users[user-object-id].Request().UpdateAsync(user);
    await graphClient.Me
        .Request()
        .UpdateAsync(user);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-07-27
      • 2019-08-26
      • 2019-01-29
      • 1970-01-01
      • 2019-07-14
      • 1970-01-01
      • 2018-04-29
      • 2020-04-15
      相关资源
      最近更新 更多