Skip to content

Update azure/msal-browser#66055

Merged
wtgodbe merged 1 commit into
mainfrom
wtgodbe/azuremsal
Mar 31, 2026
Merged

Update azure/msal-browser#66055
wtgodbe merged 1 commit into
mainfrom
wtgodbe/azuremsal

Conversation

@wtgodbe
Copy link
Copy Markdown
Member

@wtgodbe wtgodbe commented Mar 28, 2026

The 2.x versions of this package are EOL & flagged by CG. Updating to 4.x

@wtgodbe wtgodbe requested a review from javiercn March 28, 2026 04:56
@wtgodbe wtgodbe requested a review from a team as a code owner March 28, 2026 04:56
Copilot AI review requested due to automatic review settings March 28, 2026 04:56
@github-actions github-actions Bot added the area-blazor Includes: Blazor, Razor Components label Mar 28, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the Blazor WebAssembly MSAL interop package to use the supported @azure/msal-browser 4.x line, including the minimal code changes needed to align with msal-browser’s newer initialization and error-code APIs.

Changes:

  • Bump @azure/msal-browser from 2.x to ^4.30.0.
  • Add an explicit MSAL application initialization step (PublicClientApplication.initialize()), awaited during interop init.
  • Update the user-cancelled popup error-code check to the v4 API (BrowserAuthErrorCodes.userCancelled).

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/Components/WebAssembly/Authentication.Msal/src/Interop/package.json Updates the MSAL browser dependency range to 4.x.
src/Components/WebAssembly/Authentication.Msal/src/Interop/AuthenticationService.ts Adds MSAL initialization and updates error-code usage for v4.
package-lock.json Refreshes lockfile entries for @azure/msal-browser/@azure/msal-common to match the new version.

Comment on lines 289 to 292
// If the user explicitly cancelled the pop-up, avoid performing a redirect.
if (this.isMsalError(e) && e.errorCode !== Msal.BrowserAuthErrorMessage.userCancelledError.code) {
if (this.isMsalError(e) && e.errorCode !== Msal.BrowserAuthErrorCodes.userCancelled) {
this.debug('User canceled sign-in pop-up');
this.signInWithRedirect(request);
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

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

The condition here triggers the redirect fallback when the error is not userCancelled, but the log message says the user canceled. This is misleading for diagnostics; consider updating the message to reflect a non-cancel popup failure (e.g., popup blocked) that is causing the redirect fallback.

Copilot uses AI. Check for mistakes.
@wtgodbe wtgodbe merged commit c1a3e7b into main Mar 31, 2026
32 checks passed
@wtgodbe wtgodbe deleted the wtgodbe/azuremsal branch March 31, 2026 03:20
@dotnet-policy-service dotnet-policy-service Bot added this to the 11.0-preview3 milestone Mar 31, 2026
@wtgodbe
Copy link
Copy Markdown
Member Author

wtgodbe commented Apr 2, 2026

/backport to release/10.0

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 2, 2026

Started backporting to release/10.0 (link to workflow run)

@wtgodbe
Copy link
Copy Markdown
Member Author

wtgodbe commented Apr 8, 2026

/backport to release/9.0

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 8, 2026

Started backporting to release/9.0 (link to workflow run)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-blazor Includes: Blazor, Razor Components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants