Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interaction in progress error caused by other apps #7472

Open
2 tasks
ruw321 opened this issue Dec 18, 2024 · 0 comments
Open
2 tasks

Interaction in progress error caused by other apps #7472

ruw321 opened this issue Dec 18, 2024 · 0 comments
Labels
b2c Related to Azure B2C library-specific issues bug-unconfirmed A reported bug that needs to be investigated and confirmed msal-angular Related to @azure/msal-angular package msal-browser Related to msal-browser package Needs: Attention 👋 Awaiting response from the MSAL.js team public-client Issues regarding PublicClientApplications question Customer is asking for a clarification, use case or information.

Comments

@ruw321
Copy link

ruw321 commented Dec 18, 2024

Core Library

MSAL.js (@azure/msal-browser)

Core Library Version

3.26.1

Wrapper Library

MSAL Angular (@azure/msal-angular)

Wrapper Library Version

3.0.25

Public or Confidential Client?

Public

Description

In App A, I start the login process and then close the tap before it finishes. It will create a Msal.interaction.status cookie, and it will remain there even after I have closed App A. And when I try to login to App B, I get the interaction in progress error due to that cookie.

App A and App B share the same origin.

Is the cookie supposed to be there even after I have closed the tab?

I have also tried adding handleRedirectObservable() and handleRedirectPromise()

Error Message

Error - Guard - error: interaction_in_progress: Interaction is currently in progress. Please ensure that this interaction has been completed before calling an interactive API.

MSAL Logs

app-config.ts:24 [Mon, 16 Dec 2024 22:12:33 GMT] : [] : @azure/[email protected] : Verbose - Event callback registered with id: 0193d187-b9b4-7025-bb2d-10f56681ad78 3

app-config.ts:24 [Mon, 16 Dec 2024 22:12:33 GMT] : [] : @azure/[email protected] : Verbose - Emitting event to callback 0193d187-b9b4-7025-bb2d-10f56681ad78: msal:initializeStart 3

app-config.ts:24 [Mon, 16 Dec 2024 22:12:33 GMT] : [] : @azure/[email protected] : Verbose - Claims-based caching is disabled. Clearing the previous cache with claims 3

app-config.ts:24 [Mon, 16 Dec 2024 22:12:33 GMT] : [] : @azure/[email protected] : Verbose - BrowserCacheManager.getTokenKeys - No token keys found 3

app-config.ts:24 [Mon, 16 Dec 2024 22:12:33 GMT] : [] : @azure/[email protected] : Verbose - getAllAccounts called 3

app-config.ts:24 [Mon, 16 Dec 2024 22:12:33 GMT] : [] : @azure/[email protected] : Verbose - BrowserCacheManager.getAccountKeys - No account keys found 3

app-config.ts:24 [Mon, 16 Dec 2024 22:12:33 GMT] : [] : @azure/[email protected] : Verbose - Event callback registered with id: 0193d187-ba1a-7184-add9-962819ae6299 3

app-config.ts:24 [Mon, 16 Dec 2024 22:12:33 GMT] : [] : @azure/[email protected] : Verbose - Guard - canActivate 3

app-config.ts:24 [Mon, 16 Dec 2024 22:12:33 GMT] : [] : @azure/[email protected] : Verbose - MSAL Guard activated 3

app-config.ts:24 [Mon, 16 Dec 2024 22:12:33 GMT] : [] : @azure/[email protected] : Verbose - Emitting event to callback 0193d187-b9b4-7025-bb2d-10f56681ad78: msal:initializeStart 3

app-config.ts:24 [Mon, 16 Dec 2024 22:12:33 GMT] : [] : @azure/[email protected] : Verbose - Emitting event to callback 0193d187-ba1a-7184-add9-962819ae6299: msal:initializeStart 3

app-config.ts:24 [Mon, 16 Dec 2024 22:12:33 GMT] : [] : @azure/[email protected] : Verbose - Claims-based caching is disabled. Clearing the previous cache with claims 3

app-config.ts:24 [Mon, 16 Dec 2024 22:12:33 GMT] : [] : @azure/[email protected] : Verbose - BrowserCacheManager.getTokenKeys - No token keys found 3

app-config.ts:24 [Mon, 16 Dec 2024 22:12:33 GMT] : [] : @azure/[email protected] : Verbose - Emitting event to callback 0193d187-b9b4-7025-bb2d-10f56681ad78: msal:initializeEnd 3

app-config.ts:24 [Mon, 16 Dec 2024 22:12:33 GMT] : [] : @azure/[email protected] : Verbose - Emitting event to callback 0193d187-ba1a-7184-add9-962819ae6299: msal:initializeEnd 3

app-config.ts:24 [Mon, 16 Dec 2024 22:12:33 GMT] : [] : @azure/[email protected] : Verbose - Emitting event to callback 0193d187-b9b4-7025-bb2d-10f56681ad78: msal:initializeEnd 3

app-config.ts:24 [Mon, 16 Dec 2024 22:12:33 GMT] : [] : @azure/[email protected] : Verbose - Emitting event to callback 0193d187-ba1a-7184-add9-962819ae6299: msal:initializeEnd 3

app-config.ts:24 [Mon, 16 Dec 2024 22:12:33 GMT] : [] : @azure/[email protected] : Verbose - handleRedirectPromise called 3

app-config.ts:24 [Mon, 16 Dec 2024 22:12:33 GMT] : [] : @azure/[email protected] : Verbose - getAllAccounts called 3

app-config.ts:24 [Mon, 16 Dec 2024 22:12:33 GMT] : [] : @azure/[email protected] : Verbose - BrowserCacheManager.getAccountKeys - No account keys found 3

app-config.ts:24 [Mon, 16 Dec 2024 22:12:33 GMT] : [] : @azure/[email protected] : Verbose - Emitting event to callback 0193d187-b9b4-7025-bb2d-10f56681ad78: msal:handleRedirectStart 3

app-config.ts:24 [Mon, 16 Dec 2024 22:12:33 GMT] : [] : @azure/[email protected] : Verbose - BroadcastService - msal:handleRedirectStart results in setting inProgress from startup to handleRedirect 3

app-config.ts:24 [Mon, 16 Dec 2024 22:12:33 GMT] : [] : @azure/[email protected] : Verbose - Emitting event to callback 0193d187-ba1a-7184-add9-962819ae6299: msal:handleRedirectStart 3

app-config.ts:24 [Mon, 16 Dec 2024 22:12:33 GMT] : [] : @azure/[email protected] : Verbose - BroadcastService - msal:handleRedirectStart results in setting inProgress from startup to handleRedirect 3

app-config.ts:24 [Mon, 16 Dec 2024 22:12:33 GMT] : [0193d187-ba3b-7e38-a23a-de2d6c61cea0] : [email protected] : Verbose - initializeServerTelemetryManager called 3

app-config.ts:24 [Mon, 16 Dec 2024 22:12:33 GMT] : [0193d187-ba3b-7e38-a23a-de2d6c61cea0] : [email protected] : Info - handleRedirectPromise called but there is no interaction in progress, returning null. 2

app-config.ts:24 [Mon, 16 Dec 2024 22:12:33 GMT] : [] : @azure/[email protected] : Verbose - handleRedirectPromise has been called for the first time, storing the promise 3

app-config.ts:24 [Mon, 16 Dec 2024 22:12:33 GMT] : [] : @azure/[email protected] : Info - initialize has already been called, exiting early. 2

app-config.ts:24 [Mon, 16 Dec 2024 22:12:33 GMT] : [] : @azure/[email protected] : Verbose - handleRedirectPromise called 3

app-config.ts:24 [Mon, 16 Dec 2024 22:12:33 GMT] : [] : @azure/[email protected] : Verbose - handleRedirectPromise has been called previously, returning the result from the first call 3

app-config.ts:24 [Mon, 16 Dec 2024 22:12:33 GMT] : [] : @azure/[email protected] : Verbose - Emitting event to callback 0193d187-b9b4-7025-bb2d-10f56681ad78: msal:handleRedirectEnd 3

app-config.ts:24 [Mon, 16 Dec 2024 22:12:33 GMT] : [] : @azure/[email protected] : Verbose - BroadcastService - msal:handleRedirectEnd results in setting inProgress from handleRedirect to none 3

app-config.ts:24 [Mon, 16 Dec 2024 22:12:33 GMT] : [] : @azure/[email protected] : Verbose - getAllAccounts called 3

app-config.ts:24 [Mon, 16 Dec 2024 22:12:33 GMT] : [] : @azure/[email protected] : Verbose - BrowserCacheManager.getAccountKeys - No account keys found 3

app-config.ts:24 [Mon, 16 Dec 2024 22:12:33 GMT] : [] : @azure/[email protected] : Verbose - getAllAccounts called 3

app-config.ts:24 [Mon, 16 Dec 2024 22:12:33 GMT] : [] : @azure/[email protected] : Verbose - BrowserCacheManager.getAccountKeys - No account keys found 3

app-config.ts:24 [Mon, 16 Dec 2024 22:12:33 GMT] : [] : @azure/[email protected] : Verbose - Emitting event to callback 0193d187-ba1a-7184-add9-962819ae6299: msal:handleRedirectEnd 3

app-config.ts:24 [Mon, 16 Dec 2024 22:12:33 GMT] : [] : @azure/[email protected] : Verbose - BroadcastService - msal:handleRedirectEnd results in setting inProgress from handleRedirect to none 3

app-config.ts:24 [Mon, 16 Dec 2024 22:12:33 GMT] : [] : @azure/[email protected] : Verbose - getAllAccounts called 3

app-config.ts:24 [Mon, 16 Dec 2024 22:12:33 GMT] : [] : @azure/[email protected] : Verbose - BrowserCacheManager.getAccountKeys - No account keys found 3

app-config.ts:24 [Mon, 16 Dec 2024 22:12:33 GMT] : [] : @azure/[email protected] : Verbose - Guard - no accounts retrieved, log in required to activate 3

app-config.ts:24 [Mon, 16 Dec 2024 22:12:33 GMT] : [] : @azure/[email protected] : Verbose - Guard - logging in by redirect 3

app-config.ts:24 [Mon, 16 Dec 2024 22:12:33 GMT] : [] : @azure/[email protected] : Verbose - Guard - getting destination url 3

app-config.ts:24 [Mon, 16 Dec 2024 22:12:33 GMT] : [0193d187-ba41-706f-b183-3f8dd47ccb74] : @azure/[email protected] : Verbose - loginRedirect called 3

app-config.ts:24 [Mon, 16 Dec 2024 22:12:33 GMT] : [0193d187-ba41-706f-b183-3f8dd47ccb74] : @azure/[email protected] : Verbose - acquireTokenRedirect called 3

app-config.ts:24 [Mon, 16 Dec 2024 22:12:33 GMT] : [] : @azure/[email protected] : Verbose - getAllAccounts called 3

app-config.ts:24 [Mon, 16 Dec 2024 22:12:33 GMT] : [] : @azure/[email protected] : Verbose - BrowserCacheManager.getAccountKeys - No account keys found 3

app-config.ts:24 [Mon, 16 Dec 2024 22:12:33 GMT] : [] : @azure/[email protected] : Verbose - Emitting event to callback 0193d187-b9b4-7025-bb2d-10f56681ad78: msal:loginFailure 3

app-config.ts:24 [Mon, 16 Dec 2024 22:12:33 GMT] : [] : @azure/[email protected] : Verbose - Emitting event to callback 0193d187-ba1a-7184-add9-962819ae6299: msal:loginFailure 3

app-config.ts:24 [Mon, 16 Dec 2024 22:12:33 GMT] : [] : @azure/[email protected] : Error - Guard - error while logging in, unable to activate 0

app-config.ts:24 [Mon, 16 Dec 2024 22:12:33 GMT] : [] : @azure/[email protected] : Error - Guard - error: interaction_in_progress: Interaction is currently in progress. Please ensure that this interaction has been completed before calling an interactive API. For more visit: aka.ms/msaljs/browser-errors 0

app-config.ts:24 [Mon, 16 Dec 2024 22:12:33 GMT] : [] : @azure/[email protected] : Verbose - Guard - loginFailedRoute set, redirecting 3

Network Trace (Preferrably Fiddler)

  • Sent
  • Pending

MSAL Configuration

export function MSALInstanceFactory(): IPublicClientApplication {

  return new PublicClientApplication({

    auth: {

      clientId: environment.msalConfig.auth.clientId,

      authority: environment.msalConfig.auth.authority,

      redirectUri: '/',

      postLogoutRedirectUri: '/',

    },

    cache: {

      cacheLocation: BrowserCacheLocation.LocalStorage,

    },

    system: {

      allowNativeBroker: false, // Disables WAM Broker

      loggerOptions: {

        loggerCallback,

        logLevel: LogLevel.Info,

        piiLoggingEnabled: false,

      },

    },

  });

}

Relevant Code Snippets

Export const routes: Routes = [
 {
   Path: Route.Home,
   Component: HomeComponent,
   CanActivate: [MsalGuard]
 } 
]

Reproduction Steps

  1. Have two applications with the same origin
  2. In Application A, start the login process and don’t complete it, then close the tab
  3. Go to application B, start the login process as well
  4. Then you will see the error

Expected Behavior

Cookie should be cleaned up after closing the tab, or on the login in attempt in the second application. MsalGuard should be able to redirect to login page instead of hitting the interaction in progress error.

Identity Provider

Azure B2C Custom Policy

Browsers Affected (Select all that apply)

Chrome, Other

Regression

No response

@ruw321 ruw321 added bug-unconfirmed A reported bug that needs to be investigated and confirmed question Customer is asking for a clarification, use case or information. labels Dec 18, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: Attention 👋 Awaiting response from the MSAL.js team label Dec 18, 2024
@github-actions github-actions bot added b2c Related to Azure B2C library-specific issues msal-angular Related to @azure/msal-angular package msal-browser Related to msal-browser package public-client Issues regarding PublicClientApplications labels Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
b2c Related to Azure B2C library-specific issues bug-unconfirmed A reported bug that needs to be investigated and confirmed msal-angular Related to @azure/msal-angular package msal-browser Related to msal-browser package Needs: Attention 👋 Awaiting response from the MSAL.js team public-client Issues regarding PublicClientApplications question Customer is asking for a clarification, use case or information.
Projects
None yet
Development

No branches or pull requests

1 participant