Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[msal-browser] Fix state mismatch error due to encoding #2049

Merged
merged 4 commits into from
Jul 30, 2020

Conversation

jo-arroyo
Copy link
Collaborator

@jo-arroyo jo-arroyo commented Jul 28, 2020

It appears that the state that is returned from the server is being mutated by their base64 encoding mechanism, which is different to our encoding mechanism, causing a state mismatch error. This PR attempts to provide a temporary solution by decoding the state strings before comparing the response state and cached state. More investigation and communication with the server team may be necessary to figure out why this mutation occurs.

This PR addresses issue #2019 .

@github-actions github-actions bot added the msal-common Related to msal-common package label Jul 28, 2020
@coveralls
Copy link

coveralls commented Jul 28, 2020

Coverage Status

Coverage increased (+0.1%) to 81.831% when pulling 565b3de on browser-state-mismatch-fix into cb65fd9 on dev.

Copy link
Member

@sameerag sameerag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm. Please ensure follow up with the server to align on encoding mechanisms.

@mzguimaraes
Copy link

Hi all, it appears that this PR will fix an issue my team is currently having with MSAL. We're not sure what sort of release cadence you are planning for with 2.0. What sort of timeline should we expect for when this fix will be available through NPM?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
msal-common Related to msal-common package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

login error 'state_mismatch: State mismatch error' with msal-browser
6 participants