@azure/msal-node 3.1.0 → 3.2.1

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.
Files changed (60) hide show
  1. package/dist/cache/NodeStorage.mjs +1 -1
  2. package/dist/cache/TokenCache.d.ts +9 -1
  3. package/dist/cache/TokenCache.d.ts.map +1 -1
  4. package/dist/cache/TokenCache.mjs +25 -1
  5. package/dist/cache/TokenCache.mjs.map +1 -1
  6. package/dist/cache/distributed/DistributedCachePlugin.mjs +1 -1
  7. package/dist/cache/serializer/Deserializer.mjs +1 -1
  8. package/dist/cache/serializer/Serializer.mjs +1 -1
  9. package/dist/client/ClientApplication.d.ts +1 -0
  10. package/dist/client/ClientApplication.d.ts.map +1 -1
  11. package/dist/client/ClientApplication.mjs +44 -10
  12. package/dist/client/ClientApplication.mjs.map +1 -1
  13. package/dist/client/ClientAssertion.mjs +1 -1
  14. package/dist/client/ClientCredentialClient.mjs +1 -1
  15. package/dist/client/ConfidentialClientApplication.mjs +1 -1
  16. package/dist/client/DeviceCodeClient.mjs +1 -1
  17. package/dist/client/ManagedIdentityApplication.mjs +1 -1
  18. package/dist/client/ManagedIdentityClient.mjs +1 -1
  19. package/dist/client/ManagedIdentitySources/AppService.mjs +1 -1
  20. package/dist/client/ManagedIdentitySources/AzureArc.mjs +1 -1
  21. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.mjs +1 -1
  22. package/dist/client/ManagedIdentitySources/CloudShell.mjs +1 -1
  23. package/dist/client/ManagedIdentitySources/Imds.mjs +1 -1
  24. package/dist/client/ManagedIdentitySources/MachineLearning.mjs +1 -1
  25. package/dist/client/ManagedIdentitySources/ServiceFabric.mjs +1 -1
  26. package/dist/client/OnBehalfOfClient.mjs +1 -1
  27. package/dist/client/PublicClientApplication.mjs +1 -1
  28. package/dist/client/UsernamePasswordClient.mjs +1 -1
  29. package/dist/config/Configuration.mjs +1 -1
  30. package/dist/config/ManagedIdentityId.mjs +1 -1
  31. package/dist/config/ManagedIdentityRequestParameters.mjs +1 -1
  32. package/dist/crypto/CryptoProvider.mjs +1 -1
  33. package/dist/crypto/GuidGenerator.mjs +1 -1
  34. package/dist/crypto/HashUtils.mjs +1 -1
  35. package/dist/crypto/PkceGenerator.mjs +1 -1
  36. package/dist/error/ManagedIdentityError.mjs +1 -1
  37. package/dist/error/ManagedIdentityErrorCodes.mjs +1 -1
  38. package/dist/error/NodeAuthError.mjs +1 -1
  39. package/dist/index.mjs +1 -1
  40. package/dist/internals.mjs +1 -1
  41. package/dist/network/HttpClient.mjs +1 -1
  42. package/dist/network/HttpClientWithRetries.mjs +1 -1
  43. package/dist/network/LoopbackClient.mjs +1 -1
  44. package/dist/packageMetadata.d.ts +1 -1
  45. package/dist/packageMetadata.mjs +2 -2
  46. package/dist/retry/LinearRetryPolicy.mjs +1 -1
  47. package/dist/utils/Constants.mjs +1 -1
  48. package/dist/utils/EncodingUtils.mjs +1 -1
  49. package/dist/utils/NetworkUtils.mjs +1 -1
  50. package/lib/msal-node.cjs +142 -111
  51. package/lib/msal-node.cjs.map +1 -1
  52. package/lib/types/cache/TokenCache.d.ts +9 -1
  53. package/lib/types/cache/TokenCache.d.ts.map +1 -1
  54. package/lib/types/client/ClientApplication.d.ts +1 -0
  55. package/lib/types/client/ClientApplication.d.ts.map +1 -1
  56. package/lib/types/packageMetadata.d.ts +1 -1
  57. package/package.json +2 -2
  58. package/src/cache/TokenCache.ts +30 -1
  59. package/src/client/ClientApplication.ts +69 -11
  60. package/src/packageMetadata.ts +1 -1
package/lib/msal-node.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v3.1.0 2025-01-22 */
1
+ /*! @azure/msal-node v3.2.1 2025-02-05 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
@@ -152,7 +152,7 @@ class Serializer {
152
152
  }
153
153
  }
154
154
 
155
- /*! @azure/msal-common v15.0.2 2025-01-22 */
155
+ /*! @azure/msal-common v15.1.1 2025-02-05 */
156
156
  /*
157
157
  * Copyright (c) Microsoft Corporation. All rights reserved.
158
158
  * Licensed under the MIT License.
@@ -445,7 +445,7 @@ const CacheOutcome = {
445
445
  // Token renewal offset default in seconds
446
446
  const DEFAULT_TOKEN_RENEWAL_OFFSET_SEC = 300;
447
447
 
448
- /*! @azure/msal-common v15.0.2 2025-01-22 */
448
+ /*! @azure/msal-common v15.1.1 2025-02-05 */
449
449
  /*
450
450
  * Copyright (c) Microsoft Corporation. All rights reserved.
451
451
  * Licensed under the MIT License.
@@ -462,7 +462,7 @@ var AuthErrorCodes = /*#__PURE__*/Object.freeze({
462
462
  unexpectedError: unexpectedError
463
463
  });
