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
+50Lines changed: 50 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -147,6 +147,56 @@ 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
+
In msal-angular v5, URL component pattern matching for`protectedResourceMap` entries uses strict matching semantics by default. The`strictMatching` field on `MsalInterceptorConfiguration` controls this behaviour.
153
+
154
+
#### What strict matching changes
155
+
156
+
| Behaviour |Legacy (`strictMatching: false`) |Strict (default in v5) |
| 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 strict matching (the v5 default):
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.
167
+
168
+
#### Default behaviour inv5 (no configuration needed)
169
+
170
+
Strict matching is enabled by default. No additional configuration is required:
#### Opting out to legacy matching (`strictMatching: false`)
184
+
185
+
If your patterns rely on the looser matching from v4, you can set `strictMatching: false` to retain the legacy behaviour temporarily:
186
+
187
+
>**Note:** Legacy matching (`strictMatching: false`) is provided for backwards compatibility and may be removed in a future major version. We recommend updating your `protectedResourceMap` patterns to work with strict matching.
strictMatching: false // Use legacy matching for backwards compatibility
197
+
}
198
+
```
199
+
150
200
### Optional authRequest
151
201
152
202
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).
Copy file name to clipboardExpand all lines: lib/msal-angular/docs/v4-v5-upgrade-guide.md
+8-2Lines changed: 8 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,13 @@ MSAL Angular v5 requires a minimum version of Angular 19 and is dropping support
4
4
5
5
Please see the [MSAL Browser v4-v5 migration guide](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/v4-migration.md) for browser support and other key changes.
6
6
7
-
## Changes in `@azure/msal-angular@5`
7
+
## Breaking changes in `@azure/msal-angular@5`
8
+
9
+
### Strict matching for `protectedResourceMap`
10
+
11
+
In msal-angular v5, URL pattern matching for protectedResourceMap entries uses strict matching semantics by default. Strict matching treats pattern metacharacters as literals, anchors matches to the full URL component, and applies host wildcard rules that do not span dot separators. If your v4 configuration relied on looser matching behavior, update your protectedResourceMap patterns to align with strict matching, or set strictMatching to false to retain legacy behavior temporarily. See [MSAL Interceptor docs](./msal-interceptor.md#strict-matching-strictmatching) for more details.
12
+
13
+
## Other changes in `@azure/msal-angular@5`
8
14
9
15
### `inject(TOKEN)` syntax
10
16
@@ -33,4 +39,4 @@ Note: Passing a hash string directly to `handleRedirectObservable(hash)` is now
33
39
34
40
### `logout()`
35
41
36
-
`logout()` has been removed. Please use `logoutRedirect()` or `logoutPopup()` instead.
42
+
`logout()` has been removed. Please use `logoutRedirect()` or `logoutPopup()` instead.
0 commit comments