@azure/msal-node 3.8.4 → 3.8.6
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/dist/cache/CacheHelpers.mjs +1 -1
- package/dist/cache/NodeStorage.mjs +1 -1
- package/dist/cache/TokenCache.mjs +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.d.ts.map +1 -1
- package/dist/client/ClientApplication.mjs +5 -5
- 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 +3 -2
- package/dist/client/ClientCredentialClient.mjs.map +1 -1
- package/dist/client/ConfidentialClientApplication.mjs +1 -1
- package/dist/client/DeviceCodeClient.d.ts.map +1 -1
- package/dist/client/DeviceCodeClient.mjs +3 -2
- package/dist/client/DeviceCodeClient.mjs.map +1 -1
- package/dist/client/ManagedIdentityApplication.mjs +1 -1
- 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.d.ts.map +1 -1
- package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.mjs +3 -3
- package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.mjs.map +1 -1
- 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 +3 -2
- package/dist/client/OnBehalfOfClient.mjs.map +1 -1
- package/dist/client/PublicClientApplication.mjs +1 -1
- package/dist/client/UsernamePasswordClient.d.ts.map +1 -1
- package/dist/client/UsernamePasswordClient.mjs +3 -2
- package/dist/client/UsernamePasswordClient.mjs.map +1 -1
- package/dist/config/Configuration.mjs +1 -1
- 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 +1 -1
- 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.d.ts +2 -0
- package/dist/utils/Constants.d.ts.map +1 -1
- package/dist/utils/Constants.mjs +3 -1
- 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 +130 -96
- package/lib/msal-node.cjs.map +1 -1
- package/lib/types/client/ClientApplication.d.ts.map +1 -1
- package/lib/types/client/ClientCredentialClient.d.ts.map +1 -1
- package/lib/types/client/DeviceCodeClient.d.ts.map +1 -1
- package/lib/types/client/ManagedIdentitySources/BaseManagedIdentitySource.d.ts.map +1 -1
- package/lib/types/client/OnBehalfOfClient.d.ts.map +1 -1
- package/lib/types/client/UsernamePasswordClient.d.ts.map +1 -1
- package/lib/types/packageMetadata.d.ts +1 -1
- package/lib/types/utils/Constants.d.ts +2 -0
- package/lib/types/utils/Constants.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/client/ClientApplication.ts +9 -3
- package/src/client/ClientCredentialClient.ts +3 -1
- package/src/client/DeviceCodeClient.ts +3 -1
- package/src/client/ManagedIdentitySources/BaseManagedIdentitySource.ts +3 -1
- package/src/client/OnBehalfOfClient.ts +2 -0
- package/src/client/UsernamePasswordClient.ts +3 -1
- package/src/packageMetadata.ts +1 -1
- package/src/utils/Constants.ts +2 -0
package/lib/msal-node.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-node v3.8.
|
|
1
|
+
/*! @azure/msal-node v3.8.6 2026-01-17 */
|
|
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.14.1 2026-01-17 */
|
|
157
157
|
/*
|
|
158
158
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
159
159
|
* Licensed under the MIT License.
|
|
@@ -433,7 +433,7 @@ const EncodingTypes = {
|
|
|
433
433
|
UTF8: "utf-8",
|
|
434
434
|
};
|
|
435
435
|
|
|
436
|
-
/*! @azure/msal-common v15.
|
|
436
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
437
437
|
/*
|
|
438
438
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
439
439
|
* Licensed under the MIT License.
|
|
@@ -450,7 +450,7 @@ var AuthErrorCodes = /*#__PURE__*/Object.freeze({
|
|
|
450
450
|
unexpectedError: unexpectedError
|
|
451
451
|
});
|
|
452
452
|
|
|
453
|
-
/*! @azure/msal-common v15.
|
|
453
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
454
454
|
|
|
455
455
|
/*
|
|
456
456
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -499,7 +499,7 @@ function createAuthError(code, additionalMessage) {
|
|
|
499
499
|
: AuthErrorMessages[code]);
|
|
500
500
|
}
|
|
501
501
|
|
|
502
|
-
/*! @azure/msal-common v15.
|
|
502
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
503
503
|
/*
|
|
504
504
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
505
505
|
* Licensed under the MIT License.
|
|
@@ -599,7 +599,7 @@ var ClientAuthErrorCodes = /*#__PURE__*/Object.freeze({
|
|
|
599
599
|
userTimeoutReached: userTimeoutReached
|
|
600
600
|
});
|
|
601
601
|
|
|
602
|
-
/*! @azure/msal-common v15.
|
|
602
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
603
603
|
|
|
604
604
|
/*
|
|
605
605
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -856,7 +856,7 @@ function createClientAuthError(errorCode, additionalMessage) {
|
|
|
856
856
|
return new ClientAuthError(errorCode, additionalMessage);
|
|
857
857
|
}
|
|
858
858
|
|
|
859
|
-
/*! @azure/msal-common v15.
|
|
859
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
860
860
|
|
|
861
861
|
/*
|
|
862
862
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -895,7 +895,7 @@ const DEFAULT_CRYPTO_IMPLEMENTATION = {
|
|
|
895
895
|
},
|
|
896
896
|
};
|
|
897
897
|
|
|
898
|
-
/*! @azure/msal-common v15.
|
|
898
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
899
899
|
|
|
900
900
|
/*
|
|
901
901
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1086,12 +1086,12 @@ class Logger {
|
|
|
1086
1086
|
}
|
|
1087
1087
|
}
|
|
1088
1088
|
|
|
1089
|
-
/*! @azure/msal-common v15.
|
|
1089
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
1090
1090
|
/* eslint-disable header/header */
|
|
1091
1091
|
const name$1 = "@azure/msal-common";
|
|
1092
|
-
const version$1 = "15.
|
|
1092
|
+
const version$1 = "15.14.1";
|
|
1093
1093
|
|
|
1094
|
-
/*! @azure/msal-common v15.
|
|
1094
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
1095
1095
|
/*
|
|
1096
1096
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1097
1097
|
* Licensed under the MIT License.
|
|
@@ -1111,7 +1111,7 @@ const AzureCloudInstance = {
|
|
|
1111
1111
|
AzureUsGovernment: "https://login.microsoftonline.us",
|
|
1112
1112
|
};
|
|
1113
1113
|
|
|
1114
|
-
/*! @azure/msal-common v15.
|
|
1114
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
1115
1115
|
/*
|
|
1116
1116
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1117
1117
|
* Licensed under the MIT License.
|
|
@@ -1169,7 +1169,7 @@ var ClientConfigurationErrorCodes = /*#__PURE__*/Object.freeze({
|
|
|
1169
1169
|
urlParseError: urlParseError
|
|
1170
1170
|
});
|
|
1171
1171
|
|
|
1172
|
-
/*! @azure/msal-common v15.
|
|
1172
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
1173
1173
|
|
|
1174
1174
|
/*
|
|
1175
1175
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1317,7 +1317,7 @@ function createClientConfigurationError(errorCode) {
|
|
|
1317
1317
|
return new ClientConfigurationError(errorCode);
|
|
1318
1318
|
}
|
|
1319
1319
|
|
|
1320
|
-
/*! @azure/msal-common v15.
|
|
1320
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
1321
1321
|
/*
|
|
1322
1322
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1323
1323
|
* Licensed under the MIT License.
|
|
@@ -1414,7 +1414,7 @@ class StringUtils {
|
|
|
1414
1414
|
}
|
|
1415
1415
|
}
|
|
1416
1416
|
|
|
1417
|
-
/*! @azure/msal-common v15.
|
|
1417
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
1418
1418
|
|
|
1419
1419
|
/*
|
|
1420
1420
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1609,7 +1609,7 @@ class ScopeSet {
|
|
|
1609
1609
|
}
|
|
1610
1610
|
}
|
|
1611
1611
|
|
|
1612
|
-
/*! @azure/msal-common v15.
|
|
1612
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
1613
1613
|
|
|
1614
1614
|
/*
|
|
1615
1615
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1649,7 +1649,7 @@ function buildClientInfoFromHomeAccountId(homeAccountId) {
|
|
|
1649
1649
|
};
|
|
1650
1650
|
}
|
|
1651
1651
|
|
|
1652
|
-
/*! @azure/msal-common v15.
|
|
1652
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
1653
1653
|
/*
|
|
1654
1654
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1655
1655
|
* Licensed under the MIT License.
|
|
@@ -1731,7 +1731,7 @@ function updateAccountTenantProfileData(baseAccountInfo, tenantProfile, idTokenC
|
|
|
1731
1731
|
return updatedAccountInfo;
|
|
1732
1732
|
}
|
|
1733
1733
|
|
|
1734
|
-
/*! @azure/msal-common v15.
|
|
1734
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
1735
1735
|
/*
|
|
1736
1736
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1737
1737
|
* Licensed under the MIT License.
|
|
@@ -1746,7 +1746,7 @@ const AuthorityType = {
|
|
|
1746
1746
|
Ciam: 3,
|
|
1747
1747
|
};
|
|
1748
1748
|
|
|
1749
|
-
/*! @azure/msal-common v15.
|
|
1749
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
1750
1750
|
/*
|
|
1751
1751
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1752
1752
|
* Licensed under the MIT License.
|
|
@@ -1768,7 +1768,7 @@ function getTenantIdFromIdTokenClaims(idTokenClaims) {
|
|
|
1768
1768
|
return null;
|
|
1769
1769
|
}
|
|
1770
1770
|
|
|
1771
|
-
/*! @azure/msal-common v15.
|
|
1771
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
1772
1772
|
/*
|
|
1773
1773
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1774
1774
|
* Licensed under the MIT License.
|
|
@@ -1792,7 +1792,7 @@ const ProtocolMode = {
|
|
|
1792
1792
|
EAR: "EAR",
|
|
1793
1793
|
};
|
|
1794
1794
|
|
|
1795
|
-
/*! @azure/msal-common v15.
|
|
1795
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
1796
1796
|
|
|
1797
1797
|
/*
|
|
1798
1798
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1826,6 +1826,13 @@ class AccountEntity {
|
|
|
1826
1826
|
* Returns the AccountInfo interface for this account.
|
|
1827
1827
|
*/
|
|
1828
1828
|
static getAccountInfo(accountEntity) {
|
|
1829
|
+
const tenantProfiles = accountEntity.tenantProfiles || [];
|
|
1830
|
+
// Ensure at least the home tenant profile exists
|
|
1831
|
+
if (tenantProfiles.length === 0 &&
|
|
1832
|
+
accountEntity.realm &&
|
|
1833
|
+
accountEntity.localAccountId) {
|
|
1834
|
+
tenantProfiles.push(buildTenantProfile(accountEntity.homeAccountId, accountEntity.localAccountId, accountEntity.realm));
|
|
1835
|
+
}
|
|
1829
1836
|
return {
|
|
1830
1837
|
homeAccountId: accountEntity.homeAccountId,
|
|
1831
1838
|
environment: accountEntity.environment,
|
|
@@ -1837,7 +1844,7 @@ class AccountEntity {
|
|
|
1837
1844
|
nativeAccountId: accountEntity.nativeAccountId,
|
|
1838
1845
|
authorityType: accountEntity.authorityType,
|
|
1839
1846
|
// Deserialize tenant profiles array into a Map
|
|
1840
|
-
tenantProfiles: new Map(
|
|
1847
|
+
tenantProfiles: new Map(tenantProfiles.map((tenantProfile) => {
|
|
1841
1848
|
return [tenantProfile.tenantId, tenantProfile];
|
|
1842
1849
|
})),
|
|
1843
1850
|
dataBoundary: accountEntity.dataBoundary,
|
|
@@ -1938,7 +1945,14 @@ class AccountEntity {
|
|
|
1938
1945
|
account.cloudGraphHostName = cloudGraphHostName;
|
|
1939
1946
|
account.msGraphHost = msGraphHost;
|
|
1940
1947
|
// Serialize tenant profiles map into an array
|
|
1941
|
-
|
|
1948
|
+
const tenantProfiles = Array.from(accountInfo.tenantProfiles?.values() || []);
|
|
1949
|
+
// Ensure at least the home tenant profile exists
|
|
1950
|
+
if (tenantProfiles.length === 0 &&
|
|
1951
|
+
accountInfo.tenantId &&
|
|
1952
|
+
accountInfo.localAccountId) {
|
|
1953
|
+
tenantProfiles.push(buildTenantProfile(accountInfo.homeAccountId, accountInfo.localAccountId, accountInfo.tenantId, accountInfo.idTokenClaims));
|
|
1954
|
+
}
|
|
1955
|
+
account.tenantProfiles = tenantProfiles;
|
|
1942
1956
|
account.dataBoundary = accountInfo.dataBoundary;
|
|
1943
1957
|
return account;
|
|
1944
1958
|
}
|
|
@@ -2013,7 +2027,7 @@ class AccountEntity {
|
|
|
2013
2027
|
}
|
|
2014
2028
|
}
|
|
2015
2029
|
|
|
2016
|
-
/*! @azure/msal-common v15.
|
|
2030
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
2017
2031
|
|
|
2018
2032
|
/*
|
|
2019
2033
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2094,7 +2108,7 @@ function checkMaxAge(authTime, maxAge) {
|
|
|
2094
2108
|
}
|
|
2095
2109
|
}
|
|
2096
2110
|
|
|
2097
|
-
/*! @azure/msal-common v15.
|
|
2111
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
2098
2112
|
/**
|
|
2099
2113
|
* Parses hash string from given string. Returns empty string if no hash symbol is found.
|
|
2100
2114
|
* @param hashString
|
|
@@ -2154,7 +2168,7 @@ function mapToQueryString(parameters, encodeExtraParams = true, extraQueryParame
|
|
|
2154
2168
|
return queryParameterArray.join("&");
|
|
2155
2169
|
}
|
|
2156
2170
|
|
|
2157
|
-
/*! @azure/msal-common v15.
|
|
2171
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
2158
2172
|
|
|
2159
2173
|
/*
|
|
2160
2174
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2318,7 +2332,7 @@ class UrlString {
|
|
|
2318
2332
|
}
|
|
2319
2333
|
}
|
|
2320
2334
|
|
|
2321
|
-
/*! @azure/msal-common v15.
|
|
2335
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
2322
2336
|
|
|
2323
2337
|
/*
|
|
2324
2338
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2457,7 +2471,7 @@ function getCloudDiscoveryMetadataFromNetworkResponse(response, authorityHost) {
|
|
|
2457
2471
|
return null;
|
|
2458
2472
|
}
|
|
2459
2473
|
|
|
2460
|
-
/*! @azure/msal-common v15.
|
|
2474
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
2461
2475
|
/*
|
|
2462
2476
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2463
2477
|
* Licensed under the MIT License.
|
|
@@ -2465,7 +2479,7 @@ function getCloudDiscoveryMetadataFromNetworkResponse(response, authorityHost) {
|
|
|
2465
2479
|
const cacheQuotaExceeded = "cache_quota_exceeded";
|
|
2466
2480
|
const cacheErrorUnknown = "cache_error_unknown";
|
|
2467
2481
|
|
|
2468
|
-
/*! @azure/msal-common v15.
|
|
2482
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
2469
2483
|
|
|
2470
2484
|
/*
|
|
2471
2485
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2510,7 +2524,7 @@ function createCacheError(e) {
|
|
|
2510
2524
|
}
|
|
2511
2525
|
}
|
|
2512
2526
|
|
|
2513
|
-
/*! @azure/msal-common v15.
|
|
2527
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
2514
2528
|
|
|
2515
2529
|
/*
|
|
2516
2530
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2680,15 +2694,16 @@ class CacheManager {
|
|
|
2680
2694
|
* @param cacheRecord {CacheRecord}
|
|
2681
2695
|
* @param correlationId {?string} correlation id
|
|
2682
2696
|
* @param kmsi - Keep Me Signed In
|
|
2697
|
+
* @param apiId - API identifier for telemetry tracking
|
|
2683
2698
|
* @param storeInCache {?StoreInCache}
|
|
2684
2699
|
*/
|
|
2685
|
-
async saveCacheRecord(cacheRecord, correlationId, kmsi, storeInCache) {
|
|
2700
|
+
async saveCacheRecord(cacheRecord, correlationId, kmsi, apiId, storeInCache) {
|
|
2686
2701
|
if (!cacheRecord) {
|
|
2687
2702
|
throw createClientAuthError(invalidCacheRecord);
|
|
2688
2703
|
}
|
|
2689
2704
|
try {
|
|
2690
2705
|
if (!!cacheRecord.account) {
|
|
2691
|
-
await this.setAccount(cacheRecord.account, correlationId, kmsi);
|
|
2706
|
+
await this.setAccount(cacheRecord.account, correlationId, kmsi, apiId);
|
|
2692
2707
|
}
|
|
2693
2708
|
if (!!cacheRecord.idToken && storeInCache?.idToken !== false) {
|
|
2694
2709
|
await this.setIdTokenCredential(cacheRecord.idToken, correlationId, kmsi);
|
|
@@ -3619,7 +3634,7 @@ class DefaultStorageClass extends CacheManager {
|
|
|
3619
3634
|
}
|
|
3620
3635
|
}
|
|
3621
3636
|
|
|
3622
|
-
/*! @azure/msal-common v15.
|
|
3637
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
3623
3638
|
/*
|
|
3624
3639
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3625
3640
|
* Licensed under the MIT License.
|
|
@@ -3876,6 +3891,11 @@ const PerformanceEvents = {
|
|
|
3876
3891
|
Decrypt: "decrypt",
|
|
3877
3892
|
GenerateEarKey: "generateEarKey",
|
|
3878
3893
|
DecryptEarResponse: "decryptEarResponse",
|
|
3894
|
+
LoadExternalTokens: "LoadExternalTokens",
|
|
3895
|
+
LoadAccount: "loadAccount",
|
|
3896
|
+
LoadIdToken: "loadIdToken",
|
|
3897
|
+
LoadAccessToken: "loadAccessToken",
|
|
3898
|
+
LoadRefreshToken: "loadRefreshToken",
|
|
3879
3899
|
};
|
|
3880
3900
|
/**
|
|
3881
3901
|
* State of the performance event.
|
|
@@ -3886,7 +3906,7 @@ const PerformanceEvents = {
|
|
|
3886
3906
|
const PerformanceEventStatus = {
|
|
3887
3907
|
InProgress: 1};
|
|
3888
3908
|
|
|
3889
|
-
/*! @azure/msal-common v15.
|
|
3909
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
3890
3910
|
|
|
3891
3911
|
/*
|
|
3892
3912
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3965,7 +3985,7 @@ class StubPerformanceClient {
|
|
|
3965
3985
|
}
|
|
3966
3986
|
}
|
|
3967
3987
|
|
|
3968
|
-
/*! @azure/msal-common v15.
|
|
3988
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
3969
3989
|
|
|
3970
3990
|
/*
|
|
3971
3991
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4065,7 +4085,7 @@ function isOidcProtocolMode(config) {
|
|
|
4065
4085
|
return (config.authOptions.authority.options.protocolMode === ProtocolMode.OIDC);
|
|
4066
4086
|
}
|
|
4067
4087
|
|
|
4068
|
-
/*! @azure/msal-common v15.
|
|
4088
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
4069
4089
|
/*
|
|
4070
4090
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4071
4091
|
* Licensed under the MIT License.
|
|
@@ -4075,7 +4095,7 @@ const CcsCredentialType = {
|
|
|
4075
4095
|
UPN: "UPN",
|
|
4076
4096
|
};
|
|
4077
4097
|
|
|
4078
|
-
/*! @azure/msal-common v15.
|
|
4098
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
4079
4099
|
/*
|
|
4080
4100
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4081
4101
|
* Licensed under the MIT License.
|
|
@@ -4126,7 +4146,7 @@ const BROKER_CLIENT_ID = "brk_client_id";
|
|
|
4126
4146
|
const BROKER_REDIRECT_URI = "brk_redirect_uri";
|
|
4127
4147
|
const INSTANCE_AWARE = "instance_aware";
|
|
4128
4148
|
|
|
4129
|
-
/*! @azure/msal-common v15.
|
|
4149
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
4130
4150
|
|
|
4131
4151
|
/*
|
|
4132
4152
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4512,7 +4532,7 @@ function addBrokerParameters(parameters, brokerClientId, brokerRedirectUri) {
|
|
|
4512
4532
|
}
|
|
4513
4533
|
}
|
|
4514
4534
|
|
|
4515
|
-
/*! @azure/msal-common v15.
|
|
4535
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
4516
4536
|
/*
|
|
4517
4537
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4518
4538
|
* Licensed under the MIT License.
|
|
@@ -4524,7 +4544,7 @@ function isOpenIdConfigResponse(response) {
|
|
|
4524
4544
|
response.hasOwnProperty("jwks_uri"));
|
|
4525
4545
|
}
|
|
4526
4546
|
|
|
4527
|
-
/*! @azure/msal-common v15.
|
|
4547
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
4528
4548
|
/*
|
|
4529
4549
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4530
4550
|
* Licensed under the MIT License.
|
|
@@ -4534,7 +4554,7 @@ function isCloudInstanceDiscoveryResponse(response) {
|
|
|
4534
4554
|
response.hasOwnProperty("metadata"));
|
|
4535
4555
|
}
|
|
4536
4556
|
|
|
4537
|
-
/*! @azure/msal-common v15.
|
|
4557
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
4538
4558
|
/*
|
|
4539
4559
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4540
4560
|
* Licensed under the MIT License.
|
|
@@ -4544,7 +4564,7 @@ function isCloudInstanceDiscoveryErrorResponse(response) {
|
|
|
4544
4564
|
response.hasOwnProperty("error_description"));
|
|
4545
4565
|
}
|
|
4546
4566
|
|
|
4547
|
-
/*! @azure/msal-common v15.
|
|
4567
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
4548
4568
|
/*
|
|
4549
4569
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4550
4570
|
* Licensed under the MIT License.
|
|
@@ -4640,7 +4660,7 @@ const invokeAsync = (callback, eventName, logger, telemetryClient, correlationId
|
|
|
4640
4660
|
};
|
|
4641
4661
|
};
|
|
4642
4662
|
|
|
4643
|
-
/*! @azure/msal-common v15.
|
|
4663
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
4644
4664
|
|
|
4645
4665
|
/*
|
|
4646
4666
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4746,7 +4766,7 @@ RegionDiscovery.IMDS_OPTIONS = {
|
|
|
4746
4766
|
},
|
|
4747
4767
|
};
|
|
4748
4768
|
|
|
4749
|
-
/*! @azure/msal-common v15.
|
|
4769
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
4750
4770
|
/*
|
|
4751
4771
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4752
4772
|
* Licensed under the MIT License.
|
|
@@ -4801,7 +4821,7 @@ function delay(t, value) {
|
|
|
4801
4821
|
return new Promise((resolve) => setTimeout(() => resolve(value), t));
|
|
4802
4822
|
}
|
|
4803
4823
|
|
|
4804
|
-
/*! @azure/msal-common v15.
|
|
4824
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
4805
4825
|
|
|
4806
4826
|
/*
|
|
4807
4827
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5063,7 +5083,7 @@ function isAuthorityMetadataExpired(metadata) {
|
|
|
5063
5083
|
return metadata.expiresAt <= nowSeconds();
|
|
5064
5084
|
}
|
|
5065
5085
|
|
|
5066
|
-
/*! @azure/msal-common v15.
|
|
5086
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
5067
5087
|
|
|
5068
5088
|
/*
|
|
5069
5089
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5902,7 +5922,7 @@ function buildStaticAuthorityOptions(authOptions) {
|
|
|
5902
5922
|
};
|
|
5903
5923
|
}
|
|
5904
5924
|
|
|
5905
|
-
/*! @azure/msal-common v15.
|
|
5925
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
5906
5926
|
|
|
5907
5927
|
/*
|
|
5908
5928
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5933,7 +5953,7 @@ async function createDiscoveredInstance(authorityUri, networkClient, cacheManage
|
|
|
5933
5953
|
}
|
|
5934
5954
|
}
|
|
5935
5955
|
|
|
5936
|
-
/*! @azure/msal-common v15.
|
|
5956
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
5937
5957
|
|
|
5938
5958
|
/*
|
|
5939
5959
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5952,7 +5972,7 @@ class ServerError extends AuthError {
|
|
|
5952
5972
|
}
|
|
5953
5973
|
}
|
|
5954
5974
|
|
|
5955
|
-
/*! @azure/msal-common v15.
|
|
5975
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
5956
5976
|
/*
|
|
5957
5977
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5958
5978
|
* Licensed under the MIT License.
|
|
@@ -5973,7 +5993,7 @@ function getRequestThumbprint(clientId, request, homeAccountId) {
|
|
|
5973
5993
|
};
|
|
5974
5994
|
}
|
|
5975
5995
|
|
|
5976
|
-
/*! @azure/msal-common v15.
|
|
5996
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
5977
5997
|
|
|
5978
5998
|
/*
|
|
5979
5999
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6060,7 +6080,7 @@ class ThrottlingUtils {
|
|
|
6060
6080
|
}
|
|
6061
6081
|
}
|
|
6062
6082
|
|
|
6063
|
-
/*! @azure/msal-common v15.
|
|
6083
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
6064
6084
|
|
|
6065
6085
|
/*
|
|
6066
6086
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6080,7 +6100,7 @@ class NetworkError extends AuthError {
|
|
|
6080
6100
|
}
|
|
6081
6101
|
}
|
|
6082
6102
|
|
|
6083
|
-
/*! @azure/msal-common v15.
|
|
6103
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
6084
6104
|
|
|
6085
6105
|
/*
|
|
6086
6106
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6228,7 +6248,7 @@ class BaseClient {
|
|
|
6228
6248
|
}
|
|
6229
6249
|
}
|
|
6230
6250
|
|
|
6231
|
-
/*! @azure/msal-common v15.
|
|
6251
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
6232
6252
|
/*
|
|
6233
6253
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6234
6254
|
* Licensed under the MIT License.
|
|
@@ -6256,7 +6276,7 @@ var InteractionRequiredAuthErrorCodes = /*#__PURE__*/Object.freeze({
|
|
|
6256
6276
|
uxNotAllowed: uxNotAllowed
|
|
6257
6277
|
});
|
|
6258
6278
|
|
|
6259
|
-
/*! @azure/msal-common v15.
|
|
6279
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
6260
6280
|
|
|
6261
6281
|
/*
|
|
6262
6282
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6346,7 +6366,7 @@ function createInteractionRequiredAuthError(errorCode) {
|
|
|
6346
6366
|
return new InteractionRequiredAuthError(errorCode, InteractionRequiredAuthErrorMessages[errorCode]);
|
|
6347
6367
|
}
|
|
6348
6368
|
|
|
6349
|
-
/*! @azure/msal-common v15.
|
|
6369
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
6350
6370
|
|
|
6351
6371
|
/*
|
|
6352
6372
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6418,7 +6438,7 @@ class ProtocolUtils {
|
|
|
6418
6438
|
}
|
|
6419
6439
|
}
|
|
6420
6440
|
|
|
6421
|
-
/*! @azure/msal-common v15.
|
|
6441
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
6422
6442
|
|
|
6423
6443
|
/*
|
|
6424
6444
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6500,7 +6520,7 @@ class PopTokenGenerator {
|
|
|
6500
6520
|
}
|
|
6501
6521
|
}
|
|
6502
6522
|
|
|
6503
|
-
/*! @azure/msal-common v15.
|
|
6523
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
6504
6524
|
/*
|
|
6505
6525
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6506
6526
|
* Licensed under the MIT License.
|
|
@@ -6527,7 +6547,7 @@ class PopTokenGenerator {
|
|
|
6527
6547
|
}
|
|
6528
6548
|
}
|
|
6529
6549
|
|
|
6530
|
-
/*! @azure/msal-common v15.
|
|
6550
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
6531
6551
|
|
|
6532
6552
|
/*
|
|
6533
6553
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6591,7 +6611,7 @@ class ResponseHandler {
|
|
|
6591
6611
|
* @param serverTokenResponse
|
|
6592
6612
|
* @param authority
|
|
6593
6613
|
*/
|
|
6594
|
-
async handleServerTokenResponse(serverTokenResponse, authority, reqTimestamp, request, authCodePayload, userAssertionHash, handlingRefreshTokenResponse, forceCacheRefreshTokenResponse, serverRequestId) {
|
|
6614
|
+
async handleServerTokenResponse(serverTokenResponse, authority, reqTimestamp, request, apiId, authCodePayload, userAssertionHash, handlingRefreshTokenResponse, forceCacheRefreshTokenResponse, serverRequestId) {
|
|
6595
6615
|
this.performanceClient?.addQueueMeasurement(PerformanceEvents.HandleServerTokenResponse, serverTokenResponse.correlation_id);
|
|
6596
6616
|
// create an idToken object (not entity)
|
|
6597
6617
|
let idTokenClaims;
|
|
@@ -6639,14 +6659,19 @@ class ResponseHandler {
|
|
|
6639
6659
|
if (handlingRefreshTokenResponse &&
|
|
6640
6660
|
!forceCacheRefreshTokenResponse &&
|
|
6641
6661
|
cacheRecord.account) {
|
|
6642
|
-
const
|
|
6643
|
-
|
|
6644
|
-
|
|
6662
|
+
const cachedAccounts = this.cacheStorage.getAllAccounts({
|
|
6663
|
+
homeAccountId: cacheRecord.account.homeAccountId,
|
|
6664
|
+
environment: cacheRecord.account.environment,
|
|
6665
|
+
}, request.correlationId);
|
|
6666
|
+
if (cachedAccounts.length < 1) {
|
|
6645
6667
|
this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache");
|
|
6668
|
+
this.performanceClient?.addFields({
|
|
6669
|
+
acntLoggedOut: true,
|
|
6670
|
+
}, request.correlationId);
|
|
6646
6671
|
return await ResponseHandler.generateAuthenticationResult(this.cryptoObj, authority, cacheRecord, false, request, idTokenClaims, requestStateObj, undefined, serverRequestId);
|
|
6647
6672
|
}
|
|
6648
6673
|
}
|
|
6649
|
-
await this.cacheStorage.saveCacheRecord(cacheRecord, request.correlationId, isKmsi(idTokenClaims || {}), request.storeInCache);
|
|
6674
|
+
await this.cacheStorage.saveCacheRecord(cacheRecord, request.correlationId, isKmsi(idTokenClaims || {}), apiId, request.storeInCache);
|
|
6650
6675
|
}
|
|
6651
6676
|
finally {
|
|
6652
6677
|
if (this.persistencePlugin &&
|
|
@@ -6716,6 +6741,9 @@ class ResponseHandler {
|
|
|
6716
6741
|
? parseInt(serverTokenResponse.refresh_token_expires_in, 10)
|
|
6717
6742
|
: serverTokenResponse.refresh_token_expires_in;
|
|
6718
6743
|
rtExpiresOn = reqTimestamp + rtExpiresIn;
|
|
6744
|
+
this.performanceClient?.addFields({
|
|
6745
|
+
ntwkRtExpiresOnSeconds: rtExpiresOn,
|
|
6746
|
+
}, request.correlationId);
|
|
6719
6747
|
}
|
|
6720
6748
|
cachedRefreshToken = createRefreshTokenEntity(this.homeAccountIdentifier, env, serverTokenResponse.refresh_token, this.clientId, serverTokenResponse.foci, userAssertionHash, rtExpiresOn);
|
|
6721
6749
|
}
|
|
@@ -6858,7 +6886,7 @@ function buildAccountToCache(cacheStorage, authority, homeAccountId, base64Decod
|
|
|
6858
6886
|
return baseAccount;
|
|
6859
6887
|
}
|
|
6860
6888
|
|
|
6861
|
-
/*! @azure/msal-common v15.
|
|
6889
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
6862
6890
|
/*
|
|
6863
6891
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6864
6892
|
* Licensed under the MIT License.
|
|
@@ -6876,7 +6904,7 @@ async function getClientAssertion(clientAssertion, clientId, tokenEndpoint) {
|
|
|
6876
6904
|
}
|
|
6877
6905
|
}
|
|
6878
6906
|
|
|
6879
|
-
/*! @azure/msal-common v15.
|
|
6907
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
6880
6908
|
|
|
6881
6909
|
/*
|
|
6882
6910
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6898,8 +6926,9 @@ class AuthorizationCodeClient extends BaseClient {
|
|
|
6898
6926
|
* API to acquire a token in exchange of 'authorization_code` acquired by the user in the first leg of the
|
|
6899
6927
|
* authorization_code_grant
|
|
6900
6928
|
* @param request
|
|
6929
|
+
* @param apiId - API identifier for telemetry tracking
|
|
6901
6930
|
*/
|
|
6902
|
-
async acquireToken(request, authCodePayload) {
|
|
6931
|
+
async acquireToken(request, apiId, authCodePayload) {
|
|
6903
6932
|
this.performanceClient?.addQueueMeasurement(PerformanceEvents.AuthClientAcquireToken, request.correlationId);
|
|
6904
6933
|
if (!request.code) {
|
|
6905
6934
|
throw createClientAuthError(requestCannotBeMade);
|
|
@@ -6911,7 +6940,7 @@ class AuthorizationCodeClient extends BaseClient {
|
|
|
6911
6940
|
const responseHandler = new ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger, this.config.serializableCache, this.config.persistencePlugin, this.performanceClient);
|
|
6912
6941
|
// Validate response. This function throws a server error if an error is returned by the server.
|
|
6913
6942
|
responseHandler.validateTokenResponse(response.body);
|
|
6914
|
-
return invokeAsync(responseHandler.handleServerTokenResponse.bind(responseHandler), PerformanceEvents.HandleServerTokenResponse, this.logger, this.performanceClient, request.correlationId)(response.body, this.authority, reqTimestamp, request, authCodePayload, undefined, undefined, undefined, requestId);
|
|
6943
|
+
return invokeAsync(responseHandler.handleServerTokenResponse.bind(responseHandler), PerformanceEvents.HandleServerTokenResponse, this.logger, this.performanceClient, request.correlationId)(response.body, this.authority, reqTimestamp, request, apiId, authCodePayload, undefined, undefined, undefined, requestId);
|
|
6915
6944
|
}
|
|
6916
6945
|
/**
|
|
6917
6946
|
* Used to log out the current user, and redirect the user to the postLogoutRedirectUri.
|
|
@@ -7111,7 +7140,7 @@ class AuthorizationCodeClient extends BaseClient {
|
|
|
7111
7140
|
}
|
|
7112
7141
|
}
|
|
7113
7142
|
|
|
7114
|
-
/*! @azure/msal-common v15.
|
|
7143
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
7115
7144
|
|
|
7116
7145
|
/*
|
|
7117
7146
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7126,7 +7155,7 @@ class RefreshTokenClient extends BaseClient {
|
|
|
7126
7155
|
constructor(configuration, performanceClient) {
|
|
7127
7156
|
super(configuration, performanceClient);
|
|
7128
7157
|
}
|
|
7129
|
-
async acquireToken(request) {
|
|
7158
|
+
async acquireToken(request, apiId) {
|
|
7130
7159
|
this.performanceClient?.addQueueMeasurement(PerformanceEvents.RefreshTokenClientAcquireToken, request.correlationId);
|
|
7131
7160
|
const reqTimestamp = nowSeconds();
|
|
7132
7161
|
const response = await invokeAsync(this.executeTokenRequest.bind(this), PerformanceEvents.RefreshTokenClientExecuteTokenRequest, this.logger, this.performanceClient, request.correlationId)(request, this.authority);
|
|
@@ -7134,13 +7163,13 @@ class RefreshTokenClient extends BaseClient {
|
|
|
7134
7163
|
const requestId = response.headers?.[HeaderNames.X_MS_REQUEST_ID];
|
|
7135
7164
|
const responseHandler = new ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger, this.config.serializableCache, this.config.persistencePlugin);
|
|
7136
7165
|
responseHandler.validateTokenResponse(response.body);
|
|
7137
|
-
return invokeAsync(responseHandler.handleServerTokenResponse.bind(responseHandler), PerformanceEvents.HandleServerTokenResponse, this.logger, this.performanceClient, request.correlationId)(response.body, this.authority, reqTimestamp, request, undefined, undefined, true, request.forceCache, requestId);
|
|
7166
|
+
return invokeAsync(responseHandler.handleServerTokenResponse.bind(responseHandler), PerformanceEvents.HandleServerTokenResponse, this.logger, this.performanceClient, request.correlationId)(response.body, this.authority, reqTimestamp, request, apiId, undefined, undefined, true, request.forceCache, requestId);
|
|
7138
7167
|
}
|
|
7139
7168
|
/**
|
|
7140
7169
|
* Gets cached refresh token and attaches to request, then calls acquireToken API
|
|
7141
7170
|
* @param request
|
|
7142
7171
|
*/
|
|
7143
|
-
async acquireTokenByRefreshToken(request) {
|
|
7172
|
+
async acquireTokenByRefreshToken(request, apiId) {
|
|
7144
7173
|
// Cannot renew token if no request object is given.
|
|
7145
7174
|
if (!request) {
|
|
7146
7175
|
throw createClientConfigurationError(tokenRequestEmpty);
|
|
@@ -7155,7 +7184,7 @@ class RefreshTokenClient extends BaseClient {
|
|
|
7155
7184
|
// if the app is part of the family, retrive a Family refresh token if present and make a refreshTokenRequest
|
|
7156
7185
|
if (isFOCI) {
|
|
7157
7186
|
try {
|
|
7158
|
-
return await invokeAsync(this.acquireTokenWithCachedRefreshToken.bind(this), PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, this.logger, this.performanceClient, request.correlationId)(request, true);
|
|
7187
|
+
return await invokeAsync(this.acquireTokenWithCachedRefreshToken.bind(this), PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, this.logger, this.performanceClient, request.correlationId)(request, true, apiId);
|
|
7159
7188
|
}
|
|
7160
7189
|
catch (e) {
|
|
7161
7190
|
const noFamilyRTInCache = e instanceof InteractionRequiredAuthError &&
|
|
@@ -7166,7 +7195,7 @@ class RefreshTokenClient extends BaseClient {
|
|
|
7166
7195
|
e.subError === Errors.CLIENT_MISMATCH_ERROR;
|
|
7167
7196
|
// if family Refresh Token (FRT) cache acquisition fails or if client_mismatch error is seen with FRT, reattempt with application Refresh Token (ART)
|
|
7168
7197
|
if (noFamilyRTInCache || clientMismatchErrorWithFamilyRT) {
|
|
7169
|
-
return invokeAsync(this.acquireTokenWithCachedRefreshToken.bind(this), PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, this.logger, this.performanceClient, request.correlationId)(request, false);
|
|
7198
|
+
return invokeAsync(this.acquireTokenWithCachedRefreshToken.bind(this), PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, this.logger, this.performanceClient, request.correlationId)(request, false, apiId);
|
|
7170
7199
|
// throw in all other cases
|
|
7171
7200
|
}
|
|
7172
7201
|
else {
|
|
@@ -7175,26 +7204,30 @@ class RefreshTokenClient extends BaseClient {
|
|
|
7175
7204
|
}
|
|
7176
7205
|
}
|
|
7177
7206
|
// fall back to application refresh token acquisition
|
|
7178
|
-
return invokeAsync(this.acquireTokenWithCachedRefreshToken.bind(this), PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, this.logger, this.performanceClient, request.correlationId)(request, false);
|
|
7207
|
+
return invokeAsync(this.acquireTokenWithCachedRefreshToken.bind(this), PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, this.logger, this.performanceClient, request.correlationId)(request, false, apiId);
|
|
7179
7208
|
}
|
|
7180
7209
|
/**
|
|
7181
7210
|
* makes a network call to acquire tokens by exchanging RefreshToken available in userCache; throws if refresh token is not cached
|
|
7182
7211
|
* @param request
|
|
7183
7212
|
*/
|
|
7184
|
-
async acquireTokenWithCachedRefreshToken(request, foci) {
|
|
7213
|
+
async acquireTokenWithCachedRefreshToken(request, foci, apiId) {
|
|
7185
7214
|
this.performanceClient?.addQueueMeasurement(PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, request.correlationId);
|
|
7186
7215
|
// fetches family RT or application RT based on FOCI value
|
|
7187
7216
|
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);
|
|
7188
7217
|
if (!refreshToken) {
|
|
7189
7218
|
throw createInteractionRequiredAuthError(noTokensFound);
|
|
7190
7219
|
}
|
|
7191
|
-
if (refreshToken.expiresOn
|
|
7192
|
-
|
|
7193
|
-
DEFAULT_REFRESH_TOKEN_EXPIRATION_OFFSET_SECONDS
|
|
7194
|
-
this.performanceClient?.addFields({
|
|
7195
|
-
|
|
7220
|
+
if (refreshToken.expiresOn) {
|
|
7221
|
+
const offset = request.refreshTokenExpirationOffsetSeconds ||
|
|
7222
|
+
DEFAULT_REFRESH_TOKEN_EXPIRATION_OFFSET_SECONDS;
|
|
7223
|
+
this.performanceClient?.addFields({
|
|
7224
|
+
cacheRtExpiresOnSeconds: Number(refreshToken.expiresOn),
|
|
7225
|
+
rtOffsetSeconds: offset,
|
|
7226
|
+
}, request.correlationId);
|
|
7227
|
+
if (isTokenExpired(refreshToken.expiresOn, offset)) {
|
|
7228
|
+
throw createInteractionRequiredAuthError(refreshTokenExpired);
|
|
7229
|
+
}
|
|
7196
7230
|
}
|
|
7197
|
-
// attach cached RT size to the current measurement
|
|
7198
7231
|
const refreshTokenRequest = {
|
|
7199
7232
|
...request,
|
|
7200
7233
|
refreshToken: refreshToken.secret,
|
|
@@ -7205,11 +7238,10 @@ class RefreshTokenClient extends BaseClient {
|
|
|
7205
7238
|
},
|
|
7206
7239
|
};
|
|
7207
7240
|
try {
|
|
7208
|
-
return await invokeAsync(this.acquireToken.bind(this), PerformanceEvents.RefreshTokenClientAcquireToken, this.logger, this.performanceClient, request.correlationId)(refreshTokenRequest);
|
|
7241
|
+
return await invokeAsync(this.acquireToken.bind(this), PerformanceEvents.RefreshTokenClientAcquireToken, this.logger, this.performanceClient, request.correlationId)(refreshTokenRequest, apiId);
|
|
7209
7242
|
}
|
|
7210
7243
|
catch (e) {
|
|
7211
7244
|
if (e instanceof InteractionRequiredAuthError) {
|
|
7212
|
-
this.performanceClient?.addFields({ rtExpiresOnMs: Number(refreshToken.expiresOn) }, request.correlationId);
|
|
7213
7245
|
if (e.subError === badToken) {
|
|
7214
7246
|
// Remove bad refresh token from cache
|
|
7215
7247
|
this.logger.verbose("acquireTokenWithRefreshToken: bad refresh token, removing from cache");
|
|
@@ -7320,7 +7352,7 @@ class RefreshTokenClient extends BaseClient {
|
|
|
7320
7352
|
}
|
|
7321
7353
|
}
|
|
7322
7354
|
|
|
7323
|
-
/*! @azure/msal-common v15.
|
|
7355
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
7324
7356
|
|
|
7325
7357
|
/*
|
|
7326
7358
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7418,7 +7450,7 @@ class SilentFlowClient extends BaseClient {
|
|
|
7418
7450
|
}
|
|
7419
7451
|
}
|
|
7420
7452
|
|
|
7421
|
-
/*! @azure/msal-common v15.
|
|
7453
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
7422
7454
|
|
|
7423
7455
|
/*
|
|
7424
7456
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7568,7 +7600,7 @@ function extractLoginHint(account) {
|
|
|
7568
7600
|
return account.loginHint || account.idTokenClaims?.login_hint || null;
|
|
7569
7601
|
}
|
|
7570
7602
|
|
|
7571
|
-
/*! @azure/msal-common v15.
|
|
7603
|
+
/*! @azure/msal-common v15.14.1 2026-01-17 */
|
|
7572
7604
|
|
|
7573
7605
|
/*
|
|
7574
7606
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -8141,6 +8173,8 @@ const ApiId = {
|
|
|
8141
8173
|
acquireTokenByUsernamePassword: 371,
|
|
8142
8174
|
acquireTokenByDeviceCode: 671,
|
|
8143
8175
|
acquireTokenByClientCredential: 771,
|
|
8176
|
+
acquireTokenByOBO: 772,
|
|
8177
|
+
acquireTokenWithManagedIdentity: 773,
|
|
8144
8178
|
acquireTokenByCode: 871,
|
|
8145
8179
|
acquireTokenByRefreshToken: 872,
|
|
8146
8180
|
};
|
|
@@ -8207,7 +8241,7 @@ class NetworkUtils {
|
|
|
8207
8241
|
|
|
8208
8242
|
/* eslint-disable header/header */
|
|
8209
8243
|
const name = "@azure/msal-node";
|
|
8210
|
-
const version = "3.8.
|
|
8244
|
+
const version = "3.8.6";
|
|
8211
8245
|
|
|
8212
8246
|
/*
|
|
8213
8247
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -9998,7 +10032,7 @@ class UsernamePasswordClient extends BaseClient {
|
|
|
9998
10032
|
const responseHandler = new ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger, this.config.serializableCache, this.config.persistencePlugin);
|
|
9999
10033
|
// Validate response. This function throws a server error if an error is returned by the server.
|
|
10000
10034
|
responseHandler.validateTokenResponse(response.body);
|
|
10001
|
-
const tokenResponse = responseHandler.handleServerTokenResponse(response.body, this.authority, reqTimestamp, request);
|
|
10035
|
+
const tokenResponse = responseHandler.handleServerTokenResponse(response.body, this.authority, reqTimestamp, request, ApiId.acquireTokenByUsernamePassword);
|
|
10002
10036
|
return tokenResponse;
|
|
10003
10037
|
}
|
|
10004
10038
|
/**
|
|
@@ -10173,7 +10207,7 @@ class ClientApplication {
|
|
|
10173
10207
|
const authClientConfig = await this.buildOauthClientConfiguration(discoveredAuthority, validRequest.correlationId, validRequest.redirectUri, serverTelemetryManager);
|
|
10174
10208
|
const authorizationCodeClient = new AuthorizationCodeClient(authClientConfig);
|
|
10175
10209
|
this.logger.verbose("Auth code client created", validRequest.correlationId);
|
|
10176
|
-
return await authorizationCodeClient.acquireToken(validRequest, authCodePayLoad);
|
|
10210
|
+
return await authorizationCodeClient.acquireToken(validRequest, ApiId.acquireTokenByCode, authCodePayLoad);
|
|
10177
10211
|
}
|
|
10178
10212
|
catch (e) {
|
|
10179
10213
|
if (e instanceof AuthError) {
|
|
@@ -10203,7 +10237,7 @@ class ClientApplication {
|
|
|
10203
10237
|
const refreshTokenClientConfig = await this.buildOauthClientConfiguration(discoveredAuthority, validRequest.correlationId, validRequest.redirectUri || "", serverTelemetryManager);
|
|
10204
10238
|
const refreshTokenClient = new RefreshTokenClient(refreshTokenClientConfig);
|
|
10205
10239
|
this.logger.verbose("Refresh token client created", validRequest.correlationId);
|
|
10206
|
-
return await refreshTokenClient.acquireToken(validRequest);
|
|
10240
|
+
return await refreshTokenClient.acquireToken(validRequest, ApiId.acquireTokenByRefreshToken);
|
|
10207
10241
|
}
|
|
10208
10242
|
catch (e) {
|
|
10209
10243
|
if (e instanceof AuthError) {
|
|
@@ -10243,7 +10277,7 @@ class ClientApplication {
|
|
|
10243
10277
|
error.errorCode ===
|
|
10244
10278
|
tokenRefreshRequired) {
|
|
10245
10279
|
const refreshTokenClient = new RefreshTokenClient(clientConfiguration);
|
|
10246
|
-
return refreshTokenClient.acquireTokenByRefreshToken(validRequest);
|
|
10280
|
+
return refreshTokenClient.acquireTokenByRefreshToken(validRequest, ApiId.acquireTokenSilent);
|
|
10247
10281
|
}
|
|
10248
10282
|
throw error;
|
|
10249
10283
|
}
|
|
@@ -10268,7 +10302,7 @@ class ClientApplication {
|
|
|
10268
10302
|
// refresh the access token in the background
|
|
10269
10303
|
const refreshTokenClient = new RefreshTokenClient(clientConfiguration);
|
|
10270
10304
|
try {
|
|
10271
|
-
await refreshTokenClient.acquireTokenByRefreshToken(validRequest);
|
|
10305
|
+
await refreshTokenClient.acquireTokenByRefreshToken(validRequest, ApiId.acquireTokenSilent);
|
|
10272
10306
|
}
|
|
10273
10307
|
catch {
|
|
10274
10308
|
// do nothing, this is running in the background and no action is to be taken upon success or failure
|
|
@@ -10582,7 +10616,7 @@ class DeviceCodeClient extends BaseClient {
|
|
|
10582
10616
|
const responseHandler = new ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger, this.config.serializableCache, this.config.persistencePlugin);
|
|
10583
10617
|
// Validate response. This function throws a server error if an error is returned by the server.
|
|
10584
10618
|
responseHandler.validateTokenResponse(response);
|
|
10585
|
-
return responseHandler.handleServerTokenResponse(response, this.authority, reqTimestamp, request);
|
|
10619
|
+
return responseHandler.handleServerTokenResponse(response, this.authority, reqTimestamp, request, ApiId.acquireTokenByDeviceCode);
|
|
10586
10620
|
}
|
|
10587
10621
|
/**
|
|
10588
10622
|
* Creates device code request and executes http GET
|
|
@@ -11179,7 +11213,7 @@ class ClientCredentialClient extends BaseClient {
|
|
|
11179
11213
|
}
|
|
11180
11214
|
const responseHandler = new ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger, this.config.serializableCache, this.config.persistencePlugin);
|
|
11181
11215
|
responseHandler.validateTokenResponse(serverTokenResponse, refreshAccessToken);
|
|
11182
|
-
const tokenResponse = await responseHandler.handleServerTokenResponse(serverTokenResponse, this.authority, reqTimestamp, request);
|
|
11216
|
+
const tokenResponse = await responseHandler.handleServerTokenResponse(serverTokenResponse, this.authority, reqTimestamp, request, ApiId.acquireTokenByClientCredential);
|
|
11183
11217
|
return tokenResponse;
|
|
11184
11218
|
}
|
|
11185
11219
|
/**
|
|
@@ -11380,7 +11414,7 @@ class OnBehalfOfClient extends BaseClient {
|
|
|
11380
11414
|
const response = await this.executePostToTokenEndpoint(endpoint, requestBody, headers, thumbprint, request.correlationId);
|
|
11381
11415
|
const responseHandler = new ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger, this.config.serializableCache, this.config.persistencePlugin);
|
|
11382
11416
|
responseHandler.validateTokenResponse(response.body);
|
|
11383
|
-
const tokenResponse = await responseHandler.handleServerTokenResponse(response.body, this.authority, reqTimestamp, request, undefined, userAssertionHash);
|
|
11417
|
+
const tokenResponse = await responseHandler.handleServerTokenResponse(response.body, this.authority, reqTimestamp, request, ApiId.acquireTokenByOBO, undefined, userAssertionHash);
|
|
11384
11418
|
return tokenResponse;
|
|
11385
11419
|
}
|
|
11386
11420
|
/**
|
|
@@ -11835,7 +11869,7 @@ class BaseManagedIdentitySource {
|
|
|
11835
11869
|
const serverTokenResponse = await this.getServerTokenResponseAsync(response, networkClientHelper, networkRequest, networkRequestOptions);
|
|
11836
11870
|
responseHandler.validateTokenResponse(serverTokenResponse, refreshAccessToken);
|
|
11837
11871
|
// caches the token
|
|
11838
|
-
return responseHandler.handleServerTokenResponse(serverTokenResponse, fakeAuthority, reqTimestamp, managedIdentityRequest);
|
|
11872
|
+
return responseHandler.handleServerTokenResponse(serverTokenResponse, fakeAuthority, reqTimestamp, managedIdentityRequest, ApiId.acquireTokenWithManagedIdentity);
|
|
11839
11873
|
}
|
|
11840
11874
|
/**
|
|
11841
11875
|
* Determines the appropriate query parameter name for user-assigned managed identity
|