Accepted answer

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

            component={() => {
              window.location.href = forgotPasswordUrl;
              return null;

Then, in the constructor

if (window.location.hash.indexOf('AADB2C90118') >= 0) {

And that works.


Using msal-react and msal-browser I was able to get the Azure AD B2C password reset page to appear using the following code (assuming you created a password reset user flow named B2C_1_RESET):

import { useMsal } from "@azure/msal-react";
import { EventType } from '@azure/msal-browser';


const { instance, inProgress, accounts } = useMsal();

// MSAL Logging
//instance.setLogger(new Logger(loggerCallback));

const callbackId = instance.addEventCallback((message) => {
    if (message.eventType === EventType.LOGIN_FAILURE){
      if (message.error.errorMessage.includes("AADB2C90118")) { // The user has forgotten their password.
        const authority = "https://<your_domain>";
        instance.loginRedirect({authority: authority})


Credit to Ian for the hint.

You should add an extra condition in case the user cancels their attempt to change reset their account credentials. This way they are redirected back to login instead of getting stuck on your app.

import { useMsal } from "@azure/msal-react";

export default MyComponent = () => {

// other code

const { instance, accounts, inProgress } = useMsal();

instance.addEventCallback((message: any) => {
    if (message.eventType === EventType.LOGIN_FAILURE && message.error.errorMessage.includes("AADB2C90118")) {
      // The user has forgotten their password.
    } else if (message.eventType === EventType.HANDLE_REDIRECT_END && inProgress === InteractionStatus.None) {

// rest of component



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.

Related Query

More Query from same tag