1

I have this error in iPhone Mobile devices only when trying to login into the angular app using @azure/msal-angular and @azure/msal-browser. while it's working fine for Android and other devices. The login data returns correctly but the exception is raised in the console.

**Uncaught (in promise) BrowserAuthError: interaction_in_progress: Interaction is currently in progress. Please ensure that this interaction has been completed before calling an interactive API., **

  login(userFlowRequest?: RedirectRequest | PopupRequest) {
    localStorage.clear();
    sessionStorage.clear();
    if (this.msalGuardConfig.interactionType === InteractionType.Popup) {
      if (this.msalGuardConfig.authRequest) {
        this.authService
          .loginPopup({
            ...this.msalGuardConfig.authRequest,
            ...userFlowRequest,
          } as PopupRequest)
          .subscribe((response: AuthenticationResult) => {
            //('*');
            //(response);
            this.authService.instance.setActiveAccount(response.account);
          });
      } else {
        this.authService
          .loginPopup(userFlowRequest)
          .subscribe((response: AuthenticationResult) => {
            //('**');
            //(response);
            this.authService.instance.setActiveAccount(response.account);
          });
      }
    } else {
      if (this.msalGuardConfig.authRequest) {
        this.authService.loginRedirect({
          ...this.msalGuardConfig.authRequest,
          ...userFlowRequest,
        } as RedirectRequest);
      } else {
        this.authService.loginRedirect(userFlowRequest);
      }
    }
  }

I have tried every solution like updating MSAL version and using login redirect instead of login popup. I'm having a problem with the login flow in iPhone mobile devices only but few days before the same application with the same code is working fine on the iPhone device.

0 Answers0