How do I make 'forgot password' working in react-aad-msal with Azure AD B2C?

笑着哭i 提交于 2019-12-01 22:03:57

What I did was create a Route in my App.js:

          <Route
            path="/forgot"
            component={() => {
              window.location.href = forgotPasswordUrl;
              return null;
            }}
          />

Then, in the constructor

if (window.location.hash.indexOf('AADB2C90118') >= 0) {
  history.push('/forgot');
}

And that works.

Tony Ju

When using a combined sign-up/sign-in policy in Azure B2C, users have to handle the forgot password scenario themselves. You can find more detailed comments here.

A sign-up or sign-in user flow with local accounts includes a "Forgot password?" link on the first page of the experience. Clicking this link doesn't automatically trigger a password reset user flow.

Instead, the error code AADB2C90118 is returned to your application. Your application needs to handle this error code by running a specific user flow that resets the password. To see an example, take a look at a simple ASP.NET sample that demonstrates the linking of user flows.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!