464
464
 
465
- /*! @azure/msal-common v15.0.2 2025-01-22 */
465
+ /*! @azure/msal-common v15.1.1 2025-02-05 */
466
466
 
467
467
  /*
468
468
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -511,7 +511,7 @@ function createAuthError(code, additionalMessage) {
511
511
  : AuthErrorMessages[code]);
512
512
  }
513
513
 
514
- /*! @azure/msal-common v15.0.2 2025-01-22 */
514
+ /*! @azure/msal-common v15.1.1 2025-02-05 */
515
515
  /*
516
516
  * Copyright (c) Microsoft Corporation. All rights reserved.
517
517
  * Licensed under the MIT License.
@@ -609,7 +609,7 @@ var ClientAuthErrorCodes = /*#__PURE__*/Object.freeze({
609
609
  userTimeoutReached: userTimeoutReached
610
610
  });
611
611
 
612
- /*! @azure/msal-common v15.0.2 2025-01-22 */
612
+ /*! @azure/msal-common v15.1.1 2025-02-05 */
613
613
 
614
614
  /*
615
615
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -861,7 +861,7 @@ function createClientAuthError(errorCode, additionalMessage) {
861
861
  return new ClientAuthError(errorCode, additionalMessage);
862
862
  }
863
863
 
864
- /*! @azure/msal-common v15.0.2 2025-01-22 */
864
+ /*! @azure/msal-common v15.1.1 2025-02-05 */
865
865
 
866
866
  /*
867
867
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -900,7 +900,7 @@ const DEFAULT_CRYPTO_IMPLEMENTATION = {
900
900
  },
901
901
  };
902
902
 
903
- /*! @azure/msal-common v15.0.2 2025-01-22 */
903
+ /*! @azure/msal-common v15.1.1 2025-02-05 */
904
904
 
905
905
  /*
906
906
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1091,12 +1091,12 @@ class Logger {
1091
1091
  }
1092
1092
  }
1093
1093
 
1094
- /*! @azure/msal-common v15.0.2 2025-01-22 */
1094
+ /*! @azure/msal-common v15.1.1 2025-02-05 */
1095
1095
  /* eslint-disable header/header */
1096
1096
  const name$1 = "@azure/msal-common";
1097
- const version$1 = "15.0.2";
1097
+ const version$1 = "15.1.1";
1098
1098
 
1099
- /*! @azure/msal-common v15.0.2 2025-01-22 */
1099
+ /*! @azure/msal-common v15.1.1 2025-02-05 */
1100
1100
  /*
1101
1101
  * Copyright (c) Microsoft Corporation. All rights reserved.
1102
1102
  * Licensed under the MIT License.
@@ -1116,7 +1116,7 @@ const AzureCloudInstance = {
1116
1116
  AzureUsGovernment: "https://login.microsoftonline.us",
1117
1117
  };
1118
1118
 
1119
- /*! @azure/msal-common v15.0.2 2025-01-22 */
1119
+ /*! @azure/msal-common v15.1.1 2025-02-05 */
1120
1120
 
1121
1121
  /*
1122
1122
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1177,7 +1177,7 @@ function checkMaxAge(authTime, maxAge) {
1177
1177
  }
1178
1178
  }
1179
1179
 
1180
- /*! @azure/msal-common v15.0.2 2025-01-22 */
1180
+ /*! @azure/msal-common v15.1.1 2025-02-05 */
1181
1181
  /*
1182
1182
  * Copyright (c) Microsoft Corporation. All rights reserved.
1183
1183
  * Licensed under the MIT License.
@@ -1222,7 +1222,7 @@ function delay(t, value) {
1222
1222
  return new Promise((resolve) => setTimeout(() => resolve(value), t));
1223
1223
  }
1224
1224
 
1225
- /*! @azure/msal-common v15.0.2 2025-01-22 */
1225
+ /*! @azure/msal-common v15.1.1 2025-02-05 */
1226
1226
 
1227
1227
  /*
1228
1228
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1549,7 +1549,7 @@ function isAuthorityMetadataExpired(metadata) {
1549
1549
  return metadata.expiresAt <= nowSeconds();
1550
1550
  }
1551
1551
 
1552
- /*! @azure/msal-common v15.0.2 2025-01-22 */
1552
+ /*! @azure/msal-common v15.1.1 2025-02-05 */
1553
1553
  /*
1554
1554
  * Copyright (c) Microsoft Corporation. All rights reserved.
1555
1555
  * Licensed under the MIT License.
@@ -1603,7 +1603,7 @@ var ClientConfigurationErrorCodes = /*#__PURE__*/Object.freeze({
1603
1603
  urlParseError: urlParseError
1604
1604
  });
1605
1605
 
1606
- /*! @azure/msal-common v15.0.2 2025-01-22 */
1606
+ /*! @azure/msal-common v15.1.1 2025-02-05 */
1607
1607
 
1608
1608
  /*
1609
1609
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1741,7 +1741,7 @@ function createClientConfigurationError(errorCode) {
1741
1741
  return new ClientConfigurationError(errorCode);
1742
1742
  }
1743
1743
 
1744
- /*! @azure/msal-common v15.0.2 2025-01-22 */
1744
+ /*! @azure/msal-common v15.1.1 2025-02-05 */
1745
1745
  /*
1746
1746
  * Copyright (c) Microsoft Corporation. All rights reserved.
1747
1747
  * Licensed under the MIT License.
@@ -1838,7 +1838,7 @@ class StringUtils {
1838
1838
  }
1839
1839
  }
1840
1840
 
1841
- /*! @azure/msal-common v15.0.2 2025-01-22 */
1841
+ /*! @azure/msal-common v15.1.1 2025-02-05 */
1842
1842
 
1843
1843
  /*
1844
1844
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2029,7 +2029,7 @@ class ScopeSet {
2029
2029
  }
2030
2030
  }
2031
2031
 
2032
- /*! @azure/msal-common v15.0.2 2025-01-22 */
2032
+ /*! @azure/msal-common v15.1.1 2025-02-05 */
2033
2033
 
2034
2034
  /*
2035
2035
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2069,7 +2069,7 @@ function buildClientInfoFromHomeAccountId(homeAccountId) {
2069
2069
  };
2070
2070
  }
2071
2071
 
2072
- /*! @azure/msal-common v15.0.2 2025-01-22 */
2072
+ /*! @azure/msal-common v15.1.1 2025-02-05 */
2073
2073
  /*
2074
2074
  * Copyright (c) Microsoft Corporation. All rights reserved.
2075
2075
  * Licensed under the MIT License.
@@ -2148,7 +2148,7 @@ function updateAccountTenantProfileData(baseAccountInfo, tenantProfile, idTokenC
2148
2148
  return updatedAccountInfo;
2149
2149
  }
2150
2150
 
2151
- /*! @azure/msal-common v15.0.2 2025-01-22 */
2151
+ /*! @azure/msal-common v15.1.1 2025-02-05 */
2152
2152
  /*
2153
2153
  * Copyright (c) Microsoft Corporation. All rights reserved.
2154
2154
  * Licensed under the MIT License.
@@ -2163,7 +2163,7 @@ const AuthorityType = {
2163
2163
  Ciam: 3,
2164
2164
  };
2165
2165
 
2166
- /*! @azure/msal-common v15.0.2 2025-01-22 */
2166
+ /*! @azure/msal-common v15.1.1 2025-02-05 */
2167
2167
  /*
2168
2168
  * Copyright (c) Microsoft Corporation. All rights reserved.
2169
2169
  * Licensed under the MIT License.
@@ -2185,7 +2185,7 @@ function getTenantIdFromIdTokenClaims(idTokenClaims) {
2185
2185
  return null;
2186
2186
  }
2187
2187
 
2188
- /*! @azure/msal-common v15.0.2 2025-01-22 */
2188
+ /*! @azure/msal-common v15.1.1 2025-02-05 */
2189
2189
  /*
2190
2190
  * Copyright (c) Microsoft Corporation. All rights reserved.
2191
2191
  * Licensed under the MIT License.
@@ -2198,7 +2198,7 @@ const ProtocolMode = {
2198
2198
  OIDC: "OIDC",
2199
2199
  };
2200
2200
 
2201
- /*! @azure/msal-common v15.0.2 2025-01-22 */
2201
+ /*! @azure/msal-common v15.1.1 2025-02-05 */
2202
2202
 
2203
2203
  /*
2204
2204
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2441,7 +2441,7 @@ class AccountEntity {
2441
2441
  }
2442
2442
  }
2443
2443
 
2444
- /*! @azure/msal-common v15.0.2 2025-01-22 */
2444
+ /*! @azure/msal-common v15.1.1 2025-02-05 */
2445
2445
 
2446
2446
  /*
2447
2447
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2488,7 +2488,7 @@ function getDeserializedResponse(responseString) {
2488
2488
  return null;
2489
2489
  }
2490
2490
 
2491
- /*! @azure/msal-common v15.0.2 2025-01-22 */
2491
+ /*! @azure/msal-common v15.1.1 2025-02-05 */
2492
2492
 
2493
2493
  /*
2494
2494
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2652,7 +2652,7 @@ class UrlString {
2652
2652
  }
2653
2653
  }
2654
2654
 
2655
- /*! @azure/msal-common v15.0.2 2025-01-22 */
2655
+ /*! @azure/msal-common v15.1.1 2025-02-05 */
2656
2656
 
2657
2657
  /*
2658
2658
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2792,7 +2792,7 @@ function getCloudDiscoveryMetadataFromNetworkResponse(response, authorityHost) {
2792
2792
  return null;
2793
2793
  }
2794
2794
 
2795
- /*! @azure/msal-common v15.0.2 2025-01-22 */
2795
+ /*! @azure/msal-common v15.1.1 2025-02-05 */
2796
2796
  /*
2797
2797
  * Copyright (c) Microsoft Corporation. All rights reserved.
2798
2798
  * Licensed under the MIT License.
@@ -2800,7 +2800,7 @@ function getCloudDiscoveryMetadataFromNetworkResponse(response, authorityHost) {
2800
2800
  const cacheQuotaExceededErrorCode = "cache_quota_exceeded";
2801
2801
  const cacheUnknownErrorCode = "cache_error_unknown";
2802
2802
 
2803
- /*! @azure/msal-common v15.0.2 2025-01-22 */
2803
+ /*! @azure/msal-common v15.1.1 2025-02-05 */
2804
2804
 
2805
2805
  /*
2806
2806
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2827,7 +2827,7 @@ class CacheError extends Error {
2827
2827
  }
2828
2828
  }
2829
2829
 
2830
- /*! @azure/msal-common v15.0.2 2025-01-22 */
2830
+ /*! @azure/msal-common v15.1.1 2025-02-05 */
2831
2831
 
2832
2832
  /*
2833
2833
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4011,7 +4011,7 @@ class DefaultStorageClass extends CacheManager {
4011
4011
  }
4012
4012
  }
4013
4013
 
4014
- /*! @azure/msal-common v15.0.2 2025-01-22 */
4014
+ /*! @azure/msal-common v15.1.1 2025-02-05 */
4015
4015
 
4016
4016
  /*
4017
4017
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4110,7 +4110,7 @@ function isOidcProtocolMode(config) {
4110
4110
  return (config.authOptions.authority.options.protocolMode === ProtocolMode.OIDC);
4111
4111
  }
4112
4112
 
4113
- /*! @azure/msal-common v15.0.2 2025-01-22 */
4113
+ /*! @azure/msal-common v15.1.1 2025-02-05 */
4114
4114
  /*
4115
4115
  * Copyright (c) Microsoft Corporation. All rights reserved.
4116
4116
  * Licensed under the MIT License.
@@ -4120,7 +4120,7 @@ const CcsCredentialType = {
4120
4120
  UPN: "UPN",
4121
4121
  };
4122
4122
 
4123
- /*! @azure/msal-common v15.0.2 2025-01-22 */
4123
+ /*! @azure/msal-common v15.1.1 2025-02-05 */
4124
4124
  /*
4125
4125
  * Copyright (c) Microsoft Corporation. All rights reserved.
4126
4126
  * Licensed under the MIT License.
@@ -4171,7 +4171,7 @@ const X_CLIENT_EXTRA_SKU = "x-client-xtra-sku";
4171
4171
  const BROKER_CLIENT_ID = "brk_client_id";
4172
4172
  const BROKER_REDIRECT_URI = "brk_redirect_uri";
4173
4173
 
4174
- /*! @azure/msal-common v15.0.2 2025-01-22 */
4174
+ /*! @azure/msal-common v15.1.1 2025-02-05 */
4175
4175
 
4176
4176
  /*
4177
4177
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4238,7 +4238,7 @@ class RequestValidator {
4238
4238
  }
4239
4239
  }
4240
4240
 
4241
- /*! @azure/msal-common v15.0.2 2025-01-22 */
4241
+ /*! @azure/msal-common v15.1.1 2025-02-05 */
4242
4242
 
4243
4243
  /*
4244
4244
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4646,7 +4646,7 @@ class RequestParameterBuilder {
4646
4646
  }
4647
4647
  }
4648
4648
 
4649
- /*! @azure/msal-common v15.0.2 2025-01-22 */
4649
+ /*! @azure/msal-common v15.1.1 2025-02-05 */
4650
4650
  /*
4651
4651
  * Copyright (c) Microsoft Corporation. All rights reserved.
4652
4652
  * Licensed under the MIT License.
@@ -4658,7 +4658,7 @@ function isOpenIdConfigResponse(response) {
4658
4658
  response.hasOwnProperty("jwks_uri"));
4659
4659
  }
4660
4660
 
4661
- /*! @azure/msal-common v15.0.2 2025-01-22 */
4661
+ /*! @azure/msal-common v15.1.1 2025-02-05 */
4662
4662
  /*
4663
4663
  * Copyright (c) Microsoft Corporation. All rights reserved.
4664
4664
  * Licensed under the MIT License.
@@ -4668,7 +4668,7 @@ function isCloudInstanceDiscoveryResponse(response) {
4668
4668
  response.hasOwnProperty("metadata"));
4669
4669
  }
4670
4670
 
4671
- /*! @azure/msal-common v15.0.2 2025-01-22 */
4671
+ /*! @azure/msal-common v15.1.1 2025-02-05 */
4672
4672
  /*
4673
4673
  * Copyright (c) Microsoft Corporation. All rights reserved.
4674
4674
  * Licensed under the MIT License.
@@ -4678,7 +4678,7 @@ function isCloudInstanceDiscoveryErrorResponse(response) {
4678
4678
  response.hasOwnProperty("error_description"));
4679
4679
  }
4680
4680
 
4681
- /*! @azure/msal-common v15.0.2 2025-01-22 */
4681
+ /*! @azure/msal-common v15.1.1 2025-02-05 */
4682
4682
  /*
4683
4683
  * Copyright (c) Microsoft Corporation. All rights reserved.
4684
4684
  * Licensed under the MIT License.
@@ -4916,6 +4916,7 @@ const PerformanceEvents = {
4916
4916
  CacheManagerGetRefreshToken: "cacheManagerGetRefreshToken",
4917
4917
  ImportExistingCache: "importExistingCache",
4918
4918
  SetUserData: "setUserData",
4919
+ LocalStorageUpdated: "localStorageUpdated",
4919
4920
  /**
4920
4921
  * Crypto Operations
4921
4922
  */
@@ -4932,7 +4933,7 @@ const PerformanceEvents = {
4932
4933
  Decrypt: "decrypt",
4933
4934
  };
4934
4935
 
4935
- /*! @azure/msal-common v15.0.2 2025-01-22 */
4936
+ /*! @azure/msal-common v15.1.1 2025-02-05 */
4936
4937
  /*
4937
4938
  * Copyright (c) Microsoft Corporation. All rights reserved.
4938
4939
  * Licensed under the MIT License.
@@ -5028,7 +5029,7 @@ const invokeAsync = (callback, eventName, logger, telemetryClient, correlationId
5028
5029
  };
5029
5030
  };
5030
5031
 
5031
- /*! @azure/msal-common v15.0.2 2025-01-22 */
5032
+ /*! @azure/msal-common v15.1.1 2025-02-05 */
5032
5033
 
5033
5034
  /*
5034
5035
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5137,7 +5138,7 @@ RegionDiscovery.IMDS_OPTIONS = {
5137
5138
  },
5138
5139
  };
5139
5140
 
5140
- /*! @azure/msal-common v15.0.2 2025-01-22 */
5141
+ /*! @azure/msal-common v15.1.1 2025-02-05 */
5141
5142
 
5142
5143
  /*
5143
5144
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5976,7 +5977,7 @@ function buildStaticAuthorityOptions(authOptions) {
5976
5977
  };
5977
5978
  }
5978
5979
 
5979
- /*! @azure/msal-common v15.0.2 2025-01-22 */
5980
+ /*! @azure/msal-common v15.1.1 2025-02-05 */
5980
5981
 
5981
5982
  /*
5982
5983
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6007,7 +6008,7 @@ async function createDiscoveredInstance(authorityUri, networkClient, cacheManage
6007
6008
  }
6008
6009
  }
6009
6010
 
6010
- /*! @azure/msal-common v15.0.2 2025-01-22 */
6011
+ /*! @azure/msal-common v15.1.1 2025-02-05 */
6011
6012
 
6012
6013
  /*
6013
6014
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6026,7 +6027,7 @@ class ServerError extends AuthError {
6026
6027
  }
6027
6028
  }
6028
6029
 
6029
- /*! @azure/msal-common v15.0.2 2025-01-22 */
6030
+ /*! @azure/msal-common v15.1.1 2025-02-05 */
6030
6031
 
6031
6032
  /*
6032
6033
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6124,7 +6125,7 @@ class ThrottlingUtils {
6124
6125
  }
6125
6126
  }
6126
6127
 
6127
- /*! @azure/msal-common v15.0.2 2025-01-22 */
6128
+ /*! @azure/msal-common v15.1.1 2025-02-05 */
6128
6129
 
6129
6130
  /*
6130
6131
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6144,7 +6145,7 @@ class NetworkError extends AuthError {
6144
6145
  }
6145
6146
  }
6146
6147
 
6147
- /*! @azure/msal-common v15.0.2 2025-01-22 */
6148
+ /*! @azure/msal-common v15.1.1 2025-02-05 */
6148
6149
 
6149
6150
  /*
6150
6151
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6294,7 +6295,7 @@ class BaseClient {
6294
6295
  }
6295
6296
  }
6296
6297
 
6297
- /*! @azure/msal-common v15.0.2 2025-01-22 */
6298
+ /*! @azure/msal-common v15.1.1 2025-02-05 */
6298
6299
  /*
6299
6300
  * Copyright (c) Microsoft Corporation. All rights reserved.
6300
6301
  * Licensed under the MIT License.
@@ -6320,7 +6321,7 @@ var InteractionRequiredAuthErrorCodes = /*#__PURE__*/Object.freeze({
6320
6321
  refreshTokenExpired: refreshTokenExpired
6321
6322
  });
6322
6323
 
6323
- /*! @azure/msal-common v15.0.2 2025-01-22 */
6324
+ /*! @azure/msal-common v15.1.1 2025-02-05 */
6324
6325
 
6325
6326
  /*
6326
6327
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6408,7 +6409,7 @@ function createInteractionRequiredAuthError(errorCode) {
6408
6409
  return new InteractionRequiredAuthError(errorCode, InteractionRequiredAuthErrorMessages[errorCode]);
6409
6410
  }
6410
6411
 
6411
- /*! @azure/msal-common v15.0.2 2025-01-22 */
6412
+ /*! @azure/msal-common v15.1.1 2025-02-05 */
6412
6413
 
6413
6414
  /*
6414
6415
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6480,7 +6481,7 @@ class ProtocolUtils {
6480
6481
  }
6481
6482
  }
6482
6483
 
6483
- /*! @azure/msal-common v15.0.2 2025-01-22 */
6484
+ /*! @azure/msal-common v15.1.1 2025-02-05 */
6484
6485
 
6485
6486
  /*
6486
6487
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6564,7 +6565,7 @@ class PopTokenGenerator {
6564
6565
  }
6565
6566
  }
6566
6567
 
6567
- /*! @azure/msal-common v15.0.2 2025-01-22 */
6568
+ /*! @azure/msal-common v15.1.1 2025-02-05 */
6568
6569
  /*
6569
6570
  * Copyright (c) Microsoft Corporation. All rights reserved.
6570
6571
  * Licensed under the MIT License.
@@ -6591,7 +6592,7 @@ class PopTokenGenerator {
6591
6592
  }
6592
6593
  }
6593
6594
 
6594
- /*! @azure/msal-common v15.0.2 2025-01-22 */
6595
+ /*! @azure/msal-common v15.1.1 2025-02-05 */
6595
6596
 
6596
6597
  /*
6597
6598
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6968,7 +6969,7 @@ function buildAccountToCache(cacheStorage, authority, homeAccountId, base64Decod
6968
6969
  return baseAccount;
6969
6970
  }
6970
6971
 
6971
- /*! @azure/msal-common v15.0.2 2025-01-22 */
6972
+ /*! @azure/msal-common v15.1.1 2025-02-05 */
6972
6973
  /*
6973
6974
  * Copyright (c) Microsoft Corporation. All rights reserved.
6974
6975
  * Licensed under the MIT License.
@@ -6986,7 +6987,7 @@ async function getClientAssertion(clientAssertion, clientId, tokenEndpoint) {
6986
6987
  }
6987
6988
  }
6988
6989
 
6989
- /*! @azure/msal-common v15.0.2 2025-01-22 */
6990
+ /*! @azure/msal-common v15.1.1 2025-02-05 */
6990
6991
 
6991
6992
  /*
6992
6993
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7272,7 +7273,9 @@ class AuthorizationCodeClient extends BaseClient {
7272
7273
  }
7273
7274
  if (request.domainHint) {
7274
7275
  parameterBuilder.addDomainHint(request.domainHint);
7276
+ this.performanceClient?.addFields({ domainHintFromRequest: true }, correlationId);
7275
7277
  }
7278
+ this.performanceClient?.addFields({ prompt: request.prompt }, correlationId);
7276
7279
  // Add sid or loginHint with preference for login_hint claim (in request) -> sid -> loginHint (upn/email) -> username of AccountInfo object
7277
7280
  if (request.prompt !== PromptValue.SELECT_ACCOUNT) {
7278
7281
  // AAD will throw if prompt=select_account is passed with an account hint
@@ -7280,6 +7283,7 @@ class AuthorizationCodeClient extends BaseClient {
7280
7283
  // SessionID is only used in silent calls
7281
7284
  this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request");
7282
7285
  parameterBuilder.addSid(request.sid);
7286
+ this.performanceClient?.addFields({ sidFromRequest: true }, correlationId);
7283
7287
  }
7284
7288
  else if (request.account) {
7285
7289
  const accountSid = this.extractAccountSid(request.account);
@@ -7292,6 +7296,7 @@ class AuthorizationCodeClient extends BaseClient {
7292
7296
  if (accountLoginHintClaim) {
7293
7297
  this.logger.verbose("createAuthCodeUrlQueryString: login_hint claim present on account");
7294
7298
  parameterBuilder.addLoginHint(accountLoginHintClaim);
7299
+ this.performanceClient?.addFields({ loginHintFromClaim: true }, correlationId);
7295
7300
  try {
7296
7301
  const clientInfo = buildClientInfoFromHomeAccountId(request.account.homeAccountId);
7297
7302
  parameterBuilder.addCcsOid(clientInfo);
@@ -7307,6 +7312,7 @@ class AuthorizationCodeClient extends BaseClient {
7307
7312
  */
7308
7313
  this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account");
7309
7314
  parameterBuilder.addSid(accountSid);
7315
+ this.performanceClient?.addFields({ sidFromClaim: true }, correlationId);
7310
7316
  try {
7311
7317
  const clientInfo = buildClientInfoFromHomeAccountId(request.account.homeAccountId);
7312
7318
  parameterBuilder.addCcsOid(clientInfo);
@@ -7319,11 +7325,13 @@ class AuthorizationCodeClient extends BaseClient {
7319
7325
  this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from request");
7320
7326
  parameterBuilder.addLoginHint(request.loginHint);
7321
7327
  parameterBuilder.addCcsUpn(request.loginHint);
7328
+ this.performanceClient?.addFields({ loginHintFromRequest: true }, correlationId);
7322
7329
  }
7323
7330
  else if (request.account.username) {
7324
7331
  // Fallback to account username if provided
7325
7332
  this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from account");
7326
7333
  parameterBuilder.addLoginHint(request.account.username);
7334
+ this.performanceClient?.addFields({ loginHintFromUpn: true }, correlationId);
7327
7335
  try {
7328
7336
  const clientInfo = buildClientInfoFromHomeAccountId(request.account.homeAccountId);
7329
7337
  parameterBuilder.addCcsOid(clientInfo);
@@ -7337,6 +7345,7 @@ class AuthorizationCodeClient extends BaseClient {
7337
7345
  this.logger.verbose("createAuthCodeUrlQueryString: No account, adding login_hint from request");
7338
7346
  parameterBuilder.addLoginHint(request.loginHint);
7339
7347
  parameterBuilder.addCcsUpn(request.loginHint);
7348
+ this.performanceClient?.addFields({ loginHintFromRequest: true }, correlationId);
7340
7349
  }
7341
7350
  }
7342
7351
  else {
@@ -7428,7 +7437,7 @@ class AuthorizationCodeClient extends BaseClient {
7428
7437
  }
7429
7438
  }
7430
7439
 
7431
- /*! @azure/msal-common v15.0.2 2025-01-22 */
7440
+ /*! @azure/msal-common v15.1.1 2025-02-05 */
7432
7441
 
7433
7442
  /*
7434
7443
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7508,6 +7517,7 @@ class RefreshTokenClient extends BaseClient {
7508
7517
  if (refreshToken.expiresOn &&
7509
7518
  isTokenExpired(refreshToken.expiresOn, request.refreshTokenExpirationOffsetSeconds ||
7510
7519
  DEFAULT_REFRESH_TOKEN_EXPIRATION_OFFSET_SECONDS)) {
7520
+ this.performanceClient?.addFields({ rtExpiresOnMs: Number(refreshToken.expiresOn) }, request.correlationId);
7511
7521
  throw createInteractionRequiredAuthError(refreshTokenExpired);
7512
7522
  }
7513
7523
  // attach cached RT size to the current measurement
@@ -7524,12 +7534,14 @@ class RefreshTokenClient extends BaseClient {
7524
7534
  return await invokeAsync(this.acquireToken.bind(this), PerformanceEvents.RefreshTokenClientAcquireToken, this.logger, this.performanceClient, request.correlationId)(refreshTokenRequest);
7525
7535
  }
7526
7536
  catch (e) {
7527
- if (e instanceof InteractionRequiredAuthError &&
7528
- e.subError === badToken) {
7529
- // Remove bad refresh token from cache
7530
- this.logger.verbose("acquireTokenWithRefreshToken: bad refresh token, removing from cache");
7531
- const badRefreshTokenKey = generateCredentialKey(refreshToken);
7532
- this.cacheManager.removeRefreshToken(badRefreshTokenKey);
7537
+ if (e instanceof InteractionRequiredAuthError) {
7538
+ this.performanceClient?.addFields({ rtExpiresOnMs: Number(refreshToken.expiresOn) }, request.correlationId);
7539
+ if (e.subError === badToken) {
7540
+ // Remove bad refresh token from cache
7541
+ this.logger.verbose("acquireTokenWithRefreshToken: bad refresh token, removing from cache");
7542
+ const badRefreshTokenKey = generateCredentialKey(refreshToken);
7543
+ this.cacheManager.removeRefreshToken(badRefreshTokenKey);
7544
+ }
7533
7545
  }
7534
7546
  throw e;
7535
7547
  }
@@ -7648,7 +7660,7 @@ class RefreshTokenClient extends BaseClient {
7648
7660
  }
7649
7661
  }
7650
7662
 
7651
- /*! @azure/msal-common v15.0.2 2025-01-22 */
7663
+ /*! @azure/msal-common v15.1.1 2025-02-05 */
7652
7664
 
7653
7665
  /*
7654
7666
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7659,44 +7671,6 @@ class SilentFlowClient extends BaseClient {
7659
7671
  constructor(configuration, performanceClient) {
7660
7672
  super(configuration, performanceClient);
7661
7673
  }
7662
- /**
7663
- * Retrieves a token from cache if it is still valid, or uses the cached refresh token to renew
7664
- * the given token and returns the renewed token
7665
- * @param request
7666
- */
7667
- async acquireToken(request) {
7668
- try {
7669
- const [authResponse, cacheOutcome] = await this.acquireCachedToken({
7670
- ...request,
7671
- scopes: request.scopes?.length
7672
- ? request.scopes
7673
- : [...OIDC_DEFAULT_SCOPES],
7674
- });
7675
- // if the token is not expired but must be refreshed; get a new one in the background
7676
- if (cacheOutcome === CacheOutcome.PROACTIVELY_REFRESHED) {
7677
- this.logger.info("SilentFlowClient:acquireCachedToken - Cached access token's refreshOn property has been exceeded'. It's not expired, but must be refreshed.");
7678
- // refresh the access token in the background
7679
- const refreshTokenClient = new RefreshTokenClient(this.config, this.performanceClient);
7680
- refreshTokenClient
7681
- .acquireTokenByRefreshToken(request)
7682
- .catch(() => {
7683
- // do nothing, this is running in the background and no action is to be taken upon success or failure
7684
- });
7685
- }
7686
- // return the cached token
7687
- return authResponse;
7688
- }
7689
- catch (e) {
7690
- if (e instanceof ClientAuthError &&
7691
- e.errorCode === tokenRefreshRequired) {
7692
- const refreshTokenClient = new RefreshTokenClient(this.config, this.performanceClient);
7693
- return refreshTokenClient.acquireTokenByRefreshToken(request);
7694
- }
7695
- else {
7696
- throw e;
7697
- }
7698
- }
7699
- }
7700
7674
  /**
7701
7675
  * Retrieves token from cache or throws an error if it must be refreshed.
7702
7676
  * @param request
@@ -7784,7 +7758,7 @@ class SilentFlowClient extends BaseClient {
7784
7758
  }
7785
7759
  }
7786
7760
 
7787
- /*! @azure/msal-common v15.0.2 2025-01-22 */
7761
+ /*! @azure/msal-common v15.1.1 2025-02-05 */
7788
7762
 
7789
7763
  /*
7790
7764
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -9792,6 +9766,13 @@ class TokenCache {
9792
9766
  getKVStore() {
9793
9767
  return this.storage.getCache();
9794
9768
  }
9769
+ /**
9770
+ * Gets cache snapshot in CacheKVStore format
9771
+ */
9772
+ getCacheSnapshot() {
9773
+ const deserializedPersistentStorage = NodeStorage.generateInMemoryCache(this.cacheSnapshot);
9774
+ return this.storage.inMemoryCacheToCache(deserializedPersistentStorage);
9775
+ }
9795
9776
  /**
9796
9777
  * API that retrieves all accounts currently in cache to the user
9797
9778
  */
@@ -9861,6 +9842,22 @@ class TokenCache {
9861
9842
  }
9862
9843
  }
9863
9844
  }
9845
+ /**
9846
+ * Overwrites in-memory cache with persistent cache
9847
+ */
9848
+ async overwriteCache() {
9849
+ if (!this.persistence) {
9850
+ this.logger.info("No persistence layer specified, cache cannot be overwritten");
9851
+ return;
9852
+ }
9853
+ this.logger.info("Overwriting in-memory cache with persistent cache");
9854
+ this.storage.clear();
9855
+ const cacheContext = new TokenCacheContext(this, false);
9856
+ await this.persistence.beforeCacheAccess(cacheContext);
9857
+ const cacheSnapshot = this.getCacheSnapshot();
9858
+ this.storage.setCache(cacheSnapshot);
9859
+ await this.persistence.afterCacheAccess(cacheContext);
9860
+ }
9864
9861
  /**
9865
9862
  * Called when the cache has changed state.
9866
9863
  */
@@ -10134,7 +10131,7 @@ class ClientAssertion {
10134
10131
 
10135
10132
  /* eslint-disable header/header */
10136
10133
  const name = "@azure/msal-node";
10137
- const version = "3.1.0";
10134
+ const version = "3.2.1";
10138
10135
 
10139
10136
  /*
10140
10137
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -10355,18 +10352,52 @@ class ClientApplication {
10355
10352
  };
10356
10353
  const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenSilent, validRequest.correlationId, validRequest.forceRefresh);
10357
10354
  try {
10358
- const silentFlowClientConfig = await this.buildOauthClientConfiguration(validRequest.authority, validRequest.correlationId, validRequest.redirectUri || "", serverTelemetryManager, undefined, request.azureCloudOptions);
10359
- const silentFlowClient = new SilentFlowClient(silentFlowClientConfig);
10355
+ const clientConfiguration = await this.buildOauthClientConfiguration(validRequest.authority, validRequest.correlationId, validRequest.redirectUri || "", serverTelemetryManager, undefined, validRequest.azureCloudOptions);
10356
+ const silentFlowClient = new SilentFlowClient(clientConfiguration);
10360
10357
  this.logger.verbose("Silent flow client created", validRequest.correlationId);
10361
- return await silentFlowClient.acquireToken(validRequest);
10358
+ try {
10359
+ // always overwrite the in-memory cache with the persistence cache (if it exists) before a cache lookup
10360
+ await this.tokenCache.overwriteCache();
10361
+ return await this.acquireCachedTokenSilent(validRequest, silentFlowClient, clientConfiguration);
10362
+ }
10363
+ catch (error) {
10364
+ if (error instanceof ClientAuthError &&
10365
+ error.errorCode ===
10366
+ tokenRefreshRequired) {
10367
+ const refreshTokenClient = new RefreshTokenClient(clientConfiguration);
10368
+ return refreshTokenClient.acquireTokenByRefreshToken(validRequest);
10369
+ }
10370
+ throw error;
10371
+ }
10362
10372
  }
10363
- catch (e) {
10364
- if (e instanceof AuthError) {
10365
- e.setCorrelationId(validRequest.correlationId);
10373
+ catch (error) {
10374
+ if (error instanceof AuthError) {
10375
+ error.setCorrelationId(validRequest.correlationId);
10376
+ }
10377
+ serverTelemetryManager.cacheFailedRequest(error);
10378
+ throw error;
10379
+ }
10380
+ }
10381
+ async acquireCachedTokenSilent(validRequest, silentFlowClient, clientConfiguration) {
10382
+ const [authResponse, cacheOutcome] = await silentFlowClient.acquireCachedToken({
10383
+ ...validRequest,
10384
+ scopes: validRequest.scopes?.length
10385
+ ? validRequest.scopes
10386
+ : [...OIDC_DEFAULT_SCOPES],
10387
+ });
10388
+ if (cacheOutcome === CacheOutcome.PROACTIVELY_REFRESHED) {
10389
+ this.logger.info("ClientApplication:acquireCachedTokenSilent - Cached access token's refreshOn property has been exceeded'. It's not expired, but must be refreshed.");
10390
+ // refresh the access token in the background
10391
+ const refreshTokenClient = new RefreshTokenClient(clientConfiguration);
10392
+ try {
10393
+ await refreshTokenClient.acquireTokenByRefreshToken(validRequest);
10394
+ }
10395
+ catch {
10396
+ // do nothing, this is running in the background and no action is to be taken upon success or failure
10366
10397
  }
10367
- serverTelemetryManager.cacheFailedRequest(e);
10368
- throw e;
10369
10398
  }
10399
+ // return the cached token
10400
+ return authResponse;
10370
10401
  }
10371
10402
  /**
10372
10403
  * Acquires tokens with password grant by exchanging client applications username and password for credentials