@azure/msal-node 3.6.1 → 3.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/cache/NodeStorage.mjs +1 -1
- package/dist/cache/TokenCache.d.ts +1 -1
- package/dist/cache/TokenCache.d.ts.map +1 -1
- package/dist/cache/TokenCache.mjs +4 -3
- package/dist/cache/TokenCache.mjs.map +1 -1
- package/dist/cache/distributed/DistributedCachePlugin.mjs +1 -1
- package/dist/cache/serializer/Deserializer.mjs +1 -1
- package/dist/cache/serializer/Serializer.mjs +1 -1
- package/dist/client/ClientApplication.mjs +7 -7
- package/dist/client/ClientApplication.mjs.map +1 -1
- package/dist/client/ClientAssertion.mjs +1 -1
- package/dist/client/ClientCredentialClient.d.ts.map +1 -1
- package/dist/client/ClientCredentialClient.mjs +5 -5
- package/dist/client/ClientCredentialClient.mjs.map +1 -1
- package/dist/client/ConfidentialClientApplication.mjs +1 -1
- package/dist/client/DeviceCodeClient.mjs +1 -1
- package/dist/client/ManagedIdentityApplication.mjs +2 -2
- package/dist/client/ManagedIdentityClient.mjs +1 -1
- package/dist/client/ManagedIdentitySources/AppService.mjs +1 -1
- package/dist/client/ManagedIdentitySources/AzureArc.mjs +1 -1
- package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.mjs +2 -2
- package/dist/client/ManagedIdentitySources/CloudShell.mjs +1 -1
- package/dist/client/ManagedIdentitySources/Imds.mjs +1 -1
- package/dist/client/ManagedIdentitySources/MachineLearning.mjs +1 -1
- package/dist/client/ManagedIdentitySources/ServiceFabric.mjs +1 -1
- package/dist/client/OnBehalfOfClient.d.ts.map +1 -1
- package/dist/client/OnBehalfOfClient.mjs +7 -7
- package/dist/client/OnBehalfOfClient.mjs.map +1 -1
- package/dist/client/PublicClientApplication.mjs +2 -2
- package/dist/client/UsernamePasswordClient.mjs +1 -1
- package/dist/config/Configuration.mjs +2 -2
- package/dist/config/ManagedIdentityId.mjs +1 -1
- package/dist/config/ManagedIdentityRequestParameters.mjs +1 -1
- package/dist/crypto/CryptoProvider.mjs +1 -1
- package/dist/crypto/GuidGenerator.mjs +1 -1
- package/dist/crypto/HashUtils.mjs +1 -1
- package/dist/crypto/PkceGenerator.mjs +1 -1
- package/dist/error/ManagedIdentityError.mjs +2 -2
- package/dist/error/ManagedIdentityErrorCodes.mjs +1 -1
- package/dist/error/NodeAuthError.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/internals.mjs +1 -1
- package/dist/network/HttpClient.mjs +1 -1
- package/dist/network/HttpClientWithRetries.mjs +1 -1
- package/dist/network/LoopbackClient.mjs +1 -1
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/packageMetadata.mjs +2 -2
- package/dist/protocol/Authorize.mjs +1 -1
- package/dist/retry/DefaultManagedIdentityRetryPolicy.mjs +1 -1
- package/dist/retry/ExponentialRetryStrategy.mjs +1 -1
- package/dist/retry/ImdsRetryPolicy.mjs +1 -1
- package/dist/retry/LinearRetryStrategy.mjs +1 -1
- package/dist/utils/Constants.mjs +1 -3
- package/dist/utils/Constants.mjs.map +1 -1
- package/dist/utils/EncodingUtils.mjs +1 -1
- package/dist/utils/NetworkUtils.mjs +1 -1
- package/dist/utils/TimeUtils.mjs +1 -1
- package/lib/msal-node.cjs +182 -262
- package/lib/msal-node.cjs.map +1 -1
- package/lib/types/cache/TokenCache.d.ts +1 -1
- package/lib/types/cache/TokenCache.d.ts.map +1 -1
- package/lib/types/client/ClientCredentialClient.d.ts.map +1 -1
- package/lib/types/client/OnBehalfOfClient.d.ts.map +1 -1
- package/lib/types/packageMetadata.d.ts +1 -1
- package/package.json +2 -2
- package/src/cache/TokenCache.ts +5 -2
- package/src/client/ClientCredentialClient.ts +8 -4
- package/src/client/OnBehalfOfClient.ts +13 -6
- package/src/packageMetadata.ts +1 -1
package/lib/msal-node.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-node v3.6.
|
|
1
|
+
/*! @azure/msal-node v3.6.3 2025-07-08 */
|
|
2
2
|
'use strict';
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
@@ -153,7 +153,7 @@ class Serializer {
|
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
-
/*! @azure/msal-common v15.
|
|
156
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
157
157
|
/*
|
|
158
158
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
159
159
|
* Licensed under the MIT License.
|
|
@@ -292,9 +292,7 @@ const CodeChallengeMethodValues = {
|
|
|
292
292
|
*/
|
|
293
293
|
const OAuthResponseType = {
|
|
294
294
|
CODE: "code",
|
|
295
|
-
IDTOKEN_TOKEN: "id_token token"
|
|
296
|
-
IDTOKEN_TOKEN_REFRESHTOKEN: "id_token token refresh_token",
|
|
297
|
-
};
|
|
295
|
+
IDTOKEN_TOKEN: "id_token token"};
|
|
298
296
|
/**
|
|
299
297
|
* allowed values for response_mode
|
|
300
298
|
*/
|
|
@@ -307,7 +305,6 @@ const ResponseMode = {
|
|
|
307
305
|
* allowed grant_type
|
|
308
306
|
*/
|
|
309
307
|
const GrantType = {
|
|
310
|
-
IMPLICIT_GRANT: "implicit",
|
|
311
308
|
AUTHORIZATION_CODE_GRANT: "authorization_code",
|
|
312
309
|
CLIENT_CREDENTIALS_GRANT: "client_credentials",
|
|
313
310
|
RESOURCE_OWNER_PASSWORD_GRANT: "password",
|
|
@@ -321,7 +318,6 @@ const GrantType = {
|
|
|
321
318
|
const CacheAccountType = {
|
|
322
319
|
MSSTS_ACCOUNT_TYPE: "MSSTS",
|
|
323
320
|
ADFS_ACCOUNT_TYPE: "ADFS",
|
|
324
|
-
MSAV1_ACCOUNT_TYPE: "MSA",
|
|
325
321
|
GENERIC_ACCOUNT_TYPE: "Generic", // NTLM, Kerberos, FBA, Basic etc
|
|
326
322
|
};
|
|
327
323
|
/**
|
|
@@ -358,7 +354,6 @@ const AuthorityMetadataSource = {
|
|
|
358
354
|
};
|
|
359
355
|
const SERVER_TELEM_CONSTANTS = {
|
|
360
356
|
SCHEMA_VERSION: 5,
|
|
361
|
-
MAX_CUR_HEADER_BYTES: 80,
|
|
362
357
|
MAX_LAST_HEADER_BYTES: 330,
|
|
363
358
|
MAX_CACHED_ERRORS: 50,
|
|
364
359
|
CACHE_KEY: "server-telemetry",
|
|
@@ -413,9 +408,7 @@ const RegionDiscoverySources = {
|
|
|
413
408
|
* Region Discovery Outcomes
|
|
414
409
|
*/
|
|
415
410
|
const RegionDiscoveryOutcomes = {
|
|
416
|
-
CONFIGURED_MATCHES_DETECTED: "1",
|
|
417
411
|
CONFIGURED_NO_AUTO_DETECTION: "2",
|
|
418
|
-
CONFIGURED_NOT_DETECTED: "3",
|
|
419
412
|
AUTO_DETECTION_REQUESTED_SUCCESSFUL: "4",
|
|
420
413
|
AUTO_DETECTION_REQUESTED_FAILED: "5",
|
|
421
414
|
};
|
|
@@ -442,7 +435,7 @@ const EncodingTypes = {
|
|
|
442
435
|
UTF8: "utf-8",
|
|
443
436
|
};
|
|
444
437
|
|
|
445
|
-
/*! @azure/msal-common v15.
|
|
438
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
446
439
|
/*
|
|
447
440
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
448
441
|
* Licensed under the MIT License.
|
|
@@ -459,7 +452,7 @@ var AuthErrorCodes = /*#__PURE__*/Object.freeze({
|
|
|
459
452
|
unexpectedError: unexpectedError
|
|
460
453
|
});
|
|
461
454
|
|
|
462
|
-
/*! @azure/msal-common v15.
|
|
455
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
463
456
|
|
|
464
457
|
/*
|
|
465
458
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -508,7 +501,7 @@ function createAuthError(code, additionalMessage) {
|
|
|
508
501
|
: AuthErrorMessages[code]);
|
|
509
502
|
}
|
|
510
503
|
|
|
511
|
-
/*! @azure/msal-common v15.
|
|
504
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
512
505
|
/*
|
|
513
506
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
514
507
|
* Licensed under the MIT License.
|
|
@@ -606,7 +599,7 @@ var ClientAuthErrorCodes = /*#__PURE__*/Object.freeze({
|
|
|
606
599
|
userTimeoutReached: userTimeoutReached
|
|
607
600
|
});
|
|
608
601
|
|
|
609
|
-
/*! @azure/msal-common v15.
|
|
602
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
610
603
|
|
|
611
604
|
/*
|
|
612
605
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -858,7 +851,7 @@ function createClientAuthError(errorCode, additionalMessage) {
|
|
|
858
851
|
return new ClientAuthError(errorCode, additionalMessage);
|
|
859
852
|
}
|
|
860
853
|
|
|
861
|
-
/*! @azure/msal-common v15.
|
|
854
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
862
855
|
|
|
863
856
|
/*
|
|
864
857
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -897,7 +890,7 @@ const DEFAULT_CRYPTO_IMPLEMENTATION = {
|
|
|
897
890
|
},
|
|
898
891
|
};
|
|
899
892
|
|
|
900
|
-
/*! @azure/msal-common v15.
|
|
893
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
901
894
|
|
|
902
895
|
/*
|
|
903
896
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1088,12 +1081,12 @@ class Logger {
|
|
|
1088
1081
|
}
|
|
1089
1082
|
}
|
|
1090
1083
|
|
|
1091
|
-
/*! @azure/msal-common v15.
|
|
1084
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
1092
1085
|
/* eslint-disable header/header */
|
|
1093
1086
|
const name$1 = "@azure/msal-common";
|
|
1094
|
-
const version$1 = "15.
|
|
1087
|
+
const version$1 = "15.8.1";
|
|
1095
1088
|
|
|
1096
|
-
/*! @azure/msal-common v15.
|
|
1089
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
1097
1090
|
/*
|
|
1098
1091
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1099
1092
|
* Licensed under the MIT License.
|
|
@@ -1113,7 +1106,7 @@ const AzureCloudInstance = {
|
|
|
1113
1106
|
AzureUsGovernment: "https://login.microsoftonline.us",
|
|
1114
1107
|
};
|
|
1115
1108
|
|
|
1116
|
-
/*! @azure/msal-common v15.
|
|
1109
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
1117
1110
|
|
|
1118
1111
|
/*
|
|
1119
1112
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1174,7 +1167,7 @@ function checkMaxAge(authTime, maxAge) {
|
|
|
1174
1167
|
}
|
|
1175
1168
|
}
|
|
1176
1169
|
|
|
1177
|
-
/*! @azure/msal-common v15.
|
|
1170
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
1178
1171
|
/*
|
|
1179
1172
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1180
1173
|
* Licensed under the MIT License.
|
|
@@ -1229,7 +1222,7 @@ function delay(t, value) {
|
|
|
1229
1222
|
return new Promise((resolve) => setTimeout(() => resolve(value), t));
|
|
1230
1223
|
}
|
|
1231
1224
|
|
|
1232
|
-
/*! @azure/msal-common v15.
|
|
1225
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
1233
1226
|
|
|
1234
1227
|
/*
|
|
1235
1228
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1556,7 +1549,7 @@ function isAuthorityMetadataExpired(metadata) {
|
|
|
1556
1549
|
return metadata.expiresAt <= nowSeconds();
|
|
1557
1550
|
}
|
|
1558
1551
|
|
|
1559
|
-
/*! @azure/msal-common v15.
|
|
1552
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
1560
1553
|
/*
|
|
1561
1554
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1562
1555
|
* Licensed under the MIT License.
|
|
@@ -1567,7 +1560,6 @@ const authorityUriInsecure = "authority_uri_insecure";
|
|
|
1567
1560
|
const urlParseError = "url_parse_error";
|
|
1568
1561
|
const urlEmptyError = "empty_url_error";
|
|
1569
1562
|
const emptyInputScopesError = "empty_input_scopes_error";
|
|
1570
|
-
const invalidPromptValue = "invalid_prompt_value";
|
|
1571
1563
|
const invalidClaims = "invalid_claims";
|
|
1572
1564
|
const tokenRequestEmpty = "token_request_empty";
|
|
1573
1565
|
const logoutRequestEmpty = "logout_request_empty";
|
|
@@ -1597,7 +1589,6 @@ var ClientConfigurationErrorCodes = /*#__PURE__*/Object.freeze({
|
|
|
1597
1589
|
invalidClaims: invalidClaims,
|
|
1598
1590
|
invalidCloudDiscoveryMetadata: invalidCloudDiscoveryMetadata,
|
|
1599
1591
|
invalidCodeChallengeMethod: invalidCodeChallengeMethod,
|
|
1600
|
-
invalidPromptValue: invalidPromptValue,
|
|
1601
1592
|
logoutRequestEmpty: logoutRequestEmpty,
|
|
1602
1593
|
missingNonceAuthenticationHeader: missingNonceAuthenticationHeader,
|
|
1603
1594
|
missingSshJwk: missingSshJwk,
|
|
@@ -1610,7 +1601,7 @@ var ClientConfigurationErrorCodes = /*#__PURE__*/Object.freeze({
|
|
|
1610
1601
|
urlParseError: urlParseError
|
|
1611
1602
|
});
|
|
1612
1603
|
|
|
1613
|
-
/*! @azure/msal-common v15.
|
|
1604
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
1614
1605
|
|
|
1615
1606
|
/*
|
|
1616
1607
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1623,7 +1614,6 @@ const ClientConfigurationErrorMessages = {
|
|
|
1623
1614
|
[urlParseError]: "URL could not be parsed into appropriate segments.",
|
|
1624
1615
|
[urlEmptyError]: "URL was empty or null.",
|
|
1625
1616
|
[emptyInputScopesError]: "Scopes cannot be passed as null, undefined or empty array because they are required to obtain an access token.",
|
|
1626
|
-
[invalidPromptValue]: "Please see here for valid configuration options: https://azuread.github.io/microsoft-authentication-library-for-js/ref/modules/_azure_msal_common.html#commonauthorizationurlrequest",
|
|
1627
1617
|
[invalidClaims]: "Given claims parameter must be a stringified JSON object.",
|
|
1628
1618
|
[tokenRequestEmpty]: "Token request was empty and not found in cache.",
|
|
1629
1619
|
[logoutRequestEmpty]: "The logout request was null or undefined.",
|
|
@@ -1669,10 +1659,6 @@ const ClientConfigurationErrorMessage = {
|
|
|
1669
1659
|
code: emptyInputScopesError,
|
|
1670
1660
|
desc: ClientConfigurationErrorMessages[emptyInputScopesError],
|
|
1671
1661
|
},
|
|
1672
|
-
invalidPrompt: {
|
|
1673
|
-
code: invalidPromptValue,
|
|
1674
|
-
desc: ClientConfigurationErrorMessages[invalidPromptValue],
|
|
1675
|
-
},
|
|
1676
1662
|
invalidClaimsRequest: {
|
|
1677
1663
|
code: invalidClaims,
|
|
1678
1664
|
desc: ClientConfigurationErrorMessages[invalidClaims],
|
|
@@ -1748,7 +1734,7 @@ function createClientConfigurationError(errorCode) {
|
|
|
1748
1734
|
return new ClientConfigurationError(errorCode);
|
|
1749
1735
|
}
|
|
1750
1736
|
|
|
1751
|
-
/*! @azure/msal-common v15.
|
|
1737
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
1752
1738
|
/*
|
|
1753
1739
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1754
1740
|
* Licensed under the MIT License.
|
|
@@ -1845,7 +1831,7 @@ class StringUtils {
|
|
|
1845
1831
|
}
|
|
1846
1832
|
}
|
|
1847
1833
|
|
|
1848
|
-
/*! @azure/msal-common v15.
|
|
1834
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
1849
1835
|
|
|
1850
1836
|
/*
|
|
1851
1837
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2036,7 +2022,7 @@ class ScopeSet {
|
|
|
2036
2022
|
}
|
|
2037
2023
|
}
|
|
2038
2024
|
|
|
2039
|
-
/*! @azure/msal-common v15.
|
|
2025
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
2040
2026
|
|
|
2041
2027
|
/*
|
|
2042
2028
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2076,7 +2062,7 @@ function buildClientInfoFromHomeAccountId(homeAccountId) {
|
|
|
2076
2062
|
};
|
|
2077
2063
|
}
|
|
2078
2064
|
|
|
2079
|
-
/*! @azure/msal-common v15.
|
|
2065
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
2080
2066
|
/*
|
|
2081
2067
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2082
2068
|
* Licensed under the MIT License.
|
|
@@ -2155,7 +2141,7 @@ function updateAccountTenantProfileData(baseAccountInfo, tenantProfile, idTokenC
|
|
|
2155
2141
|
return updatedAccountInfo;
|
|
2156
2142
|
}
|
|
2157
2143
|
|
|
2158
|
-
/*! @azure/msal-common v15.
|
|
2144
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
2159
2145
|
/*
|
|
2160
2146
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2161
2147
|
* Licensed under the MIT License.
|
|
@@ -2170,7 +2156,7 @@ const AuthorityType = {
|
|
|
2170
2156
|
Ciam: 3,
|
|
2171
2157
|
};
|
|
2172
2158
|
|
|
2173
|
-
/*! @azure/msal-common v15.
|
|
2159
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
2174
2160
|
/*
|
|
2175
2161
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2176
2162
|
* Licensed under the MIT License.
|
|
@@ -2192,7 +2178,7 @@ function getTenantIdFromIdTokenClaims(idTokenClaims) {
|
|
|
2192
2178
|
return null;
|
|
2193
2179
|
}
|
|
2194
2180
|
|
|
2195
|
-
/*! @azure/msal-common v15.
|
|
2181
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
2196
2182
|
/*
|
|
2197
2183
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2198
2184
|
* Licensed under the MIT License.
|
|
@@ -2216,7 +2202,7 @@ const ProtocolMode = {
|
|
|
2216
2202
|
EAR: "EAR",
|
|
2217
2203
|
};
|
|
2218
2204
|
|
|
2219
|
-
/*! @azure/msal-common v15.
|
|
2205
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
2220
2206
|
|
|
2221
2207
|
/*
|
|
2222
2208
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2459,7 +2445,7 @@ class AccountEntity {
|
|
|
2459
2445
|
}
|
|
2460
2446
|
}
|
|
2461
2447
|
|
|
2462
|
-
/*! @azure/msal-common v15.
|
|
2448
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
2463
2449
|
|
|
2464
2450
|
/*
|
|
2465
2451
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2524,7 +2510,7 @@ function mapToQueryString(parameters, encodeExtraParams = true, extraQueryParame
|
|
|
2524
2510
|
return queryParameterArray.join("&");
|
|
2525
2511
|
}
|
|
2526
2512
|
|
|
2527
|
-
/*! @azure/msal-common v15.
|
|
2513
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
2528
2514
|
|
|
2529
2515
|
/*
|
|
2530
2516
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2688,7 +2674,7 @@ class UrlString {
|
|
|
2688
2674
|
}
|
|
2689
2675
|
}
|
|
2690
2676
|
|
|
2691
|
-
/*! @azure/msal-common v15.
|
|
2677
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
2692
2678
|
|
|
2693
2679
|
/*
|
|
2694
2680
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2719,7 +2705,6 @@ const rawMetdataJSON = {
|
|
|
2719
2705
|
},
|
|
2720
2706
|
},
|
|
2721
2707
|
instanceDiscoveryMetadata: {
|
|
2722
|
-
tenant_discovery_endpoint: "https://{canonicalAuthority}/v2.0/.well-known/openid-configuration",
|
|
2723
2708
|
metadata: [
|
|
2724
2709
|
{
|
|
2725
2710
|
preferred_network: "login.microsoftonline.com",
|
|
@@ -2828,42 +2813,60 @@ function getCloudDiscoveryMetadataFromNetworkResponse(response, authorityHost) {
|
|
|
2828
2813
|
return null;
|
|
2829
2814
|
}
|
|
2830
2815
|
|
|
2831
|
-
/*! @azure/msal-common v15.
|
|
2816
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
2832
2817
|
/*
|
|
2833
2818
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2834
2819
|
* Licensed under the MIT License.
|
|
2835
2820
|
*/
|
|
2836
|
-
const
|
|
2837
|
-
const
|
|
2821
|
+
const cacheQuotaExceeded = "cache_quota_exceeded";
|
|
2822
|
+
const cacheErrorUnknown = "cache_error_unknown";
|
|
2838
2823
|
|
|
2839
|
-
/*! @azure/msal-common v15.
|
|
2824
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
2840
2825
|
|
|
2841
2826
|
/*
|
|
2842
2827
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2843
2828
|
* Licensed under the MIT License.
|
|
2844
2829
|
*/
|
|
2845
2830
|
const CacheErrorMessages = {
|
|
2846
|
-
[
|
|
2847
|
-
[
|
|
2831
|
+
[cacheQuotaExceeded]: "Exceeded cache storage capacity.",
|
|
2832
|
+
[cacheErrorUnknown]: "Unexpected error occurred when using cache storage.",
|
|
2848
2833
|
};
|
|
2849
2834
|
/**
|
|
2850
2835
|
* Error thrown when there is an error with the cache
|
|
2851
2836
|
*/
|
|
2852
|
-
class CacheError extends
|
|
2837
|
+
class CacheError extends AuthError {
|
|
2853
2838
|
constructor(errorCode, errorMessage) {
|
|
2854
2839
|
const message = errorMessage ||
|
|
2855
2840
|
(CacheErrorMessages[errorCode]
|
|
2856
2841
|
? CacheErrorMessages[errorCode]
|
|
2857
|
-
: CacheErrorMessages[
|
|
2842
|
+
: CacheErrorMessages[cacheErrorUnknown]);
|
|
2858
2843
|
super(`${errorCode}: ${message}`);
|
|
2859
2844
|
Object.setPrototypeOf(this, CacheError.prototype);
|
|
2860
2845
|
this.name = "CacheError";
|
|
2861
2846
|
this.errorCode = errorCode;
|
|
2862
2847
|
this.errorMessage = message;
|
|
2863
2848
|
}
|
|
2849
|
+
}
|
|
2850
|
+
/**
|
|
2851
|
+
* Helper function to wrap browser errors in a CacheError object
|
|
2852
|
+
* @param e
|
|
2853
|
+
* @returns
|
|
2854
|
+
*/
|
|
2855
|
+
function createCacheError(e) {
|
|
2856
|
+
if (!(e instanceof Error)) {
|
|
2857
|
+
return new CacheError(cacheErrorUnknown);
|
|
2858
|
+
}
|
|
2859
|
+
if (e.name === "QuotaExceededError" ||
|
|
2860
|
+
e.name === "NS_ERROR_DOM_QUOTA_REACHED" ||
|
|
2861
|
+
e.message.includes("exceeded the quota")) {
|
|
2862
|
+
return new CacheError(cacheQuotaExceeded);
|
|
2863
|
+
}
|
|
2864
|
+
else {
|
|
2865
|
+
return new CacheError(e.name, e.message);
|
|
2866
|
+
}
|
|
2864
2867
|
}
|
|
2865
2868
|
|
|
2866
|
-
/*! @azure/msal-common v15.
|
|
2869
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
2867
2870
|
|
|
2868
2871
|
/*
|
|
2869
2872
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2886,14 +2889,14 @@ class CacheManager {
|
|
|
2886
2889
|
* @param accountFilter - (Optional) filter to narrow down the accounts returned
|
|
2887
2890
|
* @returns Array of AccountInfo objects in cache
|
|
2888
2891
|
*/
|
|
2889
|
-
getAllAccounts(accountFilter) {
|
|
2890
|
-
return this.buildTenantProfiles(this.getAccountsFilteredBy(accountFilter
|
|
2892
|
+
getAllAccounts(accountFilter, correlationId) {
|
|
2893
|
+
return this.buildTenantProfiles(this.getAccountsFilteredBy(accountFilter, correlationId), correlationId, accountFilter);
|
|
2891
2894
|
}
|
|
2892
2895
|
/**
|
|
2893
2896
|
* Gets first tenanted AccountInfo object found based on provided filters
|
|
2894
2897
|
*/
|
|
2895
|
-
getAccountInfoFilteredBy(accountFilter) {
|
|
2896
|
-
const allAccounts = this.getAllAccounts(accountFilter);
|
|
2898
|
+
getAccountInfoFilteredBy(accountFilter, correlationId) {
|
|
2899
|
+
const allAccounts = this.getAllAccounts(accountFilter, correlationId);
|
|
2897
2900
|
if (allAccounts.length > 1) {
|
|
2898
2901
|
// If one or more accounts are found, prioritize accounts that have an ID token
|
|
2899
2902
|
const sortedAccounts = allAccounts.sort((account) => {
|
|
@@ -2914,8 +2917,8 @@ class CacheManager {
|
|
|
2914
2917
|
* @param accountFilter
|
|
2915
2918
|
* @returns
|
|
2916
2919
|
*/
|
|
2917
|
-
getBaseAccountInfo(accountFilter) {
|
|
2918
|
-
const accountEntities = this.getAccountsFilteredBy(accountFilter);
|
|
2920
|
+
getBaseAccountInfo(accountFilter, correlationId) {
|
|
2921
|
+
const accountEntities = this.getAccountsFilteredBy(accountFilter, correlationId);
|
|
2919
2922
|
if (accountEntities.length > 0) {
|
|
2920
2923
|
return accountEntities[0].getAccountInfo();
|
|
2921
2924
|
}
|
|
@@ -2930,12 +2933,12 @@ class CacheManager {
|
|
|
2930
2933
|
* @param accountFilter
|
|
2931
2934
|
* @returns Array of AccountInfo objects that match account and tenant profile filters
|
|
2932
2935
|
*/
|
|
2933
|
-
buildTenantProfiles(cachedAccounts, accountFilter) {
|
|
2936
|
+
buildTenantProfiles(cachedAccounts, correlationId, accountFilter) {
|
|
2934
2937
|
return cachedAccounts.flatMap((accountEntity) => {
|
|
2935
|
-
return this.getTenantProfilesFromAccountEntity(accountEntity, accountFilter?.tenantId, accountFilter);
|
|
2938
|
+
return this.getTenantProfilesFromAccountEntity(accountEntity, correlationId, accountFilter?.tenantId, accountFilter);
|
|
2936
2939
|
});
|
|
2937
2940
|
}
|
|
2938
|
-
getTenantedAccountInfoByFilter(accountInfo, tokenKeys, tenantProfile, tenantProfileFilter) {
|
|
2941
|
+
getTenantedAccountInfoByFilter(accountInfo, tokenKeys, tenantProfile, correlationId, tenantProfileFilter) {
|
|
2939
2942
|
let tenantedAccountInfo = null;
|
|
2940
2943
|
let idTokenClaims;
|
|
2941
2944
|
if (tenantProfileFilter) {
|
|
@@ -2943,7 +2946,7 @@ class CacheManager {
|
|
|
2943
2946
|
return null;
|
|
2944
2947
|
}
|
|
2945
2948
|
}
|
|
2946
|
-
const idToken = this.getIdToken(accountInfo, tokenKeys, tenantProfile.tenantId);
|
|
2949
|
+
const idToken = this.getIdToken(accountInfo, correlationId, tokenKeys, tenantProfile.tenantId);
|
|
2947
2950
|
if (idToken) {
|
|
2948
2951
|
idTokenClaims = extractTokenClaims(idToken.secret, this.cryptoImpl.base64Decode);
|
|
2949
2952
|
if (!this.idTokenClaimsMatchTenantProfileFilter(idTokenClaims, tenantProfileFilter)) {
|
|
@@ -2955,7 +2958,7 @@ class CacheManager {
|
|
|
2955
2958
|
tenantedAccountInfo = updateAccountTenantProfileData(accountInfo, tenantProfile, idTokenClaims, idToken?.secret);
|
|
2956
2959
|
return tenantedAccountInfo;
|
|
2957
2960
|
}
|
|
2958
|
-
getTenantProfilesFromAccountEntity(accountEntity, targetTenantId, tenantProfileFilter) {
|
|
2961
|
+
getTenantProfilesFromAccountEntity(accountEntity, correlationId, targetTenantId, tenantProfileFilter) {
|
|
2959
2962
|
const accountInfo = accountEntity.getAccountInfo();
|
|
2960
2963
|
let searchTenantProfiles = accountInfo.tenantProfiles || new Map();
|
|
2961
2964
|
const tokenKeys = this.getTokenKeys();
|
|
@@ -2975,7 +2978,7 @@ class CacheManager {
|
|
|
2975
2978
|
}
|
|
2976
2979
|
const matchingTenantProfiles = [];
|
|
2977
2980
|
searchTenantProfiles.forEach((tenantProfile) => {
|
|
2978
|
-
const tenantedAccountInfo = this.getTenantedAccountInfoByFilter(accountInfo, tokenKeys, tenantProfile, tenantProfileFilter);
|
|
2981
|
+
const tenantedAccountInfo = this.getTenantedAccountInfoByFilter(accountInfo, tokenKeys, tenantProfile, correlationId, tenantProfileFilter);
|
|
2979
2982
|
if (tenantedAccountInfo) {
|
|
2980
2983
|
matchingTenantProfiles.push(tenantedAccountInfo);
|
|
2981
2984
|
}
|
|
@@ -3049,26 +3052,16 @@ class CacheManager {
|
|
|
3049
3052
|
await this.setRefreshTokenCredential(cacheRecord.refreshToken, correlationId);
|
|
3050
3053
|
}
|
|
3051
3054
|
if (!!cacheRecord.appMetadata) {
|
|
3052
|
-
this.setAppMetadata(cacheRecord.appMetadata);
|
|
3055
|
+
this.setAppMetadata(cacheRecord.appMetadata, correlationId);
|
|
3053
3056
|
}
|
|
3054
3057
|
}
|
|
3055
3058
|
catch (e) {
|
|
3056
3059
|
this.commonLogger?.error(`CacheManager.saveCacheRecord: failed`);
|
|
3057
|
-
if (e instanceof
|
|
3058
|
-
|
|
3059
|
-
if (e.name === "QuotaExceededError" ||
|
|
3060
|
-
e.name === "NS_ERROR_DOM_QUOTA_REACHED" ||
|
|
3061
|
-
e.message.includes("exceeded the quota")) {
|
|
3062
|
-
this.commonLogger?.error(`CacheManager.saveCacheRecord: exceeded storage quota`, correlationId);
|
|
3063
|
-
throw new CacheError(cacheQuotaExceededErrorCode);
|
|
3064
|
-
}
|
|
3065
|
-
else {
|
|
3066
|
-
throw new CacheError(e.name, e.message);
|
|
3067
|
-
}
|
|
3060
|
+
if (e instanceof AuthError) {
|
|
3061
|
+
throw e;
|
|
3068
3062
|
}
|
|
3069
3063
|
else {
|
|
3070
|
-
|
|
3071
|
-
throw new CacheError(cacheUnknownErrorCode);
|
|
3064
|
+
throw createCacheError(e);
|
|
3072
3065
|
}
|
|
3073
3066
|
}
|
|
3074
3067
|
}
|
|
@@ -3092,7 +3085,7 @@ class CacheManager {
|
|
|
3092
3085
|
if (!this.accessTokenKeyMatchesFilter(key, accessTokenFilter, false)) {
|
|
3093
3086
|
return;
|
|
3094
3087
|
}
|
|
3095
|
-
const tokenEntity = this.getAccessTokenCredential(key);
|
|
3088
|
+
const tokenEntity = this.getAccessTokenCredential(key, correlationId);
|
|
3096
3089
|
if (tokenEntity &&
|
|
3097
3090
|
this.credentialMatchesFilter(tokenEntity, accessTokenFilter)) {
|
|
3098
3091
|
const tokenScopeSet = ScopeSet.fromString(tokenEntity.target);
|
|
@@ -3108,7 +3101,7 @@ class CacheManager {
|
|
|
3108
3101
|
* Not checking for casing as keys are all generated in lower case, remember to convert to lower case if object properties are compared
|
|
3109
3102
|
* @param accountFilter - An object containing Account properties to filter by
|
|
3110
3103
|
*/
|
|
3111
|
-
getAccountsFilteredBy(accountFilter) {
|
|
3104
|
+
getAccountsFilteredBy(accountFilter, correlationId) {
|
|
3112
3105
|
const allAccountKeys = this.getAccountKeys();
|
|
3113
3106
|
const matchingAccounts = [];
|
|
3114
3107
|
allAccountKeys.forEach((cacheKey) => {
|
|
@@ -3116,7 +3109,7 @@ class CacheManager {
|
|
|
3116
3109
|
// Don't parse value if the key doesn't match the account filters
|
|
3117
3110
|
return;
|
|
3118
3111
|
}
|
|
3119
|
-
const entity = this.getAccount(cacheKey,
|
|
3112
|
+
const entity = this.getAccount(cacheKey, correlationId);
|
|
3120
3113
|
// Match base account fields
|
|
3121
3114
|
if (!entity) {
|
|
3122
3115
|
return;
|
|
@@ -3353,12 +3346,12 @@ class CacheManager {
|
|
|
3353
3346
|
* @param account
|
|
3354
3347
|
*/
|
|
3355
3348
|
removeAccount(accountKey, correlationId) {
|
|
3356
|
-
const account = this.getAccount(accountKey,
|
|
3349
|
+
const account = this.getAccount(accountKey, correlationId);
|
|
3357
3350
|
if (!account) {
|
|
3358
3351
|
return;
|
|
3359
3352
|
}
|
|
3360
3353
|
this.removeAccountContext(account, correlationId);
|
|
3361
|
-
this.removeItem(accountKey);
|
|
3354
|
+
this.removeItem(accountKey, correlationId);
|
|
3362
3355
|
}
|
|
3363
3356
|
/**
|
|
3364
3357
|
* Removes credentials associated with the provided account
|
|
@@ -3369,7 +3362,7 @@ class CacheManager {
|
|
|
3369
3362
|
const accountId = account.generateAccountId();
|
|
3370
3363
|
allTokenKeys.idToken.forEach((key) => {
|
|
3371
3364
|
if (key.indexOf(accountId) === 0) {
|
|
3372
|
-
this.removeIdToken(key);
|
|
3365
|
+
this.removeIdToken(key, correlationId);
|
|
3373
3366
|
}
|
|
3374
3367
|
});
|
|
3375
3368
|
allTokenKeys.accessToken.forEach((key) => {
|
|
@@ -3379,45 +3372,43 @@ class CacheManager {
|
|
|
3379
3372
|
});
|
|
3380
3373
|
allTokenKeys.refreshToken.forEach((key) => {
|
|
3381
3374
|
if (key.indexOf(accountId) === 0) {
|
|
3382
|
-
this.removeRefreshToken(key);
|
|
3375
|
+
this.removeRefreshToken(key, correlationId);
|
|
3383
3376
|
}
|
|
3384
3377
|
});
|
|
3385
3378
|
}
|
|
3386
3379
|
/**
|
|
3387
|
-
*
|
|
3388
|
-
* @param
|
|
3380
|
+
* Removes accessToken from the cache
|
|
3381
|
+
* @param key
|
|
3382
|
+
* @param correlationId
|
|
3389
3383
|
*/
|
|
3390
3384
|
removeAccessToken(key, correlationId) {
|
|
3391
|
-
const credential = this.getAccessTokenCredential(key);
|
|
3392
|
-
|
|
3385
|
+
const credential = this.getAccessTokenCredential(key, correlationId);
|
|
3386
|
+
this.removeItem(key, correlationId);
|
|
3387
|
+
this.performanceClient.incrementFields({ accessTokensRemoved: 1 }, correlationId);
|
|
3388
|
+
if (!credential ||
|
|
3389
|
+
credential.credentialType.toLowerCase() !==
|
|
3390
|
+
CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase() ||
|
|
3391
|
+
credential.tokenType !== AuthenticationScheme.POP) {
|
|
3392
|
+
// If the credential is not a PoP token, we can return
|
|
3393
3393
|
return;
|
|
3394
3394
|
}
|
|
3395
|
-
this.removeItem(key);
|
|
3396
3395
|
// Remove Token Binding Key from key store for PoP Tokens Credentials
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
void this.cryptoImpl
|
|
3404
|
-
.removeTokenBindingKey(kid)
|
|
3405
|
-
.catch(() => {
|
|
3406
|
-
this.commonLogger.error(`Failed to remove token binding key ${kid}`, correlationId);
|
|
3407
|
-
this.performanceClient?.incrementFields({ removeTokenBindingKeyFailure: 1 }, correlationId);
|
|
3408
|
-
});
|
|
3409
|
-
}
|
|
3410
|
-
}
|
|
3396
|
+
const kid = credential.keyId;
|
|
3397
|
+
if (kid) {
|
|
3398
|
+
void this.cryptoImpl.removeTokenBindingKey(kid).catch(() => {
|
|
3399
|
+
this.commonLogger.error(`Failed to remove token binding key ${kid}`, correlationId);
|
|
3400
|
+
this.performanceClient?.incrementFields({ removeTokenBindingKeyFailure: 1 }, correlationId);
|
|
3401
|
+
});
|
|
3411
3402
|
}
|
|
3412
3403
|
}
|
|
3413
3404
|
/**
|
|
3414
3405
|
* Removes all app metadata objects from cache.
|
|
3415
3406
|
*/
|
|
3416
|
-
removeAppMetadata() {
|
|
3407
|
+
removeAppMetadata(correlationId) {
|
|
3417
3408
|
const allCacheKeys = this.getKeys();
|
|
3418
3409
|
allCacheKeys.forEach((cacheKey) => {
|
|
3419
3410
|
if (this.isAppMetadata(cacheKey)) {
|
|
3420
|
-
this.removeItem(cacheKey);
|
|
3411
|
+
this.removeItem(cacheKey, correlationId);
|
|
3421
3412
|
}
|
|
3422
3413
|
});
|
|
3423
3414
|
return true;
|
|
@@ -3426,9 +3417,9 @@ class CacheManager {
|
|
|
3426
3417
|
* Retrieve AccountEntity from cache
|
|
3427
3418
|
* @param account
|
|
3428
3419
|
*/
|
|
3429
|
-
readAccountFromCache(account) {
|
|
3420
|
+
readAccountFromCache(account, correlationId) {
|
|
3430
3421
|
const accountKey = AccountEntity.generateAccountCacheKey(account);
|
|
3431
|
-
return this.getAccount(accountKey,
|
|
3422
|
+
return this.getAccount(accountKey, correlationId);
|
|
3432
3423
|
}
|
|
3433
3424
|
/**
|
|
3434
3425
|
* Retrieve IdTokenEntity from cache
|
|
@@ -3438,7 +3429,7 @@ class CacheManager {
|
|
|
3438
3429
|
* @param performanceClient {?IPerformanceClient}
|
|
3439
3430
|
* @param correlationId {?string}
|
|
3440
3431
|
*/
|
|
3441
|
-
getIdToken(account, tokenKeys, targetRealm, performanceClient
|
|
3432
|
+
getIdToken(account, correlationId, tokenKeys, targetRealm, performanceClient) {
|
|
3442
3433
|
this.commonLogger.trace("CacheManager - getIdToken called");
|
|
3443
3434
|
const idTokenFilter = {
|
|
3444
3435
|
homeAccountId: account.homeAccountId,
|
|
@@ -3447,7 +3438,7 @@ class CacheManager {
|
|
|
3447
3438
|
clientId: this.clientId,
|
|
3448
3439
|
realm: targetRealm,
|
|
3449
3440
|
};
|
|
3450
|
-
const idTokenMap = this.getIdTokensByFilter(idTokenFilter, tokenKeys);
|
|
3441
|
+
const idTokenMap = this.getIdTokensByFilter(idTokenFilter, correlationId, tokenKeys);
|
|
3451
3442
|
const numIdTokens = idTokenMap.size;
|
|
3452
3443
|
if (numIdTokens < 1) {
|
|
3453
3444
|
this.commonLogger.info("CacheManager:getIdToken - No token found");
|
|
@@ -3480,7 +3471,7 @@ class CacheManager {
|
|
|
3480
3471
|
// Multiple tokens for a single tenant profile, remove all and return null
|
|
3481
3472
|
this.commonLogger.info("CacheManager:getIdToken - Multiple matching ID tokens found, clearing them");
|
|
3482
3473
|
tokensToBeRemoved.forEach((idToken, key) => {
|
|
3483
|
-
this.removeIdToken(key);
|
|
3474
|
+
this.removeIdToken(key, correlationId);
|
|
3484
3475
|
});
|
|
3485
3476
|
if (performanceClient && correlationId) {
|
|
3486
3477
|
performanceClient.addFields({ multiMatchedID: idTokenMap.size }, correlationId);
|
|
@@ -3495,7 +3486,7 @@ class CacheManager {
|
|
|
3495
3486
|
* @param filter
|
|
3496
3487
|
* @returns
|
|
3497
3488
|
*/
|
|
3498
|
-
getIdTokensByFilter(filter, tokenKeys) {
|
|
3489
|
+
getIdTokensByFilter(filter, correlationId, tokenKeys) {
|
|
3499
3490
|
const idTokenKeys = (tokenKeys && tokenKeys.idToken) || this.getTokenKeys().idToken;
|
|
3500
3491
|
const idTokens = new Map();
|
|
3501
3492
|
idTokenKeys.forEach((key) => {
|
|
@@ -3505,7 +3496,7 @@ class CacheManager {
|
|
|
3505
3496
|
})) {
|
|
3506
3497
|
return;
|
|
3507
3498
|
}
|
|
3508
|
-
const idToken = this.getIdTokenCredential(key);
|
|
3499
|
+
const idToken = this.getIdTokenCredential(key, correlationId);
|
|
3509
3500
|
if (idToken && this.credentialMatchesFilter(idToken, filter)) {
|
|
3510
3501
|
idTokens.set(key, idToken);
|
|
3511
3502
|
}
|
|
@@ -3534,20 +3525,21 @@ class CacheManager {
|
|
|
3534
3525
|
* Removes idToken from the cache
|
|
3535
3526
|
* @param key
|
|
3536
3527
|
*/
|
|
3537
|
-
removeIdToken(key) {
|
|
3538
|
-
this.removeItem(key);
|
|
3528
|
+
removeIdToken(key, correlationId) {
|
|
3529
|
+
this.removeItem(key, correlationId);
|
|
3539
3530
|
}
|
|
3540
3531
|
/**
|
|
3541
3532
|
* Removes refresh token from the cache
|
|
3542
3533
|
* @param key
|
|
3543
3534
|
*/
|
|
3544
|
-
removeRefreshToken(key) {
|
|
3545
|
-
this.removeItem(key);
|
|
3535
|
+
removeRefreshToken(key, correlationId) {
|
|
3536
|
+
this.removeItem(key, correlationId);
|
|
3546
3537
|
}
|
|
3547
3538
|
/**
|
|
3548
3539
|
* Retrieve AccessTokenEntity from cache
|
|
3549
3540
|
* @param account {AccountInfo}
|
|
3550
3541
|
* @param request {BaseAuthRequest}
|
|
3542
|
+
* @param correlationId {?string}
|
|
3551
3543
|
* @param tokenKeys {?TokenKeys}
|
|
3552
3544
|
* @param performanceClient {?IPerformanceClient}
|
|
3553
3545
|
*/
|
|
@@ -3581,7 +3573,7 @@ class CacheManager {
|
|
|
3581
3573
|
accessTokenKeys.forEach((key) => {
|
|
3582
3574
|
// Validate key
|
|
3583
3575
|
if (this.accessTokenKeyMatchesFilter(key, accessTokenFilter, true)) {
|
|
3584
|
-
const accessToken = this.getAccessTokenCredential(key);
|
|
3576
|
+
const accessToken = this.getAccessTokenCredential(key, correlationId);
|
|
3585
3577
|
// Validate value
|
|
3586
3578
|
if (accessToken &&
|
|
3587
3579
|
this.credentialMatchesFilter(accessToken, accessTokenFilter)) {
|
|
@@ -3651,14 +3643,14 @@ class CacheManager {
|
|
|
3651
3643
|
* @param filter
|
|
3652
3644
|
* @returns
|
|
3653
3645
|
*/
|
|
3654
|
-
getAccessTokensByFilter(filter) {
|
|
3646
|
+
getAccessTokensByFilter(filter, correlationId) {
|
|
3655
3647
|
const tokenKeys = this.getTokenKeys();
|
|
3656
3648
|
const accessTokens = [];
|
|
3657
3649
|
tokenKeys.accessToken.forEach((key) => {
|
|
3658
3650
|
if (!this.accessTokenKeyMatchesFilter(key, filter, true)) {
|
|
3659
3651
|
return;
|
|
3660
3652
|
}
|
|
3661
|
-
const accessToken = this.getAccessTokenCredential(key);
|
|
3653
|
+
const accessToken = this.getAccessTokenCredential(key, correlationId);
|
|
3662
3654
|
if (accessToken &&
|
|
3663
3655
|
this.credentialMatchesFilter(accessToken, filter)) {
|
|
3664
3656
|
accessTokens.push(accessToken);
|
|
@@ -3670,11 +3662,11 @@ class CacheManager {
|
|
|
3670
3662
|
* Helper to retrieve the appropriate refresh token from cache
|
|
3671
3663
|
* @param account {AccountInfo}
|
|
3672
3664
|
* @param familyRT {boolean}
|
|
3665
|
+
* @param correlationId {?string}
|
|
3673
3666
|
* @param tokenKeys {?TokenKeys}
|
|
3674
3667
|
* @param performanceClient {?IPerformanceClient}
|
|
3675
|
-
* @param correlationId {?string}
|
|
3676
3668
|
*/
|
|
3677
|
-
getRefreshToken(account, familyRT, tokenKeys, performanceClient
|
|
3669
|
+
getRefreshToken(account, familyRT, correlationId, tokenKeys, performanceClient) {
|
|
3678
3670
|
this.commonLogger.trace("CacheManager - getRefreshToken called");
|
|
3679
3671
|
const id = familyRT ? THE_FAMILY_ID : undefined;
|
|
3680
3672
|
const refreshTokenFilter = {
|
|
@@ -3690,7 +3682,7 @@ class CacheManager {
|
|
|
3690
3682
|
refreshTokenKeys.forEach((key) => {
|
|
3691
3683
|
// Validate key
|
|
3692
3684
|
if (this.refreshTokenKeyMatchesFilter(key, refreshTokenFilter)) {
|
|
3693
|
-
const refreshToken = this.getRefreshTokenCredential(key);
|
|
3685
|
+
const refreshToken = this.getRefreshTokenCredential(key, correlationId);
|
|
3694
3686
|
// Validate value
|
|
3695
3687
|
if (refreshToken &&
|
|
3696
3688
|
this.credentialMatchesFilter(refreshToken, refreshTokenFilter)) {
|
|
@@ -4040,7 +4032,7 @@ class DefaultStorageClass extends CacheManager {
|
|
|
4040
4032
|
}
|
|
4041
4033
|
}
|
|
4042
4034
|
|
|
4043
|
-
/*! @azure/msal-common v15.
|
|
4035
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
4044
4036
|
/*
|
|
4045
4037
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4046
4038
|
* Licensed under the MIT License.
|
|
@@ -4305,12 +4297,9 @@ const PerformanceEvents = {
|
|
|
4305
4297
|
* @enum {number}
|
|
4306
4298
|
*/
|
|
4307
4299
|
const PerformanceEventStatus = {
|
|
4308
|
-
|
|
4309
|
-
InProgress: 1,
|
|
4310
|
-
Completed: 2,
|
|
4311
|
-
};
|
|
4300
|
+
InProgress: 1};
|
|
4312
4301
|
|
|
4313
|
-
/*! @azure/msal-common v15.
|
|
4302
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
4314
4303
|
|
|
4315
4304
|
/*
|
|
4316
4305
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4389,7 +4378,7 @@ class StubPerformanceClient {
|
|
|
4389
4378
|
}
|
|
4390
4379
|
}
|
|
4391
4380
|
|
|
4392
|
-
/*! @azure/msal-common v15.
|
|
4381
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
4393
4382
|
|
|
4394
4383
|
/*
|
|
4395
4384
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4489,7 +4478,7 @@ function isOidcProtocolMode(config) {
|
|
|
4489
4478
|
return (config.authOptions.authority.options.protocolMode === ProtocolMode.OIDC);
|
|
4490
4479
|
}
|
|
4491
4480
|
|
|
4492
|
-
/*! @azure/msal-common v15.
|
|
4481
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
4493
4482
|
/*
|
|
4494
4483
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4495
4484
|
* Licensed under the MIT License.
|
|
@@ -4499,7 +4488,7 @@ const CcsCredentialType = {
|
|
|
4499
4488
|
UPN: "UPN",
|
|
4500
4489
|
};
|
|
4501
4490
|
|
|
4502
|
-
/*! @azure/msal-common v15.
|
|
4491
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
4503
4492
|
/*
|
|
4504
4493
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4505
4494
|
* Licensed under the MIT License.
|
|
@@ -4550,7 +4539,7 @@ const BROKER_CLIENT_ID = "brk_client_id";
|
|
|
4550
4539
|
const BROKER_REDIRECT_URI = "brk_redirect_uri";
|
|
4551
4540
|
const INSTANCE_AWARE = "instance_aware";
|
|
4552
4541
|
|
|
4553
|
-
/*! @azure/msal-common v15.
|
|
4542
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
4554
4543
|
|
|
4555
4544
|
/*
|
|
4556
4545
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4936,7 +4925,7 @@ function addBrokerParameters(parameters, brokerClientId, brokerRedirectUri) {
|
|
|
4936
4925
|
}
|
|
4937
4926
|
}
|
|
4938
4927
|
|
|
4939
|
-
/*! @azure/msal-common v15.
|
|
4928
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
4940
4929
|
/*
|
|
4941
4930
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4942
4931
|
* Licensed under the MIT License.
|
|
@@ -4948,7 +4937,7 @@ function isOpenIdConfigResponse(response) {
|
|
|
4948
4937
|
response.hasOwnProperty("jwks_uri"));
|
|
4949
4938
|
}
|
|
4950
4939
|
|
|
4951
|
-
/*! @azure/msal-common v15.
|
|
4940
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
4952
4941
|
/*
|
|
4953
4942
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4954
4943
|
* Licensed under the MIT License.
|
|
@@ -4958,7 +4947,7 @@ function isCloudInstanceDiscoveryResponse(response) {
|
|
|
4958
4947
|
response.hasOwnProperty("metadata"));
|
|
4959
4948
|
}
|
|
4960
4949
|
|
|
4961
|
-
/*! @azure/msal-common v15.
|
|
4950
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
4962
4951
|
/*
|
|
4963
4952
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4964
4953
|
* Licensed under the MIT License.
|
|
@@ -4968,7 +4957,7 @@ function isCloudInstanceDiscoveryErrorResponse(response) {
|
|
|
4968
4957
|
response.hasOwnProperty("error_description"));
|
|
4969
4958
|
}
|
|
4970
4959
|
|
|
4971
|
-
/*! @azure/msal-common v15.
|
|
4960
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
4972
4961
|
/*
|
|
4973
4962
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4974
4963
|
* Licensed under the MIT License.
|
|
@@ -5064,7 +5053,7 @@ const invokeAsync = (callback, eventName, logger, telemetryClient, correlationId
|
|
|
5064
5053
|
};
|
|
5065
5054
|
};
|
|
5066
5055
|
|
|
5067
|
-
/*! @azure/msal-common v15.
|
|
5056
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
5068
5057
|
|
|
5069
5058
|
/*
|
|
5070
5059
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5170,7 +5159,7 @@ RegionDiscovery.IMDS_OPTIONS = {
|
|
|
5170
5159
|
},
|
|
5171
5160
|
};
|
|
5172
5161
|
|
|
5173
|
-
/*! @azure/msal-common v15.
|
|
5162
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
5174
5163
|
|
|
5175
5164
|
/*
|
|
5176
5165
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6009,7 +5998,7 @@ function buildStaticAuthorityOptions(authOptions) {
|
|
|
6009
5998
|
};
|
|
6010
5999
|
}
|
|
6011
6000
|
|
|
6012
|
-
/*! @azure/msal-common v15.
|
|
6001
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
6013
6002
|
|
|
6014
6003
|
/*
|
|
6015
6004
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6040,7 +6029,7 @@ async function createDiscoveredInstance(authorityUri, networkClient, cacheManage
|
|
|
6040
6029
|
}
|
|
6041
6030
|
}
|
|
6042
6031
|
|
|
6043
|
-
/*! @azure/msal-common v15.
|
|
6032
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
6044
6033
|
|
|
6045
6034
|
/*
|
|
6046
6035
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6059,7 +6048,7 @@ class ServerError extends AuthError {
|
|
|
6059
6048
|
}
|
|
6060
6049
|
}
|
|
6061
6050
|
|
|
6062
|
-
/*! @azure/msal-common v15.
|
|
6051
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
6063
6052
|
/*
|
|
6064
6053
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6065
6054
|
* Licensed under the MIT License.
|
|
@@ -6080,7 +6069,7 @@ function getRequestThumbprint(clientId, request, homeAccountId) {
|
|
|
6080
6069
|
};
|
|
6081
6070
|
}
|
|
6082
6071
|
|
|
6083
|
-
/*! @azure/msal-common v15.
|
|
6072
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
6084
6073
|
|
|
6085
6074
|
/*
|
|
6086
6075
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6100,12 +6089,12 @@ class ThrottlingUtils {
|
|
|
6100
6089
|
* @param cacheManager
|
|
6101
6090
|
* @param thumbprint
|
|
6102
6091
|
*/
|
|
6103
|
-
static preProcess(cacheManager, thumbprint) {
|
|
6092
|
+
static preProcess(cacheManager, thumbprint, correlationId) {
|
|
6104
6093
|
const key = ThrottlingUtils.generateThrottlingStorageKey(thumbprint);
|
|
6105
6094
|
const value = cacheManager.getThrottlingCache(key);
|
|
6106
6095
|
if (value) {
|
|
6107
6096
|
if (value.throttleTime < Date.now()) {
|
|
6108
|
-
cacheManager.removeItem(key);
|
|
6097
|
+
cacheManager.removeItem(key, correlationId);
|
|
6109
6098
|
return;
|
|
6110
6099
|
}
|
|
6111
6100
|
throw new ServerError(value.errorCodes?.join(" ") || Constants$1.EMPTY_STRING, value.errorMessage, value.subError);
|
|
@@ -6117,7 +6106,7 @@ class ThrottlingUtils {
|
|
|
6117
6106
|
* @param thumbprint
|
|
6118
6107
|
* @param response
|
|
6119
6108
|
*/
|
|
6120
|
-
static postProcess(cacheManager, thumbprint, response) {
|
|
6109
|
+
static postProcess(cacheManager, thumbprint, response, correlationId) {
|
|
6121
6110
|
if (ThrottlingUtils.checkResponseStatus(response) ||
|
|
6122
6111
|
ThrottlingUtils.checkResponseForRetryAfter(response)) {
|
|
6123
6112
|
const thumbprintValue = {
|
|
@@ -6127,7 +6116,7 @@ class ThrottlingUtils {
|
|
|
6127
6116
|
errorMessage: response.body.error_description,
|
|
6128
6117
|
subError: response.body.suberror,
|
|
6129
6118
|
};
|
|
6130
|
-
cacheManager.setThrottlingCache(ThrottlingUtils.generateThrottlingStorageKey(thumbprint), thumbprintValue);
|
|
6119
|
+
cacheManager.setThrottlingCache(ThrottlingUtils.generateThrottlingStorageKey(thumbprint), thumbprintValue, correlationId);
|
|
6131
6120
|
}
|
|
6132
6121
|
}
|
|
6133
6122
|
/**
|
|
@@ -6163,11 +6152,11 @@ class ThrottlingUtils {
|
|
|
6163
6152
|
static removeThrottle(cacheManager, clientId, request, homeAccountIdentifier) {
|
|
6164
6153
|
const thumbprint = getRequestThumbprint(clientId, request, homeAccountIdentifier);
|
|
6165
6154
|
const key = this.generateThrottlingStorageKey(thumbprint);
|
|
6166
|
-
cacheManager.removeItem(key);
|
|
6155
|
+
cacheManager.removeItem(key, request.correlationId);
|
|
6167
6156
|
}
|
|
6168
6157
|
}
|
|
6169
6158
|
|
|
6170
|
-
/*! @azure/msal-common v15.
|
|
6159
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
6171
6160
|
|
|
6172
6161
|
/*
|
|
6173
6162
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6187,7 +6176,7 @@ class NetworkError extends AuthError {
|
|
|
6187
6176
|
}
|
|
6188
6177
|
}
|
|
6189
6178
|
|
|
6190
|
-
/*! @azure/msal-common v15.
|
|
6179
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
6191
6180
|
|
|
6192
6181
|
/*
|
|
6193
6182
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6269,7 +6258,7 @@ class BaseClient {
|
|
|
6269
6258
|
* @param correlationId - CorrelationId for telemetry
|
|
6270
6259
|
*/
|
|
6271
6260
|
async sendPostRequest(thumbprint, tokenEndpoint, options, correlationId) {
|
|
6272
|
-
ThrottlingUtils.preProcess(this.cacheManager, thumbprint);
|
|
6261
|
+
ThrottlingUtils.preProcess(this.cacheManager, thumbprint, correlationId);
|
|
6273
6262
|
let response;
|
|
6274
6263
|
try {
|
|
6275
6264
|
response = await invokeAsync((this.networkClient.sendPostRequestAsync.bind(this.networkClient)), PerformanceEvents.NetworkClientSendPostRequestAsync, this.logger, this.performanceClient, correlationId)(tokenEndpoint, options);
|
|
@@ -6304,7 +6293,7 @@ class BaseClient {
|
|
|
6304
6293
|
throw createClientAuthError(networkError);
|
|
6305
6294
|
}
|
|
6306
6295
|
}
|
|
6307
|
-
ThrottlingUtils.postProcess(this.cacheManager, thumbprint, response);
|
|
6296
|
+
ThrottlingUtils.postProcess(this.cacheManager, thumbprint, response, correlationId);
|
|
6308
6297
|
return response;
|
|
6309
6298
|
}
|
|
6310
6299
|
/**
|
|
@@ -6335,7 +6324,7 @@ class BaseClient {
|
|
|
6335
6324
|
}
|
|
6336
6325
|
}
|
|
6337
6326
|
|
|
6338
|
-
/*! @azure/msal-common v15.
|
|
6327
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
6339
6328
|
/*
|
|
6340
6329
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6341
6330
|
* Licensed under the MIT License.
|
|
@@ -6363,7 +6352,7 @@ var InteractionRequiredAuthErrorCodes = /*#__PURE__*/Object.freeze({
|
|
|
6363
6352
|
uxNotAllowed: uxNotAllowed
|
|
6364
6353
|
});
|
|
6365
6354
|
|
|
6366
|
-
/*! @azure/msal-common v15.
|
|
6355
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
6367
6356
|
|
|
6368
6357
|
/*
|
|
6369
6358
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6453,7 +6442,7 @@ function createInteractionRequiredAuthError(errorCode) {
|
|
|
6453
6442
|
return new InteractionRequiredAuthError(errorCode, InteractionRequiredAuthErrorMessages[errorCode]);
|
|
6454
6443
|
}
|
|
6455
6444
|
|
|
6456
|
-
/*! @azure/msal-common v15.
|
|
6445
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
6457
6446
|
|
|
6458
6447
|
/*
|
|
6459
6448
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6525,16 +6514,14 @@ class ProtocolUtils {
|
|
|
6525
6514
|
}
|
|
6526
6515
|
}
|
|
6527
6516
|
|
|
6528
|
-
/*! @azure/msal-common v15.
|
|
6517
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
6529
6518
|
|
|
6530
6519
|
/*
|
|
6531
6520
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6532
6521
|
* Licensed under the MIT License.
|
|
6533
6522
|
*/
|
|
6534
6523
|
const KeyLocation = {
|
|
6535
|
-
SW: "sw"
|
|
6536
|
-
UHW: "uhw",
|
|
6537
|
-
};
|
|
6524
|
+
SW: "sw"};
|
|
6538
6525
|
/** @internal */
|
|
6539
6526
|
class PopTokenGenerator {
|
|
6540
6527
|
constructor(cryptoUtils, performanceClient) {
|
|
@@ -6609,7 +6596,7 @@ class PopTokenGenerator {
|
|
|
6609
6596
|
}
|
|
6610
6597
|
}
|
|
6611
6598
|
|
|
6612
|
-
/*! @azure/msal-common v15.
|
|
6599
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
6613
6600
|
/*
|
|
6614
6601
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6615
6602
|
* Licensed under the MIT License.
|
|
@@ -6636,7 +6623,7 @@ class PopTokenGenerator {
|
|
|
6636
6623
|
}
|
|
6637
6624
|
}
|
|
6638
6625
|
|
|
6639
|
-
/*! @azure/msal-common v15.
|
|
6626
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
6640
6627
|
|
|
6641
6628
|
/*
|
|
6642
6629
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6749,7 +6736,7 @@ class ResponseHandler {
|
|
|
6749
6736
|
!forceCacheRefreshTokenResponse &&
|
|
6750
6737
|
cacheRecord.account) {
|
|
6751
6738
|
const key = cacheRecord.account.generateAccountKey();
|
|
6752
|
-
const account = this.cacheStorage.getAccount(key);
|
|
6739
|
+
const account = this.cacheStorage.getAccount(key, request.correlationId);
|
|
6753
6740
|
if (!account) {
|
|
6754
6741
|
this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache");
|
|
6755
6742
|
return await ResponseHandler.generateAuthenticationResult(this.cryptoObj, authority, cacheRecord, false, request, idTokenClaims, requestStateObj, undefined, serverRequestId);
|
|
@@ -6784,7 +6771,7 @@ class ResponseHandler {
|
|
|
6784
6771
|
let cachedAccount;
|
|
6785
6772
|
if (serverTokenResponse.id_token && !!idTokenClaims) {
|
|
6786
6773
|
cachedIdToken = createIdTokenEntity(this.homeAccountIdentifier, env, serverTokenResponse.id_token, this.clientId, claimsTenantId || "");
|
|
6787
|
-
cachedAccount = buildAccountToCache(this.cacheStorage, authority, this.homeAccountIdentifier, this.cryptoObj.base64Decode, idTokenClaims, serverTokenResponse.client_info, env, claimsTenantId, authCodePayload, undefined, // nativeAccountId
|
|
6774
|
+
cachedAccount = buildAccountToCache(this.cacheStorage, authority, this.homeAccountIdentifier, this.cryptoObj.base64Decode, request.correlationId, idTokenClaims, serverTokenResponse.client_info, env, claimsTenantId, authCodePayload, undefined, // nativeAccountId
|
|
6788
6775
|
this.logger);
|
|
6789
6776
|
}
|
|
6790
6777
|
// AccessToken
|
|
@@ -6933,7 +6920,7 @@ class ResponseHandler {
|
|
|
6933
6920
|
};
|
|
6934
6921
|
}
|
|
6935
6922
|
}
|
|
6936
|
-
function buildAccountToCache(cacheStorage, authority, homeAccountId, base64Decode, idTokenClaims, clientInfo, environment, claimsTenantId, authCodePayload, nativeAccountId, logger) {
|
|
6923
|
+
function buildAccountToCache(cacheStorage, authority, homeAccountId, base64Decode, correlationId, idTokenClaims, clientInfo, environment, claimsTenantId, authCodePayload, nativeAccountId, logger) {
|
|
6937
6924
|
logger?.verbose("setCachedAccount called");
|
|
6938
6925
|
// Check if base account is already cached
|
|
6939
6926
|
const accountKeys = cacheStorage.getAccountKeys();
|
|
@@ -6942,7 +6929,7 @@ function buildAccountToCache(cacheStorage, authority, homeAccountId, base64Decod
|
|
|
6942
6929
|
});
|
|
6943
6930
|
let cachedAccount = null;
|
|
6944
6931
|
if (baseAccountKey) {
|
|
6945
|
-
cachedAccount = cacheStorage.getAccount(baseAccountKey);
|
|
6932
|
+
cachedAccount = cacheStorage.getAccount(baseAccountKey, correlationId);
|
|
6946
6933
|
}
|
|
6947
6934
|
const baseAccount = cachedAccount ||
|
|
6948
6935
|
AccountEntity.createAccount({
|
|
@@ -6967,74 +6954,7 @@ function buildAccountToCache(cacheStorage, authority, homeAccountId, base64Decod
|
|
|
6967
6954
|
return baseAccount;
|
|
6968
6955
|
}
|
|
6969
6956
|
|
|
6970
|
-
/*! @azure/msal-common v15.
|
|
6971
|
-
|
|
6972
|
-
/*
|
|
6973
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6974
|
-
* Licensed under the MIT License.
|
|
6975
|
-
*/
|
|
6976
|
-
/**
|
|
6977
|
-
* Validates server consumable params from the "request" objects
|
|
6978
|
-
*/
|
|
6979
|
-
class RequestValidator {
|
|
6980
|
-
/**
|
|
6981
|
-
* Utility to check if the `redirectUri` in the request is a non-null value
|
|
6982
|
-
* @param redirectUri
|
|
6983
|
-
*/
|
|
6984
|
-
static validateRedirectUri(redirectUri) {
|
|
6985
|
-
if (!redirectUri) {
|
|
6986
|
-
throw createClientConfigurationError(redirectUriEmpty);
|
|
6987
|
-
}
|
|
6988
|
-
}
|
|
6989
|
-
/**
|
|
6990
|
-
* Utility to validate prompt sent by the user in the request
|
|
6991
|
-
* @param prompt
|
|
6992
|
-
*/
|
|
6993
|
-
static validatePrompt(prompt) {
|
|
6994
|
-
const promptValues = [];
|
|
6995
|
-
for (const value in PromptValue) {
|
|
6996
|
-
promptValues.push(PromptValue[value]);
|
|
6997
|
-
}
|
|
6998
|
-
if (promptValues.indexOf(prompt) < 0) {
|
|
6999
|
-
throw createClientConfigurationError(invalidPromptValue);
|
|
7000
|
-
}
|
|
7001
|
-
}
|
|
7002
|
-
static validateClaims(claims) {
|
|
7003
|
-
try {
|
|
7004
|
-
JSON.parse(claims);
|
|
7005
|
-
}
|
|
7006
|
-
catch (e) {
|
|
7007
|
-
throw createClientConfigurationError(invalidClaims);
|
|
7008
|
-
}
|
|
7009
|
-
}
|
|
7010
|
-
/**
|
|
7011
|
-
* Utility to validate code_challenge and code_challenge_method
|
|
7012
|
-
* @param codeChallenge
|
|
7013
|
-
* @param codeChallengeMethod
|
|
7014
|
-
*/
|
|
7015
|
-
static validateCodeChallengeParams(codeChallenge, codeChallengeMethod) {
|
|
7016
|
-
if (!codeChallenge || !codeChallengeMethod) {
|
|
7017
|
-
throw createClientConfigurationError(pkceParamsMissing);
|
|
7018
|
-
}
|
|
7019
|
-
else {
|
|
7020
|
-
this.validateCodeChallengeMethod(codeChallengeMethod);
|
|
7021
|
-
}
|
|
7022
|
-
}
|
|
7023
|
-
/**
|
|
7024
|
-
* Utility to validate code_challenge_method
|
|
7025
|
-
* @param codeChallengeMethod
|
|
7026
|
-
*/
|
|
7027
|
-
static validateCodeChallengeMethod(codeChallengeMethod) {
|
|
7028
|
-
if ([
|
|
7029
|
-
CodeChallengeMethodValues.PLAIN,
|
|
7030
|
-
CodeChallengeMethodValues.S256,
|
|
7031
|
-
].indexOf(codeChallengeMethod) < 0) {
|
|
7032
|
-
throw createClientConfigurationError(invalidCodeChallengeMethod);
|
|
7033
|
-
}
|
|
7034
|
-
}
|
|
7035
|
-
}
|
|
7036
|
-
|
|
7037
|
-
/*! @azure/msal-common v15.7.1 2025-06-18 */
|
|
6957
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
7038
6958
|
/*
|
|
7039
6959
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
7040
6960
|
* Licensed under the MIT License.
|
|
@@ -7052,7 +6972,7 @@ async function getClientAssertion(clientAssertion, clientId, tokenEndpoint) {
|
|
|
7052
6972
|
}
|
|
7053
6973
|
}
|
|
7054
6974
|
|
|
7055
|
-
/*! @azure/msal-common v15.
|
|
6975
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
7056
6976
|
|
|
7057
6977
|
/*
|
|
7058
6978
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7146,7 +7066,9 @@ class AuthorizationCodeClient extends BaseClient {
|
|
|
7146
7066
|
*/
|
|
7147
7067
|
if (!this.includeRedirectUri) {
|
|
7148
7068
|
// Just validate
|
|
7149
|
-
|
|
7069
|
+
if (!request.redirectUri) {
|
|
7070
|
+
throw createClientConfigurationError(redirectUriEmpty);
|
|
7071
|
+
}
|
|
7150
7072
|
}
|
|
7151
7073
|
else {
|
|
7152
7074
|
// Validate and include redirect uri
|
|
@@ -7285,7 +7207,7 @@ class AuthorizationCodeClient extends BaseClient {
|
|
|
7285
7207
|
}
|
|
7286
7208
|
}
|
|
7287
7209
|
|
|
7288
|
-
/*! @azure/msal-common v15.
|
|
7210
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
7289
7211
|
|
|
7290
7212
|
/*
|
|
7291
7213
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7358,7 +7280,7 @@ class RefreshTokenClient extends BaseClient {
|
|
|
7358
7280
|
async acquireTokenWithCachedRefreshToken(request, foci) {
|
|
7359
7281
|
this.performanceClient?.addQueueMeasurement(PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, request.correlationId);
|
|
7360
7282
|
// fetches family RT or application RT based on FOCI value
|
|
7361
|
-
const refreshToken = invoke(this.cacheManager.getRefreshToken.bind(this.cacheManager), PerformanceEvents.CacheManagerGetRefreshToken, this.logger, this.performanceClient, request.correlationId)(request.account, foci, undefined, this.performanceClient
|
|
7283
|
+
const refreshToken = invoke(this.cacheManager.getRefreshToken.bind(this.cacheManager), PerformanceEvents.CacheManagerGetRefreshToken, this.logger, this.performanceClient, request.correlationId)(request.account, foci, request.correlationId, undefined, this.performanceClient);
|
|
7362
7284
|
if (!refreshToken) {
|
|
7363
7285
|
throw createInteractionRequiredAuthError(noTokensFound);
|
|
7364
7286
|
}
|
|
@@ -7388,7 +7310,7 @@ class RefreshTokenClient extends BaseClient {
|
|
|
7388
7310
|
// Remove bad refresh token from cache
|
|
7389
7311
|
this.logger.verbose("acquireTokenWithRefreshToken: bad refresh token, removing from cache");
|
|
7390
7312
|
const badRefreshTokenKey = generateCredentialKey(refreshToken);
|
|
7391
|
-
this.cacheManager.removeRefreshToken(badRefreshTokenKey);
|
|
7313
|
+
this.cacheManager.removeRefreshToken(badRefreshTokenKey, request.correlationId);
|
|
7392
7314
|
}
|
|
7393
7315
|
}
|
|
7394
7316
|
throw e;
|
|
@@ -7494,7 +7416,7 @@ class RefreshTokenClient extends BaseClient {
|
|
|
7494
7416
|
}
|
|
7495
7417
|
}
|
|
7496
7418
|
|
|
7497
|
-
/*! @azure/msal-common v15.
|
|
7419
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
7498
7420
|
|
|
7499
7421
|
/*
|
|
7500
7422
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7546,9 +7468,9 @@ class SilentFlowClient extends BaseClient {
|
|
|
7546
7468
|
}
|
|
7547
7469
|
const environment = request.authority || this.authority.getPreferredCache();
|
|
7548
7470
|
const cacheRecord = {
|
|
7549
|
-
account: this.cacheManager.readAccountFromCache(request.account),
|
|
7471
|
+
account: this.cacheManager.readAccountFromCache(request.account, request.correlationId),
|
|
7550
7472
|
accessToken: cachedAccessToken,
|
|
7551
|
-
idToken: this.cacheManager.getIdToken(request.account, tokenKeys, requestTenantId, this.performanceClient
|
|
7473
|
+
idToken: this.cacheManager.getIdToken(request.account, request.correlationId, tokenKeys, requestTenantId, this.performanceClient),
|
|
7552
7474
|
refreshToken: null,
|
|
7553
7475
|
appMetadata: this.cacheManager.readAppMetadataFromCache(environment),
|
|
7554
7476
|
};
|
|
@@ -7592,7 +7514,7 @@ class SilentFlowClient extends BaseClient {
|
|
|
7592
7514
|
}
|
|
7593
7515
|
}
|
|
7594
7516
|
|
|
7595
|
-
/*! @azure/msal-common v15.
|
|
7517
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
7596
7518
|
|
|
7597
7519
|
/*
|
|
7598
7520
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7742,7 +7664,7 @@ function extractLoginHint(account) {
|
|
|
7742
7664
|
return account.idTokenClaims?.login_hint || null;
|
|
7743
7665
|
}
|
|
7744
7666
|
|
|
7745
|
-
/*! @azure/msal-common v15.
|
|
7667
|
+
/*! @azure/msal-common v15.8.1 2025-07-08 */
|
|
7746
7668
|
|
|
7747
7669
|
/*
|
|
7748
7670
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7881,7 +7803,7 @@ class ServerTelemetryManager {
|
|
|
7881
7803
|
else {
|
|
7882
7804
|
lastRequests.errors.push(SERVER_TELEM_CONSTANTS.UNKNOWN_ERROR);
|
|
7883
7805
|
}
|
|
7884
|
-
this.cacheManager.setServerTelemetry(this.telemetryCacheKey, lastRequests);
|
|
7806
|
+
this.cacheManager.setServerTelemetry(this.telemetryCacheKey, lastRequests, this.correlationId);
|
|
7885
7807
|
return;
|
|
7886
7808
|
}
|
|
7887
7809
|
/**
|
|
@@ -7890,7 +7812,7 @@ class ServerTelemetryManager {
|
|
|
7890
7812
|
incrementCacheHits() {
|
|
7891
7813
|
const lastRequests = this.getLastRequests();
|
|
7892
7814
|
lastRequests.cacheHits += 1;
|
|
7893
|
-
this.cacheManager.setServerTelemetry(this.telemetryCacheKey, lastRequests);
|
|
7815
|
+
this.cacheManager.setServerTelemetry(this.telemetryCacheKey, lastRequests, this.correlationId);
|
|
7894
7816
|
return lastRequests.cacheHits;
|
|
7895
7817
|
}
|
|
7896
7818
|
/**
|
|
@@ -7914,7 +7836,7 @@ class ServerTelemetryManager {
|
|
|
7914
7836
|
const errorCount = lastRequests.errors.length;
|
|
7915
7837
|
if (numErrorsFlushed === errorCount) {
|
|
7916
7838
|
// All errors were sent on last request, clear Telemetry cache
|
|
7917
|
-
this.cacheManager.removeItem(this.telemetryCacheKey);
|
|
7839
|
+
this.cacheManager.removeItem(this.telemetryCacheKey, this.correlationId);
|
|
7918
7840
|
}
|
|
7919
7841
|
else {
|
|
7920
7842
|
// Partial data was flushed to server, construct a new telemetry cache item with errors that were not flushed
|
|
@@ -7923,7 +7845,7 @@ class ServerTelemetryManager {
|
|
|
7923
7845
|
errors: lastRequests.errors.slice(numErrorsFlushed),
|
|
7924
7846
|
cacheHits: 0,
|
|
7925
7847
|
};
|
|
7926
|
-
this.cacheManager.setServerTelemetry(this.telemetryCacheKey, serverTelemEntity);
|
|
7848
|
+
this.cacheManager.setServerTelemetry(this.telemetryCacheKey, serverTelemEntity, this.correlationId);
|
|
7927
7849
|
}
|
|
7928
7850
|
}
|
|
7929
7851
|
/**
|
|
@@ -7990,7 +7912,7 @@ class ServerTelemetryManager {
|
|
|
7990
7912
|
setNativeBrokerErrorCode(errorCode) {
|
|
7991
7913
|
const lastRequests = this.getLastRequests();
|
|
7992
7914
|
lastRequests.nativeBrokerErrorCode = errorCode;
|
|
7993
|
-
this.cacheManager.setServerTelemetry(this.telemetryCacheKey, lastRequests);
|
|
7915
|
+
this.cacheManager.setServerTelemetry(this.telemetryCacheKey, lastRequests, this.correlationId);
|
|
7994
7916
|
}
|
|
7995
7917
|
getNativeBrokerErrorCode() {
|
|
7996
7918
|
return this.getLastRequests().nativeBrokerErrorCode;
|
|
@@ -7998,7 +7920,7 @@ class ServerTelemetryManager {
|
|
|
7998
7920
|
clearNativeBrokerErrorCode() {
|
|
7999
7921
|
const lastRequests = this.getLastRequests();
|
|
8000
7922
|
delete lastRequests.nativeBrokerErrorCode;
|
|
8001
|
-
this.cacheManager.setServerTelemetry(this.telemetryCacheKey, lastRequests);
|
|
7923
|
+
this.cacheManager.setServerTelemetry(this.telemetryCacheKey, lastRequests, this.correlationId);
|
|
8002
7924
|
}
|
|
8003
7925
|
static makeExtraSkuString(params) {
|
|
8004
7926
|
return makeExtraSkuString(params);
|
|
@@ -8258,7 +8180,6 @@ const HttpMethod = {
|
|
|
8258
8180
|
POST: "post",
|
|
8259
8181
|
};
|
|
8260
8182
|
const ProxyStatus = {
|
|
8261
|
-
SUCCESS: HttpStatus.SUCCESS,
|
|
8262
8183
|
SUCCESS_RANGE_START: HttpStatus.SUCCESS_RANGE_START,
|
|
8263
8184
|
SUCCESS_RANGE_END: HttpStatus.SUCCESS_RANGE_END,
|
|
8264
8185
|
SERVER_ERROR: HttpStatus.SERVER_ERROR,
|
|
@@ -8313,7 +8234,6 @@ const ApiId = {
|
|
|
8313
8234
|
* JWT constants
|
|
8314
8235
|
*/
|
|
8315
8236
|
const JwtConstants = {
|
|
8316
|
-
ALGORITHM: "alg",
|
|
8317
8237
|
RSA_256: "RS256",
|
|
8318
8238
|
PSS_256: "PS256",
|
|
8319
8239
|
X5T_256: "x5t#S256",
|
|
@@ -9685,7 +9605,7 @@ class TokenCache {
|
|
|
9685
9605
|
/**
|
|
9686
9606
|
* API that retrieves all accounts currently in cache to the user
|
|
9687
9607
|
*/
|
|
9688
|
-
async getAllAccounts() {
|
|
9608
|
+
async getAllAccounts(correlationId = new CryptoProvider().createNewGuid()) {
|
|
9689
9609
|
this.logger.trace("getAllAccounts called");
|
|
9690
9610
|
let cacheContext;
|
|
9691
9611
|
try {
|
|
@@ -9693,7 +9613,7 @@ class TokenCache {
|
|
|
9693
9613
|
cacheContext = new TokenCacheContext(this, false);
|
|
9694
9614
|
await this.persistence.beforeCacheAccess(cacheContext);
|
|
9695
9615
|
}
|
|
9696
|
-
return this.storage.getAllAccounts();
|
|
9616
|
+
return this.storage.getAllAccounts({}, correlationId);
|
|
9697
9617
|
}
|
|
9698
9618
|
finally {
|
|
9699
9619
|
if (this.persistence && cacheContext) {
|
|
@@ -10040,7 +9960,7 @@ class ClientAssertion {
|
|
|
10040
9960
|
|
|
10041
9961
|
/* eslint-disable header/header */
|
|
10042
9962
|
const name = "@azure/msal-node";
|
|
10043
|
-
const version = "3.6.
|
|
9963
|
+
const version = "3.6.3";
|
|
10044
9964
|
|
|
10045
9965
|
/*
|
|
10046
9966
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -11130,7 +11050,7 @@ class ClientCredentialClient extends BaseClient {
|
|
|
11130
11050
|
await clientConfiguration.persistencePlugin.beforeCacheAccess(cacheContext);
|
|
11131
11051
|
}
|
|
11132
11052
|
const cachedAccessToken = this.readAccessTokenFromCache(authority, managedIdentityConfiguration.managedIdentityId?.id ||
|
|
11133
|
-
clientConfiguration.authOptions.clientId, new ScopeSet(request.scopes || []), cacheManager);
|
|
11053
|
+
clientConfiguration.authOptions.clientId, new ScopeSet(request.scopes || []), cacheManager, request.correlationId);
|
|
11134
11054
|
if (clientConfiguration.serializableCache &&
|
|
11135
11055
|
clientConfiguration.persistencePlugin &&
|
|
11136
11056
|
cacheContext) {
|
|
@@ -11167,7 +11087,7 @@ class ClientCredentialClient extends BaseClient {
|
|
|
11167
11087
|
/**
|
|
11168
11088
|
* Reads access token from the cache
|
|
11169
11089
|
*/
|
|
11170
|
-
readAccessTokenFromCache(authority, id, scopeSet, cacheManager) {
|
|
11090
|
+
readAccessTokenFromCache(authority, id, scopeSet, cacheManager, correlationId) {
|
|
11171
11091
|
const accessTokenFilter = {
|
|
11172
11092
|
homeAccountId: Constants$1.EMPTY_STRING,
|
|
11173
11093
|
environment: authority.canonicalAuthorityUrlComponents.HostNameAndPort,
|
|
@@ -11176,7 +11096,7 @@ class ClientCredentialClient extends BaseClient {
|
|
|
11176
11096
|
realm: authority.tenant,
|
|
11177
11097
|
target: ScopeSet.createSearchScopes(scopeSet.asArray()),
|
|
11178
11098
|
};
|
|
11179
|
-
const accessTokens = cacheManager.getAccessTokensByFilter(accessTokenFilter);
|
|
11099
|
+
const accessTokens = cacheManager.getAccessTokensByFilter(accessTokenFilter, correlationId);
|
|
11180
11100
|
if (accessTokens.length < 1) {
|
|
11181
11101
|
return null;
|
|
11182
11102
|
}
|
|
@@ -11329,7 +11249,7 @@ class OnBehalfOfClient extends BaseClient {
|
|
|
11329
11249
|
throw createClientAuthError(tokenRefreshRequired);
|
|
11330
11250
|
}
|
|
11331
11251
|
// fetch the idToken from cache
|
|
11332
|
-
const cachedIdToken = this.readIdTokenFromCacheForOBO(cachedAccessToken.homeAccountId);
|
|
11252
|
+
const cachedIdToken = this.readIdTokenFromCacheForOBO(cachedAccessToken.homeAccountId, request.correlationId);
|
|
11333
11253
|
let idTokenClaims;
|
|
11334
11254
|
let cachedAccount = null;
|
|
11335
11255
|
if (cachedIdToken) {
|
|
@@ -11342,7 +11262,7 @@ class OnBehalfOfClient extends BaseClient {
|
|
|
11342
11262
|
username: Constants$1.EMPTY_STRING,
|
|
11343
11263
|
localAccountId: localAccountId || Constants$1.EMPTY_STRING,
|
|
11344
11264
|
};
|
|
11345
|
-
cachedAccount = this.cacheManager.readAccountFromCache(accountInfo);
|
|
11265
|
+
cachedAccount = this.cacheManager.readAccountFromCache(accountInfo, request.correlationId);
|
|
11346
11266
|
}
|
|
11347
11267
|
// increment telemetry cache hit counter
|
|
11348
11268
|
if (this.config.serverTelemetryManager) {
|
|
@@ -11361,7 +11281,7 @@ class OnBehalfOfClient extends BaseClient {
|
|
|
11361
11281
|
* Certain use cases of OBO flow do not expect an idToken in the cache/or from the service
|
|
11362
11282
|
* @param atHomeAccountId - account id
|
|
11363
11283
|
*/
|
|
11364
|
-
readIdTokenFromCacheForOBO(atHomeAccountId) {
|
|
11284
|
+
readIdTokenFromCacheForOBO(atHomeAccountId, correlationId) {
|
|
11365
11285
|
const idTokenFilter = {
|
|
11366
11286
|
homeAccountId: atHomeAccountId,
|
|
11367
11287
|
environment: this.authority.canonicalAuthorityUrlComponents.HostNameAndPort,
|
|
@@ -11369,7 +11289,7 @@ class OnBehalfOfClient extends BaseClient {
|
|
|
11369
11289
|
clientId: this.config.authOptions.clientId,
|
|
11370
11290
|
realm: this.authority.tenant,
|
|
11371
11291
|
};
|
|
11372
|
-
const idTokenMap = this.cacheManager.getIdTokensByFilter(idTokenFilter);
|
|
11292
|
+
const idTokenMap = this.cacheManager.getIdTokensByFilter(idTokenFilter, correlationId);
|
|
11373
11293
|
// When acquiring a token on behalf of an application, there might not be an id token in the cache
|
|
11374
11294
|
if (Object.values(idTokenMap).length < 1) {
|
|
11375
11295
|
return null;
|
|
@@ -11400,7 +11320,7 @@ class OnBehalfOfClient extends BaseClient {
|
|
|
11400
11320
|
requestedClaimsHash: request.requestedClaimsHash,
|
|
11401
11321
|
userAssertionHash: this.userAssertionHash,
|
|
11402
11322
|
};
|
|
11403
|
-
const accessTokens = this.cacheManager.getAccessTokensByFilter(accessTokenFilter);
|
|
11323
|
+
const accessTokens = this.cacheManager.getAccessTokensByFilter(accessTokenFilter, request.correlationId);
|
|
11404
11324
|
const numAccessTokens = accessTokens.length;
|
|
11405
11325
|
if (numAccessTokens < 1) {
|
|
11406
11326
|
return null;
|