简体   繁体   English

Azure B2C - 自定义策略 - 密码更改

[英]Azure B2C - Custom Policy - Password Change

I have a B2C tenant setup using the oob sign-up/sign-in user flow working fine.我有一个 B2C 租户设置,使用 oob 注册/登录用户流程工作正常。 I have also implemented a custom policy to allow the user to change their password when they are already signed in to our application according to this article .我还实施了一个自定义策略,允许用户在已经根据这篇文章登录到我们的应用程序时更改他们的密码。

When testing, if I directly navigate to the custom policy endpoint, it first prompts me to sign-in and then takes me to the password change form which works fine.测试时,如果我直接导航到自定义策略端点,它会首先提示我登录,然后将我带到密码更改表单,该表单工作正常。 However, in our case since the user is already signed in to our application, we would like to bypass the sign-in form and take the user directly to the password change form.然而,在我们的例子中,由于用户已经登录到我们的应用程序,我们希望绕过登录表单,直接将用户带到密码更改表单。 According to this article I can remove the prompt=login in the url and it should bypass the sign-in form if the user is already signed in.根据这篇文章,我可以删除 url 中的prompt=login ,如果用户已经登录,它应该绕过登录表单。

To test this, I first login to my app using the signup/signin user flow and then invoke the custom policy url in the same browser tab session without the prompt=login .为了对此进行测试,我首先使用注册/登录用户流程登录到我的应用程序,然后在同一浏览器选项卡 session 中调用自定义策略 url 而无需prompt=login It does take me directly to the password change form, however, I get the following error when I try to change the password:它确实将我直接带到密码更改表单,但是,当我尝试更改密码时出现以下错误:

Invalid username or password无效的用户名或密码

I have confirmed that I am entering the correct current password.我已确认我正在输入正确的当前密码。 How can I troubleshoot this and where might the issue be?我该如何解决这个问题以及问题出在哪里?

Thanks, Param谢谢,参数

This is typical of incorrect setup of custom policies.这是自定义策略设置不正确的典型表现。

Delete the two app registrations: ProxyIEF and IEF apps.删除两个应用程序注册:ProxyIEF 和 IEF 应用程序。

Run the tool to set it up for you: https://aka.ms/iefsetup .运行该工具为您进行设置: https://aka.ms/iefsetup

Test sign in works with the custom policy.测试登录适用于自定义策略。

Then follow the document you linked again to setup the password change flow.然后再次按照您链接的文档设置密码更改流程。 You can download the polices back from the Portal to work with.您可以从门户下载策略以供使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM