You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/msal-angular/docs/msal-interceptor.md
+37Lines changed: 37 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -147,6 +147,43 @@ Other things to note regarding the `protectedResourceMap`:
147
147
***Wildcards**:`protectedResourceMap` supports using `*`forwildcards. When using wildcards, if multiple matching entries are found in the `protectedResourceMap`, the first match found will be used (based on the order of the `protectedResourceMap`).
148
148
***Relative paths**: If there are relative resource paths in your application, you may need to provide the relative path in the `protectedResourceMap`. This also applies to issues that may arise with ngx-translate. Be aware that the relative path in your `protectedResourceMap` may or may not need a leading slash depending on your app, and may need to try both.
149
149
150
+
### Strict Matching (`strictMatching`)
151
+
152
+
The optional `strictMatching` boolean field on `MsalInterceptorConfiguration` enables stricter, more semantically correct URL component pattern matching for`protectedResourceMap`entries. It defaults to `false`for backwards compatibility with existing applications.
| Metacharacter escaping |`.` and other regex metacharacters are **not** escaped; they act as regex operators | All metacharacters (including `.`) are treated as **literals**|
159
+
| Anchoring | Pattern may match anywhere within the string | Pattern must match the **full string** (`^…$`) |
160
+
| Host wildcard (`*`) |`*` matches any character sequence, including `.`|`*` matches any character sequence that does **not** include `.` (wildcards stay within a single DNS label) |
161
+
| Path/search/hash wildcard (`*`) |`*` matches any character sequence |`*` matches any character sequence (unchanged) |
162
+
|`?` character | Passed through to the underlying regex | Treated as a **literal**`?` (URL query-string separator, not a wildcard) |
163
+
164
+
With `strictMatching: true`:
165
+
-A pattern like `*.contoso.com` matches `app.contoso.com` but **not**`a.b.contoso.com` (wildcard cannot span dot separators).
166
+
-A pattern like `https://graph.microsoft.com/v1.0/me` matches only that exact URL.
`strictMatching` is optional and defaults to `false`in the current release line so existing applications are unaffected. You can opt in incrementally by enabling it and reviewing your `protectedResourceMap` patterns for correctness.
184
+
185
+
>**Forward-looking note:** In **msal-angular v5**, `strictMatching` will be `true` by default. We recommend reviewing and updating your `protectedResourceMap` patterns to be compatible with strict matching semantics before upgrading to v5.
186
+
150
187
### Optional authRequest
151
188
152
189
For more information on the optional `authRequest` that can be set in the `MsalInterceptorConfiguration`, please see our [multi-tenant doc here](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-angular/docs/multi-tenant.md#dynamic-auth-request).
0 commit comments