Core Library
MSAL.js (@azure/msal-browser)
Core Library Version
5.6.1
Wrapper Library
MSAL Angular (@azure/msal-angular)
Wrapper Library Version
None
Public or Confidential Client?
Confidential
Description
Recently, we have migrated to 5.x and using msal-browser (5.6.1) version. We have implemented redirect bridge to handle popup communication as per COOP requirements.
When user clicks on sign in and on popup is opened, if user cancel it there is no updates post through event callback and sign in flow is blocked as interaction status is still in progress.
It takes more than 60s and ends up in the timeout error.
Is there alternate option to handle this scenario with v5.x while following COOP requirements? Am I missing anything her
Error Message
Error Message: Uncaught (in promise) BrowserAuthError: timed_out: See https://aka.ms/msal.js.errors#timed_out for details
Stack trace Details:
BrowserAuthError: timed_out
at BrowserAuthError.createMonitorWindowTimeoutError
at PopupHandler.monitorPopupForHash
(PopupHandler.ts)
at PopupClient.acquireTokenPopupAsync
(PopupClient.ts)
at StandardInteractionClient.acquireToken
(StandardInteractionClient.ts)
at PublicClientApplication.acquireTokenPopup
(PublicClientApplication.ts)
at PublicClientApplication.loginPopup
(PublicClientApplication.ts)
MSAL Logs
No response
Network Trace (Preferrably Fiddler)
MSAL Configuration
{
auth: {
clientId: '',
authority: 'https://login.microsoftonline.com/common/',
redirectUri: '<domain>/redirect',
},
cache: {
cacheLocation: BrowserCacheLocation.LocalStorage
}
Relevant Code Snippets
private async runAuthExclusive<T>(fn: () => Promise<T>): Promise<T> {
if (this.pendingAuth) {
try { await this.pendingAuth; } catch { }
}
const p = fn();
this.pendingAuth = p;
try {
return await p;
} finally {
if (this.pendingAuth === p) this.pendingAuth = null;
}
}
public async signIn(authParams: any) {
return this.runAuthExclusive(async () => {
try {
const response = await this.msalInstance.loginPopup({
...authParams,
prompt: authParams.prompt ?? "select_account",
redirectUri: this.getPopupRedirectUri()
});
if (response?.account) {
this.setCurrentAccount(response.account);
}
} catch (e: any) {
if (e instanceof BrowserAuthError && e.errorCode === "popup_window_error") {
await this.msalInstance.loginRedirect({
...authParams,
prompt: authParams.prompt ?? "select_account",
redirectUri: this.getRedirectUri(),
redirectStartPage: window.location.href
});
return;
}
throw e;
}
});
}
Reproduction Steps
- Load UHF Me control on the page.
- Set Me Control Configuration and pass signIn.bind(authModule) instance to me control config.
- Set other configuration settings for MeControl as needed.
- Run the application.
Expected Behavior
On Pop up close by user, there should an immediate updates to the caller/parent window or an event update to perform other operations like clear popup settings and unblock sign in flow UI interaction.
Identity Provider
Entra ID (formerly Azure AD) / MSA
Browsers Affected (Select all that apply)
Chrome, Edge, Firefox
Regression
@azure/msal-browser(3.x)
Core Library
MSAL.js (@azure/msal-browser)
Core Library Version
5.6.1
Wrapper Library
MSAL Angular (@azure/msal-angular)
Wrapper Library Version
None
Public or Confidential Client?
Confidential
Description
Recently, we have migrated to 5.x and using msal-browser (5.6.1) version. We have implemented redirect bridge to handle popup communication as per COOP requirements.
When user clicks on sign in and on popup is opened, if user cancel it there is no updates post through event callback and sign in flow is blocked as interaction status is still in progress.
It takes more than 60s and ends up in the timeout error.
Is there alternate option to handle this scenario with v5.x while following COOP requirements? Am I missing anything her
Error Message
Error Message: Uncaught (in promise) BrowserAuthError: timed_out: See https://aka.ms/msal.js.errors#timed_out for details
Stack trace Details:
BrowserAuthError: timed_out
at BrowserAuthError.createMonitorWindowTimeoutError
at PopupHandler.monitorPopupForHash
(PopupHandler.ts)
at PopupClient.acquireTokenPopupAsync
(PopupClient.ts)
at StandardInteractionClient.acquireToken
(StandardInteractionClient.ts)
at PublicClientApplication.acquireTokenPopup
(PublicClientApplication.ts)
at PublicClientApplication.loginPopup
(PublicClientApplication.ts)
MSAL Logs
No response
Network Trace (Preferrably Fiddler)
MSAL Configuration
Relevant Code Snippets
Reproduction Steps
Expected Behavior
On Pop up close by user, there should an immediate updates to the caller/parent window or an event update to perform other operations like clear popup settings and unblock sign in flow UI interaction.
Identity Provider
Entra ID (formerly Azure AD) / MSA
Browsers Affected (Select all that apply)
Chrome, Edge, Firefox
Regression
@azure/msal-browser(3.x)