@azure/msal-node 3.6.1 → 3.6.2
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 +180 -188
- 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.2 2025-07-01 */
|
|
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.0 2025-07-01 */
|
|
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.0 2025-07-01 */
|
|
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.0 2025-07-01 */
|
|
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.0 2025-07-01 */
|
|
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.0 2025-07-01 */
|
|
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.0 2025-07-01 */
|
|
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.0 2025-07-01 */
|
|
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.0 2025-07-01 */
|
|
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.0";
|
|
1095
1088
|
|
|
1096
|
-
/*! @azure/msal-common v15.
|
|
1089
|
+
/*! @azure/msal-common v15.8.0 2025-07-01 */
|
|
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.0 2025-07-01 */
|
|
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.0 2025-07-01 */
|
|
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.0 2025-07-01 */
|
|
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.0 2025-07-01 */
|
|
1560
1553
|
/*
|
|
1561
1554
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1562
1555
|
* Licensed under the MIT License.
|
|
@@ -1610,7 +1603,7 @@ var ClientConfigurationErrorCodes = /*#__PURE__*/Object.freeze({
|
|
|
1610
1603
|
urlParseError: urlParseError
|
|
1611
1604
|
});
|
|
1612
1605
|
|
|
1613
|
-
/*! @azure/msal-common v15.
|
|
1606
|
+
/*! @azure/msal-common v15.8.0 2025-07-01 */
|
|
1614
1607
|
|
|
1615
1608
|
/*
|
|
1616
1609
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1748,7 +1741,7 @@ function createClientConfigurationError(errorCode) {
|
|
|
1748
1741
|
return new ClientConfigurationError(errorCode);
|
|
1749
1742
|
}
|
|
1750
1743
|
|
|
1751
|
-
/*! @azure/msal-common v15.
|
|
1744
|
+
/*! @azure/msal-common v15.8.0 2025-07-01 */
|
|
1752
1745
|
/*
|
|
1753
1746
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1754
1747
|
* Licensed under the MIT License.
|
|
@@ -1845,7 +1838,7 @@ class StringUtils {
|
|
|
1845
1838
|
}
|
|
1846
1839
|
}
|
|
1847
1840
|
|
|
1848
|
-
/*! @azure/msal-common v15.
|
|
1841
|
+
/*! @azure/msal-common v15.8.0 2025-07-01 */
|
|
1849
1842
|
|
|
1850
1843
|
/*
|
|
1851
1844
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2036,7 +2029,7 @@ class ScopeSet {
|
|
|
2036
2029
|
}
|
|
2037
2030
|
}
|
|
2038
2031
|
|
|
2039
|
-
/*! @azure/msal-common v15.
|
|
2032
|
+
/*! @azure/msal-common v15.8.0 2025-07-01 */
|
|
2040
2033
|
|
|
2041
2034
|
/*
|
|
2042
2035
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2076,7 +2069,7 @@ function buildClientInfoFromHomeAccountId(homeAccountId) {
|
|
|
2076
2069
|
};
|
|
2077
2070
|
}
|
|
2078
2071
|
|
|
2079
|
-
/*! @azure/msal-common v15.
|
|
2072
|
+
/*! @azure/msal-common v15.8.0 2025-07-01 */
|
|
2080
2073
|
/*
|
|
2081
2074
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2082
2075
|
* Licensed under the MIT License.
|
|
@@ -2155,7 +2148,7 @@ function updateAccountTenantProfileData(baseAccountInfo, tenantProfile, idTokenC
|
|
|
2155
2148
|
return updatedAccountInfo;
|
|
2156
2149
|
}
|
|
2157
2150
|
|
|
2158
|
-
/*! @azure/msal-common v15.
|
|
2151
|
+
/*! @azure/msal-common v15.8.0 2025-07-01 */
|
|
2159
2152
|
/*
|
|
2160
2153
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2161
2154
|
* Licensed under the MIT License.
|
|
@@ -2170,7 +2163,7 @@ const AuthorityType = {
|
|
|
2170
2163
|
Ciam: 3,
|
|
2171
2164
|
};
|
|
2172
2165
|
|
|
2173
|
-
/*! @azure/msal-common v15.
|
|
2166
|
+
/*! @azure/msal-common v15.8.0 2025-07-01 */
|
|
2174
2167
|
/*
|
|
2175
2168
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2176
2169
|
* Licensed under the MIT License.
|
|
@@ -2192,7 +2185,7 @@ function getTenantIdFromIdTokenClaims(idTokenClaims) {
|
|
|
2192
2185
|
return null;
|
|
2193
2186
|
}
|
|
2194
2187
|
|
|
2195
|
-
/*! @azure/msal-common v15.
|
|
2188
|
+
/*! @azure/msal-common v15.8.0 2025-07-01 */
|
|
2196
2189
|
/*
|
|
2197
2190
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2198
2191
|
* Licensed under the MIT License.
|
|
@@ -2216,7 +2209,7 @@ const ProtocolMode = {
|
|
|
2216
2209
|
EAR: "EAR",
|
|
2217
2210
|
};
|
|
2218
2211
|
|
|
2219
|
-
/*! @azure/msal-common v15.
|
|
2212
|
+
/*! @azure/msal-common v15.8.0 2025-07-01 */
|
|
2220
2213
|
|
|
2221
2214
|
/*
|
|
2222
2215
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2459,7 +2452,7 @@ class AccountEntity {
|
|
|
2459
2452
|
}
|
|
2460
2453
|
}
|
|
2461
2454
|
|
|
2462
|
-
/*! @azure/msal-common v15.
|
|
2455
|
+
/*! @azure/msal-common v15.8.0 2025-07-01 */
|
|
2463
2456
|
|
|
2464
2457
|
/*
|
|
2465
2458
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2524,7 +2517,7 @@ function mapToQueryString(parameters, encodeExtraParams = true, extraQueryParame
|
|
|
2524
2517
|
return queryParameterArray.join("&");
|
|
2525
2518
|
}
|
|
2526
2519
|
|
|
2527
|
-
/*! @azure/msal-common v15.
|
|
2520
|
+
/*! @azure/msal-common v15.8.0 2025-07-01 */
|
|
2528
2521
|
|
|
2529
2522
|
/*
|
|
2530
2523
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2688,7 +2681,7 @@ class UrlString {
|
|
|
2688
2681
|
}
|
|
2689
2682
|
}
|
|
2690
2683
|
|
|
2691
|
-
/*! @azure/msal-common v15.
|
|
2684
|
+
/*! @azure/msal-common v15.8.0 2025-07-01 */
|
|
2692
2685
|
|
|
2693
2686
|
/*
|
|
2694
2687
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2719,7 +2712,6 @@ const rawMetdataJSON = {
|
|
|
2719
2712
|
},
|
|
2720
2713
|
},
|
|
2721
2714
|
instanceDiscoveryMetadata: {
|
|
2722
|
-
tenant_discovery_endpoint: "https://{canonicalAuthority}/v2.0/.well-known/openid-configuration",
|
|
2723
2715
|
metadata: [
|
|
2724
2716
|
{
|
|
2725
2717
|
preferred_network: "login.microsoftonline.com",
|
|
@@ -2828,42 +2820,60 @@ function getCloudDiscoveryMetadataFromNetworkResponse(response, authorityHost) {
|
|
|
2828
2820
|
return null;
|
|
2829
2821
|
}
|
|
2830
2822
|
|
|
2831
|
-
/*! @azure/msal-common v15.
|
|
2823
|
+
/*! @azure/msal-common v15.8.0 2025-07-01 */
|
|
2832
2824
|
/*
|
|
2833
2825
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2834
2826
|
* Licensed under the MIT License.
|
|
2835
2827
|
*/
|
|
2836
|
-
const
|
|
2837
|
-
const
|
|
2828
|
+
const cacheQuotaExceeded = "cache_quota_exceeded";
|
|
2829
|
+
const cacheErrorUnknown = "cache_error_unknown";
|
|
2838
2830
|
|
|
2839
|
-
/*! @azure/msal-common v15.
|
|
2831
|
+
/*! @azure/msal-common v15.8.0 2025-07-01 */
|
|
2840
2832
|
|
|
2841
2833
|
/*
|
|
2842
2834
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2843
2835
|
* Licensed under the MIT License.
|
|
2844
2836
|
*/
|
|
2845
2837
|
const CacheErrorMessages = {
|
|
2846
|
-
[
|
|
2847
|
-
[
|
|
2838
|
+
[cacheQuotaExceeded]: "Exceeded cache storage capacity.",
|
|
2839
|
+
[cacheErrorUnknown]: "Unexpected error occurred when using cache storage.",
|
|
2848
2840
|
};
|
|
2849
2841
|
/**
|
|
2850
2842
|
* Error thrown when there is an error with the cache
|
|
2851
2843
|
*/
|
|
2852
|
-
class CacheError extends
|
|
2844
|
+
class CacheError extends AuthError {
|
|
2853
2845
|
constructor(errorCode, errorMessage) {
|
|
2854
2846
|
const message = errorMessage ||
|
|
2855
2847
|
(CacheErrorMessages[errorCode]
|
|
2856
2848
|
? CacheErrorMessages[errorCode]
|
|
2857
|
-
: CacheErrorMessages[
|
|
2849
|
+
: CacheErrorMessages[cacheErrorUnknown]);
|
|
2858
2850
|
super(`${errorCode}: ${message}`);
|
|
2859
2851
|
Object.setPrototypeOf(this, CacheError.prototype);
|
|
2860
2852
|
this.name = "CacheError";
|
|
2861
2853
|
this.errorCode = errorCode;
|
|
2862
2854
|
this.errorMessage = message;
|
|
2863
2855
|
}
|
|
2856
|
+
}
|
|
2857
|
+
/**
|
|
2858
|
+
* Helper function to wrap browser errors in a CacheError object
|
|
2859
|
+
* @param e
|
|
2860
|
+
* @returns
|
|
2861
|
+
*/
|
|
2862
|
+
function createCacheError(e) {
|
|
2863
|
+
if (!(e instanceof Error)) {
|
|
2864
|
+
return new CacheError(cacheErrorUnknown);
|
|
2865
|
+
}
|
|
2866
|
+
if (e.name === "QuotaExceededError" ||
|
|
2867
|
+
e.name === "NS_ERROR_DOM_QUOTA_REACHED" ||
|
|
2868
|
+
e.message.includes("exceeded the quota")) {
|
|
2869
|
+
return new CacheError(cacheQuotaExceeded);
|
|
2870
|
+
}
|
|
2871
|
+
else {
|
|
2872
|
+
return new CacheError(e.name, e.message);
|
|
2873
|
+
}
|
|
2864
2874
|
}
|
|
2865
2875
|
|
|
2866
|
-
/*! @azure/msal-common v15.
|
|
2876
|
+
/*! @azure/msal-common v15.8.0 2025-07-01 */
|
|
2867
2877
|
|
|
2868
2878
|
/*
|
|
2869
2879
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2886,14 +2896,14 @@ class CacheManager {
|
|
|
2886
2896
|
* @param accountFilter - (Optional) filter to narrow down the accounts returned
|
|
2887
2897
|
* @returns Array of AccountInfo objects in cache
|
|
2888
2898
|
*/
|
|
2889
|
-
getAllAccounts(accountFilter) {
|
|
2890
|
-
return this.buildTenantProfiles(this.getAccountsFilteredBy(accountFilter
|
|
2899
|
+
getAllAccounts(accountFilter, correlationId) {
|
|
2900
|
+
return this.buildTenantProfiles(this.getAccountsFilteredBy(accountFilter, correlationId), correlationId, accountFilter);
|
|
2891
2901
|
}
|
|
2892
2902
|
/**
|
|
2893
2903
|
* Gets first tenanted AccountInfo object found based on provided filters
|
|
2894
2904
|
*/
|
|
2895
|
-
getAccountInfoFilteredBy(accountFilter) {
|
|
2896
|
-
const allAccounts = this.getAllAccounts(accountFilter);
|
|
2905
|
+
getAccountInfoFilteredBy(accountFilter, correlationId) {
|
|
2906
|
+
const allAccounts = this.getAllAccounts(accountFilter, correlationId);
|
|
2897
2907
|
if (allAccounts.length > 1) {
|
|
2898
2908
|
// If one or more accounts are found, prioritize accounts that have an ID token
|
|
2899
2909
|
const sortedAccounts = allAccounts.sort((account) => {
|
|
@@ -2914,8 +2924,8 @@ class CacheManager {
|
|
|
2914
2924
|
* @param accountFilter
|
|
2915
2925
|
* @returns
|
|
2916
2926
|
*/
|
|
2917
|
-
getBaseAccountInfo(accountFilter) {
|
|
2918
|
-
const accountEntities = this.getAccountsFilteredBy(accountFilter);
|
|
2927
|
+
getBaseAccountInfo(accountFilter, correlationId) {
|
|
2928
|
+
const accountEntities = this.getAccountsFilteredBy(accountFilter, correlationId);
|
|
2919
2929
|
if (accountEntities.length > 0) {
|
|
2920
2930
|
return accountEntities[0].getAccountInfo();
|
|
2921
2931
|
}
|
|
@@ -2930,12 +2940,12 @@ class CacheManager {
|
|
|
2930
2940
|
* @param accountFilter
|
|
2931
2941
|
* @returns Array of AccountInfo objects that match account and tenant profile filters
|
|
2932
2942
|
*/
|
|
2933
|
-
buildTenantProfiles(cachedAccounts, accountFilter) {
|
|
2943
|
+
buildTenantProfiles(cachedAccounts, correlationId, accountFilter) {
|
|
2934
2944
|
return cachedAccounts.flatMap((accountEntity) => {
|
|
2935
|
-
return this.getTenantProfilesFromAccountEntity(accountEntity, accountFilter?.tenantId, accountFilter);
|
|
2945
|
+
return this.getTenantProfilesFromAccountEntity(accountEntity, correlationId, accountFilter?.tenantId, accountFilter);
|
|
2936
2946
|
});
|
|
2937
2947
|
}
|
|
2938
|
-
getTenantedAccountInfoByFilter(accountInfo, tokenKeys, tenantProfile, tenantProfileFilter) {
|
|
2948
|
+
getTenantedAccountInfoByFilter(accountInfo, tokenKeys, tenantProfile, correlationId, tenantProfileFilter) {
|
|
2939
2949
|
let tenantedAccountInfo = null;
|
|
2940
2950
|
let idTokenClaims;
|
|
2941
2951
|
if (tenantProfileFilter) {
|
|
@@ -2943,7 +2953,7 @@ class CacheManager {
|
|
|
2943
2953
|
return null;
|
|
2944
2954
|
}
|
|
2945
2955
|
}
|
|
2946
|
-
const idToken = this.getIdToken(accountInfo, tokenKeys, tenantProfile.tenantId);
|
|
2956
|
+
const idToken = this.getIdToken(accountInfo, correlationId, tokenKeys, tenantProfile.tenantId);
|
|
2947
2957
|
if (idToken) {
|
|
2948
2958
|
idTokenClaims = extractTokenClaims(idToken.secret, this.cryptoImpl.base64Decode);
|
|
2949
2959
|
if (!this.idTokenClaimsMatchTenantProfileFilter(idTokenClaims, tenantProfileFilter)) {
|
|
@@ -2955,7 +2965,7 @@ class CacheManager {
|
|
|
2955
2965
|
tenantedAccountInfo = updateAccountTenantProfileData(accountInfo, tenantProfile, idTokenClaims, idToken?.secret);
|
|
2956
2966
|
return tenantedAccountInfo;
|
|
2957
2967
|
}
|
|
2958
|
-
getTenantProfilesFromAccountEntity(accountEntity, targetTenantId, tenantProfileFilter) {
|
|
2968
|
+
getTenantProfilesFromAccountEntity(accountEntity, correlationId, targetTenantId, tenantProfileFilter) {
|
|
2959
2969
|
const accountInfo = accountEntity.getAccountInfo();
|
|
2960
2970
|
let searchTenantProfiles = accountInfo.tenantProfiles || new Map();
|
|
2961
2971
|
const tokenKeys = this.getTokenKeys();
|
|
@@ -2975,7 +2985,7 @@ class CacheManager {
|
|
|
2975
2985
|
}
|
|
2976
2986
|
const matchingTenantProfiles = [];
|
|
2977
2987
|
searchTenantProfiles.forEach((tenantProfile) => {
|
|
2978
|
-
const tenantedAccountInfo = this.getTenantedAccountInfoByFilter(accountInfo, tokenKeys, tenantProfile, tenantProfileFilter);
|
|
2988
|
+
const tenantedAccountInfo = this.getTenantedAccountInfoByFilter(accountInfo, tokenKeys, tenantProfile, correlationId, tenantProfileFilter);
|
|
2979
2989
|
if (tenantedAccountInfo) {
|
|
2980
2990
|
matchingTenantProfiles.push(tenantedAccountInfo);
|
|
2981
2991
|
}
|
|
@@ -3049,26 +3059,16 @@ class CacheManager {
|
|
|
3049
3059
|
await this.setRefreshTokenCredential(cacheRecord.refreshToken, correlationId);
|
|
3050
3060
|
}
|
|
3051
3061
|
if (!!cacheRecord.appMetadata) {
|
|
3052
|
-
this.setAppMetadata(cacheRecord.appMetadata);
|
|
3062
|
+
this.setAppMetadata(cacheRecord.appMetadata, correlationId);
|
|
3053
3063
|
}
|
|
3054
3064
|
}
|
|
3055
3065
|
catch (e) {
|
|
3056
3066
|
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
|
-
}
|
|
3067
|
+
if (e instanceof AuthError) {
|
|
3068
|
+
throw e;
|
|
3068
3069
|
}
|
|
3069
3070
|
else {
|
|
3070
|
-
|
|
3071
|
-
throw new CacheError(cacheUnknownErrorCode);
|
|
3071
|
+
throw createCacheError(e);
|
|
3072
3072
|
}
|
|
3073
3073
|
}
|
|
3074
3074
|
}
|
|
@@ -3092,7 +3092,7 @@ class CacheManager {
|
|
|
3092
3092
|
if (!this.accessTokenKeyMatchesFilter(key, accessTokenFilter, false)) {
|
|
3093
3093
|
return;
|
|
3094
3094
|
}
|
|
3095
|
-
const tokenEntity = this.getAccessTokenCredential(key);
|
|
3095
|
+
const tokenEntity = this.getAccessTokenCredential(key, correlationId);
|
|
3096
3096
|
if (tokenEntity &&
|
|
3097
3097
|
this.credentialMatchesFilter(tokenEntity, accessTokenFilter)) {
|
|
3098
3098
|
const tokenScopeSet = ScopeSet.fromString(tokenEntity.target);
|
|
@@ -3108,7 +3108,7 @@ class CacheManager {
|
|
|
3108
3108
|
* Not checking for casing as keys are all generated in lower case, remember to convert to lower case if object properties are compared
|
|
3109
3109
|
* @param accountFilter - An object containing Account properties to filter by
|
|
3110
3110
|
*/
|
|
3111
|
-
getAccountsFilteredBy(accountFilter) {
|
|
3111
|
+
getAccountsFilteredBy(accountFilter, correlationId) {
|
|
3112
3112
|
const allAccountKeys = this.getAccountKeys();
|
|
3113
3113
|
const matchingAccounts = [];
|
|
3114
3114
|
allAccountKeys.forEach((cacheKey) => {
|
|
@@ -3116,7 +3116,7 @@ class CacheManager {
|
|
|
3116
3116
|
// Don't parse value if the key doesn't match the account filters
|
|
3117
3117
|
return;
|
|
3118
3118
|
}
|
|
3119
|
-
const entity = this.getAccount(cacheKey,
|
|
3119
|
+
const entity = this.getAccount(cacheKey, correlationId);
|
|
3120
3120
|
// Match base account fields
|
|
3121
3121
|
if (!entity) {
|
|
3122
3122
|
return;
|
|
@@ -3353,12 +3353,12 @@ class CacheManager {
|
|
|
3353
3353
|
* @param account
|
|
3354
3354
|
*/
|
|
3355
3355
|
removeAccount(accountKey, correlationId) {
|
|
3356
|
-
const account = this.getAccount(accountKey,
|
|
3356
|
+
const account = this.getAccount(accountKey, correlationId);
|
|
3357
3357
|
if (!account) {
|
|
3358
3358
|
return;
|
|
3359
3359
|
}
|
|
3360
3360
|
this.removeAccountContext(account, correlationId);
|
|
3361
|
-
this.removeItem(accountKey);
|
|
3361
|
+
this.removeItem(accountKey, correlationId);
|
|
3362
3362
|
}
|
|
3363
3363
|
/**
|
|
3364
3364
|
* Removes credentials associated with the provided account
|
|
@@ -3369,7 +3369,7 @@ class CacheManager {
|
|
|
3369
3369
|
const accountId = account.generateAccountId();
|
|
3370
3370
|
allTokenKeys.idToken.forEach((key) => {
|
|
3371
3371
|
if (key.indexOf(accountId) === 0) {
|
|
3372
|
-
this.removeIdToken(key);
|
|
3372
|
+
this.removeIdToken(key, correlationId);
|
|
3373
3373
|
}
|
|
3374
3374
|
});
|
|
3375
3375
|
allTokenKeys.accessToken.forEach((key) => {
|
|
@@ -3379,45 +3379,43 @@ class CacheManager {
|
|
|
3379
3379
|
});
|
|
3380
3380
|
allTokenKeys.refreshToken.forEach((key) => {
|
|
3381
3381
|
if (key.indexOf(accountId) === 0) {
|
|
3382
|
-
this.removeRefreshToken(key);
|
|
3382
|
+
this.removeRefreshToken(key, correlationId);
|
|
3383
3383
|
}
|
|
3384
3384
|
});
|
|
3385
3385
|
}
|
|
3386
3386
|
/**
|
|
3387
|
-
*
|
|
3388
|
-
* @param
|
|
3387
|
+
* Removes accessToken from the cache
|
|
3388
|
+
* @param key
|
|
3389
|
+
* @param correlationId
|
|
3389
3390
|
*/
|
|
3390
3391
|
removeAccessToken(key, correlationId) {
|
|
3391
|
-
const credential = this.getAccessTokenCredential(key);
|
|
3392
|
-
|
|
3392
|
+
const credential = this.getAccessTokenCredential(key, correlationId);
|
|
3393
|
+
this.removeItem(key, correlationId);
|
|
3394
|
+
this.performanceClient.incrementFields({ accessTokensRemoved: 1 }, correlationId);
|
|
3395
|
+
if (!credential ||
|
|
3396
|
+
credential.credentialType.toLowerCase() !==
|
|
3397
|
+
CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase() ||
|
|
3398
|
+
credential.tokenType !== AuthenticationScheme.POP) {
|
|
3399
|
+
// If the credential is not a PoP token, we can return
|
|
3393
3400
|
return;
|
|
3394
3401
|
}
|
|
3395
|
-
this.removeItem(key);
|
|
3396
3402
|
// 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
|
-
}
|
|
3403
|
+
const kid = credential.keyId;
|
|
3404
|
+
if (kid) {
|
|
3405
|
+
void this.cryptoImpl.removeTokenBindingKey(kid).catch(() => {
|
|
3406
|
+
this.commonLogger.error(`Failed to remove token binding key ${kid}`, correlationId);
|
|
3407
|
+
this.performanceClient?.incrementFields({ removeTokenBindingKeyFailure: 1 }, correlationId);
|
|
3408
|
+
});
|
|
3411
3409
|
}
|
|
3412
3410
|
}
|
|
3413
3411
|
/**
|
|
3414
3412
|
* Removes all app metadata objects from cache.
|
|
3415
3413
|
*/
|
|
3416
|
-
removeAppMetadata() {
|
|
3414
|
+
removeAppMetadata(correlationId) {
|
|
3417
3415
|
const allCacheKeys = this.getKeys();
|
|
3418
3416
|
allCacheKeys.forEach((cacheKey) => {
|
|
3419
3417
|
if (this.isAppMetadata(cacheKey)) {
|
|
3420
|
-
this.removeItem(cacheKey);
|
|
3418
|
+
this.removeItem(cacheKey, correlationId);
|
|
3421
3419
|
}
|
|
3422
3420
|
});
|
|
3423
3421
|
return true;
|
|
@@ -3426,9 +3424,9 @@ class CacheManager {
|
|
|
3426
3424
|
* Retrieve AccountEntity from cache
|
|
3427
3425
|
* @param account
|
|
3428
3426
|
*/
|
|
3429
|
-
readAccountFromCache(account) {
|
|
3427
|
+
readAccountFromCache(account, correlationId) {
|
|
3430
3428
|
const accountKey = AccountEntity.generateAccountCacheKey(account);
|
|
3431
|
-
return this.getAccount(accountKey,
|
|
3429
|
+
return this.getAccount(accountKey, correlationId);
|
|
3432
3430
|
}
|
|
3433
3431
|
/**
|
|
3434
3432
|
* Retrieve IdTokenEntity from cache
|
|
@@ -3438,7 +3436,7 @@ class CacheManager {
|
|
|
3438
3436
|
* @param performanceClient {?IPerformanceClient}
|
|
3439
3437
|
* @param correlationId {?string}
|
|
3440
3438
|
*/
|
|
3441
|
-
getIdToken(account, tokenKeys, targetRealm, performanceClient
|
|
3439
|
+
getIdToken(account, correlationId, tokenKeys, targetRealm, performanceClient) {
|
|
3442
3440
|
this.commonLogger.trace("CacheManager - getIdToken called");
|
|
3443
3441
|
const idTokenFilter = {
|
|
3444
3442
|
homeAccountId: account.homeAccountId,
|
|
@@ -3447,7 +3445,7 @@ class CacheManager {
|
|
|
3447
3445
|
clientId: this.clientId,
|
|
3448
3446
|
realm: targetRealm,
|
|
3449
3447
|
};
|
|
3450
|
-
const idTokenMap = this.getIdTokensByFilter(idTokenFilter, tokenKeys);
|
|
3448
|
+
const idTokenMap = this.getIdTokensByFilter(idTokenFilter, correlationId, tokenKeys);
|
|
3451
3449
|
const numIdTokens = idTokenMap.size;
|
|
3452
3450
|
if (numIdTokens < 1) {
|
|
3453
3451
|
this.commonLogger.info("CacheManager:getIdToken - No token found");
|
|
@@ -3480,7 +3478,7 @@ class CacheManager {
|
|
|
3480
3478
|
// Multiple tokens for a single tenant profile, remove all and return null
|
|
3481
3479
|
this.commonLogger.info("CacheManager:getIdToken - Multiple matching ID tokens found, clearing them");
|
|
3482
3480
|
tokensToBeRemoved.forEach((idToken, key) => {
|
|
3483
|
-
this.removeIdToken(key);
|
|
3481
|
+
this.removeIdToken(key, correlationId);
|
|
3484
3482
|
});
|
|
3485
3483
|
if (performanceClient && correlationId) {
|
|
3486
3484
|
performanceClient.addFields({ multiMatchedID: idTokenMap.size }, correlationId);
|
|
@@ -3495,7 +3493,7 @@ class CacheManager {
|
|
|
3495
3493
|
* @param filter
|
|
3496
3494
|
* @returns
|
|
3497
3495
|
*/
|
|
3498
|
-
getIdTokensByFilter(filter, tokenKeys) {
|
|
3496
|
+
getIdTokensByFilter(filter, correlationId, tokenKeys) {
|
|
3499
3497
|
const idTokenKeys = (tokenKeys && tokenKeys.idToken) || this.getTokenKeys().idToken;
|
|
3500
3498
|
const idTokens = new Map();
|
|
3501
3499
|
idTokenKeys.forEach((key) => {
|
|
@@ -3505,7 +3503,7 @@ class CacheManager {
|
|
|
3505
3503
|
})) {
|
|
3506
3504
|
return;
|
|
3507
3505
|
}
|
|
3508
|
-
const idToken = this.getIdTokenCredential(key);
|
|
3506
|
+
const idToken = this.getIdTokenCredential(key, correlationId);
|
|
3509
3507
|
if (idToken && this.credentialMatchesFilter(idToken, filter)) {
|
|
3510
3508
|
idTokens.set(key, idToken);
|
|
3511
3509
|
}
|
|
@@ -3534,20 +3532,21 @@ class CacheManager {
|
|
|
3534
3532
|
* Removes idToken from the cache
|
|
3535
3533
|
* @param key
|
|
3536
3534
|
*/
|
|
3537
|
-
removeIdToken(key) {
|
|
3538
|
-
this.removeItem(key);
|
|
3535
|
+
removeIdToken(key, correlationId) {
|
|
3536
|
+
this.removeItem(key, correlationId);
|
|
3539
3537
|
}
|
|
3540
3538
|
/**
|
|
3541
3539
|
* Removes refresh token from the cache
|
|
3542
3540
|
* @param key
|
|
3543
3541
|
*/
|
|
3544
|
-
removeRefreshToken(key) {
|
|
3545
|
-
this.removeItem(key);
|
|
3542
|
+
removeRefreshToken(key, correlationId) {
|
|
3543
|
+
this.removeItem(key, correlationId);
|
|
3546
3544
|
}
|
|
3547
3545
|
/**
|
|
3548
3546
|
* Retrieve AccessTokenEntity from cache
|
|
3549
3547
|
* @param account {AccountInfo}
|
|
3550
3548
|
* @param request {BaseAuthRequest}
|
|
3549
|
+
* @param correlationId {?string}
|
|
3551
3550
|
* @param tokenKeys {?TokenKeys}
|
|
3552
3551
|
* @param performanceClient {?IPerformanceClient}
|
|
3553
3552
|
*/
|
|
@@ -3581,7 +3580,7 @@ class CacheManager {
|
|
|
3581
3580
|
accessTokenKeys.forEach((key) => {
|
|
3582
3581
|
// Validate key
|
|
3583
3582
|
if (this.accessTokenKeyMatchesFilter(key, accessTokenFilter, true)) {
|
|
3584
|
-
const accessToken = this.getAccessTokenCredential(key);
|
|
3583
|
+
const accessToken = this.getAccessTokenCredential(key, correlationId);
|
|
3585
3584
|
// Validate value
|
|
3586
3585
|
if (accessToken &&
|
|
3587
3586
|
this.credentialMatchesFilter(accessToken, accessTokenFilter)) {
|
|
@@ -3651,14 +3650,14 @@ class CacheManager {
|
|
|
3651
3650
|
* @param filter
|
|
3652
3651
|
* @returns
|
|
3653
3652
|
*/
|
|
3654
|
-
getAccessTokensByFilter(filter) {
|
|
3653
|
+
getAccessTokensByFilter(filter, correlationId) {
|
|
3655
3654
|
const tokenKeys = this.getTokenKeys();
|
|
3656
3655
|
const accessTokens = [];
|
|
3657
3656
|
tokenKeys.accessToken.forEach((key) => {
|
|
3658
3657
|
if (!this.accessTokenKeyMatchesFilter(key, filter, true)) {
|
|
3659
3658
|
return;
|
|
3660
3659
|
}
|
|
3661
|
-
const accessToken = this.getAccessTokenCredential(key);
|
|
3660
|
+
const accessToken = this.getAccessTokenCredential(key, correlationId);
|
|
3662
3661
|
if (accessToken &&
|
|
3663
3662
|
this.credentialMatchesFilter(accessToken, filter)) {
|
|
3664
3663
|
accessTokens.push(accessToken);
|
|
@@ -3670,11 +3669,11 @@ class CacheManager {
|
|
|
3670
3669
|
* Helper to retrieve the appropriate refresh token from cache
|
|
3671
3670
|
* @param account {AccountInfo}
|
|
3672
3671
|
* @param familyRT {boolean}
|
|
3672
|
+
* @param correlationId {?string}
|
|
3673
3673
|
* @param tokenKeys {?TokenKeys}
|
|
3674
3674
|
* @param performanceClient {?IPerformanceClient}
|
|
3675
|
-
* @param correlationId {?string}
|
|
3676
3675
|
*/
|
|
3677
|
-
getRefreshToken(account, familyRT, tokenKeys, performanceClient
|
|
3676
|
+
getRefreshToken(account, familyRT, correlationId, tokenKeys, performanceClient) {
|
|
3678
3677
|
this.commonLogger.trace("CacheManager - getRefreshToken called");
|
|
3679
3678
|
const id = familyRT ? THE_FAMILY_ID : undefined;
|
|
3680
3679
|
const refreshTokenFilter = {
|
|
@@ -3690,7 +3689,7 @@ class CacheManager {
|
|
|
3690
3689
|
refreshTokenKeys.forEach((key) => {
|
|
3691
3690
|
// Validate key
|
|
3692
3691
|
if (this.refreshTokenKeyMatchesFilter(key, refreshTokenFilter)) {
|
|
3693
|
-
const refreshToken = this.getRefreshTokenCredential(key);
|
|
3692
|
+
const refreshToken = this.getRefreshTokenCredential(key, correlationId);
|
|
3694
3693
|
// Validate value
|
|
3695
3694
|
if (refreshToken &&
|
|
3696
3695
|
this.credentialMatchesFilter(refreshToken, refreshTokenFilter)) {
|
|
@@ -4040,7 +4039,7 @@ class DefaultStorageClass extends CacheManager {
|
|
|
4040
4039
|
}
|
|
4041
4040
|
}
|
|
4042
4041
|
|
|
4043
|
-
/*! @azure/msal-common v15.
|
|
4042
|
+
/*! @azure/msal-common v15.8.0 2025-07-01 */
|
|
4044
4043
|
/*
|
|
4045
4044
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4046
4045
|
* Licensed under the MIT License.
|
|
@@ -4305,12 +4304,9 @@ const PerformanceEvents = {
|
|
|
4305
4304
|
* @enum {number}
|
|
4306
4305
|
*/
|
|
4307
4306
|
const PerformanceEventStatus = {
|
|
4308
|
-
|
|
4309
|
-
InProgress: 1,
|
|
4310
|
-
Completed: 2,
|
|
4311
|
-
};
|
|
4307
|
+
InProgress: 1};
|
|
4312
4308
|
|
|
4313
|
-
/*! @azure/msal-common v15.
|
|
4309
|
+
/*! @azure/msal-common v15.8.0 2025-07-01 */
|
|
4314
4310
|
|
|
4315
4311
|
/*
|
|
4316
4312
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4389,7 +4385,7 @@ class StubPerformanceClient {
|
|
|
4389
4385
|
}
|
|
4390
4386
|
}
|
|
4391
4387
|
|
|
4392
|
-
/*! @azure/msal-common v15.
|
|
4388
|
+
/*! @azure/msal-common v15.8.0 2025-07-01 */
|
|
4393
4389
|
|
|
4394
4390
|
/*
|
|
4395
4391
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4489,7 +4485,7 @@ function isOidcProtocolMode(config) {
|
|
|
4489
4485
|
return (config.authOptions.authority.options.protocolMode === ProtocolMode.OIDC);
|
|
4490
4486
|
}
|
|
4491
4487
|
|
|
4492
|
-
/*! @azure/msal-common v15.
|
|
4488
|
+
/*! @azure/msal-common v15.8.0 2025-07-01 */
|
|
4493
4489
|
/*
|
|
4494
4490
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4495
4491
|
* Licensed under the MIT License.
|
|
@@ -4499,7 +4495,7 @@ const CcsCredentialType = {
|
|
|
4499
4495
|
UPN: "UPN",
|
|
4500
4496
|
};
|
|
4501
4497
|
|
|
4502
|
-
/*! @azure/msal-common v15.
|
|
4498
|
+
/*! @azure/msal-common v15.8.0 2025-07-01 */
|
|
4503
4499
|
/*
|
|
4504
4500
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4505
4501
|
* Licensed under the MIT License.
|
|
@@ -4550,7 +4546,7 @@ const BROKER_CLIENT_ID = "brk_client_id";
|
|
|
4550
4546
|
const BROKER_REDIRECT_URI = "brk_redirect_uri";
|
|
4551
4547
|
const INSTANCE_AWARE = "instance_aware";
|
|
4552
4548
|
|
|
4553
|
-
/*! @azure/msal-common v15.
|
|
4549
|
+
/*! @azure/msal-common v15.8.0 2025-07-01 */
|
|
4554
4550
|
|
|
4555
4551
|
/*
|
|
4556
4552
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4936,7 +4932,7 @@ function addBrokerParameters(parameters, brokerClientId, brokerRedirectUri) {
|
|
|
4936
4932
|
}
|
|
4937
4933
|
}
|
|
4938
4934
|
|
|
4939
|
-
/*! @azure/msal-common v15.
|
|
4935
|
+
/*! @azure/msal-common v15.8.0 2025-07-01 */
|
|
4940
4936
|
/*
|
|
4941
4937
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4942
4938
|
* Licensed under the MIT License.
|
|
@@ -4948,7 +4944,7 @@ function isOpenIdConfigResponse(response) {
|
|
|
4948
4944
|
response.hasOwnProperty("jwks_uri"));
|
|
4949
4945
|
}
|
|
4950
4946
|
|
|
4951
|
-
/*! @azure/msal-common v15.
|
|
4947
|
+
/*! @azure/msal-common v15.8.0 2025-07-01 */
|
|
4952
4948
|
/*
|
|
4953
4949
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4954
4950
|
* Licensed under the MIT License.
|
|
@@ -4958,7 +4954,7 @@ function isCloudInstanceDiscoveryResponse(response) {
|
|
|
4958
4954
|
response.hasOwnProperty("metadata"));
|
|
4959
4955
|
}
|
|
4960
4956
|
|
|
4961
|
-
/*! @azure/msal-common v15.
|
|
4957
|
+
/*! @azure/msal-common v15.8.0 2025-07-01 */
|
|
4962
4958
|
/*
|
|
4963
4959
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4964
4960
|
* Licensed under the MIT License.
|
|
@@ -4968,7 +4964,7 @@ function isCloudInstanceDiscoveryErrorResponse(response) {
|
|
|
4968
4964
|
response.hasOwnProperty("error_description"));
|
|
4969
4965
|
}
|
|
4970
4966
|
|
|
4971
|
-
/*! @azure/msal-common v15.
|
|
4967
|
+
/*! @azure/msal-common v15.8.0 2025-07-01 */
|
|
4972
4968
|
/*
|
|
4973
4969
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4974
4970
|
* Licensed under the MIT License.
|
|
@@ -5064,7 +5060,7 @@ const invokeAsync = (callback, eventName, logger, telemetryClient, correlationId
|
|
|
5064
5060
|
};
|
|
5065
5061
|
};
|
|
5066
5062
|
|
|
5067
|
-
/*! @azure/msal-common v15.
|
|
5063
|
+
/*! @azure/msal-common v15.8.0 2025-07-01 */
|
|
5068
5064
|
|
|
5069
5065
|
/*
|
|
5070
5066
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5170,7 +5166,7 @@ RegionDiscovery.IMDS_OPTIONS = {
|
|
|
5170
5166
|
},
|
|
5171
5167
|
};
|
|
5172
5168
|
|
|
5173
|
-
/*! @azure/msal-common v15.
|
|
5169
|
+
/*! @azure/msal-common v15.8.0 2025-07-01 */
|
|
5174
5170
|
|
|
5175
5171
|
/*
|
|
5176
5172
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6009,7 +6005,7 @@ function buildStaticAuthorityOptions(authOptions) {
|
|
|
6009
6005
|
};
|
|
6010
6006
|
}
|
|
6011
6007
|
|
|
6012
|
-
/*! @azure/msal-common v15.
|
|
6008
|
+
/*! @azure/msal-common v15.8.0 2025-07-01 */
|
|
6013
6009
|
|
|
6014
6010
|
/*
|
|
6015
6011
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6040,7 +6036,7 @@ async function createDiscoveredInstance(authorityUri, networkClient, cacheManage
|
|
|
6040
6036
|
}
|
|
6041
6037
|
}
|
|
6042
6038
|
|
|
6043
|
-
/*! @azure/msal-common v15.
|
|
6039
|
+
/*! @azure/msal-common v15.8.0 2025-07-01 */
|
|
6044
6040
|
|
|
6045
6041
|
/*
|
|
6046
6042
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6059,7 +6055,7 @@ class ServerError extends AuthError {
|
|
|
6059
6055
|
}
|
|
6060
6056
|
}
|
|
6061
6057
|
|
|
6062
|
-
/*! @azure/msal-common v15.
|
|
6058
|
+
/*! @azure/msal-common v15.8.0 2025-07-01 */
|
|
6063
6059
|
/*
|
|
6064
6060
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6065
6061
|
* Licensed under the MIT License.
|
|
@@ -6080,7 +6076,7 @@ function getRequestThumbprint(clientId, request, homeAccountId) {
|
|
|
6080
6076
|
};
|
|
6081
6077
|
}
|
|
6082
6078
|
|
|
6083
|
-
/*! @azure/msal-common v15.
|
|
6079
|
+
/*! @azure/msal-common v15.8.0 2025-07-01 */
|
|
6084
6080
|
|
|
6085
6081
|
/*
|
|
6086
6082
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6100,12 +6096,12 @@ class ThrottlingUtils {
|
|
|
6100
6096
|
* @param cacheManager
|
|
6101
6097
|
* @param thumbprint
|
|
6102
6098
|
*/
|
|
6103
|
-
static preProcess(cacheManager, thumbprint) {
|
|
6099
|
+
static preProcess(cacheManager, thumbprint, correlationId) {
|
|
6104
6100
|
const key = ThrottlingUtils.generateThrottlingStorageKey(thumbprint);
|
|
6105
6101
|
const value = cacheManager.getThrottlingCache(key);
|
|
6106
6102
|
if (value) {
|
|
6107
6103
|
if (value.throttleTime < Date.now()) {
|
|
6108
|
-
cacheManager.removeItem(key);
|
|
6104
|
+
cacheManager.removeItem(key, correlationId);
|
|
6109
6105
|
return;
|
|
6110
6106
|
}
|
|
6111
6107
|
throw new ServerError(value.errorCodes?.join(" ") || Constants$1.EMPTY_STRING, value.errorMessage, value.subError);
|
|
@@ -6117,7 +6113,7 @@ class ThrottlingUtils {
|
|
|
6117
6113
|
* @param thumbprint
|
|
6118
6114
|
* @param response
|
|
6119
6115
|
*/
|
|
6120
|
-
static postProcess(cacheManager, thumbprint, response) {
|
|
6116
|
+
static postProcess(cacheManager, thumbprint, response, correlationId) {
|
|
6121
6117
|
if (ThrottlingUtils.checkResponseStatus(response) ||
|
|
6122
6118
|
ThrottlingUtils.checkResponseForRetryAfter(response)) {
|
|
6123
6119
|
const thumbprintValue = {
|
|
@@ -6127,7 +6123,7 @@ class ThrottlingUtils {
|
|
|
6127
6123
|
errorMessage: response.body.error_description,
|
|
6128
6124
|
subError: response.body.suberror,
|
|
6129
6125
|
};
|
|
6130
|
-
cacheManager.setThrottlingCache(ThrottlingUtils.generateThrottlingStorageKey(thumbprint), thumbprintValue);
|
|
6126
|
+
cacheManager.setThrottlingCache(ThrottlingUtils.generateThrottlingStorageKey(thumbprint), thumbprintValue, correlationId);
|
|
6131
6127
|
}
|
|
6132
6128
|
}
|
|
6133
6129
|
/**
|
|
@@ -6163,11 +6159,11 @@ class ThrottlingUtils {
|
|
|
6163
6159
|
static removeThrottle(cacheManager, clientId, request, homeAccountIdentifier) {
|
|
6164
6160
|
const thumbprint = getRequestThumbprint(clientId, request, homeAccountIdentifier);
|
|
6165
6161
|
const key = this.generateThrottlingStorageKey(thumbprint);
|
|
6166
|
-
cacheManager.removeItem(key);
|
|
6162
|
+
cacheManager.removeItem(key, request.correlationId);
|
|
6167
6163
|
}
|
|
6168
6164
|
}
|
|
6169
6165
|
|
|
6170
|
-
/*! @azure/msal-common v15.
|
|
6166
|
+
/*! @azure/msal-common v15.8.0 2025-07-01 */
|
|
6171
6167
|
|
|
6172
6168
|
/*
|
|
6173
6169
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6187,7 +6183,7 @@ class NetworkError extends AuthError {
|
|
|
6187
6183
|
}
|
|
6188
6184
|
}
|
|
6189
6185
|
|
|
6190
|
-
/*! @azure/msal-common v15.
|
|
6186
|
+
/*! @azure/msal-common v15.8.0 2025-07-01 */
|
|
6191
6187
|
|
|
6192
6188
|
/*
|
|
6193
6189
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6269,7 +6265,7 @@ class BaseClient {
|
|
|
6269
6265
|
* @param correlationId - CorrelationId for telemetry
|
|
6270
6266
|
*/
|
|
6271
6267
|
async sendPostRequest(thumbprint, tokenEndpoint, options, correlationId) {
|
|
6272
|
-
ThrottlingUtils.preProcess(this.cacheManager, thumbprint);
|
|
6268
|
+
ThrottlingUtils.preProcess(this.cacheManager, thumbprint, correlationId);
|
|
6273
6269
|
let response;
|
|
6274
6270
|
try {
|
|
6275
6271
|
response = await invokeAsync((this.networkClient.sendPostRequestAsync.bind(this.networkClient)), PerformanceEvents.NetworkClientSendPostRequestAsync, this.logger, this.performanceClient, correlationId)(tokenEndpoint, options);
|
|
@@ -6304,7 +6300,7 @@ class BaseClient {
|
|
|
6304
6300
|
throw createClientAuthError(networkError);
|
|
6305
6301
|
}
|
|
6306
6302
|
}
|
|
6307
|
-
ThrottlingUtils.postProcess(this.cacheManager, thumbprint, response);
|
|
6303
|
+
ThrottlingUtils.postProcess(this.cacheManager, thumbprint, response, correlationId);
|
|
6308
6304
|
return response;
|
|
6309
6305
|
}
|
|
6310
6306
|
/**
|
|
@@ -6335,7 +6331,7 @@ class BaseClient {
|
|
|
6335
6331
|
}
|
|
6336
6332
|
}
|
|
6337
6333
|
|
|
6338
|
-
/*! @azure/msal-common v15.
|
|
6334
|
+
/*! @azure/msal-common v15.8.0 2025-07-01 */
|
|
6339
6335
|
/*
|
|
6340
6336
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6341
6337
|
* Licensed under the MIT License.
|
|
@@ -6363,7 +6359,7 @@ var InteractionRequiredAuthErrorCodes = /*#__PURE__*/Object.freeze({
|
|
|
6363
6359
|
uxNotAllowed: uxNotAllowed
|
|
6364
6360
|
});
|
|
6365
6361
|
|
|
6366
|
-
/*! @azure/msal-common v15.
|
|
6362
|
+
/*! @azure/msal-common v15.8.0 2025-07-01 */
|
|
6367
6363
|
|
|
6368
6364
|
/*
|
|
6369
6365
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6453,7 +6449,7 @@ function createInteractionRequiredAuthError(errorCode) {
|
|
|
6453
6449
|
return new InteractionRequiredAuthError(errorCode, InteractionRequiredAuthErrorMessages[errorCode]);
|
|
6454
6450
|
}
|
|
6455
6451
|
|
|
6456
|
-
/*! @azure/msal-common v15.
|
|
6452
|
+
/*! @azure/msal-common v15.8.0 2025-07-01 */
|
|
6457
6453
|
|
|
6458
6454
|
/*
|
|
6459
6455
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6525,16 +6521,14 @@ class ProtocolUtils {
|
|
|
6525
6521
|
}
|
|
6526
6522
|
}
|
|
6527
6523
|
|
|
6528
|
-
/*! @azure/msal-common v15.
|
|
6524
|
+
/*! @azure/msal-common v15.8.0 2025-07-01 */
|
|
6529
6525
|
|
|
6530
6526
|
/*
|
|
6531
6527
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6532
6528
|
* Licensed under the MIT License.
|
|
6533
6529
|
*/
|
|
6534
6530
|
const KeyLocation = {
|
|
6535
|
-
SW: "sw"
|
|
6536
|
-
UHW: "uhw",
|
|
6537
|
-
};
|
|
6531
|
+
SW: "sw"};
|
|
6538
6532
|
/** @internal */
|
|
6539
6533
|
class PopTokenGenerator {
|
|
6540
6534
|
constructor(cryptoUtils, performanceClient) {
|
|
@@ -6609,7 +6603,7 @@ class PopTokenGenerator {
|
|
|
6609
6603
|
}
|
|
6610
6604
|
}
|
|
6611
6605
|
|
|
6612
|
-
/*! @azure/msal-common v15.
|
|
6606
|
+
/*! @azure/msal-common v15.8.0 2025-07-01 */
|
|
6613
6607
|
/*
|
|
6614
6608
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6615
6609
|
* Licensed under the MIT License.
|
|
@@ -6636,7 +6630,7 @@ class PopTokenGenerator {
|
|
|
6636
6630
|
}
|
|
6637
6631
|
}
|
|
6638
6632
|
|
|
6639
|
-
/*! @azure/msal-common v15.
|
|
6633
|
+
/*! @azure/msal-common v15.8.0 2025-07-01 */
|
|
6640
6634
|
|
|
6641
6635
|
/*
|
|
6642
6636
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6749,7 +6743,7 @@ class ResponseHandler {
|
|
|
6749
6743
|
!forceCacheRefreshTokenResponse &&
|
|
6750
6744
|
cacheRecord.account) {
|
|
6751
6745
|
const key = cacheRecord.account.generateAccountKey();
|
|
6752
|
-
const account = this.cacheStorage.getAccount(key);
|
|
6746
|
+
const account = this.cacheStorage.getAccount(key, request.correlationId);
|
|
6753
6747
|
if (!account) {
|
|
6754
6748
|
this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache");
|
|
6755
6749
|
return await ResponseHandler.generateAuthenticationResult(this.cryptoObj, authority, cacheRecord, false, request, idTokenClaims, requestStateObj, undefined, serverRequestId);
|
|
@@ -6784,7 +6778,7 @@ class ResponseHandler {
|
|
|
6784
6778
|
let cachedAccount;
|
|
6785
6779
|
if (serverTokenResponse.id_token && !!idTokenClaims) {
|
|
6786
6780
|
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
|
|
6781
|
+
cachedAccount = buildAccountToCache(this.cacheStorage, authority, this.homeAccountIdentifier, this.cryptoObj.base64Decode, request.correlationId, idTokenClaims, serverTokenResponse.client_info, env, claimsTenantId, authCodePayload, undefined, // nativeAccountId
|
|
6788
6782
|
this.logger);
|
|
6789
6783
|
}
|
|
6790
6784
|
// AccessToken
|
|
@@ -6933,7 +6927,7 @@ class ResponseHandler {
|
|
|
6933
6927
|
};
|
|
6934
6928
|
}
|
|
6935
6929
|
}
|
|
6936
|
-
function buildAccountToCache(cacheStorage, authority, homeAccountId, base64Decode, idTokenClaims, clientInfo, environment, claimsTenantId, authCodePayload, nativeAccountId, logger) {
|
|
6930
|
+
function buildAccountToCache(cacheStorage, authority, homeAccountId, base64Decode, correlationId, idTokenClaims, clientInfo, environment, claimsTenantId, authCodePayload, nativeAccountId, logger) {
|
|
6937
6931
|
logger?.verbose("setCachedAccount called");
|
|
6938
6932
|
// Check if base account is already cached
|
|
6939
6933
|
const accountKeys = cacheStorage.getAccountKeys();
|
|
@@ -6942,7 +6936,7 @@ function buildAccountToCache(cacheStorage, authority, homeAccountId, base64Decod
|
|
|
6942
6936
|
});
|
|
6943
6937
|
let cachedAccount = null;
|
|
6944
6938
|
if (baseAccountKey) {
|
|
6945
|
-
cachedAccount = cacheStorage.getAccount(baseAccountKey);
|
|
6939
|
+
cachedAccount = cacheStorage.getAccount(baseAccountKey, correlationId);
|
|
6946
6940
|
}
|
|
6947
6941
|
const baseAccount = cachedAccount ||
|
|
6948
6942
|
AccountEntity.createAccount({
|
|
@@ -6967,7 +6961,7 @@ function buildAccountToCache(cacheStorage, authority, homeAccountId, base64Decod
|
|
|
6967
6961
|
return baseAccount;
|
|
6968
6962
|
}
|
|
6969
6963
|
|
|
6970
|
-
/*! @azure/msal-common v15.
|
|
6964
|
+
/*! @azure/msal-common v15.8.0 2025-07-01 */
|
|
6971
6965
|
|
|
6972
6966
|
/*
|
|
6973
6967
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7034,7 +7028,7 @@ class RequestValidator {
|
|
|
7034
7028
|
}
|
|
7035
7029
|
}
|
|
7036
7030
|
|
|
7037
|
-
/*! @azure/msal-common v15.
|
|
7031
|
+
/*! @azure/msal-common v15.8.0 2025-07-01 */
|
|
7038
7032
|
/*
|
|
7039
7033
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
7040
7034
|
* Licensed under the MIT License.
|
|
@@ -7052,7 +7046,7 @@ async function getClientAssertion(clientAssertion, clientId, tokenEndpoint) {
|
|
|
7052
7046
|
}
|
|
7053
7047
|
}
|
|
7054
7048
|
|
|
7055
|
-
/*! @azure/msal-common v15.
|
|
7049
|
+
/*! @azure/msal-common v15.8.0 2025-07-01 */
|
|
7056
7050
|
|
|
7057
7051
|
/*
|
|
7058
7052
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7285,7 +7279,7 @@ class AuthorizationCodeClient extends BaseClient {
|
|
|
7285
7279
|
}
|
|
7286
7280
|
}
|
|
7287
7281
|
|
|
7288
|
-
/*! @azure/msal-common v15.
|
|
7282
|
+
/*! @azure/msal-common v15.8.0 2025-07-01 */
|
|
7289
7283
|
|
|
7290
7284
|
/*
|
|
7291
7285
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7358,7 +7352,7 @@ class RefreshTokenClient extends BaseClient {
|
|
|
7358
7352
|
async acquireTokenWithCachedRefreshToken(request, foci) {
|
|
7359
7353
|
this.performanceClient?.addQueueMeasurement(PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, request.correlationId);
|
|
7360
7354
|
// 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
|
|
7355
|
+
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
7356
|
if (!refreshToken) {
|
|
7363
7357
|
throw createInteractionRequiredAuthError(noTokensFound);
|
|
7364
7358
|
}
|
|
@@ -7388,7 +7382,7 @@ class RefreshTokenClient extends BaseClient {
|
|
|
7388
7382
|
// Remove bad refresh token from cache
|
|
7389
7383
|
this.logger.verbose("acquireTokenWithRefreshToken: bad refresh token, removing from cache");
|
|
7390
7384
|
const badRefreshTokenKey = generateCredentialKey(refreshToken);
|
|
7391
|
-
this.cacheManager.removeRefreshToken(badRefreshTokenKey);
|
|
7385
|
+
this.cacheManager.removeRefreshToken(badRefreshTokenKey, request.correlationId);
|
|
7392
7386
|
}
|
|
7393
7387
|
}
|
|
7394
7388
|
throw e;
|
|
@@ -7494,7 +7488,7 @@ class RefreshTokenClient extends BaseClient {
|
|
|
7494
7488
|
}
|
|
7495
7489
|
}
|
|
7496
7490
|
|
|
7497
|
-
/*! @azure/msal-common v15.
|
|
7491
|
+
/*! @azure/msal-common v15.8.0 2025-07-01 */
|
|
7498
7492
|
|
|
7499
7493
|
/*
|
|
7500
7494
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7546,9 +7540,9 @@ class SilentFlowClient extends BaseClient {
|
|
|
7546
7540
|
}
|
|
7547
7541
|
const environment = request.authority || this.authority.getPreferredCache();
|
|
7548
7542
|
const cacheRecord = {
|
|
7549
|
-
account: this.cacheManager.readAccountFromCache(request.account),
|
|
7543
|
+
account: this.cacheManager.readAccountFromCache(request.account, request.correlationId),
|
|
7550
7544
|
accessToken: cachedAccessToken,
|
|
7551
|
-
idToken: this.cacheManager.getIdToken(request.account, tokenKeys, requestTenantId, this.performanceClient
|
|
7545
|
+
idToken: this.cacheManager.getIdToken(request.account, request.correlationId, tokenKeys, requestTenantId, this.performanceClient),
|
|
7552
7546
|
refreshToken: null,
|
|
7553
7547
|
appMetadata: this.cacheManager.readAppMetadataFromCache(environment),
|
|
7554
7548
|
};
|
|
@@ -7592,7 +7586,7 @@ class SilentFlowClient extends BaseClient {
|
|
|
7592
7586
|
}
|
|
7593
7587
|
}
|
|
7594
7588
|
|
|
7595
|
-
/*! @azure/msal-common v15.
|
|
7589
|
+
/*! @azure/msal-common v15.8.0 2025-07-01 */
|
|
7596
7590
|
|
|
7597
7591
|
/*
|
|
7598
7592
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7742,7 +7736,7 @@ function extractLoginHint(account) {
|
|
|
7742
7736
|
return account.idTokenClaims?.login_hint || null;
|
|
7743
7737
|
}
|
|
7744
7738
|
|
|
7745
|
-
/*! @azure/msal-common v15.
|
|
7739
|
+
/*! @azure/msal-common v15.8.0 2025-07-01 */
|
|
7746
7740
|
|
|
7747
7741
|
/*
|
|
7748
7742
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7881,7 +7875,7 @@ class ServerTelemetryManager {
|
|
|
7881
7875
|
else {
|
|
7882
7876
|
lastRequests.errors.push(SERVER_TELEM_CONSTANTS.UNKNOWN_ERROR);
|
|
7883
7877
|
}
|
|
7884
|
-
this.cacheManager.setServerTelemetry(this.telemetryCacheKey, lastRequests);
|
|
7878
|
+
this.cacheManager.setServerTelemetry(this.telemetryCacheKey, lastRequests, this.correlationId);
|
|
7885
7879
|
return;
|
|
7886
7880
|
}
|
|
7887
7881
|
/**
|
|
@@ -7890,7 +7884,7 @@ class ServerTelemetryManager {
|
|
|
7890
7884
|
incrementCacheHits() {
|
|
7891
7885
|
const lastRequests = this.getLastRequests();
|
|
7892
7886
|
lastRequests.cacheHits += 1;
|
|
7893
|
-
this.cacheManager.setServerTelemetry(this.telemetryCacheKey, lastRequests);
|
|
7887
|
+
this.cacheManager.setServerTelemetry(this.telemetryCacheKey, lastRequests, this.correlationId);
|
|
7894
7888
|
return lastRequests.cacheHits;
|
|
7895
7889
|
}
|
|
7896
7890
|
/**
|
|
@@ -7914,7 +7908,7 @@ class ServerTelemetryManager {
|
|
|
7914
7908
|
const errorCount = lastRequests.errors.length;
|
|
7915
7909
|
if (numErrorsFlushed === errorCount) {
|
|
7916
7910
|
// All errors were sent on last request, clear Telemetry cache
|
|
7917
|
-
this.cacheManager.removeItem(this.telemetryCacheKey);
|
|
7911
|
+
this.cacheManager.removeItem(this.telemetryCacheKey, this.correlationId);
|
|
7918
7912
|
}
|
|
7919
7913
|
else {
|
|
7920
7914
|
// Partial data was flushed to server, construct a new telemetry cache item with errors that were not flushed
|
|
@@ -7923,7 +7917,7 @@ class ServerTelemetryManager {
|
|
|
7923
7917
|
errors: lastRequests.errors.slice(numErrorsFlushed),
|
|
7924
7918
|
cacheHits: 0,
|
|
7925
7919
|
};
|
|
7926
|
-
this.cacheManager.setServerTelemetry(this.telemetryCacheKey, serverTelemEntity);
|
|
7920
|
+
this.cacheManager.setServerTelemetry(this.telemetryCacheKey, serverTelemEntity, this.correlationId);
|
|
7927
7921
|
}
|
|
7928
7922
|
}
|
|
7929
7923
|
/**
|
|
@@ -7990,7 +7984,7 @@ class ServerTelemetryManager {
|
|
|
7990
7984
|
setNativeBrokerErrorCode(errorCode) {
|
|
7991
7985
|
const lastRequests = this.getLastRequests();
|
|
7992
7986
|
lastRequests.nativeBrokerErrorCode = errorCode;
|
|
7993
|
-
this.cacheManager.setServerTelemetry(this.telemetryCacheKey, lastRequests);
|
|
7987
|
+
this.cacheManager.setServerTelemetry(this.telemetryCacheKey, lastRequests, this.correlationId);
|
|
7994
7988
|
}
|
|
7995
7989
|
getNativeBrokerErrorCode() {
|
|
7996
7990
|
return this.getLastRequests().nativeBrokerErrorCode;
|
|
@@ -7998,7 +7992,7 @@ class ServerTelemetryManager {
|
|
|
7998
7992
|
clearNativeBrokerErrorCode() {
|
|
7999
7993
|
const lastRequests = this.getLastRequests();
|
|
8000
7994
|
delete lastRequests.nativeBrokerErrorCode;
|
|
8001
|
-
this.cacheManager.setServerTelemetry(this.telemetryCacheKey, lastRequests);
|
|
7995
|
+
this.cacheManager.setServerTelemetry(this.telemetryCacheKey, lastRequests, this.correlationId);
|
|
8002
7996
|
}
|
|
8003
7997
|
static makeExtraSkuString(params) {
|
|
8004
7998
|
return makeExtraSkuString(params);
|
|
@@ -8258,7 +8252,6 @@ const HttpMethod = {
|
|
|
8258
8252
|
POST: "post",
|
|
8259
8253
|
};
|
|
8260
8254
|
const ProxyStatus = {
|
|
8261
|
-
SUCCESS: HttpStatus.SUCCESS,
|
|
8262
8255
|
SUCCESS_RANGE_START: HttpStatus.SUCCESS_RANGE_START,
|
|
8263
8256
|
SUCCESS_RANGE_END: HttpStatus.SUCCESS_RANGE_END,
|
|
8264
8257
|
SERVER_ERROR: HttpStatus.SERVER_ERROR,
|
|
@@ -8313,7 +8306,6 @@ const ApiId = {
|
|
|
8313
8306
|
* JWT constants
|
|
8314
8307
|
*/
|
|
8315
8308
|
const JwtConstants = {
|
|
8316
|
-
ALGORITHM: "alg",
|
|
8317
8309
|
RSA_256: "RS256",
|
|
8318
8310
|
PSS_256: "PS256",
|
|
8319
8311
|
X5T_256: "x5t#S256",
|
|
@@ -9685,7 +9677,7 @@ class TokenCache {
|
|
|
9685
9677
|
/**
|
|
9686
9678
|
* API that retrieves all accounts currently in cache to the user
|
|
9687
9679
|
*/
|
|
9688
|
-
async getAllAccounts() {
|
|
9680
|
+
async getAllAccounts(correlationId = new CryptoProvider().createNewGuid()) {
|
|
9689
9681
|
this.logger.trace("getAllAccounts called");
|
|
9690
9682
|
let cacheContext;
|
|
9691
9683
|
try {
|
|
@@ -9693,7 +9685,7 @@ class TokenCache {
|
|
|
9693
9685
|
cacheContext = new TokenCacheContext(this, false);
|
|
9694
9686
|
await this.persistence.beforeCacheAccess(cacheContext);
|
|
9695
9687
|
}
|
|
9696
|
-
return this.storage.getAllAccounts();
|
|
9688
|
+
return this.storage.getAllAccounts({}, correlationId);
|
|
9697
9689
|
}
|
|
9698
9690
|
finally {
|
|
9699
9691
|
if (this.persistence && cacheContext) {
|
|
@@ -10040,7 +10032,7 @@ class ClientAssertion {
|
|
|
10040
10032
|
|
|
10041
10033
|
/* eslint-disable header/header */
|
|
10042
10034
|
const name = "@azure/msal-node";
|
|
10043
|
-
const version = "3.6.
|
|
10035
|
+
const version = "3.6.2";
|
|
10044
10036
|
|
|
10045
10037
|
/*
|
|
10046
10038
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -11130,7 +11122,7 @@ class ClientCredentialClient extends BaseClient {
|
|
|
11130
11122
|
await clientConfiguration.persistencePlugin.beforeCacheAccess(cacheContext);
|
|
11131
11123
|
}
|
|
11132
11124
|
const cachedAccessToken = this.readAccessTokenFromCache(authority, managedIdentityConfiguration.managedIdentityId?.id ||
|
|
11133
|
-
clientConfiguration.authOptions.clientId, new ScopeSet(request.scopes || []), cacheManager);
|
|
11125
|
+
clientConfiguration.authOptions.clientId, new ScopeSet(request.scopes || []), cacheManager, request.correlationId);
|
|
11134
11126
|
if (clientConfiguration.serializableCache &&
|
|
11135
11127
|
clientConfiguration.persistencePlugin &&
|
|
11136
11128
|
cacheContext) {
|
|
@@ -11167,7 +11159,7 @@ class ClientCredentialClient extends BaseClient {
|
|
|
11167
11159
|
/**
|
|
11168
11160
|
* Reads access token from the cache
|
|
11169
11161
|
*/
|
|
11170
|
-
readAccessTokenFromCache(authority, id, scopeSet, cacheManager) {
|
|
11162
|
+
readAccessTokenFromCache(authority, id, scopeSet, cacheManager, correlationId) {
|
|
11171
11163
|
const accessTokenFilter = {
|
|
11172
11164
|
homeAccountId: Constants$1.EMPTY_STRING,
|
|
11173
11165
|
environment: authority.canonicalAuthorityUrlComponents.HostNameAndPort,
|
|
@@ -11176,7 +11168,7 @@ class ClientCredentialClient extends BaseClient {
|
|
|
11176
11168
|
realm: authority.tenant,
|
|
11177
11169
|
target: ScopeSet.createSearchScopes(scopeSet.asArray()),
|
|
11178
11170
|
};
|
|
11179
|
-
const accessTokens = cacheManager.getAccessTokensByFilter(accessTokenFilter);
|
|
11171
|
+
const accessTokens = cacheManager.getAccessTokensByFilter(accessTokenFilter, correlationId);
|
|
11180
11172
|
if (accessTokens.length < 1) {
|
|
11181
11173
|
return null;
|
|
11182
11174
|
}
|
|
@@ -11329,7 +11321,7 @@ class OnBehalfOfClient extends BaseClient {
|
|
|
11329
11321
|
throw createClientAuthError(tokenRefreshRequired);
|
|
11330
11322
|
}
|
|
11331
11323
|
// fetch the idToken from cache
|
|
11332
|
-
const cachedIdToken = this.readIdTokenFromCacheForOBO(cachedAccessToken.homeAccountId);
|
|
11324
|
+
const cachedIdToken = this.readIdTokenFromCacheForOBO(cachedAccessToken.homeAccountId, request.correlationId);
|
|
11333
11325
|
let idTokenClaims;
|
|
11334
11326
|
let cachedAccount = null;
|
|
11335
11327
|
if (cachedIdToken) {
|
|
@@ -11342,7 +11334,7 @@ class OnBehalfOfClient extends BaseClient {
|
|
|
11342
11334
|
username: Constants$1.EMPTY_STRING,
|
|
11343
11335
|
localAccountId: localAccountId || Constants$1.EMPTY_STRING,
|
|
11344
11336
|
};
|
|
11345
|
-
cachedAccount = this.cacheManager.readAccountFromCache(accountInfo);
|
|
11337
|
+
cachedAccount = this.cacheManager.readAccountFromCache(accountInfo, request.correlationId);
|
|
11346
11338
|
}
|
|
11347
11339
|
// increment telemetry cache hit counter
|
|
11348
11340
|
if (this.config.serverTelemetryManager) {
|
|
@@ -11361,7 +11353,7 @@ class OnBehalfOfClient extends BaseClient {
|
|
|
11361
11353
|
* Certain use cases of OBO flow do not expect an idToken in the cache/or from the service
|
|
11362
11354
|
* @param atHomeAccountId - account id
|
|
11363
11355
|
*/
|
|
11364
|
-
readIdTokenFromCacheForOBO(atHomeAccountId) {
|
|
11356
|
+
readIdTokenFromCacheForOBO(atHomeAccountId, correlationId) {
|
|
11365
11357
|
const idTokenFilter = {
|
|
11366
11358
|
homeAccountId: atHomeAccountId,
|
|
11367
11359
|
environment: this.authority.canonicalAuthorityUrlComponents.HostNameAndPort,
|
|
@@ -11369,7 +11361,7 @@ class OnBehalfOfClient extends BaseClient {
|
|
|
11369
11361
|
clientId: this.config.authOptions.clientId,
|
|
11370
11362
|
realm: this.authority.tenant,
|
|
11371
11363
|
};
|
|
11372
|
-
const idTokenMap = this.cacheManager.getIdTokensByFilter(idTokenFilter);
|
|
11364
|
+
const idTokenMap = this.cacheManager.getIdTokensByFilter(idTokenFilter, correlationId);
|
|
11373
11365
|
// When acquiring a token on behalf of an application, there might not be an id token in the cache
|
|
11374
11366
|
if (Object.values(idTokenMap).length < 1) {
|
|
11375
11367
|
return null;
|
|
@@ -11400,7 +11392,7 @@ class OnBehalfOfClient extends BaseClient {
|
|
|
11400
11392
|
requestedClaimsHash: request.requestedClaimsHash,
|
|
11401
11393
|
userAssertionHash: this.userAssertionHash,
|
|
11402
11394
|
};
|
|
11403
|
-
const accessTokens = this.cacheManager.getAccessTokensByFilter(accessTokenFilter);
|
|
11395
|
+
const accessTokens = this.cacheManager.getAccessTokensByFilter(accessTokenFilter, request.correlationId);
|
|
11404
11396
|
const numAccessTokens = accessTokens.length;
|
|
11405
11397
|
if (numAccessTokens < 1) {
|
|
11406
11398
|
return null;
|