Auth code grant stuck on authorization code
See original GitHub issueCore Library
MSAL.js v2 (@azure/msal-browser)
Core Library Version
2.23.0
Wrapper Library
MSAL React (@azure/msal-react)
Wrapper Library Version
1.3.2
Description
We have been using this same Aure app registration, redirect, etc for over 2 years without any issues but over the past few days, our auth flow has been failing. To eliminate application errors I followed the code demo in the documentation and got the same issue described below:
- The user is prompted to enter their email in popup
- User is redirected to the login page in popup
- The auth code is seen coming back in the URL
Auth flow simply stalls here. No errors, no prompts, no pending requests. Code is taken directly from the tutorial here: https://docs.microsoft.com/en-us/azure/active-directory/develop/tutorial-v2-react
Error Message
No response
Msal Logs
SAL AUTH LOGGING] [Mon, 25 Apr 2022 03:03:48 GMT] : @azure/msal-browser@2.23.0 : Info - Emitting event: msal:handleRedirectStart authConfig.js:17 [MSAL AUTH LOGGING] [Mon, 25 Apr 2022 03:03:48 GMT] : [06f236fd-cf44-475d-b2c1-46e095a4b4f5] : msal.js.browser@2.23.0 : Info - handleRedirectPromise called but there is no interaction in progress, returning null. 2authConfig.js:17 [MSAL AUTH LOGGING] [Mon, 25 Apr 2022 03:03:48 GMT] : @azure/msal-react@1.3.2 : Info - MsalProvider - msal:handleRedirectStart results in setting inProgress from startup to handleRedirect authConfig.js:17 [MSAL AUTH LOGGING] [Mon, 25 Apr 2022 03:03:48 GMT] : @azure/msal-browser@2.23.0 : Info - Emitting event: msal:handleRedirectEnd 2authConfig.js:17 [MSAL AUTH LOGGING] [Mon, 25 Apr 2022 03:03:48 GMT] : @azure/msal-react@1.3.2 : Info - MsalProvider - msal:handleRedirectEnd results in setting inProgress from handleRedirect to none authConfig.js:17 [MSAL AUTH LOGGING] [Mon, 25 Apr 2022 03:03:56 GMT] : @azure/msal-browser@2.23.0 : Info - Emitting event: msal:loginStart authConfig.js:17 [MSAL AUTH LOGGING] [Mon, 25 Apr 2022 03:03:56 GMT] : @azure/msal-react@1.3.2 : Info - MsalProvider - msal:loginStart results in setting inProgress from none to login authConfig.js:17 [MSAL AUTH LOGGING] [Mon, 25 Apr 2022 03:03:56 GMT] : @azure/msal-react@1.3.2 : Info - MsalProvider - msal:loginStart results in setting inProgress from none to login authConfig.js:17 [MSAL AUTH LOGGING] [Mon, 25 Apr 2022 03:03:56 GMT] : @azure/msal-browser@2.23.0 : Info - Emitting event: msal:popupOpened
MSAL Configuration
{
auth: {
clientId: "<clientId>",
authority: "https://login.microsoftonline.com/<tenentId>", // This is a URL (e.g. https://login.microsoftonline.com/{your tenant ID})
redirectUri: "<redirectUrl>/redirect.html",
},
cache: {
cacheLocation: "sessionStorage", // This configures where your cache will be stored
storeAuthStateInCookie: false, // Set this to "true" if you are having issues on IE11 or Edge
}
}
Relevant Code Snippets
import { useMsal } from "@azure/msal-react";
function handleLogin(instance) {
instance.loginPopup(loginRequest).catch(e => {
console.error(e);
});
}
Reproduction Steps
- build out sample app from tutorial
- plug in relevant msal config info
- click login button
- observe auth flow stall in popup on code return
Expected Behavior
Auth flow completes, tokens are retrieved and set in sessionStorage
Identity Provider
Azure AD / MSA
Browsers Affected (Select all that apply)
Chrome
Regression
No response
Source
External (Customer)
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
Apologies for the delayed follow up. Dug into this an found it was a conflict in a minor version of react-router. Not sure which one, needed to get a fix out so I pinned it to the lowest minor version. Try taking the caret out of your dependencies list for react-router-dom and related dependancies.
Thanks, closing the issue.