Skip to content

Changed popup behavior with v5? #8325

@rhegner

Description

@rhegner

Core Library

MSAL.js (@azure/msal-browser)

Core Library Version

5.2.0

Wrapper Library

MSAL Angular (@azure/msal-angular)

Wrapper Library Version

5.0.4

Public or Confidential Client?

Public

Description

In my code I'm using MsalService.loginPopup().

With @azure/msal-angular 4.0.26, the popup closed automatically after logging in.

With @azure/msal-angular 5.0.4 the popup stays open and shows the redirect page, which is undesirable, at least in my case.

Is this by design? Or is this a bug? (Maybe related somehow internally related to #8316 ?)

Error Message

No response

MSAL Logs

No response

Network Trace (Preferrably Fiddler)

  • Sent
  • Pending

MSAL Configuration

{
        provide: MSAL_INSTANCE,
        useValue: new PublicClientApplication({  // MSAL Configuration
          auth: {
            clientId: runtimeConfig.msalClientId,
            authority: runtimeConfig.msalAuthority,
            redirectUri: runtimeConfig.inventoryBaseUrl + '/dashboard'
          },
          cache: {
            cacheLocation: BrowserCacheLocation.LocalStorage
          },
          system: {
            loggerOptions: {
              loggerCallback: (_level, message, _pii) => console.log(message),
              logLevel: LogLevel.Warning,
              piiLoggingEnabled: false
            }
          }
        })
      },
      {
        provide: MSAL_GUARD_CONFIG,
        useValue: {
          interactionType: InteractionType.Popup
        } as MsalGuardConfiguration,
      },
      {
        provide: MSAL_INTERCEPTOR_CONFIG,
        useValue: {
          interactionType: InteractionType.Popup,
          protectedResourceMap: new Map()
        } as MsalInterceptorConfiguration,
      }

Relevant Code Snippets

const authResponse = await firstValueFrom(this.msalService.loginPopup({ scopes: this.msalScopes }));

Reproduction Steps

  1. Use loginPopup() with v4
  2. Use loginPopup() with v5
  3. Observe difference

Expected Behavior

Popup closing after login instead of loading/showing redirect URL.

Identity Provider

Entra ID (formerly Azure AD) / MSA

Browsers Affected (Select all that apply)

Chrome

Regression

@azure/msal-angular 4.0.26

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type
    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