Skip to content

BrowserAuthError: user_cancelled: User cancelled the flow. #5709

Closed
@arslan-ideawake

Description

@arslan-ideawake

Core Library

MSAL.js v2 (@azure/msal-browser)

Core Library Version

2.18.0

Wrapper Library

MSAL Angular (@azure/msal-angular)

Wrapper Library Version

None

Public or Confidential Client?

Public

Description

Currently, I'm working on an angular v8 project which is using @azure/msal-browser, previously it was working fine locally, in testing and production environments as well, but now when loginPopup of msal function call, it still opens an authentication window in a new tab, but automatically trigger user cancel event, even if user does not close auth tab, but on localhost still working fine.
Screenshot 2023-02-22 at 5 40 08 PM

MSAL Configuration

{
    auth: {
      clientId: environment.azure.clientId,
      authority: 'https://login.microsoftonline.com/common',
      redirectUri: environment.azure.redirectURI
    },
    cache: {
      cacheLocation: 'sessionStorage',
      storeAuthStateInCookie: false
    }
}

Relevant Code Snippets

MSAL_CONFIG: Configuration = {
    auth: {
      clientId: environment.azure.clientId,
      authority: 'https://login.microsoftonline.com/common',
      redirectUri: environment.azure.redirectURI
    },
    cache: {
      cacheLocation: 'sessionStorage',
      storeAuthStateInCookie: false
    }
  };

  private myMSALObj: PublicClientApplication = new PublicClientApplication(
    this.MSAL_CONFIG
  );
  private loginRequest?: PopupRequest;
  
  azureLogin() {
    this.loginRequest = {
      scopes: [
        'user.read',
        'profile',
        'email',
        'openid',
      ],
    };
    return this.myMSALObj.loginPopup(this.loginRequest);
  }

Identity Provider

None

Source

External (Customer)

Metadata

Metadata

Assignees

Labels

msal-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

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions