question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AuthError: Unexpected error in authentication.: Hash does not contain state.

See original GitHub issue

I’m submitting a…


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Other... Please describe:

Browser:

  • Chrome version XX
  • Firefox version XX
  • IE version XX
  • Edge version XX
  • Safari version XX

Library version

1.0.0

Current behavior

Steps to reproduce.

  1. Attempt a B2C login flow using loginRedirect
  2. When asked to log in, click “reset password” (This will redirect back to the SPA)
  3. Catch the AuthError (AADB2C90118) and redirect the user to the password reset flow
  4. Click “cancel” on the password reset flow. (This redirects back to the SPA)

now calling new UserAgentApplication(config) will error with the message:

AuthError: Unexpected error in authentication.: Hash does not contain state.

At this point you can’t recover. Even if you catch the error, clear session storage, and try to call new UserAgentApplication(config) it will still error again.

Expected behavior

After redirecting back to the SPA after the user clicks “cancel” msal should trigger your errorReceivedCallback and give it an error that can be recovered from.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:12
  • Comments:24 (4 by maintainers)

github_iconTop GitHub Comments

10reactions
StefanChristoucommented, Apr 1, 2020

Please re-open this issue. Getting the same problem, setting storeAuthStateInCookie to true does not resolve the problem.

7reactions
kaytripcommented, Mar 17, 2020

Same issue here with Google Chrome (build 80.0.3987.122). Regular login works, but when using a custom Sign Up policy we receive the AuthError: Unexpected error in authentication.: Hash does not contain state. error.

Read more comments on GitHub >

github_iconTop Results From Across the Web

azure ad b2c - Error in Angular MSAL AuthError: Unexpected ...
ERROR AuthError : Unexpected error in authentication.: Hash does not contain state. My b2C config looks exactly like this in sample. Any ...
Read more >
Hash does not contain state - Blazor Forums
Blazor MSAL Auntentication library error “Unexpected error in authentication.: Hash does not contain state”. Posted 2 years ago by preetiislur.
Read more >
BrowserAuthError | microsoft-authentication-libraries-for-js
Creates an error thrown when the state value in the hash does not match the interaction type of the API attempting to consume...
Read more >
Configure third party OAuth IdP authentication - Microsoft Learn
In this article, learn Teams authentication tabs Microsoft Azure AD, ... else { // Unexpected condition: hash does not contain error or ...
Read more >
Job 6 | lib/msal-browser/src/error/BrowserAuthError.ts | Coveralls
1 /* 3 * Licensed under the MIT License. 4 */ 6 import from "@azure/msal‑common" 17×
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found