No_cached_authority_error MSAL v2

Mikhail Delly 126 Reputation points
2021-10-12T14:25:11.227+00:00

Libraries

  • MSAL:

"@azure/msal-browser": "^2.15.0",
"@azure/msal-react": "^1.0.1",

  • B2C custom Policies:
    1. Update user profile
    2. Change user password
    3. SignIn

Description

The

"no_cached_authority_error"

throws sometimes especially when the site is kept open in the browser for the long period of time (but not only in this case) .
It displayed after redirecting to the homepage when user enters valid login credentials and click sign in button (SignIn b2c custom policy).
So it will happen when the whole b2c login process is passed successfully.

139875-image.png

After getting this error the homepage could be reloaded without any errors, user logged in successfully.

139779-image.png

139883-image.png

The same issue could happen after changing user password or user profile via another b2c policies.
So also will happen when the whole b2c policy process is passed successfully.

139922-image.png

139921-image.png

Server:

"http://localhost:3000"

Reproduction Steps

Occurs randomly during signing in, changing password or changing email using b2c policies after redirecting to the homepage

The investigation is complicated by the fact that this problem is reproduced every other time.

Maybe someone faced a similar problem?

Microsoft Entra
{count} vote

2 answers

Sort by: Most helpful
  1. Alejandro Lopez 1 Reputation point
    2021-11-23T22:41:21.22+00:00

    Yes, I am having the same issue and it is pretty annoying.

    0 comments No comments

  2. Hardik Chaudhary 1 Reputation point
    2022-06-28T08:15:01.427+00:00

    I am facing the same issue