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

Error - Guard - error while logging in, unable to activate - blocks the msal guard #6055

Closed
SamShekhovtsov opened this issue May 23, 2023 · 2 comments
Assignees
Labels
answered Question has received "first qualified response" 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: Author Feedback Awaiting response from issue author no-issue-activity Issue author has not responded in 5 days public-client Issues regarding PublicClientApplications question Customer is asking for a clarification, use case or information.

Comments

@SamShekhovtsov
Copy link

Core Library

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

Core Library Version

2.33.0

Wrapper Library

MSAL Angular (@azure/msal-angular)

Wrapper Library Version

2.5.3

Public or Confidential Client?

Confidential

Description

When user clicks for example change password, there is a request created for a password change. In case, if the user cancelled the change password dialog, he is sent back to the site, however the "Error - Guard - error while logging in, unable to activate" blocks the user from any action.

I was trying different workarounds for solving this issue:
set the active account (however the active account is set correctly)

authService.ssoSilent

nothing helps, the system remains broken, all features are not functioning due to the error mentioned above.

When users cancels the Change Password or cancels the Impersonate flow by clicking the Cancel button - the system shouldn't be competely broken. The user is expected to remain logged in.

Error Message

ERROR ServerError: access_denied: AADB2C90091: The user has cancelled entering self-asserted information.
Error - Guard - error while logging in, unable to activate

Msal Logs

Error - Guard - error while logging in, unable to activate

MSAL Configuration

export function MSALInstanceFactory(): IPublicClientApplication {
  return new PublicClientApplication(msalConfig);
}

export function MSALGuardConfigFactory(): MsalGuardConfiguration {
  return {
    interactionType: InteractionType.Redirect,
    authRequest: loginRequest
  };
}

Relevant Code Snippets

changePassword() {
        let changePasswordRequest: RedirectRequest | PopupRequest = {
            authority: b2cPolicies.authorities.customChangePassword.authority,
            scopes: [],
        };

        this.login(changePasswordRequest);
    }


    trySsoSilentLogin(originalSignInAccount: AccountInfo) {
        
        let signUpSignInFlowRequest: SsoSilentRequest = {
            authority: b2cPolicies.authorities.customSignUpSignIn.authority,
            account: originalSignInAccount as AccountInfo
        };

        // silently login again with the customSignUpSignIn policy
        this.authService.ssoSilent(signUpSignInFlowRequest);
    }

this.authService.loginRedirect(userFlowRequest);

Reproduction Steps

  1. implement the change password flow
  2. click / activate the change password function
  3. cancel the change password flow by clicking the "Cancel" button
  4. try to use the system as usual

Expected Behavior

the user should be able to use the system as usual after cancelling the current change password or impoersonate user flow.

Identity Provider

Azure B2C Custom Policy

Browsers Affected (Select all that apply)

Chrome, Firefox, Edge, Internet Explorer

Regression

No response

Source

External (Customer)

@SamShekhovtsov SamShekhovtsov 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 May 23, 2023
@ghost ghost added the Needs: Attention 👋 Awaiting response from the MSAL.js team label May 23, 2023
@github-actions github-actions bot added b2c Related to Azure B2C library-specific issues confidential-client Issues regarding ConfidentialClientApplications msal-angular Related to @azure/msal-angular package msal-browser Related to msal-browser package labels May 23, 2023
@ghost ghost assigned lalimasharda May 23, 2023
@lalimasharda
Copy link
Contributor

Hey @SamShekhovtsov! This is a known issue and a duplicate of #4378 (workaround mentioned). We are tracking this bug internally, but it is deprioritized at the moment.

@ghost ghost added answered Question has received "first qualified response" Needs: Author Feedback Awaiting response from issue author and removed Needs: Attention 👋 Awaiting response from the MSAL.js team labels May 23, 2023
@ghost
Copy link

ghost commented May 29, 2023

@SamShekhovtsov This issue has been automatically marked as stale because it is marked as requiring author feedback but has not had any activity for 5 days. If your issue has been resolved please let us know by closing the issue. If your issue has not been resolved please leave a comment to keep this open. It will be closed automatically in 7 days if it remains stale.

@ghost ghost added the no-issue-activity Issue author has not responded in 5 days label May 29, 2023
@bgavrilMS bgavrilMS added public-client Issues regarding PublicClientApplications and removed confidential-client Issues regarding ConfidentialClientApplications labels Jun 2, 2023
@ghost ghost closed this as completed Jun 9, 2023
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered Question has received "first qualified response" 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: Author Feedback Awaiting response from issue author no-issue-activity Issue author has not responded in 5 days 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

4 participants