Skip to content

SilentSSO in v5 swallow errors #8381

@h3rmanj

Description

@h3rmanj

Core Library

MSAL.js (@azure/msal-browser)

Core Library Version

5.4.0

Wrapper Library

MSAL React (@azure/msal-react)

Wrapper Library Version

5.0.6

Public or Confidential Client?

Public

Description

Using InteractionType.Silent with <MsalAuthenticationTemplate> or useMsalAuthentication() swallows errors.

By adding an event callback with addEventCallback, I can see the instance still emits the error events, but the component and hook never registers it. It's stuck in a limbo state, not showing loadingComponent, errorComponent or children.

This also seems to specifically happen on localhost.

Error Message

No response

MSAL Logs

No response

Network Trace (Preferrably Fiddler)

  • Sent
  • Pending

MSAL Configuration

const instance = new PublicClientApplication({
	auth: {
		clientId: import.meta.env.VITE_MSAL_CLIENT_ID,
		authority: import.meta.env.VITE_MSAL_AUTHORITY,
		redirectUri: `${window.location.origin}/redirect`,
	},
});

Relevant Code Snippets

https://github.com/h3rmanj/msal-silent-repro

Reproduction Steps

See the reproduction repository README.

Expected Behavior

We get an authenticationResult with the error properly set.

Identity Provider

Entra ID (formerly Azure AD) / MSA

Browsers Affected (Select all that apply)

Chrome, Firefox, Edge, Safari, Other

Regression

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug-unconfirmedA reported bug that needs to be investigated and confirmedmsal-browserRelated to msal-browser packagemsal-reactRelated to @azure/msal-reactpublic-clientIssues regarding PublicClientApplicationsquestionCustomer is asking for a clarification, use case or information.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions