-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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-react seems not to be React 18 compliant #5277
Comments
A potential root cause could come from the behavior of the useEffect hook when using a Strict Mode in React 18:
Hope it will help... |
@vherilier We haven't seen this issue with our React apps running on React 18. Are you able to provide your configuration and usage above? Specifically, where you are providing the redirectUri. |
@jo-arroyo I'm quite following the example provided from Azure about SPA. for msal configuration:
with |
@jo-arroyo : btw I'm using react-redux |
@vherilier Are you also able to send verbose level logs? |
@jo-arroyo Here's the requested logs file I could extract by msal-react-18_1665134410086.log I hope it will help in understanding the difference experienced between your React |
@vherilier Thanks for sharing your app. Two things I'm noticing:
|
@tnorling Thanks for your feedbacks and suggestions. |
@tnorling providing explicitly redirect URIs solves the issue. Thanks for double checking the code and for your suggestions. |
Core Library
MSAL.js v2 (@azure/msal-browser)
Core Library Version
2.28.3
Wrapper Library
MSAL React (@azure/msal-react)
Wrapper Library Version
1.4.7
Public or Confidential Client?
Public
Description
Hi ,
Switching React from 17.0.2 to 18.2.0, the msal authentication process stops now to show an error message on screen when the related app is "called" in the browser.
After having the error returned, rewriting the calling URL of the app once again leads finally to the app.
Reverting React to 17's version is solving the issue.
Thanks in advance for your support
Error Message
on the browser screen, the process stops and shows this error:
Request Id: 53d9342b-7c94-4c98-90a7-447254597200
Correlation Id: c75471e3-954b-4b43-9ac2-a3c9bf75c985
Timestamp: 2022-10-04T15:42:44Z
Message: AADSTS50011: The redirect URI 'http://localhost:3000/#code=0.AS0AYSBbEGm2MUuSrCTTBNGV3LQFRGpvFsRFtDWJEdxBGGYtAMs.AgABAAIAAAD--DLA3VO7QrddgJg7WevrAgDs_wQA9P_wg8k--6oCcOfaxld9i3oEKoJ49KjS0BozT0YBN3a7rFCIZi83kt3v-x5SeOgSS3PQyjHL6sOdDF5mDprdNAjd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05YWM3LTEwODYwY2E3NmE0MCIsIm1ldGEiOnsiaW50ZXJhY3Rpb25UeXBlIjoicmVkaXJlY3QifX0%3d&session_state=76e6846a-6d8c-4841-93bc-8d169f04688a' specified in the request does not match the redirect URIs configured for the application '6a4405b4-166f-45c4-b435-8911dc411866'. Make sure the redirect URI sent in the request matches one added to your application in the Azure portal. Navigate to https://aka.ms/redirectUriMismatchError to learn more about how to fix this.
Msal Logs
no msal logs returned at this step.
MSAL Configuration
Relevant Code Snippets
Reproduction Steps
Expected Behavior
The authentication may not stop and lead to the app.
Identity Provider
Azure B2C Basic Policy
Browsers Affected (Select all that apply)
Chrome, Firefox, Edge, Internet Explorer
Regression
react 17.0.2
Source
External (Customer)
The text was updated successfully, but these errors were encountered: