Skip to content

Update docs and add warning for strictMatching#8388

Merged
jo-arroyo merged 8 commits intodevfrom
strict-matching-console-docs
Mar 9, 2026
Merged

Update docs and add warning for strictMatching#8388
jo-arroyo merged 8 commits intodevfrom
strict-matching-console-docs

Conversation

@jo-arroyo
Copy link
Contributor

@jo-arroyo jo-arroyo commented Mar 6, 2026

This PR adds strictMatching runtime warning and documentation for @azure/msal-angular. When strictMatching is not explicitly configured on MsalInterceptorConfiguration, MsalInterceptor now emits a one-time warning via the MSAL logger. This helps developers discover silent 401 failures caused by misconfigured protectedResourceMap keys under the v5 default strict matching behaviour.

Code Changes

  • msal.interceptor.ts — Inline check in the constructor emits a logger warning when strictMatching === undefined, linking to the strict matching docs.
  • msal.interceptor.spec.ts — 3 new warning tests (undefined → warns, true/false → no warn). Existing tests updated to pass strictMatching: true to suppress the warning.

Documentation Changes

  • msal-interceptor.md — Common failure patterns table, environment-driven configuration guidance, troubleshooting section with fix options, and runtime warning explanation.
  • v4-v5-upgrade-guide.md — Quick checklist, v5 minor upgrade callout, and environment-driven protectedResourceMap code sample with // TODO migration comment.
  • known-issues.md — Concise entry linking to strict matching docs.
  • configuration.mdstrictMatching: false with comments in dynamic config samples; guidance comments in static config samples.

@jo-arroyo jo-arroyo marked this pull request as ready for review March 6, 2026 23:38
@jo-arroyo jo-arroyo requested a review from a team as a code owner March 6, 2026 23:38
Copilot AI review requested due to automatic review settings March 6, 2026 23:38
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a one-time runtime warning to MsalInterceptor when strictMatching is not explicitly configured, helping Angular developers discover potential silent 401 failures caused by the v5 default strict URL matching behavior. It also adds comprehensive documentation about common failure patterns, troubleshooting, and migration guidance.

Changes:

  • Added a constructor-time Logger.warning() call in MsalInterceptor when strictMatching === undefined, with a link to the strict matching documentation.
  • Added 3 new test cases validating the warning behavior (fires when undefined, silent when explicitly true or false), and updated existing tests to pass explicit strictMatching values to avoid triggering the warning.
  • Added extensive documentation across multiple files covering common failure patterns, environment-driven configuration guidance, troubleshooting steps, and known issues.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
lib/msal-angular/src/msal.interceptor.ts Adds runtime warning in constructor when strictMatching is not explicitly set
lib/msal-angular/src/msal.interceptor.spec.ts 3 new warning tests; existing tests updated to pass explicit strictMatching values
lib/msal-angular/docs/msal-interceptor.md Common failure patterns table, environment-driven config guidance, troubleshooting section, runtime warning docs
lib/msal-angular/docs/v4-v5-upgrade-guide.md Quick checklist, v5 minor upgrade callout, environment-driven code sample
lib/msal-angular/docs/known-issues.md New 5.x entry linking to strict matching docs
lib/msal-angular/docs/configuration.md strictMatching: false in dynamic config samples; guidance comments in static config samples
change/@azure-msal-angular-7198751c-a747-4b3e-bc7c-cfc69d4901fc.json Beachball changefile with patch type

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@jo-arroyo jo-arroyo merged commit 1d8e35f into dev Mar 9, 2026
7 checks passed
@jo-arroyo jo-arroyo deleted the strict-matching-console-docs branch March 9, 2026 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants