gpt4 book ai didi

Azure AD B2C 密码重置

转载 作者:行者123 更新时间:2023-12-01 06:52:01 26 4
gpt4 key购买 nike

我正在尝试了解如何使用 Azure AD B2C 密码重置。

似乎有多种方法可以处理密码重置。这些有什么区别呢?这些之间有价格差异吗?其中一些功能是 Azure AD 的功能,而另一些功能是 Azure AD B2C 的功能吗?为什么下面的方法 3 似乎不起作用?

  1. 通过 Azure B2C 用户流(策略)。

    • 登录 v1 的政策转到下面的 AD 密码重置。
    • 虽然所有其他政策都涉及 B2C 密码重置,但允许用户通过存储在用户个人资料中的主电子邮件地址重置密码。
  2. 通过 Azure Active Directory 自助服务密码重置。可通过 https://passwordreset.microsoftonline.com 访问。这允许用户通过个人资料中存储的任何电子邮件地址重置密码。

  3. 用户个人资料上的重置密码按钮。这提供了一个临时密码,但是临时密码似乎不起作用。

最佳答案

#AAD B2C ≠ AAD ===> AAD B2C 用户 ≠ AAD 用户

目前,我们仅支持两种在一般场景下重置 Azure AD B2C 用户密码的方法:

  1. 使用 Azure AD B2C 密码重置策略/用户流程进行自助重置密码 (SSPR)。

  2. 管理员帮助用户使用 Azure AD Graph API 重置密码:https://learn.microsoft.com/en-us/previous-versions/azure/ad/graph/api/users-operations#reset-a-users-password--

您的问题的答案:

What is the difference between these? Is there is a price differencebetween these? Are some of these features of Azure AD, whilst some arefeatures of Azure AD B2C?

  • 密码重置政策/用户流程适用于 AAD B2C 用户。您可以直接使用它。 AAD B2C 用户可以使用它自行重置密码。它也是 SSPR 的一种。

  • Azure Active Directory 自助服务密码重置。一般来说,它是针对企业用户的。如this feature仅适用于 V1 登录用户流程,我不建议您使用这种方式。

  • 用户个人资料上的重置密码按钮。仅适用于 AAD(组织/企业)用户。 AAD B2C 用户请勿使用此按钮。

Why does method 3 below not appear to work?

正如我在上面提到的,此功能仅适用于 Azure AD 用户。不是 AAD B2C 用户。因此,您无法在此处重置B2C用户的密码。

正如 Alex 所说,AAD B2C 用户不是 Azure AD 用户。 B2C用户适用于2c场景。普通 Azure AD 用户适用于组织/企业场景。

您也可以引用我对What's the difference between Azure AD B2C tenant and normal Azure AD tenant?的回答

<小时/>

有关 B2C 密码重置策略如何运作的更多信息:

  • 点击“注册/加入”策略中的“忘记密码”按钮后,AAD B2C 将向应用程序发送一条包含“AADB2C90118”的消息。

  • 例如,在 ASP.NET MVC Web App 中,那么它应该挑战

private Task OnAuthenticationFailed(AuthenticationFailedNotification<OpenIdConnectMessage, OpenIdConnectAuthenticationOptions> notification)
{
notification.HandleResponse();
// Handle the error code that Azure AD B2C throws when trying to reset a password from the login page
// because password reset is not supported by a "sign-up or sign-in policy"
if (notification.ProtocolMessage.ErrorDescription != null && notification.ProtocolMessage.ErrorDescription.Contains("AADB2C90118"))
{
// If the user clicked the reset password link, redirect to the reset password route
notification.Response.Redirect("/Account/ResetPassword");
}
}
  • 这意味着应用程序收到此消息后会将其重定向到/Account/ResetPassword

  • /Account/ResetPassword 是在帐户 Controller 中定义的。应根据您定义的密码重置策略名称来确定。

public void ResetPassword()
{
// Let the middleware know you are trying to use the reset password policy (see OnRedirectToIdentityProvider in Startup.Auth.cs)
HttpContext.GetOwinContext().Set("Policy", Startup.ResetPasswordPolicyId);

// Set the page to redirect to after changing passwords
var authenticationProperties = new AuthenticationProperties { RedirectUri = "/" };
HttpContext.GetOwinContext().Authentication.Challenge(authenticationProperties);

return;
}
  • 然后,用户将被重定向到 B2C 密码重置政策以更改其密码。

关于Azure AD B2C 密码重置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54787974/

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