Skip to content

spfxsinglesignon.aspx loads msal_browser_v4_min.js instead of msal-redirect-bridge.min.js in Edge popup flow #10874

Description

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

💥 SharePoint Framework

Developer environment

None

What browser(s) / client(s) have you tested

  • 💥 Internet Explorer
  • 💥 Microsoft Edge
  • 💥 Google Chrome
  • 💥 FireFox
  • 💥 Safari
  • mobile (iOS/iPadOS)
  • mobile (Android)
  • not applicable
  • other (enter in the "Additional environment details" area below)

Additional environment details

Browser: Microsoft Edge (latest stable, reproducible consistently)
Browser comparison: Reproducible in Edge, not reproducible in Chrome
SPFx version: 1.23.0
MSAL version: @azure/msal-browser 5.11.x

Describe the bug / error

After upgrading from @azure/msal-browser 3.x to 5.11.x to support SharePoint Online's newer popup authentication bridge, popup authentication works correctly in Chrome but fails in Microsoft Edge.

Authentication itself succeeds, however the popup never completes and remains on spfxsinglesignon.aspx#code=.... The parent page remains in interaction_in_progress.

If the popup is manually closed and the page refreshed, acquireTokenSilent() succeeds, indicating that authentication completed and tokens/accounts were cached successfully.

MSAL Configuration

const msalConfig = {
  auth: {
    clientId: "<client-id>",
    authority: "https://login.microsoftonline.com/<tenant-id>",
    redirectUri: "https://<tenant>.sharepoint.com/_forms/spfxsinglesignon.aspx"
  }
};

Authentication request:

await msalInstance.loginPopup({
  scopes: ["https://<tenant>.sharepoint.com/.default"],
  prompt: "select_account"
});

Reproduction steps
Open SPFx application in Edge.
Call loginPopup().
Select an account in Microsoft login page.
Authentication redirects to:
https://.sharepoint.com/_forms/spfxsinglesignon.aspx#code=...
Popup never closes.
Parent page remains in interaction_in_progress.
Expected behavior

Popup should complete authentication, notify the parent window, close automatically, and return the authentication result.

Actual behavior

Popup remains open indefinitely on:

Relevant Code Snippets

import { PublicClientApplication } from "@azure/msal-browser";

const msalInstance = new PublicClientApplication({
    auth: {
        clientId: "<client-id>",
        authority: "https://login.microsoftonline.com/<tenant-id>",
        redirectUri: "https://<tenant>.sharepoint.com/_forms/spfxsinglesignon.aspx"
    }
});

await msalInstance.initialize();

try {
    const response = await msalInstance.loginPopup({
        scopes: ["https://<tenant>.sharepoint.com/.default"],
        prompt: "select_account"
    });

    console.log(response);
} catch (error) {
    console.error(error);
}


Observed behavior in Edge:

1. Popup opens.
2. User selects account.
3. Authentication succeeds and redirects to:


https://<tenant>.sharepoint.com/_forms/spfxsinglesignon.aspx#code=...


4. Popup remains open indefinitely.
5. Parent page remains in `interaction_in_progress`.

Inside the popup after redirect:


window.opener
// null

window.name
// ""


Network requests show:


/_layouts/15/msal_browser_v4_min.js


loaded instead of:


/_layouts/15/Msal/msal-redirect-bridge.min.js


Manually executing:


dynamicLoadJs(
  '/_layouts/15/Msal/msal-redirect-bridge.min.js',
  function () {
    if (
      typeof msalRedirectBridge !== 'undefined' &&
      typeof msalRedirectBridge.broadcastResponseToMainFrame === 'function'
    ) {
      msalRedirectBridge.broadcastResponseToMainFrame();
    }
  }
);


immediately:

* closes the popup
* returns the authentication result to the parent window
* clears `interaction_in_progress`
* allows the application to continue normally

The same configuration works correctly in Chrome.

The same configuration works correctly in Chrome.`

Metadata

Metadata

Assignees

Labels

area:authCategory: Authentication (Azure AD / etc)sharepoint-developer-supportsharepoint-developer-supporttype:bug-confirmedConfirmed bug, not working as designed / expected.

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions