Update docs and add warning for strictMatching#8388
Merged
Conversation
…reAD/microsoft-authentication-library-for-js into strict-matching-console-docs
Contributor
There was a problem hiding this comment.
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 inMsalInterceptorwhenstrictMatching === undefined, with a link to the strict matching documentation. - Added 3 new test cases validating the warning behavior (fires when undefined, silent when explicitly
trueorfalse), and updated existing tests to pass explicitstrictMatchingvalues 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>
jennyf19
approved these changes
Mar 6, 2026
peterzenz
approved these changes
Mar 7, 2026
shylasummers
approved these changes
Mar 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds
strictMatchingruntime warning and documentation for@azure/msal-angular. WhenstrictMatchingis not explicitly configured onMsalInterceptorConfiguration,MsalInterceptornow emits a one-time warning via the MSAL logger. This helps developers discover silent 401 failures caused by misconfiguredprotectedResourceMapkeys under the v5 default strict matching behaviour.Code Changes
msal.interceptor.ts— Inline check in the constructor emits a logger warning whenstrictMatching === 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 passstrictMatching: trueto 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-drivenprotectedResourceMapcode sample with// TODOmigration comment.known-issues.md— Concise entry linking to strict matching docs.configuration.md—strictMatching: falsewith comments in dynamic config samples; guidance comments in static config samples.