Azure AD B2C密码重置链接不起作用 [英] Azure AD B2C password reset link doesn't work

查看:74
本文介绍了Azure AD B2C密码重置链接不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

顺便说一句,我希望我在Azure B2C上所做的每一步都不需要遍历stackoverflow.感谢上帝,它在这里.反正....

As an aside, I wish that every move I make on Azure B2C did not require a trip to stackoverflow. Thank God it's here. Anyway....

我已经故意使用与另一个帖子非常相似的标题,因为它已经被回答了,但我不理解.

I have intentionally used a very similar title as another post as it has been answered but I do not understand it.

我希望为我的用户提供一个重置策略,因此请按照文章中的演练进行操作:

I wish to offer a reset policy to my users so have followed walk-through in the post:

启用自助服务密码

我正在使用注册/登录"策略,因此出现错误.我回到这个StackOverflow帖子,并在这篇文章中指出原因:

I am using Signup/SignIn policy, so I get an error. I go back to this StackOverflow post and I identify why in this post:

密码重置无效

这是因为注册/登录政策:这要求应用程序做一些额外的工作."

It is because of the "Sign-up/sign-in Policy: This requires the application to do some extra work."

足够好...但是我将重定向代码准确地放在哪里?

Fair enough... but where exactly do I put this redirect code kindly explained in the post???

推荐答案

您的 AuthenticationFailed 处理程序-通常在 Startup.Auth.cs 中:

In the code example from the answer in Azure AD B2C self service password reset link doesn't work, you need to put the check for error code "AADB2C90118" in your AuthenticationFailed handler - which is typically in Startup.Auth.cs:

在示例中,处理程序会将用户重定向到"/Account/ResetPassword" ,该代码指示 AccountController 中的 ResetPassword 方法,,则提出身份验证挑战,以将用户重定向到您的密码重置B2C策略.(只要您在 AuthenticationHandler 中适当地更新了重定向,就可以将这段代码移动到您喜欢的控制器上.)

In the example, the handler will redirect the user to "/Account/ResetPassword" which indicates the ResetPassword method in the AccountController which, in turn, presents an auth challenge to redirect the user to your password reset B2C policy. (You could move this code to which ever controller you like as long as you update the redirect in AuthenticationHandler appropriately.)

这篇关于Azure AD B2C密码重置链接不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