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

When using standalone components MSAL Angular gets stuck in a redirect loop after signing-in when query string contains an apostrophe (%27) #7636

Open
2 tasks
HomerBart opened this issue Mar 13, 2025 · 0 comments
Labels
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

@HomerBart
Copy link

Core Library

MSAL.js (@azure/msal-browser)

Core Library Version

^4.0.0 (4.7.0)

Wrapper Library

MSAL Angular (@azure/msal-angular)

Wrapper Library Version

^4.0.0 (4.0.6)

Public or Confidential Client?

Public

Description

When using standalone components MSAL Angular gets stuck in a redirect loop after signing-in when query string contains an apostrophe (%27) - for example: https://localhost:4200/profile?comments=blah%27blah.

This is easily reproduced using the Angular Standalone Sample

Error Message

There is no error message, but the MSAL Angular gets stuck in a redirect loop.

MSAL Logs

Please find verbose logs attached.

VerboseLogs.txt

Network Trace (Preferrably Fiddler)

  • Sent
  • Pending

MSAL Configuration

Exactly as in the Angular Standalone Sample, just with the client id and authority updated.

{
  auth: {
    clientId: "clientId",
    authority: "https://login.microsoftonline.com/tenantId",
    redirectUri: '/',
    postLogoutRedirectUri: '/'
  },
  cache: {
    cacheLocation: BrowserCacheLocation.SessionStorage,
  },
  system: {
    allowPlatformBroker: false, // Disables WAM Broker
    loggerOptions: {
      loggerCallback,
      logLevel: LogLevel.Verbose,
      piiLoggingEnabled: false,
    }
  }
}

Relevant Code Snippets

See the Angular Standalone Sample](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-angular-samples/angular-standalone-sample)

Reproduction Steps

  1. Run the Angular Standalone Sample (I run it using HTTPS)
  2. Open the web browser and navigate directly to the profile route passing a query string parameter containing an apostrophe. For example: https://localhost:4200/profile?comments=blah%27blah
  3. Sign in
  4. MSAL angular gets stuck in a redirect loop.

Expected Behavior

MSAL Angular shouldn't get stuck in a redirect loop. It should display the profile route.

Identity Provider

Entra ID (formerly Azure AD) / MSA

Browsers Affected (Select all that apply)

Edge, Chrome

Regression

No response

@HomerBart HomerBart 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 Mar 13, 2025
@github-actions github-actions bot added msal-angular Related to @azure/msal-angular package msal-browser Related to msal-browser package public-client Issues regarding PublicClientApplications labels Mar 13, 2025
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: Attention 👋 Awaiting response from the MSAL.js team label Mar 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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