@azure/msal-node 3.6.0 → 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.
Files changed (94) hide show
  1. package/README.md +1 -0
  2. package/dist/cache/NodeStorage.d.ts.map +1 -1
  3. package/dist/cache/NodeStorage.mjs +3 -2
  4. package/dist/cache/NodeStorage.mjs.map +1 -1
  5. package/dist/cache/TokenCache.d.ts +2 -2
  6. package/dist/cache/TokenCache.d.ts.map +1 -1
  7. package/dist/cache/TokenCache.mjs +7 -5
  8. package/dist/cache/TokenCache.mjs.map +1 -1
  9. package/dist/cache/distributed/DistributedCachePlugin.mjs +1 -1
  10. package/dist/cache/serializer/Deserializer.mjs +1 -1
  11. package/dist/cache/serializer/Serializer.mjs +1 -1
  12. package/dist/client/ClientApplication.mjs +7 -7
  13. package/dist/client/ClientApplication.mjs.map +1 -1
  14. package/dist/client/ClientAssertion.mjs +1 -1
  15. package/dist/client/ClientCredentialClient.d.ts.map +1 -1
  16. package/dist/client/ClientCredentialClient.mjs +5 -5
  17. package/dist/client/ClientCredentialClient.mjs.map +1 -1
  18. package/dist/client/ConfidentialClientApplication.mjs +1 -1
  19. package/dist/client/DeviceCodeClient.mjs +1 -1
  20. package/dist/client/ManagedIdentityApplication.mjs +2 -2
  21. package/dist/client/ManagedIdentityClient.mjs +1 -1
  22. package/dist/client/ManagedIdentitySources/AppService.mjs +1 -1
  23. package/dist/client/ManagedIdentitySources/AzureArc.mjs +1 -1
  24. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.mjs +2 -2
  25. package/dist/client/ManagedIdentitySources/CloudShell.mjs +1 -1
  26. package/dist/client/ManagedIdentitySources/Imds.mjs +1 -1
  27. package/dist/client/ManagedIdentitySources/MachineLearning.d.ts +1 -0
  28. package/dist/client/ManagedIdentitySources/MachineLearning.d.ts.map +1 -1
  29. package/dist/client/ManagedIdentitySources/MachineLearning.mjs +13 -4
  30. package/dist/client/ManagedIdentitySources/MachineLearning.mjs.map +1 -1
  31. package/dist/client/ManagedIdentitySources/ServiceFabric.mjs +1 -1
  32. package/dist/client/OnBehalfOfClient.d.ts.map +1 -1
  33. package/dist/client/OnBehalfOfClient.mjs +7 -7
  34. package/dist/client/OnBehalfOfClient.mjs.map +1 -1
  35. package/dist/client/PublicClientApplication.d.ts.map +1 -1
  36. package/dist/client/PublicClientApplication.mjs +3 -3
  37. package/dist/client/PublicClientApplication.mjs.map +1 -1
  38. package/dist/client/UsernamePasswordClient.mjs +1 -1
  39. package/dist/config/Configuration.mjs +2 -2
  40. package/dist/config/ManagedIdentityId.mjs +1 -1
  41. package/dist/config/ManagedIdentityRequestParameters.mjs +1 -1
  42. package/dist/crypto/CryptoProvider.d.ts +1 -1
  43. package/dist/crypto/CryptoProvider.d.ts.map +1 -1
  44. package/dist/crypto/CryptoProvider.mjs +1 -1
  45. package/dist/crypto/GuidGenerator.mjs +1 -1
  46. package/dist/crypto/HashUtils.mjs +1 -1
  47. package/dist/crypto/PkceGenerator.mjs +1 -1
  48. package/dist/error/ManagedIdentityError.mjs +2 -2
  49. package/dist/error/ManagedIdentityErrorCodes.mjs +1 -1
  50. package/dist/error/NodeAuthError.mjs +1 -1
  51. package/dist/index.mjs +1 -1
  52. package/dist/internals.mjs +1 -1
  53. package/dist/network/HttpClient.mjs +1 -1
  54. package/dist/network/HttpClientWithRetries.mjs +1 -1
  55. package/dist/network/LoopbackClient.mjs +1 -1
  56. package/dist/packageMetadata.d.ts +1 -1
  57. package/dist/packageMetadata.mjs +2 -2
  58. package/dist/protocol/Authorize.mjs +1 -1
  59. package/dist/retry/DefaultManagedIdentityRetryPolicy.mjs +1 -1
  60. package/dist/retry/ExponentialRetryStrategy.mjs +1 -1
  61. package/dist/retry/ImdsRetryPolicy.mjs +1 -1
  62. package/dist/retry/LinearRetryStrategy.mjs +1 -1
  63. package/dist/utils/Constants.d.ts +1 -0
  64. package/dist/utils/Constants.d.ts.map +1 -1
  65. package/dist/utils/Constants.mjs +2 -3
  66. package/dist/utils/Constants.mjs.map +1 -1
  67. package/dist/utils/EncodingUtils.mjs +1 -1
  68. package/dist/utils/NetworkUtils.mjs +1 -1
  69. package/dist/utils/TimeUtils.mjs +1 -1
  70. package/lib/msal-node.cjs +1058 -969
  71. package/lib/msal-node.cjs.map +1 -1
  72. package/lib/types/cache/NodeStorage.d.ts.map +1 -1
  73. package/lib/types/cache/TokenCache.d.ts +2 -2
  74. package/lib/types/cache/TokenCache.d.ts.map +1 -1
  75. package/lib/types/client/ClientCredentialClient.d.ts.map +1 -1
  76. package/lib/types/client/ManagedIdentitySources/MachineLearning.d.ts +1 -0
  77. package/lib/types/client/ManagedIdentitySources/MachineLearning.d.ts.map +1 -1
  78. package/lib/types/client/OnBehalfOfClient.d.ts.map +1 -1
  79. package/lib/types/client/PublicClientApplication.d.ts.map +1 -1
  80. package/lib/types/crypto/CryptoProvider.d.ts +1 -1
  81. package/lib/types/crypto/CryptoProvider.d.ts.map +1 -1
  82. package/lib/types/packageMetadata.d.ts +1 -1
  83. package/lib/types/utils/Constants.d.ts +1 -0
  84. package/lib/types/utils/Constants.d.ts.map +1 -1
  85. package/package.json +2 -2
  86. package/src/cache/NodeStorage.ts +8 -1
  87. package/src/cache/TokenCache.ts +13 -5
  88. package/src/client/ClientCredentialClient.ts +8 -4
  89. package/src/client/ManagedIdentitySources/MachineLearning.ts +21 -2
  90. package/src/client/OnBehalfOfClient.ts +13 -6
  91. package/src/client/PublicClientApplication.ts +4 -1
  92. package/src/crypto/CryptoProvider.ts +1 -1
  93. package/src/packageMetadata.ts +1 -1
  94. package/src/utils/Constants.ts +1 -0
package/lib/msal-node.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v3.6.0 2025-05-30 */
1
+ /*! @azure/msal-node v3.6.2 2025-07-01 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
@@ -6,8 +6,8 @@ var http = require('http');
6
6
  var https = require('https');
7
7
  var uuid = require('uuid');
8
8
  var crypto = require('crypto');
9
- var jwt = require('jsonwebtoken');
10
9
  var msalCommon = require('@azure/msal-common');
10
+ var jwt = require('jsonwebtoken');
11
11
  var fs = require('fs');
12
12
  var path = require('path');
13
13
 
@@ -153,7 +153,7 @@ class Serializer {
153
153
  }
154
154
  }
155
155
 
156
- /*! @azure/msal-common v15.7.0 2025-05-30 */
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.7.0 2025-05-30 */
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.7.0 2025-05-30 */
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.7.0 2025-05-30 */
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.7.0 2025-05-30 */
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.7.0 2025-05-30 */
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.7.0 2025-05-30 */
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.7.0 2025-05-30 */
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.7.0";
1087
+ const version$1 = "15.8.0";
1095
1088
 
1096
- /*! @azure/msal-common v15.7.0 2025-05-30 */
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.7.0 2025-05-30 */
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.7.0 2025-05-30 */
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.7.0 2025-05-30 */
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.7.0 2025-05-30 */
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.7.0 2025-05-30 */
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.7.0 2025-05-30 */
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.7.0 2025-05-30 */
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.7.0 2025-05-30 */
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.7.0 2025-05-30 */
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.7.0 2025-05-30 */
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.7.0 2025-05-30 */
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.7.0 2025-05-30 */
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.7.0 2025-05-30 */
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.7.0 2025-05-30 */
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.7.0 2025-05-30 */
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.7.0 2025-05-30 */
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.7.0 2025-05-30 */
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 cacheQuotaExceededErrorCode = "cache_quota_exceeded";
2837
- const cacheUnknownErrorCode = "cache_error_unknown";
2828
+ const cacheQuotaExceeded = "cache_quota_exceeded";
2829
+ const cacheErrorUnknown = "cache_error_unknown";
2838
2830
 
2839
- /*! @azure/msal-common v15.7.0 2025-05-30 */
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
- [cacheQuotaExceededErrorCode]: "Exceeded cache storage capacity.",
2847
- [cacheUnknownErrorCode]: "Unexpected error occurred when using cache storage.",
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 Error {
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[cacheUnknownErrorCode]);
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.7.0 2025-05-30 */
2876
+ /*! @azure/msal-common v15.8.0 2025-07-01 */
2867
2877
 
2868
2878
  /*
2869
2879
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2874,25 +2884,26 @@ class CacheError extends Error {
2874
2884
  * @internal
2875
2885
  */
2876
2886
  class CacheManager {
2877
- constructor(clientId, cryptoImpl, logger, staticAuthorityOptions) {
2887
+ constructor(clientId, cryptoImpl, logger, performanceClient, staticAuthorityOptions) {
2878
2888
  this.clientId = clientId;
2879
2889
  this.cryptoImpl = cryptoImpl;
2880
2890
  this.commonLogger = logger.clone(name$1, version$1);
2881
2891
  this.staticAuthorityOptions = staticAuthorityOptions;
2892
+ this.performanceClient = performanceClient;
2882
2893
  }
2883
2894
  /**
2884
2895
  * Returns all the accounts in the cache that match the optional filter. If no filter is provided, all accounts are returned.
2885
2896
  * @param accountFilter - (Optional) filter to narrow down the accounts returned
2886
2897
  * @returns Array of AccountInfo objects in cache
2887
2898
  */
2888
- getAllAccounts(accountFilter) {
2889
- return this.buildTenantProfiles(this.getAccountsFilteredBy(accountFilter || {}), accountFilter);
2899
+ getAllAccounts(accountFilter, correlationId) {
2900
+ return this.buildTenantProfiles(this.getAccountsFilteredBy(accountFilter, correlationId), correlationId, accountFilter);
2890
2901
  }
2891
2902
  /**
2892
2903
  * Gets first tenanted AccountInfo object found based on provided filters
2893
2904
  */
2894
- getAccountInfoFilteredBy(accountFilter) {
2895
- const allAccounts = this.getAllAccounts(accountFilter);
2905
+ getAccountInfoFilteredBy(accountFilter, correlationId) {
2906
+ const allAccounts = this.getAllAccounts(accountFilter, correlationId);
2896
2907
  if (allAccounts.length > 1) {
2897
2908
  // If one or more accounts are found, prioritize accounts that have an ID token
2898
2909
  const sortedAccounts = allAccounts.sort((account) => {
@@ -2913,8 +2924,8 @@ class CacheManager {
2913
2924
  * @param accountFilter
2914
2925
  * @returns
2915
2926
  */
2916
- getBaseAccountInfo(accountFilter) {
2917
- const accountEntities = this.getAccountsFilteredBy(accountFilter);
2927
+ getBaseAccountInfo(accountFilter, correlationId) {
2928
+ const accountEntities = this.getAccountsFilteredBy(accountFilter, correlationId);
2918
2929
  if (accountEntities.length > 0) {
2919
2930
  return accountEntities[0].getAccountInfo();
2920
2931
  }
@@ -2929,12 +2940,12 @@ class CacheManager {
2929
2940
  * @param accountFilter
2930
2941
  * @returns Array of AccountInfo objects that match account and tenant profile filters
2931
2942
  */
2932
- buildTenantProfiles(cachedAccounts, accountFilter) {
2943
+ buildTenantProfiles(cachedAccounts, correlationId, accountFilter) {
2933
2944
  return cachedAccounts.flatMap((accountEntity) => {
2934
- return this.getTenantProfilesFromAccountEntity(accountEntity, accountFilter?.tenantId, accountFilter);
2945
+ return this.getTenantProfilesFromAccountEntity(accountEntity, correlationId, accountFilter?.tenantId, accountFilter);
2935
2946
  });
2936
2947
  }
2937
- getTenantedAccountInfoByFilter(accountInfo, tokenKeys, tenantProfile, tenantProfileFilter) {
2948
+ getTenantedAccountInfoByFilter(accountInfo, tokenKeys, tenantProfile, correlationId, tenantProfileFilter) {
2938
2949
  let tenantedAccountInfo = null;
2939
2950
  let idTokenClaims;
2940
2951
  if (tenantProfileFilter) {
@@ -2942,7 +2953,7 @@ class CacheManager {
2942
2953
  return null;
2943
2954
  }
2944
2955
  }
2945
- const idToken = this.getIdToken(accountInfo, tokenKeys, tenantProfile.tenantId);
2956
+ const idToken = this.getIdToken(accountInfo, correlationId, tokenKeys, tenantProfile.tenantId);
2946
2957
  if (idToken) {
2947
2958
  idTokenClaims = extractTokenClaims(idToken.secret, this.cryptoImpl.base64Decode);
2948
2959
  if (!this.idTokenClaimsMatchTenantProfileFilter(idTokenClaims, tenantProfileFilter)) {
@@ -2954,7 +2965,7 @@ class CacheManager {
2954
2965
  tenantedAccountInfo = updateAccountTenantProfileData(accountInfo, tenantProfile, idTokenClaims, idToken?.secret);
2955
2966
  return tenantedAccountInfo;
2956
2967
  }
2957
- getTenantProfilesFromAccountEntity(accountEntity, targetTenantId, tenantProfileFilter) {
2968
+ getTenantProfilesFromAccountEntity(accountEntity, correlationId, targetTenantId, tenantProfileFilter) {
2958
2969
  const accountInfo = accountEntity.getAccountInfo();
2959
2970
  let searchTenantProfiles = accountInfo.tenantProfiles || new Map();
2960
2971
  const tokenKeys = this.getTokenKeys();
@@ -2974,7 +2985,7 @@ class CacheManager {
2974
2985
  }
2975
2986
  const matchingTenantProfiles = [];
2976
2987
  searchTenantProfiles.forEach((tenantProfile) => {
2977
- const tenantedAccountInfo = this.getTenantedAccountInfoByFilter(accountInfo, tokenKeys, tenantProfile, tenantProfileFilter);
2988
+ const tenantedAccountInfo = this.getTenantedAccountInfoByFilter(accountInfo, tokenKeys, tenantProfile, correlationId, tenantProfileFilter);
2978
2989
  if (tenantedAccountInfo) {
2979
2990
  matchingTenantProfiles.push(tenantedAccountInfo);
2980
2991
  }
@@ -3048,26 +3059,16 @@ class CacheManager {
3048
3059
  await this.setRefreshTokenCredential(cacheRecord.refreshToken, correlationId);
3049
3060
  }
3050
3061
  if (!!cacheRecord.appMetadata) {
3051
- this.setAppMetadata(cacheRecord.appMetadata);
3062
+ this.setAppMetadata(cacheRecord.appMetadata, correlationId);
3052
3063
  }
3053
3064
  }
3054
3065
  catch (e) {
3055
3066
  this.commonLogger?.error(`CacheManager.saveCacheRecord: failed`);
3056
- if (e instanceof Error) {
3057
- this.commonLogger?.errorPii(`CacheManager.saveCacheRecord: ${e.message}`, correlationId);
3058
- if (e.name === "QuotaExceededError" ||
3059
- e.name === "NS_ERROR_DOM_QUOTA_REACHED" ||
3060
- e.message.includes("exceeded the quota")) {
3061
- this.commonLogger?.error(`CacheManager.saveCacheRecord: exceeded storage quota`, correlationId);
3062
- throw new CacheError(cacheQuotaExceededErrorCode);
3063
- }
3064
- else {
3065
- throw new CacheError(e.name, e.message);
3066
- }
3067
+ if (e instanceof AuthError) {
3068
+ throw e;
3067
3069
  }
3068
3070
  else {
3069
- this.commonLogger?.errorPii(`CacheManager.saveCacheRecord: ${e}`, correlationId);
3070
- throw new CacheError(cacheUnknownErrorCode);
3071
+ throw createCacheError(e);
3071
3072
  }
3072
3073
  }
3073
3074
  }
@@ -3087,21 +3088,19 @@ class CacheManager {
3087
3088
  };
3088
3089
  const tokenKeys = this.getTokenKeys();
3089
3090
  const currentScopes = ScopeSet.fromString(credential.target);
3090
- const removedAccessTokens = [];
3091
3091
  tokenKeys.accessToken.forEach((key) => {
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);
3099
3099
  if (tokenScopeSet.intersectingScopeSets(currentScopes)) {
3100
- removedAccessTokens.push(this.removeAccessToken(key));
3100
+ this.removeAccessToken(key, correlationId);
3101
3101
  }
3102
3102
  }
3103
3103
  });
3104
- await Promise.all(removedAccessTokens);
3105
3104
  await this.setAccessTokenCredential(credential, correlationId);
3106
3105
  }
3107
3106
  /**
@@ -3109,7 +3108,7 @@ class CacheManager {
3109
3108
  * Not checking for casing as keys are all generated in lower case, remember to convert to lower case if object properties are compared
3110
3109
  * @param accountFilter - An object containing Account properties to filter by
3111
3110
  */
3112
- getAccountsFilteredBy(accountFilter) {
3111
+ getAccountsFilteredBy(accountFilter, correlationId) {
3113
3112
  const allAccountKeys = this.getAccountKeys();
3114
3113
  const matchingAccounts = [];
3115
3114
  allAccountKeys.forEach((cacheKey) => {
@@ -3117,7 +3116,7 @@ class CacheManager {
3117
3116
  // Don't parse value if the key doesn't match the account filters
3118
3117
  return;
3119
3118
  }
3120
- const entity = this.getAccount(cacheKey, this.commonLogger);
3119
+ const entity = this.getAccount(cacheKey, correlationId);
3121
3120
  // Match base account fields
3122
3121
  if (!entity) {
3123
3122
  return;
@@ -3343,86 +3342,80 @@ class CacheManager {
3343
3342
  /**
3344
3343
  * Removes all accounts and related tokens from cache.
3345
3344
  */
3346
- async removeAllAccounts() {
3345
+ removeAllAccounts(correlationId) {
3347
3346
  const allAccountKeys = this.getAccountKeys();
3348
- const removedAccounts = [];
3349
3347
  allAccountKeys.forEach((cacheKey) => {
3350
- removedAccounts.push(this.removeAccount(cacheKey));
3348
+ this.removeAccount(cacheKey, correlationId);
3351
3349
  });
3352
- await Promise.all(removedAccounts);
3353
3350
  }
3354
3351
  /**
3355
3352
  * Removes the account and related tokens for a given account key
3356
3353
  * @param account
3357
3354
  */
3358
- async removeAccount(accountKey) {
3359
- const account = this.getAccount(accountKey, this.commonLogger);
3355
+ removeAccount(accountKey, correlationId) {
3356
+ const account = this.getAccount(accountKey, correlationId);
3360
3357
  if (!account) {
3361
3358
  return;
3362
3359
  }
3363
- await this.removeAccountContext(account);
3364
- this.removeItem(accountKey);
3360
+ this.removeAccountContext(account, correlationId);
3361
+ this.removeItem(accountKey, correlationId);
3365
3362
  }
3366
3363
  /**
3367
3364
  * Removes credentials associated with the provided account
3368
3365
  * @param account
3369
3366
  */
3370
- async removeAccountContext(account) {
3367
+ removeAccountContext(account, correlationId) {
3371
3368
  const allTokenKeys = this.getTokenKeys();
3372
3369
  const accountId = account.generateAccountId();
3373
- const removedCredentials = [];
3374
3370
  allTokenKeys.idToken.forEach((key) => {
3375
3371
  if (key.indexOf(accountId) === 0) {
3376
- this.removeIdToken(key);
3372
+ this.removeIdToken(key, correlationId);
3377
3373
  }
3378
3374
  });
3379
3375
  allTokenKeys.accessToken.forEach((key) => {
3380
3376
  if (key.indexOf(accountId) === 0) {
3381
- removedCredentials.push(this.removeAccessToken(key));
3377
+ this.removeAccessToken(key, correlationId);
3382
3378
  }
3383
3379
  });
3384
3380
  allTokenKeys.refreshToken.forEach((key) => {
3385
3381
  if (key.indexOf(accountId) === 0) {
3386
- this.removeRefreshToken(key);
3382
+ this.removeRefreshToken(key, correlationId);
3387
3383
  }
3388
3384
  });
3389
- await Promise.all(removedCredentials);
3390
3385
  }
3391
3386
  /**
3392
- * returns a boolean if the given credential is removed
3393
- * @param credential
3394
- */
3395
- async removeAccessToken(key) {
3396
- const credential = this.getAccessTokenCredential(key);
3397
- if (!credential) {
3387
+ * Removes accessToken from the cache
3388
+ * @param key
3389
+ * @param correlationId
3390
+ */
3391
+ removeAccessToken(key, correlationId) {
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
3398
3400
  return;
3399
3401
  }
3400
3402
  // Remove Token Binding Key from key store for PoP Tokens Credentials
3401
- if (credential.credentialType.toLowerCase() ===
3402
- CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()) {
3403
- if (credential.tokenType === AuthenticationScheme.POP) {
3404
- const accessTokenWithAuthSchemeEntity = credential;
3405
- const kid = accessTokenWithAuthSchemeEntity.keyId;
3406
- if (kid) {
3407
- try {
3408
- await this.cryptoImpl.removeTokenBindingKey(kid);
3409
- }
3410
- catch (error) {
3411
- throw createClientAuthError(bindingKeyNotRemoved);
3412
- }
3413
- }
3414
- }
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
+ });
3415
3409
  }
3416
- return this.removeItem(key);
3417
3410
  }
3418
3411
  /**
3419
3412
  * Removes all app metadata objects from cache.
3420
3413
  */
3421
- removeAppMetadata() {
3414
+ removeAppMetadata(correlationId) {
3422
3415
  const allCacheKeys = this.getKeys();
3423
3416
  allCacheKeys.forEach((cacheKey) => {
3424
3417
  if (this.isAppMetadata(cacheKey)) {
3425
- this.removeItem(cacheKey);
3418
+ this.removeItem(cacheKey, correlationId);
3426
3419
  }
3427
3420
  });
3428
3421
  return true;
@@ -3431,9 +3424,9 @@ class CacheManager {
3431
3424
  * Retrieve AccountEntity from cache
3432
3425
  * @param account
3433
3426
  */
3434
- readAccountFromCache(account) {
3427
+ readAccountFromCache(account, correlationId) {
3435
3428
  const accountKey = AccountEntity.generateAccountCacheKey(account);
3436
- return this.getAccount(accountKey, this.commonLogger);
3429
+ return this.getAccount(accountKey, correlationId);
3437
3430
  }
3438
3431
  /**
3439
3432
  * Retrieve IdTokenEntity from cache
@@ -3443,7 +3436,7 @@ class CacheManager {
3443
3436
  * @param performanceClient {?IPerformanceClient}
3444
3437
  * @param correlationId {?string}
3445
3438
  */
3446
- getIdToken(account, tokenKeys, targetRealm, performanceClient, correlationId) {
3439
+ getIdToken(account, correlationId, tokenKeys, targetRealm, performanceClient) {
3447
3440
  this.commonLogger.trace("CacheManager - getIdToken called");
3448
3441
  const idTokenFilter = {
3449
3442
  homeAccountId: account.homeAccountId,
@@ -3452,7 +3445,7 @@ class CacheManager {
3452
3445
  clientId: this.clientId,
3453
3446
  realm: targetRealm,
3454
3447
  };
3455
- const idTokenMap = this.getIdTokensByFilter(idTokenFilter, tokenKeys);
3448
+ const idTokenMap = this.getIdTokensByFilter(idTokenFilter, correlationId, tokenKeys);
3456
3449
  const numIdTokens = idTokenMap.size;
3457
3450
  if (numIdTokens < 1) {
3458
3451
  this.commonLogger.info("CacheManager:getIdToken - No token found");
@@ -3485,7 +3478,7 @@ class CacheManager {
3485
3478
  // Multiple tokens for a single tenant profile, remove all and return null
3486
3479
  this.commonLogger.info("CacheManager:getIdToken - Multiple matching ID tokens found, clearing them");
3487
3480
  tokensToBeRemoved.forEach((idToken, key) => {
3488
- this.removeIdToken(key);
3481
+ this.removeIdToken(key, correlationId);
3489
3482
  });
3490
3483
  if (performanceClient && correlationId) {
3491
3484
  performanceClient.addFields({ multiMatchedID: idTokenMap.size }, correlationId);
@@ -3500,7 +3493,7 @@ class CacheManager {
3500
3493
  * @param filter
3501
3494
  * @returns
3502
3495
  */
3503
- getIdTokensByFilter(filter, tokenKeys) {
3496
+ getIdTokensByFilter(filter, correlationId, tokenKeys) {
3504
3497
  const idTokenKeys = (tokenKeys && tokenKeys.idToken) || this.getTokenKeys().idToken;
3505
3498
  const idTokens = new Map();
3506
3499
  idTokenKeys.forEach((key) => {
@@ -3510,7 +3503,7 @@ class CacheManager {
3510
3503
  })) {
3511
3504
  return;
3512
3505
  }
3513
- const idToken = this.getIdTokenCredential(key);
3506
+ const idToken = this.getIdTokenCredential(key, correlationId);
3514
3507
  if (idToken && this.credentialMatchesFilter(idToken, filter)) {
3515
3508
  idTokens.set(key, idToken);
3516
3509
  }
@@ -3539,26 +3532,27 @@ class CacheManager {
3539
3532
  * Removes idToken from the cache
3540
3533
  * @param key
3541
3534
  */
3542
- removeIdToken(key) {
3543
- this.removeItem(key);
3535
+ removeIdToken(key, correlationId) {
3536
+ this.removeItem(key, correlationId);
3544
3537
  }
3545
3538
  /**
3546
3539
  * Removes refresh token from the cache
3547
3540
  * @param key
3548
3541
  */
3549
- removeRefreshToken(key) {
3550
- this.removeItem(key);
3542
+ removeRefreshToken(key, correlationId) {
3543
+ this.removeItem(key, correlationId);
3551
3544
  }
3552
3545
  /**
3553
3546
  * Retrieve AccessTokenEntity from cache
3554
3547
  * @param account {AccountInfo}
3555
3548
  * @param request {BaseAuthRequest}
3549
+ * @param correlationId {?string}
3556
3550
  * @param tokenKeys {?TokenKeys}
3557
3551
  * @param performanceClient {?IPerformanceClient}
3558
- * @param correlationId {?string}
3559
3552
  */
3560
- getAccessToken(account, request, tokenKeys, targetRealm, performanceClient, correlationId) {
3561
- this.commonLogger.trace("CacheManager - getAccessToken called");
3553
+ getAccessToken(account, request, tokenKeys, targetRealm) {
3554
+ const correlationId = request.correlationId;
3555
+ this.commonLogger.trace("CacheManager - getAccessToken called", correlationId);
3562
3556
  const scopes = ScopeSet.createSearchScopes(request.scopes);
3563
3557
  const authScheme = request.authenticationScheme || AuthenticationScheme.BEARER;
3564
3558
  /*
@@ -3586,7 +3580,7 @@ class CacheManager {
3586
3580
  accessTokenKeys.forEach((key) => {
3587
3581
  // Validate key
3588
3582
  if (this.accessTokenKeyMatchesFilter(key, accessTokenFilter, true)) {
3589
- const accessToken = this.getAccessTokenCredential(key);
3583
+ const accessToken = this.getAccessTokenCredential(key, correlationId);
3590
3584
  // Validate value
3591
3585
  if (accessToken &&
3592
3586
  this.credentialMatchesFilter(accessToken, accessTokenFilter)) {
@@ -3596,20 +3590,18 @@ class CacheManager {
3596
3590
  });
3597
3591
  const numAccessTokens = accessTokens.length;
3598
3592
  if (numAccessTokens < 1) {
3599
- this.commonLogger.info("CacheManager:getAccessToken - No token found");
3593
+ this.commonLogger.info("CacheManager:getAccessToken - No token found", correlationId);
3600
3594
  return null;
3601
3595
  }
3602
3596
  else if (numAccessTokens > 1) {
3603
- this.commonLogger.info("CacheManager:getAccessToken - Multiple access tokens found, clearing them");
3597
+ this.commonLogger.info("CacheManager:getAccessToken - Multiple access tokens found, clearing them", correlationId);
3604
3598
  accessTokens.forEach((accessToken) => {
3605
- void this.removeAccessToken(generateCredentialKey(accessToken));
3599
+ this.removeAccessToken(generateCredentialKey(accessToken), correlationId);
3606
3600
  });
3607
- if (performanceClient && correlationId) {
3608
- performanceClient.addFields({ multiMatchedAT: accessTokens.length }, correlationId);
3609
- }
3601
+ this.performanceClient.addFields({ multiMatchedAT: accessTokens.length }, correlationId);
3610
3602
  return null;
3611
3603
  }
3612
- this.commonLogger.info("CacheManager:getAccessToken - Returning access token");
3604
+ this.commonLogger.info("CacheManager:getAccessToken - Returning access token", correlationId);
3613
3605
  return accessTokens[0];
3614
3606
  }
3615
3607
  /**
@@ -3658,14 +3650,14 @@ class CacheManager {
3658
3650
  * @param filter
3659
3651
  * @returns
3660
3652
  */
3661
- getAccessTokensByFilter(filter) {
3653
+ getAccessTokensByFilter(filter, correlationId) {
3662
3654
  const tokenKeys = this.getTokenKeys();
3663
3655
  const accessTokens = [];
3664
3656
  tokenKeys.accessToken.forEach((key) => {
3665
3657
  if (!this.accessTokenKeyMatchesFilter(key, filter, true)) {
3666
3658
  return;
3667
3659
  }
3668
- const accessToken = this.getAccessTokenCredential(key);
3660
+ const accessToken = this.getAccessTokenCredential(key, correlationId);
3669
3661
  if (accessToken &&
3670
3662
  this.credentialMatchesFilter(accessToken, filter)) {
3671
3663
  accessTokens.push(accessToken);
@@ -3677,11 +3669,11 @@ class CacheManager {
3677
3669
  * Helper to retrieve the appropriate refresh token from cache
3678
3670
  * @param account {AccountInfo}
3679
3671
  * @param familyRT {boolean}
3672
+ * @param correlationId {?string}
3680
3673
  * @param tokenKeys {?TokenKeys}
3681
3674
  * @param performanceClient {?IPerformanceClient}
3682
- * @param correlationId {?string}
3683
3675
  */
3684
- getRefreshToken(account, familyRT, tokenKeys, performanceClient, correlationId) {
3676
+ getRefreshToken(account, familyRT, correlationId, tokenKeys, performanceClient) {
3685
3677
  this.commonLogger.trace("CacheManager - getRefreshToken called");
3686
3678
  const id = familyRT ? THE_FAMILY_ID : undefined;
3687
3679
  const refreshTokenFilter = {
@@ -3697,7 +3689,7 @@ class CacheManager {
3697
3689
  refreshTokenKeys.forEach((key) => {
3698
3690
  // Validate key
3699
3691
  if (this.refreshTokenKeyMatchesFilter(key, refreshTokenFilter)) {
3700
- const refreshToken = this.getRefreshTokenCredential(key);
3692
+ const refreshToken = this.getRefreshTokenCredential(key, correlationId);
3701
3693
  // Validate value
3702
3694
  if (refreshToken &&
3703
3695
  this.credentialMatchesFilter(refreshToken, refreshTokenFilter)) {
@@ -4047,845 +4039,932 @@ class DefaultStorageClass extends CacheManager {
4047
4039
  }
4048
4040
  }
4049
4041
 
4050
- /*! @azure/msal-common v15.7.0 2025-05-30 */
4051
-
4042
+ /*! @azure/msal-common v15.8.0 2025-07-01 */
4052
4043
  /*
4053
4044
  * Copyright (c) Microsoft Corporation. All rights reserved.
4054
4045
  * Licensed under the MIT License.
4055
4046
  */
4056
- const DEFAULT_SYSTEM_OPTIONS$1 = {
4057
- tokenRenewalOffsetSeconds: DEFAULT_TOKEN_RENEWAL_OFFSET_SEC,
4058
- preventCorsPreflight: false,
4059
- };
4060
- const DEFAULT_LOGGER_IMPLEMENTATION = {
4061
- loggerCallback: () => {
4062
- // allow users to not set loggerCallback
4063
- },
4064
- piiLoggingEnabled: false,
4065
- logLevel: exports.LogLevel.Info,
4066
- correlationId: Constants$1.EMPTY_STRING,
4067
- };
4068
- const DEFAULT_CACHE_OPTIONS$1 = {
4069
- claimsBasedCachingEnabled: false,
4070
- };
4071
- const DEFAULT_NETWORK_IMPLEMENTATION = {
4072
- async sendGetRequestAsync() {
4073
- throw createClientAuthError(methodNotImplemented);
4074
- },
4075
- async sendPostRequestAsync() {
4076
- throw createClientAuthError(methodNotImplemented);
4077
- },
4078
- };
4079
- const DEFAULT_LIBRARY_INFO = {
4080
- sku: Constants$1.SKU,
4081
- version: version$1,
4082
- cpu: Constants$1.EMPTY_STRING,
4083
- os: Constants$1.EMPTY_STRING,
4084
- };
4085
- const DEFAULT_CLIENT_CREDENTIALS = {
4086
- clientSecret: Constants$1.EMPTY_STRING,
4087
- clientAssertion: undefined,
4088
- };
4089
- const DEFAULT_AZURE_CLOUD_OPTIONS = {
4090
- azureCloudInstance: AzureCloudInstance.None,
4091
- tenant: `${Constants$1.DEFAULT_COMMON_TENANT}`,
4092
- };
4093
- const DEFAULT_TELEMETRY_OPTIONS$1 = {
4094
- application: {
4095
- appName: "",
4096
- appVersion: "",
4097
- },
4098
- };
4099
4047
  /**
4100
- * Function that sets the default options when not explicitly configured from app developer
4101
- *
4102
- * @param Configuration
4048
+ * Enumeration of operations that are instrumented by have their performance measured by the PerformanceClient.
4103
4049
  *
4104
- * @returns Configuration
4105
- */
4106
- function buildClientConfiguration({ authOptions: userAuthOptions, systemOptions: userSystemOptions, loggerOptions: userLoggerOption, cacheOptions: userCacheOptions, storageInterface: storageImplementation, networkInterface: networkImplementation, cryptoInterface: cryptoImplementation, clientCredentials: clientCredentials, libraryInfo: libraryInfo, telemetry: telemetry, serverTelemetryManager: serverTelemetryManager, persistencePlugin: persistencePlugin, serializableCache: serializableCache, }) {
4107
- const loggerOptions = {
4108
- ...DEFAULT_LOGGER_IMPLEMENTATION,
4109
- ...userLoggerOption,
4110
- };
4111
- return {
4112
- authOptions: buildAuthOptions(userAuthOptions),
4113
- systemOptions: { ...DEFAULT_SYSTEM_OPTIONS$1, ...userSystemOptions },
4114
- loggerOptions: loggerOptions,
4115
- cacheOptions: { ...DEFAULT_CACHE_OPTIONS$1, ...userCacheOptions },
4116
- storageInterface: storageImplementation ||
4117
- new DefaultStorageClass(userAuthOptions.clientId, DEFAULT_CRYPTO_IMPLEMENTATION, new Logger(loggerOptions)),
4118
- networkInterface: networkImplementation || DEFAULT_NETWORK_IMPLEMENTATION,
4119
- cryptoInterface: cryptoImplementation || DEFAULT_CRYPTO_IMPLEMENTATION,
4120
- clientCredentials: clientCredentials || DEFAULT_CLIENT_CREDENTIALS,
4121
- libraryInfo: { ...DEFAULT_LIBRARY_INFO, ...libraryInfo },
4122
- telemetry: { ...DEFAULT_TELEMETRY_OPTIONS$1, ...telemetry },
4123
- serverTelemetryManager: serverTelemetryManager || null,
4124
- persistencePlugin: persistencePlugin || null,
4125
- serializableCache: serializableCache || null,
4126
- };
4127
- }
4128
- /**
4129
- * Construct authoptions from the client and platform passed values
4130
- * @param authOptions
4131
- */
4132
- function buildAuthOptions(authOptions) {
4133
- return {
4134
- clientCapabilities: [],
4135
- azureCloudOptions: DEFAULT_AZURE_CLOUD_OPTIONS,
4136
- skipAuthorityMetadataCache: false,
4137
- instanceAware: false,
4138
- encodeExtraQueryParams: false,
4139
- ...authOptions,
4140
- };
4141
- }
4142
- /**
4143
- * Returns true if config has protocolMode set to ProtocolMode.OIDC, false otherwise
4144
- * @param ClientConfiguration
4145
- */
4146
- function isOidcProtocolMode(config) {
4147
- return (config.authOptions.authority.options.protocolMode === ProtocolMode.OIDC);
4148
- }
4149
-
4150
- /*! @azure/msal-common v15.7.0 2025-05-30 */
4151
- /*
4152
- * Copyright (c) Microsoft Corporation. All rights reserved.
4153
- * Licensed under the MIT License.
4154
- */
4155
- const CcsCredentialType = {
4156
- HOME_ACCOUNT_ID: "home_account_id",
4157
- UPN: "UPN",
4158
- };
4159
-
4160
- /*! @azure/msal-common v15.7.0 2025-05-30 */
4161
- /*
4162
- * Copyright (c) Microsoft Corporation. All rights reserved.
4163
- * Licensed under the MIT License.
4164
- */
4165
- const CLIENT_ID = "client_id";
4166
- const REDIRECT_URI = "redirect_uri";
4167
- const RESPONSE_TYPE = "response_type";
4168
- const RESPONSE_MODE = "response_mode";
4169
- const GRANT_TYPE = "grant_type";
4170
- const CLAIMS = "claims";
4171
- const SCOPE = "scope";
4172
- const REFRESH_TOKEN = "refresh_token";
4173
- const STATE = "state";
4174
- const NONCE = "nonce";
4175
- const PROMPT = "prompt";
4176
- const CODE = "code";
4177
- const CODE_CHALLENGE = "code_challenge";
4178
- const CODE_CHALLENGE_METHOD = "code_challenge_method";
4179
- const CODE_VERIFIER = "code_verifier";
4180
- const CLIENT_REQUEST_ID = "client-request-id";
4181
- const X_CLIENT_SKU = "x-client-SKU";
4182
- const X_CLIENT_VER = "x-client-VER";
4183
- const X_CLIENT_OS = "x-client-OS";
4184
- const X_CLIENT_CPU = "x-client-CPU";
4185
- const X_CLIENT_CURR_TELEM = "x-client-current-telemetry";
4186
- const X_CLIENT_LAST_TELEM = "x-client-last-telemetry";
4187
- const X_MS_LIB_CAPABILITY = "x-ms-lib-capability";
4188
- const X_APP_NAME = "x-app-name";
4189
- const X_APP_VER = "x-app-ver";
4190
- const POST_LOGOUT_URI = "post_logout_redirect_uri";
4191
- const ID_TOKEN_HINT = "id_token_hint";
4192
- const DEVICE_CODE = "device_code";
4193
- const CLIENT_SECRET = "client_secret";
4194
- const CLIENT_ASSERTION = "client_assertion";
4195
- const CLIENT_ASSERTION_TYPE = "client_assertion_type";
4196
- const TOKEN_TYPE = "token_type";
4197
- const REQ_CNF = "req_cnf";
4198
- const OBO_ASSERTION = "assertion";
4199
- const REQUESTED_TOKEN_USE = "requested_token_use";
4200
- const ON_BEHALF_OF = "on_behalf_of";
4201
- const RETURN_SPA_CODE = "return_spa_code";
4202
- const LOGOUT_HINT = "logout_hint";
4203
- const SID = "sid";
4204
- const LOGIN_HINT = "login_hint";
4205
- const DOMAIN_HINT = "domain_hint";
4206
- const X_CLIENT_EXTRA_SKU = "x-client-xtra-sku";
4207
- const BROKER_CLIENT_ID = "brk_client_id";
4208
- const BROKER_REDIRECT_URI = "brk_redirect_uri";
4209
- const INSTANCE_AWARE = "instance_aware";
4210
-
4211
- /*! @azure/msal-common v15.7.0 2025-05-30 */
4212
-
4213
- /*
4214
- * Copyright (c) Microsoft Corporation. All rights reserved.
4215
- * Licensed under the MIT License.
4216
- */
4217
- function instrumentBrokerParams(parameters, correlationId, performanceClient) {
4218
- if (!correlationId) {
4219
- return;
4220
- }
4221
- const clientId = parameters.get(CLIENT_ID);
4222
- if (clientId && parameters.has(BROKER_CLIENT_ID)) {
4223
- performanceClient?.addFields({
4224
- embeddedClientId: clientId,
4225
- embeddedRedirectUri: parameters.get(REDIRECT_URI),
4226
- }, correlationId);
4227
- }
4228
- }
4229
- /**
4230
- * Add the given response_type
4231
- * @param parameters
4232
- * @param responseType
4233
- */
4234
- function addResponseType(parameters, responseType) {
4235
- parameters.set(RESPONSE_TYPE, responseType);
4236
- }
4237
- /**
4238
- * add response_mode. defaults to query.
4239
- * @param responseMode
4240
- */
4241
- function addResponseMode(parameters, responseMode) {
4242
- parameters.set(RESPONSE_MODE, responseMode ? responseMode : ResponseMode.QUERY);
4243
- }
4244
- /**
4245
- * add scopes. set addOidcScopes to false to prevent default scopes in non-user scenarios
4246
- * @param scopeSet
4247
- * @param addOidcScopes
4248
- */
4249
- function addScopes(parameters, scopes, addOidcScopes = true, defaultScopes = OIDC_DEFAULT_SCOPES) {
4250
- // Always add openid to the scopes when adding OIDC scopes
4251
- if (addOidcScopes &&
4252
- !defaultScopes.includes("openid") &&
4253
- !scopes.includes("openid")) {
4254
- defaultScopes.push("openid");
4255
- }
4256
- const requestScopes = addOidcScopes
4257
- ? [...(scopes || []), ...defaultScopes]
4258
- : scopes || [];
4259
- const scopeSet = new ScopeSet(requestScopes);
4260
- parameters.set(SCOPE, scopeSet.printScopes());
4261
- }
4262
- /**
4263
- * add clientId
4264
- * @param clientId
4265
- */
4266
- function addClientId(parameters, clientId) {
4267
- parameters.set(CLIENT_ID, clientId);
4268
- }
4269
- /**
4270
- * add redirect_uri
4271
- * @param redirectUri
4272
- */
4273
- function addRedirectUri(parameters, redirectUri) {
4274
- parameters.set(REDIRECT_URI, redirectUri);
4275
- }
4276
- /**
4277
- * add post logout redirectUri
4278
- * @param redirectUri
4050
+ * @export
4051
+ * @enum {number}
4279
4052
  */
4280
- function addPostLogoutRedirectUri(parameters, redirectUri) {
4281
- parameters.set(POST_LOGOUT_URI, redirectUri);
4282
- }
4053
+ const PerformanceEvents = {
4054
+ /**
4055
+ * acquireTokenByCode API (msal-browser and msal-node).
4056
+ * Used to acquire tokens by trading an authorization code against the token endpoint.
4057
+ */
4058
+ AcquireTokenByCode: "acquireTokenByCode",
4059
+ /**
4060
+ * acquireTokenByRefreshToken API (msal-browser and msal-node).
4061
+ * Used to renew an access token using a refresh token against the token endpoint.
4062
+ */
4063
+ AcquireTokenByRefreshToken: "acquireTokenByRefreshToken",
4064
+ /**
4065
+ * acquireTokenSilent API (msal-browser and msal-node).
4066
+ * Used to silently acquire a new access token (from the cache or the network).
4067
+ */
4068
+ AcquireTokenSilent: "acquireTokenSilent",
4069
+ /**
4070
+ * acquireTokenSilentAsync (msal-browser).
4071
+ * Internal API for acquireTokenSilent.
4072
+ */
4073
+ AcquireTokenSilentAsync: "acquireTokenSilentAsync",
4074
+ /**
4075
+ * acquireTokenPopup (msal-browser).
4076
+ * Used to acquire a new access token interactively through pop ups
4077
+ */
4078
+ AcquireTokenPopup: "acquireTokenPopup",
4079
+ /**
4080
+ * acquireTokenPreRedirect (msal-browser).
4081
+ * First part of the redirect flow.
4082
+ * Used to acquire a new access token interactively through redirects.
4083
+ */
4084
+ AcquireTokenPreRedirect: "acquireTokenPreRedirect",
4085
+ /**
4086
+ * acquireTokenRedirect (msal-browser).
4087
+ * Second part of the redirect flow.
4088
+ * Used to acquire a new access token interactively through redirects.
4089
+ */
4090
+ AcquireTokenRedirect: "acquireTokenRedirect",
4091
+ /**
4092
+ * getPublicKeyThumbprint API in CryptoOpts class (msal-browser).
4093
+ * Used to generate a public/private keypair and generate a public key thumbprint for pop requests.
4094
+ */
4095
+ CryptoOptsGetPublicKeyThumbprint: "cryptoOptsGetPublicKeyThumbprint",
4096
+ /**
4097
+ * signJwt API in CryptoOpts class (msal-browser).
4098
+ * Used to signed a pop token.
4099
+ */
4100
+ CryptoOptsSignJwt: "cryptoOptsSignJwt",
4101
+ /**
4102
+ * acquireToken API in the SilentCacheClient class (msal-browser).
4103
+ * Used to read access tokens from the cache.
4104
+ */
4105
+ SilentCacheClientAcquireToken: "silentCacheClientAcquireToken",
4106
+ /**
4107
+ * acquireToken API in the SilentIframeClient class (msal-browser).
4108
+ * Used to acquire a new set of tokens from the authorize endpoint in a hidden iframe.
4109
+ */
4110
+ SilentIframeClientAcquireToken: "silentIframeClientAcquireToken",
4111
+ AwaitConcurrentIframe: "awaitConcurrentIframe",
4112
+ /**
4113
+ * acquireToken API in SilentRereshClient (msal-browser).
4114
+ * Used to acquire a new set of tokens from the token endpoint using a refresh token.
4115
+ */
4116
+ SilentRefreshClientAcquireToken: "silentRefreshClientAcquireToken",
4117
+ /**
4118
+ * ssoSilent API (msal-browser).
4119
+ * Used to silently acquire an authorization code and set of tokens using a hidden iframe.
4120
+ */
4121
+ SsoSilent: "ssoSilent",
4122
+ /**
4123
+ * getDiscoveredAuthority API in StandardInteractionClient class (msal-browser).
4124
+ * Used to load authority metadata for a request.
4125
+ */
4126
+ StandardInteractionClientGetDiscoveredAuthority: "standardInteractionClientGetDiscoveredAuthority",
4127
+ /**
4128
+ * acquireToken APIs in msal-browser.
4129
+ * Used to make an /authorize endpoint call with native brokering enabled.
4130
+ */
4131
+ FetchAccountIdWithNativeBroker: "fetchAccountIdWithNativeBroker",
4132
+ /**
4133
+ * acquireToken API in NativeInteractionClient class (msal-browser).
4134
+ * Used to acquire a token from Native component when native brokering is enabled.
4135
+ */
4136
+ NativeInteractionClientAcquireToken: "nativeInteractionClientAcquireToken",
4137
+ /**
4138
+ * Time spent creating default headers for requests to token endpoint
4139
+ */
4140
+ BaseClientCreateTokenRequestHeaders: "baseClientCreateTokenRequestHeaders",
4141
+ /**
4142
+ * Time spent sending/waiting for the response of a request to the token endpoint
4143
+ */
4144
+ NetworkClientSendPostRequestAsync: "networkClientSendPostRequestAsync",
4145
+ RefreshTokenClientExecutePostToTokenEndpoint: "refreshTokenClientExecutePostToTokenEndpoint",
4146
+ AuthorizationCodeClientExecutePostToTokenEndpoint: "authorizationCodeClientExecutePostToTokenEndpoint",
4147
+ /**
4148
+ * Used to measure the time taken for completing embedded-broker handshake (PW-Broker).
4149
+ */
4150
+ BrokerHandhshake: "brokerHandshake",
4151
+ /**
4152
+ * acquireTokenByRefreshToken API in BrokerClientApplication (PW-Broker) .
4153
+ */
4154
+ AcquireTokenByRefreshTokenInBroker: "acquireTokenByRefreshTokenInBroker",
4155
+ /**
4156
+ * Time taken for token acquisition by broker
4157
+ */
4158
+ AcquireTokenByBroker: "acquireTokenByBroker",
4159
+ /**
4160
+ * Time spent on the network for refresh token acquisition
4161
+ */
4162
+ RefreshTokenClientExecuteTokenRequest: "refreshTokenClientExecuteTokenRequest",
4163
+ /**
4164
+ * Time taken for acquiring refresh token , records RT size
4165
+ */
4166
+ RefreshTokenClientAcquireToken: "refreshTokenClientAcquireToken",
4167
+ /**
4168
+ * Time taken for acquiring cached refresh token
4169
+ */
4170
+ RefreshTokenClientAcquireTokenWithCachedRefreshToken: "refreshTokenClientAcquireTokenWithCachedRefreshToken",
4171
+ /**
4172
+ * acquireTokenByRefreshToken API in RefreshTokenClient (msal-common).
4173
+ */
4174
+ RefreshTokenClientAcquireTokenByRefreshToken: "refreshTokenClientAcquireTokenByRefreshToken",
4175
+ /**
4176
+ * Helper function to create token request body in RefreshTokenClient (msal-common).
4177
+ */
4178
+ RefreshTokenClientCreateTokenRequestBody: "refreshTokenClientCreateTokenRequestBody",
4179
+ /**
4180
+ * acquireTokenFromCache (msal-browser).
4181
+ * Internal API for acquiring token from cache
4182
+ */
4183
+ AcquireTokenFromCache: "acquireTokenFromCache",
4184
+ SilentFlowClientAcquireCachedToken: "silentFlowClientAcquireCachedToken",
4185
+ SilentFlowClientGenerateResultFromCacheRecord: "silentFlowClientGenerateResultFromCacheRecord",
4186
+ /**
4187
+ * acquireTokenBySilentIframe (msal-browser).
4188
+ * Internal API for acquiring token by silent Iframe
4189
+ */
4190
+ AcquireTokenBySilentIframe: "acquireTokenBySilentIframe",
4191
+ /**
4192
+ * Internal API for initializing base request in BaseInteractionClient (msal-browser)
4193
+ */
4194
+ InitializeBaseRequest: "initializeBaseRequest",
4195
+ /**
4196
+ * Internal API for initializing silent request in SilentCacheClient (msal-browser)
4197
+ */
4198
+ InitializeSilentRequest: "initializeSilentRequest",
4199
+ InitializeClientApplication: "initializeClientApplication",
4200
+ InitializeCache: "initializeCache",
4201
+ /**
4202
+ * Helper function in SilentIframeClient class (msal-browser).
4203
+ */
4204
+ SilentIframeClientTokenHelper: "silentIframeClientTokenHelper",
4205
+ /**
4206
+ * SilentHandler
4207
+ */
4208
+ SilentHandlerInitiateAuthRequest: "silentHandlerInitiateAuthRequest",
4209
+ SilentHandlerMonitorIframeForHash: "silentHandlerMonitorIframeForHash",
4210
+ SilentHandlerLoadFrame: "silentHandlerLoadFrame",
4211
+ SilentHandlerLoadFrameSync: "silentHandlerLoadFrameSync",
4212
+ /**
4213
+ * Helper functions in StandardInteractionClient class (msal-browser)
4214
+ */
4215
+ StandardInteractionClientCreateAuthCodeClient: "standardInteractionClientCreateAuthCodeClient",
4216
+ StandardInteractionClientGetClientConfiguration: "standardInteractionClientGetClientConfiguration",
4217
+ StandardInteractionClientInitializeAuthorizationRequest: "standardInteractionClientInitializeAuthorizationRequest",
4218
+ /**
4219
+ * getAuthCodeUrl API (msal-browser and msal-node).
4220
+ */
4221
+ GetAuthCodeUrl: "getAuthCodeUrl",
4222
+ GetStandardParams: "getStandardParams",
4223
+ /**
4224
+ * Functions from InteractionHandler (msal-browser)
4225
+ */
4226
+ HandleCodeResponseFromServer: "handleCodeResponseFromServer",
4227
+ HandleCodeResponse: "handleCodeResponse",
4228
+ HandleResponseEar: "handleResponseEar",
4229
+ HandleResponsePlatformBroker: "handleResponsePlatformBroker",
4230
+ HandleResponseCode: "handleResponseCode",
4231
+ UpdateTokenEndpointAuthority: "updateTokenEndpointAuthority",
4232
+ /**
4233
+ * APIs in Authorization Code Client (msal-common)
4234
+ */
4235
+ AuthClientAcquireToken: "authClientAcquireToken",
4236
+ AuthClientExecuteTokenRequest: "authClientExecuteTokenRequest",
4237
+ AuthClientCreateTokenRequestBody: "authClientCreateTokenRequestBody",
4238
+ /**
4239
+ * Generate functions in PopTokenGenerator (msal-common)
4240
+ */
4241
+ PopTokenGenerateCnf: "popTokenGenerateCnf",
4242
+ PopTokenGenerateKid: "popTokenGenerateKid",
4243
+ /**
4244
+ * handleServerTokenResponse API in ResponseHandler (msal-common)
4245
+ */
4246
+ HandleServerTokenResponse: "handleServerTokenResponse",
4247
+ DeserializeResponse: "deserializeResponse",
4248
+ /**
4249
+ * Authority functions
4250
+ */
4251
+ AuthorityFactoryCreateDiscoveredInstance: "authorityFactoryCreateDiscoveredInstance",
4252
+ AuthorityResolveEndpointsAsync: "authorityResolveEndpointsAsync",
4253
+ AuthorityResolveEndpointsFromLocalSources: "authorityResolveEndpointsFromLocalSources",
4254
+ AuthorityGetCloudDiscoveryMetadataFromNetwork: "authorityGetCloudDiscoveryMetadataFromNetwork",
4255
+ AuthorityUpdateCloudDiscoveryMetadata: "authorityUpdateCloudDiscoveryMetadata",
4256
+ AuthorityGetEndpointMetadataFromNetwork: "authorityGetEndpointMetadataFromNetwork",
4257
+ AuthorityUpdateEndpointMetadata: "authorityUpdateEndpointMetadata",
4258
+ AuthorityUpdateMetadataWithRegionalInformation: "authorityUpdateMetadataWithRegionalInformation",
4259
+ /**
4260
+ * Region Discovery functions
4261
+ */
4262
+ RegionDiscoveryDetectRegion: "regionDiscoveryDetectRegion",
4263
+ RegionDiscoveryGetRegionFromIMDS: "regionDiscoveryGetRegionFromIMDS",
4264
+ RegionDiscoveryGetCurrentVersion: "regionDiscoveryGetCurrentVersion",
4265
+ AcquireTokenByCodeAsync: "acquireTokenByCodeAsync",
4266
+ GetEndpointMetadataFromNetwork: "getEndpointMetadataFromNetwork",
4267
+ GetCloudDiscoveryMetadataFromNetworkMeasurement: "getCloudDiscoveryMetadataFromNetworkMeasurement",
4268
+ HandleRedirectPromiseMeasurement: "handleRedirectPromise",
4269
+ HandleNativeRedirectPromiseMeasurement: "handleNativeRedirectPromise",
4270
+ UpdateCloudDiscoveryMetadataMeasurement: "updateCloudDiscoveryMetadataMeasurement",
4271
+ UsernamePasswordClientAcquireToken: "usernamePasswordClientAcquireToken",
4272
+ NativeMessageHandlerHandshake: "nativeMessageHandlerHandshake",
4273
+ NativeGenerateAuthResult: "nativeGenerateAuthResult",
4274
+ RemoveHiddenIframe: "removeHiddenIframe",
4275
+ /**
4276
+ * Cache operations
4277
+ */
4278
+ ClearTokensAndKeysWithClaims: "clearTokensAndKeysWithClaims",
4279
+ CacheManagerGetRefreshToken: "cacheManagerGetRefreshToken",
4280
+ ImportExistingCache: "importExistingCache",
4281
+ SetUserData: "setUserData",
4282
+ LocalStorageUpdated: "localStorageUpdated",
4283
+ /**
4284
+ * Crypto Operations
4285
+ */
4286
+ GeneratePkceCodes: "generatePkceCodes",
4287
+ GenerateCodeVerifier: "generateCodeVerifier",
4288
+ GenerateCodeChallengeFromVerifier: "generateCodeChallengeFromVerifier",
4289
+ Sha256Digest: "sha256Digest",
4290
+ GetRandomValues: "getRandomValues",
4291
+ GenerateHKDF: "generateHKDF",
4292
+ GenerateBaseKey: "generateBaseKey",
4293
+ Base64Decode: "base64Decode",
4294
+ UrlEncodeArr: "urlEncodeArr",
4295
+ Encrypt: "encrypt",
4296
+ Decrypt: "decrypt",
4297
+ GenerateEarKey: "generateEarKey",
4298
+ DecryptEarResponse: "decryptEarResponse",
4299
+ };
4283
4300
  /**
4284
- * add id_token_hint to logout request
4285
- * @param idTokenHint
4301
+ * State of the performance event.
4302
+ *
4303
+ * @export
4304
+ * @enum {number}
4286
4305
  */
4287
- function addIdTokenHint(parameters, idTokenHint) {
4288
- parameters.set(ID_TOKEN_HINT, idTokenHint);
4289
- }
4290
- /**
4291
- * add domain_hint
4292
- * @param domainHint
4293
- */
4294
- function addDomainHint(parameters, domainHint) {
4295
- parameters.set(DOMAIN_HINT, domainHint);
4296
- }
4297
- /**
4298
- * add login_hint
4299
- * @param loginHint
4300
- */
4301
- function addLoginHint(parameters, loginHint) {
4302
- parameters.set(LOGIN_HINT, loginHint);
4303
- }
4304
- /**
4305
- * Adds the CCS (Cache Credential Service) query parameter for login_hint
4306
- * @param loginHint
4307
- */
4308
- function addCcsUpn(parameters, loginHint) {
4309
- parameters.set(HeaderNames.CCS_HEADER, `UPN:${loginHint}`);
4310
- }
4311
- /**
4312
- * Adds the CCS (Cache Credential Service) query parameter for account object
4313
- * @param loginHint
4314
- */
4315
- function addCcsOid(parameters, clientInfo) {
4316
- parameters.set(HeaderNames.CCS_HEADER, `Oid:${clientInfo.uid}@${clientInfo.utid}`);
4317
- }
4318
- /**
4319
- * add sid
4320
- * @param sid
4321
- */
4322
- function addSid(parameters, sid) {
4323
- parameters.set(SID, sid);
4324
- }
4325
- /**
4326
- * add claims
4327
- * @param claims
4306
+ const PerformanceEventStatus = {
4307
+ InProgress: 1};
4308
+
4309
+ /*! @azure/msal-common v15.8.0 2025-07-01 */
4310
+
4311
+ /*
4312
+ * Copyright (c) Microsoft Corporation. All rights reserved.
4313
+ * Licensed under the MIT License.
4328
4314
  */
4329
- function addClaims(parameters, claims, clientCapabilities) {
4330
- const mergedClaims = addClientCapabilitiesToClaims(claims, clientCapabilities);
4331
- try {
4332
- JSON.parse(mergedClaims);
4315
+ class StubPerformanceMeasurement {
4316
+ startMeasurement() {
4317
+ return;
4333
4318
  }
4334
- catch (e) {
4335
- throw createClientConfigurationError(invalidClaims);
4319
+ endMeasurement() {
4320
+ return;
4321
+ }
4322
+ flushMeasurement() {
4323
+ return null;
4336
4324
  }
4337
- parameters.set(CLAIMS, mergedClaims);
4338
- }
4339
- /**
4340
- * add correlationId
4341
- * @param correlationId
4342
- */
4343
- function addCorrelationId(parameters, correlationId) {
4344
- parameters.set(CLIENT_REQUEST_ID, correlationId);
4345
4325
  }
4346
- /**
4347
- * add library info query params
4348
- * @param libraryInfo
4349
- */
4350
- function addLibraryInfo(parameters, libraryInfo) {
4351
- // Telemetry Info
4352
- parameters.set(X_CLIENT_SKU, libraryInfo.sku);
4353
- parameters.set(X_CLIENT_VER, libraryInfo.version);
4354
- if (libraryInfo.os) {
4355
- parameters.set(X_CLIENT_OS, libraryInfo.os);
4326
+ class StubPerformanceClient {
4327
+ generateId() {
4328
+ return "callback-id";
4356
4329
  }
4357
- if (libraryInfo.cpu) {
4358
- parameters.set(X_CLIENT_CPU, libraryInfo.cpu);
4330
+ startMeasurement(measureName, correlationId) {
4331
+ return {
4332
+ end: () => null,
4333
+ discard: () => { },
4334
+ add: () => { },
4335
+ increment: () => { },
4336
+ event: {
4337
+ eventId: this.generateId(),
4338
+ status: PerformanceEventStatus.InProgress,
4339
+ authority: "",
4340
+ libraryName: "",
4341
+ libraryVersion: "",
4342
+ clientId: "",
4343
+ name: measureName,
4344
+ startTimeMs: Date.now(),
4345
+ correlationId: correlationId || "",
4346
+ },
4347
+ measurement: new StubPerformanceMeasurement(),
4348
+ };
4359
4349
  }
4360
- }
4361
- /**
4362
- * Add client telemetry parameters
4363
- * @param appTelemetry
4364
- */
4365
- function addApplicationTelemetry(parameters, appTelemetry) {
4366
- if (appTelemetry?.appName) {
4367
- parameters.set(X_APP_NAME, appTelemetry.appName);
4350
+ startPerformanceMeasurement() {
4351
+ return new StubPerformanceMeasurement();
4368
4352
  }
4369
- if (appTelemetry?.appVersion) {
4370
- parameters.set(X_APP_VER, appTelemetry.appVersion);
4353
+ calculateQueuedTime() {
4354
+ return 0;
4371
4355
  }
4372
- }
4373
- /**
4374
- * add prompt
4375
- * @param prompt
4376
- */
4377
- function addPrompt(parameters, prompt) {
4378
- parameters.set(PROMPT, prompt);
4379
- }
4380
- /**
4381
- * add state
4382
- * @param state
4383
- */
4384
- function addState(parameters, state) {
4385
- if (state) {
4386
- parameters.set(STATE, state);
4356
+ addQueueMeasurement() {
4357
+ return;
4387
4358
  }
4388
- }
4389
- /**
4390
- * add nonce
4391
- * @param nonce
4392
- */
4393
- function addNonce(parameters, nonce) {
4394
- parameters.set(NONCE, nonce);
4395
- }
4396
- /**
4397
- * add code_challenge and code_challenge_method
4398
- * - throw if either of them are not passed
4399
- * @param codeChallenge
4400
- * @param codeChallengeMethod
4401
- */
4402
- function addCodeChallengeParams(parameters, codeChallenge, codeChallengeMethod) {
4403
- if (codeChallenge && codeChallengeMethod) {
4404
- parameters.set(CODE_CHALLENGE, codeChallenge);
4405
- parameters.set(CODE_CHALLENGE_METHOD, codeChallengeMethod);
4359
+ setPreQueueTime() {
4360
+ return;
4406
4361
  }
4407
- else {
4408
- throw createClientConfigurationError(pkceParamsMissing);
4362
+ endMeasurement() {
4363
+ return null;
4409
4364
  }
4410
- }
4411
- /**
4412
- * add the `authorization_code` passed by the user to exchange for a token
4413
- * @param code
4365
+ discardMeasurements() {
4366
+ return;
4367
+ }
4368
+ removePerformanceCallback() {
4369
+ return true;
4370
+ }
4371
+ addPerformanceCallback() {
4372
+ return "";
4373
+ }
4374
+ emitEvents() {
4375
+ return;
4376
+ }
4377
+ addFields() {
4378
+ return;
4379
+ }
4380
+ incrementFields() {
4381
+ return;
4382
+ }
4383
+ cacheEventByCorrelationId() {
4384
+ return;
4385
+ }
4386
+ }
4387
+
4388
+ /*! @azure/msal-common v15.8.0 2025-07-01 */
4389
+
4390
+ /*
4391
+ * Copyright (c) Microsoft Corporation. All rights reserved.
4392
+ * Licensed under the MIT License.
4414
4393
  */
4415
- function addAuthorizationCode(parameters, code) {
4416
- parameters.set(CODE, code);
4417
- }
4394
+ const DEFAULT_SYSTEM_OPTIONS$1 = {
4395
+ tokenRenewalOffsetSeconds: DEFAULT_TOKEN_RENEWAL_OFFSET_SEC,
4396
+ preventCorsPreflight: false,
4397
+ };
4398
+ const DEFAULT_LOGGER_IMPLEMENTATION = {
4399
+ loggerCallback: () => {
4400
+ // allow users to not set loggerCallback
4401
+ },
4402
+ piiLoggingEnabled: false,
4403
+ logLevel: exports.LogLevel.Info,
4404
+ correlationId: Constants$1.EMPTY_STRING,
4405
+ };
4406
+ const DEFAULT_CACHE_OPTIONS$1 = {
4407
+ claimsBasedCachingEnabled: false,
4408
+ };
4409
+ const DEFAULT_NETWORK_IMPLEMENTATION = {
4410
+ async sendGetRequestAsync() {
4411
+ throw createClientAuthError(methodNotImplemented);
4412
+ },
4413
+ async sendPostRequestAsync() {
4414
+ throw createClientAuthError(methodNotImplemented);
4415
+ },
4416
+ };
4417
+ const DEFAULT_LIBRARY_INFO = {
4418
+ sku: Constants$1.SKU,
4419
+ version: version$1,
4420
+ cpu: Constants$1.EMPTY_STRING,
4421
+ os: Constants$1.EMPTY_STRING,
4422
+ };
4423
+ const DEFAULT_CLIENT_CREDENTIALS = {
4424
+ clientSecret: Constants$1.EMPTY_STRING,
4425
+ clientAssertion: undefined,
4426
+ };
4427
+ const DEFAULT_AZURE_CLOUD_OPTIONS = {
4428
+ azureCloudInstance: AzureCloudInstance.None,
4429
+ tenant: `${Constants$1.DEFAULT_COMMON_TENANT}`,
4430
+ };
4431
+ const DEFAULT_TELEMETRY_OPTIONS$1 = {
4432
+ application: {
4433
+ appName: "",
4434
+ appVersion: "",
4435
+ },
4436
+ };
4418
4437
  /**
4419
- * add the `authorization_code` passed by the user to exchange for a token
4420
- * @param code
4438
+ * Function that sets the default options when not explicitly configured from app developer
4439
+ *
4440
+ * @param Configuration
4441
+ *
4442
+ * @returns Configuration
4421
4443
  */
4422
- function addDeviceCode(parameters, code) {
4423
- parameters.set(DEVICE_CODE, code);
4444
+ function buildClientConfiguration({ authOptions: userAuthOptions, systemOptions: userSystemOptions, loggerOptions: userLoggerOption, cacheOptions: userCacheOptions, storageInterface: storageImplementation, networkInterface: networkImplementation, cryptoInterface: cryptoImplementation, clientCredentials: clientCredentials, libraryInfo: libraryInfo, telemetry: telemetry, serverTelemetryManager: serverTelemetryManager, persistencePlugin: persistencePlugin, serializableCache: serializableCache, }) {
4445
+ const loggerOptions = {
4446
+ ...DEFAULT_LOGGER_IMPLEMENTATION,
4447
+ ...userLoggerOption,
4448
+ };
4449
+ return {
4450
+ authOptions: buildAuthOptions(userAuthOptions),
4451
+ systemOptions: { ...DEFAULT_SYSTEM_OPTIONS$1, ...userSystemOptions },
4452
+ loggerOptions: loggerOptions,
4453
+ cacheOptions: { ...DEFAULT_CACHE_OPTIONS$1, ...userCacheOptions },
4454
+ storageInterface: storageImplementation ||
4455
+ new DefaultStorageClass(userAuthOptions.clientId, DEFAULT_CRYPTO_IMPLEMENTATION, new Logger(loggerOptions), new StubPerformanceClient()),
4456
+ networkInterface: networkImplementation || DEFAULT_NETWORK_IMPLEMENTATION,
4457
+ cryptoInterface: cryptoImplementation || DEFAULT_CRYPTO_IMPLEMENTATION,
4458
+ clientCredentials: clientCredentials || DEFAULT_CLIENT_CREDENTIALS,
4459
+ libraryInfo: { ...DEFAULT_LIBRARY_INFO, ...libraryInfo },
4460
+ telemetry: { ...DEFAULT_TELEMETRY_OPTIONS$1, ...telemetry },
4461
+ serverTelemetryManager: serverTelemetryManager || null,
4462
+ persistencePlugin: persistencePlugin || null,
4463
+ serializableCache: serializableCache || null,
4464
+ };
4424
4465
  }
4425
4466
  /**
4426
- * add the `refreshToken` passed by the user
4427
- * @param refreshToken
4467
+ * Construct authoptions from the client and platform passed values
4468
+ * @param authOptions
4428
4469
  */
4429
- function addRefreshToken(parameters, refreshToken) {
4430
- parameters.set(REFRESH_TOKEN, refreshToken);
4470
+ function buildAuthOptions(authOptions) {
4471
+ return {
4472
+ clientCapabilities: [],
4473
+ azureCloudOptions: DEFAULT_AZURE_CLOUD_OPTIONS,
4474
+ skipAuthorityMetadataCache: false,
4475
+ instanceAware: false,
4476
+ encodeExtraQueryParams: false,
4477
+ ...authOptions,
4478
+ };
4431
4479
  }
4432
4480
  /**
4433
- * add the `code_verifier` passed by the user to exchange for a token
4434
- * @param codeVerifier
4481
+ * Returns true if config has protocolMode set to ProtocolMode.OIDC, false otherwise
4482
+ * @param ClientConfiguration
4435
4483
  */
4436
- function addCodeVerifier(parameters, codeVerifier) {
4437
- parameters.set(CODE_VERIFIER, codeVerifier);
4438
- }
4439
- /**
4440
- * add client_secret
4441
- * @param clientSecret
4484
+ function isOidcProtocolMode(config) {
4485
+ return (config.authOptions.authority.options.protocolMode === ProtocolMode.OIDC);
4486
+ }
4487
+
4488
+ /*! @azure/msal-common v15.8.0 2025-07-01 */
4489
+ /*
4490
+ * Copyright (c) Microsoft Corporation. All rights reserved.
4491
+ * Licensed under the MIT License.
4442
4492
  */
4443
- function addClientSecret(parameters, clientSecret) {
4444
- parameters.set(CLIENT_SECRET, clientSecret);
4445
- }
4446
- /**
4447
- * add clientAssertion for confidential client flows
4448
- * @param clientAssertion
4493
+ const CcsCredentialType = {
4494
+ HOME_ACCOUNT_ID: "home_account_id",
4495
+ UPN: "UPN",
4496
+ };
4497
+
4498
+ /*! @azure/msal-common v15.8.0 2025-07-01 */
4499
+ /*
4500
+ * Copyright (c) Microsoft Corporation. All rights reserved.
4501
+ * Licensed under the MIT License.
4449
4502
  */
4450
- function addClientAssertion(parameters, clientAssertion) {
4451
- if (clientAssertion) {
4452
- parameters.set(CLIENT_ASSERTION, clientAssertion);
4503
+ const CLIENT_ID = "client_id";
4504
+ const REDIRECT_URI = "redirect_uri";
4505
+ const RESPONSE_TYPE = "response_type";
4506
+ const RESPONSE_MODE = "response_mode";
4507
+ const GRANT_TYPE = "grant_type";
4508
+ const CLAIMS = "claims";
4509
+ const SCOPE = "scope";
4510
+ const REFRESH_TOKEN = "refresh_token";
4511
+ const STATE = "state";
4512
+ const NONCE = "nonce";
4513
+ const PROMPT = "prompt";
4514
+ const CODE = "code";
4515
+ const CODE_CHALLENGE = "code_challenge";
4516
+ const CODE_CHALLENGE_METHOD = "code_challenge_method";
4517
+ const CODE_VERIFIER = "code_verifier";
4518
+ const CLIENT_REQUEST_ID = "client-request-id";
4519
+ const X_CLIENT_SKU = "x-client-SKU";
4520
+ const X_CLIENT_VER = "x-client-VER";
4521
+ const X_CLIENT_OS = "x-client-OS";
4522
+ const X_CLIENT_CPU = "x-client-CPU";
4523
+ const X_CLIENT_CURR_TELEM = "x-client-current-telemetry";
4524
+ const X_CLIENT_LAST_TELEM = "x-client-last-telemetry";
4525
+ const X_MS_LIB_CAPABILITY = "x-ms-lib-capability";
4526
+ const X_APP_NAME = "x-app-name";
4527
+ const X_APP_VER = "x-app-ver";
4528
+ const POST_LOGOUT_URI = "post_logout_redirect_uri";
4529
+ const ID_TOKEN_HINT = "id_token_hint";
4530
+ const DEVICE_CODE = "device_code";
4531
+ const CLIENT_SECRET = "client_secret";
4532
+ const CLIENT_ASSERTION = "client_assertion";
4533
+ const CLIENT_ASSERTION_TYPE = "client_assertion_type";
4534
+ const TOKEN_TYPE = "token_type";
4535
+ const REQ_CNF = "req_cnf";
4536
+ const OBO_ASSERTION = "assertion";
4537
+ const REQUESTED_TOKEN_USE = "requested_token_use";
4538
+ const ON_BEHALF_OF = "on_behalf_of";
4539
+ const RETURN_SPA_CODE = "return_spa_code";
4540
+ const LOGOUT_HINT = "logout_hint";
4541
+ const SID = "sid";
4542
+ const LOGIN_HINT = "login_hint";
4543
+ const DOMAIN_HINT = "domain_hint";
4544
+ const X_CLIENT_EXTRA_SKU = "x-client-xtra-sku";
4545
+ const BROKER_CLIENT_ID = "brk_client_id";
4546
+ const BROKER_REDIRECT_URI = "brk_redirect_uri";
4547
+ const INSTANCE_AWARE = "instance_aware";
4548
+
4549
+ /*! @azure/msal-common v15.8.0 2025-07-01 */
4550
+
4551
+ /*
4552
+ * Copyright (c) Microsoft Corporation. All rights reserved.
4553
+ * Licensed under the MIT License.
4554
+ */
4555
+ function instrumentBrokerParams(parameters, correlationId, performanceClient) {
4556
+ if (!correlationId) {
4557
+ return;
4558
+ }
4559
+ const clientId = parameters.get(CLIENT_ID);
4560
+ if (clientId && parameters.has(BROKER_CLIENT_ID)) {
4561
+ performanceClient?.addFields({
4562
+ embeddedClientId: clientId,
4563
+ embeddedRedirectUri: parameters.get(REDIRECT_URI),
4564
+ }, correlationId);
4453
4565
  }
4454
4566
  }
4455
4567
  /**
4456
- * add clientAssertionType for confidential client flows
4457
- * @param clientAssertionType
4568
+ * Add the given response_type
4569
+ * @param parameters
4570
+ * @param responseType
4458
4571
  */
4459
- function addClientAssertionType(parameters, clientAssertionType) {
4460
- if (clientAssertionType) {
4461
- parameters.set(CLIENT_ASSERTION_TYPE, clientAssertionType);
4462
- }
4572
+ function addResponseType(parameters, responseType) {
4573
+ parameters.set(RESPONSE_TYPE, responseType);
4463
4574
  }
4464
4575
  /**
4465
- * add OBO assertion for confidential client flows
4466
- * @param clientAssertion
4576
+ * add response_mode. defaults to query.
4577
+ * @param responseMode
4467
4578
  */
4468
- function addOboAssertion(parameters, oboAssertion) {
4469
- parameters.set(OBO_ASSERTION, oboAssertion);
4579
+ function addResponseMode(parameters, responseMode) {
4580
+ parameters.set(RESPONSE_MODE, responseMode ? responseMode : ResponseMode.QUERY);
4470
4581
  }
4471
4582
  /**
4472
- * add grant type
4473
- * @param grantType
4583
+ * add scopes. set addOidcScopes to false to prevent default scopes in non-user scenarios
4584
+ * @param scopeSet
4585
+ * @param addOidcScopes
4474
4586
  */
4475
- function addRequestTokenUse(parameters, tokenUse) {
4476
- parameters.set(REQUESTED_TOKEN_USE, tokenUse);
4587
+ function addScopes(parameters, scopes, addOidcScopes = true, defaultScopes = OIDC_DEFAULT_SCOPES) {
4588
+ // Always add openid to the scopes when adding OIDC scopes
4589
+ if (addOidcScopes &&
4590
+ !defaultScopes.includes("openid") &&
4591
+ !scopes.includes("openid")) {
4592
+ defaultScopes.push("openid");
4593
+ }
4594
+ const requestScopes = addOidcScopes
4595
+ ? [...(scopes || []), ...defaultScopes]
4596
+ : scopes || [];
4597
+ const scopeSet = new ScopeSet(requestScopes);
4598
+ parameters.set(SCOPE, scopeSet.printScopes());
4477
4599
  }
4478
4600
  /**
4479
- * add grant type
4480
- * @param grantType
4601
+ * add clientId
4602
+ * @param clientId
4481
4603
  */
4482
- function addGrantType(parameters, grantType) {
4483
- parameters.set(GRANT_TYPE, grantType);
4604
+ function addClientId(parameters, clientId) {
4605
+ parameters.set(CLIENT_ID, clientId);
4484
4606
  }
4485
4607
  /**
4486
- * add client info
4487
- *
4608
+ * add redirect_uri
4609
+ * @param redirectUri
4488
4610
  */
4489
- function addClientInfo(parameters) {
4490
- parameters.set(CLIENT_INFO, "1");
4491
- }
4492
- function addInstanceAware(parameters) {
4493
- if (!parameters.has(INSTANCE_AWARE)) {
4494
- parameters.set(INSTANCE_AWARE, "true");
4495
- }
4611
+ function addRedirectUri(parameters, redirectUri) {
4612
+ parameters.set(REDIRECT_URI, redirectUri);
4496
4613
  }
4497
4614
  /**
4498
- * add extraQueryParams
4499
- * @param eQParams
4615
+ * add post logout redirectUri
4616
+ * @param redirectUri
4500
4617
  */
4501
- function addExtraQueryParameters(parameters, eQParams) {
4502
- Object.entries(eQParams).forEach(([key, value]) => {
4503
- if (!parameters.has(key) && value) {
4504
- parameters.set(key, value);
4505
- }
4506
- });
4507
- }
4508
- function addClientCapabilitiesToClaims(claims, clientCapabilities) {
4509
- let mergedClaims;
4510
- // Parse provided claims into JSON object or initialize empty object
4511
- if (!claims) {
4512
- mergedClaims = {};
4513
- }
4514
- else {
4515
- try {
4516
- mergedClaims = JSON.parse(claims);
4517
- }
4518
- catch (e) {
4519
- throw createClientConfigurationError(invalidClaims);
4520
- }
4521
- }
4522
- if (clientCapabilities && clientCapabilities.length > 0) {
4523
- if (!mergedClaims.hasOwnProperty(ClaimsRequestKeys.ACCESS_TOKEN)) {
4524
- // Add access_token key to claims object
4525
- mergedClaims[ClaimsRequestKeys.ACCESS_TOKEN] = {};
4526
- }
4527
- // Add xms_cc claim with provided clientCapabilities to access_token key
4528
- mergedClaims[ClaimsRequestKeys.ACCESS_TOKEN][ClaimsRequestKeys.XMS_CC] =
4529
- {
4530
- values: clientCapabilities,
4531
- };
4532
- }
4533
- return JSON.stringify(mergedClaims);
4618
+ function addPostLogoutRedirectUri(parameters, redirectUri) {
4619
+ parameters.set(POST_LOGOUT_URI, redirectUri);
4534
4620
  }
4535
4621
  /**
4536
- * adds `username` for Password Grant flow
4537
- * @param username
4622
+ * add id_token_hint to logout request
4623
+ * @param idTokenHint
4538
4624
  */
4539
- function addUsername(parameters, username) {
4540
- parameters.set(PasswordGrantConstants.username, username);
4625
+ function addIdTokenHint(parameters, idTokenHint) {
4626
+ parameters.set(ID_TOKEN_HINT, idTokenHint);
4541
4627
  }
4542
4628
  /**
4543
- * adds `password` for Password Grant flow
4544
- * @param password
4629
+ * add domain_hint
4630
+ * @param domainHint
4545
4631
  */
4546
- function addPassword(parameters, password) {
4547
- parameters.set(PasswordGrantConstants.password, password);
4632
+ function addDomainHint(parameters, domainHint) {
4633
+ parameters.set(DOMAIN_HINT, domainHint);
4548
4634
  }
4549
4635
  /**
4550
- * add pop_jwk to query params
4551
- * @param cnfString
4636
+ * add login_hint
4637
+ * @param loginHint
4552
4638
  */
4553
- function addPopToken(parameters, cnfString) {
4554
- if (cnfString) {
4555
- parameters.set(TOKEN_TYPE, AuthenticationScheme.POP);
4556
- parameters.set(REQ_CNF, cnfString);
4557
- }
4639
+ function addLoginHint(parameters, loginHint) {
4640
+ parameters.set(LOGIN_HINT, loginHint);
4558
4641
  }
4559
4642
  /**
4560
- * add SSH JWK and key ID to query params
4643
+ * Adds the CCS (Cache Credential Service) query parameter for login_hint
4644
+ * @param loginHint
4561
4645
  */
4562
- function addSshJwk(parameters, sshJwkString) {
4563
- if (sshJwkString) {
4564
- parameters.set(TOKEN_TYPE, AuthenticationScheme.SSH);
4565
- parameters.set(REQ_CNF, sshJwkString);
4566
- }
4646
+ function addCcsUpn(parameters, loginHint) {
4647
+ parameters.set(HeaderNames.CCS_HEADER, `UPN:${loginHint}`);
4567
4648
  }
4568
4649
  /**
4569
- * add server telemetry fields
4570
- * @param serverTelemetryManager
4650
+ * Adds the CCS (Cache Credential Service) query parameter for account object
4651
+ * @param loginHint
4571
4652
  */
4572
- function addServerTelemetry(parameters, serverTelemetryManager) {
4573
- parameters.set(X_CLIENT_CURR_TELEM, serverTelemetryManager.generateCurrentRequestHeaderValue());
4574
- parameters.set(X_CLIENT_LAST_TELEM, serverTelemetryManager.generateLastRequestHeaderValue());
4653
+ function addCcsOid(parameters, clientInfo) {
4654
+ parameters.set(HeaderNames.CCS_HEADER, `Oid:${clientInfo.uid}@${clientInfo.utid}`);
4575
4655
  }
4576
4656
  /**
4577
- * Adds parameter that indicates to the server that throttling is supported
4657
+ * add sid
4658
+ * @param sid
4578
4659
  */
4579
- function addThrottling(parameters) {
4580
- parameters.set(X_MS_LIB_CAPABILITY, ThrottlingConstants.X_MS_LIB_CAPABILITY_VALUE);
4660
+ function addSid(parameters, sid) {
4661
+ parameters.set(SID, sid);
4581
4662
  }
4582
4663
  /**
4583
- * Adds logout_hint parameter for "silent" logout which prevent server account picker
4664
+ * add claims
4665
+ * @param claims
4584
4666
  */
4585
- function addLogoutHint(parameters, logoutHint) {
4586
- parameters.set(LOGOUT_HINT, logoutHint);
4587
- }
4588
- function addBrokerParameters(parameters, brokerClientId, brokerRedirectUri) {
4589
- if (!parameters.has(BROKER_CLIENT_ID)) {
4590
- parameters.set(BROKER_CLIENT_ID, brokerClientId);
4667
+ function addClaims(parameters, claims, clientCapabilities) {
4668
+ const mergedClaims = addClientCapabilitiesToClaims(claims, clientCapabilities);
4669
+ try {
4670
+ JSON.parse(mergedClaims);
4591
4671
  }
4592
- if (!parameters.has(BROKER_REDIRECT_URI)) {
4593
- parameters.set(BROKER_REDIRECT_URI, brokerRedirectUri);
4672
+ catch (e) {
4673
+ throw createClientConfigurationError(invalidClaims);
4594
4674
  }
4595
- }
4596
-
4597
- /*! @azure/msal-common v15.7.0 2025-05-30 */
4598
- /*
4599
- * Copyright (c) Microsoft Corporation. All rights reserved.
4600
- * Licensed under the MIT License.
4675
+ parameters.set(CLAIMS, mergedClaims);
4676
+ }
4677
+ /**
4678
+ * add correlationId
4679
+ * @param correlationId
4601
4680
  */
4602
- function isOpenIdConfigResponse(response) {
4603
- return (response.hasOwnProperty("authorization_endpoint") &&
4604
- response.hasOwnProperty("token_endpoint") &&
4605
- response.hasOwnProperty("issuer") &&
4606
- response.hasOwnProperty("jwks_uri"));
4607
- }
4608
-
4609
- /*! @azure/msal-common v15.7.0 2025-05-30 */
4610
- /*
4611
- * Copyright (c) Microsoft Corporation. All rights reserved.
4612
- * Licensed under the MIT License.
4613
- */
4614
- function isCloudInstanceDiscoveryResponse(response) {
4615
- return (response.hasOwnProperty("tenant_discovery_endpoint") &&
4616
- response.hasOwnProperty("metadata"));
4617
- }
4618
-
4619
- /*! @azure/msal-common v15.7.0 2025-05-30 */
4620
- /*
4621
- * Copyright (c) Microsoft Corporation. All rights reserved.
4622
- * Licensed under the MIT License.
4623
- */
4624
- function isCloudInstanceDiscoveryErrorResponse(response) {
4625
- return (response.hasOwnProperty("error") &&
4626
- response.hasOwnProperty("error_description"));
4627
- }
4628
-
4629
- /*! @azure/msal-common v15.7.0 2025-05-30 */
4630
- /*
4631
- * Copyright (c) Microsoft Corporation. All rights reserved.
4632
- * Licensed under the MIT License.
4681
+ function addCorrelationId(parameters, correlationId) {
4682
+ parameters.set(CLIENT_REQUEST_ID, correlationId);
4683
+ }
4684
+ /**
4685
+ * add library info query params
4686
+ * @param libraryInfo
4633
4687
  */
4688
+ function addLibraryInfo(parameters, libraryInfo) {
4689
+ // Telemetry Info
4690
+ parameters.set(X_CLIENT_SKU, libraryInfo.sku);
4691
+ parameters.set(X_CLIENT_VER, libraryInfo.version);
4692
+ if (libraryInfo.os) {
4693
+ parameters.set(X_CLIENT_OS, libraryInfo.os);
4694
+ }
4695
+ if (libraryInfo.cpu) {
4696
+ parameters.set(X_CLIENT_CPU, libraryInfo.cpu);
4697
+ }
4698
+ }
4634
4699
  /**
4635
- * Enumeration of operations that are instrumented by have their performance measured by the PerformanceClient.
4636
- *
4637
- * @export
4638
- * @enum {number}
4700
+ * Add client telemetry parameters
4701
+ * @param appTelemetry
4639
4702
  */
4640
- const PerformanceEvents = {
4641
- /**
4642
- * acquireTokenByCode API (msal-browser and msal-node).
4643
- * Used to acquire tokens by trading an authorization code against the token endpoint.
4644
- */
4645
- AcquireTokenByCode: "acquireTokenByCode",
4646
- /**
4647
- * acquireTokenByRefreshToken API (msal-browser and msal-node).
4648
- * Used to renew an access token using a refresh token against the token endpoint.
4649
- */
4650
- AcquireTokenByRefreshToken: "acquireTokenByRefreshToken",
4651
- /**
4652
- * acquireTokenSilent API (msal-browser and msal-node).
4653
- * Used to silently acquire a new access token (from the cache or the network).
4654
- */
4655
- AcquireTokenSilent: "acquireTokenSilent",
4656
- /**
4657
- * acquireTokenSilentAsync (msal-browser).
4658
- * Internal API for acquireTokenSilent.
4659
- */
4660
- AcquireTokenSilentAsync: "acquireTokenSilentAsync",
4661
- /**
4662
- * acquireTokenPopup (msal-browser).
4663
- * Used to acquire a new access token interactively through pop ups
4664
- */
4665
- AcquireTokenPopup: "acquireTokenPopup",
4666
- /**
4667
- * acquireTokenPreRedirect (msal-browser).
4668
- * First part of the redirect flow.
4669
- * Used to acquire a new access token interactively through redirects.
4670
- */
4671
- AcquireTokenPreRedirect: "acquireTokenPreRedirect",
4672
- /**
4673
- * acquireTokenRedirect (msal-browser).
4674
- * Second part of the redirect flow.
4675
- * Used to acquire a new access token interactively through redirects.
4676
- */
4677
- AcquireTokenRedirect: "acquireTokenRedirect",
4678
- /**
4679
- * getPublicKeyThumbprint API in CryptoOpts class (msal-browser).
4680
- * Used to generate a public/private keypair and generate a public key thumbprint for pop requests.
4681
- */
4682
- CryptoOptsGetPublicKeyThumbprint: "cryptoOptsGetPublicKeyThumbprint",
4683
- /**
4684
- * signJwt API in CryptoOpts class (msal-browser).
4685
- * Used to signed a pop token.
4686
- */
4687
- CryptoOptsSignJwt: "cryptoOptsSignJwt",
4688
- /**
4689
- * acquireToken API in the SilentCacheClient class (msal-browser).
4690
- * Used to read access tokens from the cache.
4691
- */
4692
- SilentCacheClientAcquireToken: "silentCacheClientAcquireToken",
4693
- /**
4694
- * acquireToken API in the SilentIframeClient class (msal-browser).
4695
- * Used to acquire a new set of tokens from the authorize endpoint in a hidden iframe.
4696
- */
4697
- SilentIframeClientAcquireToken: "silentIframeClientAcquireToken",
4698
- AwaitConcurrentIframe: "awaitConcurrentIframe",
4699
- /**
4700
- * acquireToken API in SilentRereshClient (msal-browser).
4701
- * Used to acquire a new set of tokens from the token endpoint using a refresh token.
4702
- */
4703
- SilentRefreshClientAcquireToken: "silentRefreshClientAcquireToken",
4704
- /**
4705
- * ssoSilent API (msal-browser).
4706
- * Used to silently acquire an authorization code and set of tokens using a hidden iframe.
4707
- */
4708
- SsoSilent: "ssoSilent",
4709
- /**
4710
- * getDiscoveredAuthority API in StandardInteractionClient class (msal-browser).
4711
- * Used to load authority metadata for a request.
4712
- */
4713
- StandardInteractionClientGetDiscoveredAuthority: "standardInteractionClientGetDiscoveredAuthority",
4714
- /**
4715
- * acquireToken APIs in msal-browser.
4716
- * Used to make an /authorize endpoint call with native brokering enabled.
4717
- */
4718
- FetchAccountIdWithNativeBroker: "fetchAccountIdWithNativeBroker",
4719
- /**
4720
- * acquireToken API in NativeInteractionClient class (msal-browser).
4721
- * Used to acquire a token from Native component when native brokering is enabled.
4722
- */
4723
- NativeInteractionClientAcquireToken: "nativeInteractionClientAcquireToken",
4724
- /**
4725
- * Time spent creating default headers for requests to token endpoint
4726
- */
4727
- BaseClientCreateTokenRequestHeaders: "baseClientCreateTokenRequestHeaders",
4728
- /**
4729
- * Time spent sending/waiting for the response of a request to the token endpoint
4730
- */
4731
- NetworkClientSendPostRequestAsync: "networkClientSendPostRequestAsync",
4732
- RefreshTokenClientExecutePostToTokenEndpoint: "refreshTokenClientExecutePostToTokenEndpoint",
4733
- AuthorizationCodeClientExecutePostToTokenEndpoint: "authorizationCodeClientExecutePostToTokenEndpoint",
4734
- /**
4735
- * Used to measure the time taken for completing embedded-broker handshake (PW-Broker).
4736
- */
4737
- BrokerHandhshake: "brokerHandshake",
4738
- /**
4739
- * acquireTokenByRefreshToken API in BrokerClientApplication (PW-Broker) .
4740
- */
4741
- AcquireTokenByRefreshTokenInBroker: "acquireTokenByRefreshTokenInBroker",
4742
- /**
4743
- * Time taken for token acquisition by broker
4744
- */
4745
- AcquireTokenByBroker: "acquireTokenByBroker",
4746
- /**
4747
- * Time spent on the network for refresh token acquisition
4748
- */
4749
- RefreshTokenClientExecuteTokenRequest: "refreshTokenClientExecuteTokenRequest",
4750
- /**
4751
- * Time taken for acquiring refresh token , records RT size
4752
- */
4753
- RefreshTokenClientAcquireToken: "refreshTokenClientAcquireToken",
4754
- /**
4755
- * Time taken for acquiring cached refresh token
4756
- */
4757
- RefreshTokenClientAcquireTokenWithCachedRefreshToken: "refreshTokenClientAcquireTokenWithCachedRefreshToken",
4758
- /**
4759
- * acquireTokenByRefreshToken API in RefreshTokenClient (msal-common).
4760
- */
4761
- RefreshTokenClientAcquireTokenByRefreshToken: "refreshTokenClientAcquireTokenByRefreshToken",
4762
- /**
4763
- * Helper function to create token request body in RefreshTokenClient (msal-common).
4764
- */
4765
- RefreshTokenClientCreateTokenRequestBody: "refreshTokenClientCreateTokenRequestBody",
4766
- /**
4767
- * acquireTokenFromCache (msal-browser).
4768
- * Internal API for acquiring token from cache
4769
- */
4770
- AcquireTokenFromCache: "acquireTokenFromCache",
4771
- SilentFlowClientAcquireCachedToken: "silentFlowClientAcquireCachedToken",
4772
- SilentFlowClientGenerateResultFromCacheRecord: "silentFlowClientGenerateResultFromCacheRecord",
4773
- /**
4774
- * acquireTokenBySilentIframe (msal-browser).
4775
- * Internal API for acquiring token by silent Iframe
4776
- */
4777
- AcquireTokenBySilentIframe: "acquireTokenBySilentIframe",
4778
- /**
4779
- * Internal API for initializing base request in BaseInteractionClient (msal-browser)
4780
- */
4781
- InitializeBaseRequest: "initializeBaseRequest",
4782
- /**
4783
- * Internal API for initializing silent request in SilentCacheClient (msal-browser)
4784
- */
4785
- InitializeSilentRequest: "initializeSilentRequest",
4786
- InitializeClientApplication: "initializeClientApplication",
4787
- InitializeCache: "initializeCache",
4788
- /**
4789
- * Helper function in SilentIframeClient class (msal-browser).
4790
- */
4791
- SilentIframeClientTokenHelper: "silentIframeClientTokenHelper",
4792
- /**
4793
- * SilentHandler
4794
- */
4795
- SilentHandlerInitiateAuthRequest: "silentHandlerInitiateAuthRequest",
4796
- SilentHandlerMonitorIframeForHash: "silentHandlerMonitorIframeForHash",
4797
- SilentHandlerLoadFrame: "silentHandlerLoadFrame",
4798
- SilentHandlerLoadFrameSync: "silentHandlerLoadFrameSync",
4799
- /**
4800
- * Helper functions in StandardInteractionClient class (msal-browser)
4801
- */
4802
- StandardInteractionClientCreateAuthCodeClient: "standardInteractionClientCreateAuthCodeClient",
4803
- StandardInteractionClientGetClientConfiguration: "standardInteractionClientGetClientConfiguration",
4804
- StandardInteractionClientInitializeAuthorizationRequest: "standardInteractionClientInitializeAuthorizationRequest",
4805
- /**
4806
- * getAuthCodeUrl API (msal-browser and msal-node).
4807
- */
4808
- GetAuthCodeUrl: "getAuthCodeUrl",
4809
- GetStandardParams: "getStandardParams",
4810
- /**
4811
- * Functions from InteractionHandler (msal-browser)
4812
- */
4813
- HandleCodeResponseFromServer: "handleCodeResponseFromServer",
4814
- HandleCodeResponse: "handleCodeResponse",
4815
- HandleResponseEar: "handleResponseEar",
4816
- HandleResponsePlatformBroker: "handleResponsePlatformBroker",
4817
- HandleResponseCode: "handleResponseCode",
4818
- UpdateTokenEndpointAuthority: "updateTokenEndpointAuthority",
4819
- /**
4820
- * APIs in Authorization Code Client (msal-common)
4821
- */
4822
- AuthClientAcquireToken: "authClientAcquireToken",
4823
- AuthClientExecuteTokenRequest: "authClientExecuteTokenRequest",
4824
- AuthClientCreateTokenRequestBody: "authClientCreateTokenRequestBody",
4825
- /**
4826
- * Generate functions in PopTokenGenerator (msal-common)
4827
- */
4828
- PopTokenGenerateCnf: "popTokenGenerateCnf",
4829
- PopTokenGenerateKid: "popTokenGenerateKid",
4830
- /**
4831
- * handleServerTokenResponse API in ResponseHandler (msal-common)
4832
- */
4833
- HandleServerTokenResponse: "handleServerTokenResponse",
4834
- DeserializeResponse: "deserializeResponse",
4835
- /**
4836
- * Authority functions
4837
- */
4838
- AuthorityFactoryCreateDiscoveredInstance: "authorityFactoryCreateDiscoveredInstance",
4839
- AuthorityResolveEndpointsAsync: "authorityResolveEndpointsAsync",
4840
- AuthorityResolveEndpointsFromLocalSources: "authorityResolveEndpointsFromLocalSources",
4841
- AuthorityGetCloudDiscoveryMetadataFromNetwork: "authorityGetCloudDiscoveryMetadataFromNetwork",
4842
- AuthorityUpdateCloudDiscoveryMetadata: "authorityUpdateCloudDiscoveryMetadata",
4843
- AuthorityGetEndpointMetadataFromNetwork: "authorityGetEndpointMetadataFromNetwork",
4844
- AuthorityUpdateEndpointMetadata: "authorityUpdateEndpointMetadata",
4845
- AuthorityUpdateMetadataWithRegionalInformation: "authorityUpdateMetadataWithRegionalInformation",
4846
- /**
4847
- * Region Discovery functions
4848
- */
4849
- RegionDiscoveryDetectRegion: "regionDiscoveryDetectRegion",
4850
- RegionDiscoveryGetRegionFromIMDS: "regionDiscoveryGetRegionFromIMDS",
4851
- RegionDiscoveryGetCurrentVersion: "regionDiscoveryGetCurrentVersion",
4852
- AcquireTokenByCodeAsync: "acquireTokenByCodeAsync",
4853
- GetEndpointMetadataFromNetwork: "getEndpointMetadataFromNetwork",
4854
- GetCloudDiscoveryMetadataFromNetworkMeasurement: "getCloudDiscoveryMetadataFromNetworkMeasurement",
4855
- HandleRedirectPromiseMeasurement: "handleRedirectPromise",
4856
- HandleNativeRedirectPromiseMeasurement: "handleNativeRedirectPromise",
4857
- UpdateCloudDiscoveryMetadataMeasurement: "updateCloudDiscoveryMetadataMeasurement",
4858
- UsernamePasswordClientAcquireToken: "usernamePasswordClientAcquireToken",
4859
- NativeMessageHandlerHandshake: "nativeMessageHandlerHandshake",
4860
- NativeGenerateAuthResult: "nativeGenerateAuthResult",
4861
- RemoveHiddenIframe: "removeHiddenIframe",
4862
- /**
4863
- * Cache operations
4864
- */
4865
- ClearTokensAndKeysWithClaims: "clearTokensAndKeysWithClaims",
4866
- CacheManagerGetRefreshToken: "cacheManagerGetRefreshToken",
4867
- ImportExistingCache: "importExistingCache",
4868
- SetUserData: "setUserData",
4869
- LocalStorageUpdated: "localStorageUpdated",
4870
- /**
4871
- * Crypto Operations
4872
- */
4873
- GeneratePkceCodes: "generatePkceCodes",
4874
- GenerateCodeVerifier: "generateCodeVerifier",
4875
- GenerateCodeChallengeFromVerifier: "generateCodeChallengeFromVerifier",
4876
- Sha256Digest: "sha256Digest",
4877
- GetRandomValues: "getRandomValues",
4878
- GenerateHKDF: "generateHKDF",
4879
- GenerateBaseKey: "generateBaseKey",
4880
- Base64Decode: "base64Decode",
4881
- UrlEncodeArr: "urlEncodeArr",
4882
- Encrypt: "encrypt",
4883
- Decrypt: "decrypt",
4884
- GenerateEarKey: "generateEarKey",
4885
- DecryptEarResponse: "decryptEarResponse",
4886
- };
4703
+ function addApplicationTelemetry(parameters, appTelemetry) {
4704
+ if (appTelemetry?.appName) {
4705
+ parameters.set(X_APP_NAME, appTelemetry.appName);
4706
+ }
4707
+ if (appTelemetry?.appVersion) {
4708
+ parameters.set(X_APP_VER, appTelemetry.appVersion);
4709
+ }
4710
+ }
4711
+ /**
4712
+ * add prompt
4713
+ * @param prompt
4714
+ */
4715
+ function addPrompt(parameters, prompt) {
4716
+ parameters.set(PROMPT, prompt);
4717
+ }
4718
+ /**
4719
+ * add state
4720
+ * @param state
4721
+ */
4722
+ function addState(parameters, state) {
4723
+ if (state) {
4724
+ parameters.set(STATE, state);
4725
+ }
4726
+ }
4727
+ /**
4728
+ * add nonce
4729
+ * @param nonce
4730
+ */
4731
+ function addNonce(parameters, nonce) {
4732
+ parameters.set(NONCE, nonce);
4733
+ }
4734
+ /**
4735
+ * add code_challenge and code_challenge_method
4736
+ * - throw if either of them are not passed
4737
+ * @param codeChallenge
4738
+ * @param codeChallengeMethod
4739
+ */
4740
+ function addCodeChallengeParams(parameters, codeChallenge, codeChallengeMethod) {
4741
+ if (codeChallenge && codeChallengeMethod) {
4742
+ parameters.set(CODE_CHALLENGE, codeChallenge);
4743
+ parameters.set(CODE_CHALLENGE_METHOD, codeChallengeMethod);
4744
+ }
4745
+ else {
4746
+ throw createClientConfigurationError(pkceParamsMissing);
4747
+ }
4748
+ }
4749
+ /**
4750
+ * add the `authorization_code` passed by the user to exchange for a token
4751
+ * @param code
4752
+ */
4753
+ function addAuthorizationCode(parameters, code) {
4754
+ parameters.set(CODE, code);
4755
+ }
4756
+ /**
4757
+ * add the `authorization_code` passed by the user to exchange for a token
4758
+ * @param code
4759
+ */
4760
+ function addDeviceCode(parameters, code) {
4761
+ parameters.set(DEVICE_CODE, code);
4762
+ }
4763
+ /**
4764
+ * add the `refreshToken` passed by the user
4765
+ * @param refreshToken
4766
+ */
4767
+ function addRefreshToken(parameters, refreshToken) {
4768
+ parameters.set(REFRESH_TOKEN, refreshToken);
4769
+ }
4770
+ /**
4771
+ * add the `code_verifier` passed by the user to exchange for a token
4772
+ * @param codeVerifier
4773
+ */
4774
+ function addCodeVerifier(parameters, codeVerifier) {
4775
+ parameters.set(CODE_VERIFIER, codeVerifier);
4776
+ }
4777
+ /**
4778
+ * add client_secret
4779
+ * @param clientSecret
4780
+ */
4781
+ function addClientSecret(parameters, clientSecret) {
4782
+ parameters.set(CLIENT_SECRET, clientSecret);
4783
+ }
4784
+ /**
4785
+ * add clientAssertion for confidential client flows
4786
+ * @param clientAssertion
4787
+ */
4788
+ function addClientAssertion(parameters, clientAssertion) {
4789
+ if (clientAssertion) {
4790
+ parameters.set(CLIENT_ASSERTION, clientAssertion);
4791
+ }
4792
+ }
4793
+ /**
4794
+ * add clientAssertionType for confidential client flows
4795
+ * @param clientAssertionType
4796
+ */
4797
+ function addClientAssertionType(parameters, clientAssertionType) {
4798
+ if (clientAssertionType) {
4799
+ parameters.set(CLIENT_ASSERTION_TYPE, clientAssertionType);
4800
+ }
4801
+ }
4802
+ /**
4803
+ * add OBO assertion for confidential client flows
4804
+ * @param clientAssertion
4805
+ */
4806
+ function addOboAssertion(parameters, oboAssertion) {
4807
+ parameters.set(OBO_ASSERTION, oboAssertion);
4808
+ }
4809
+ /**
4810
+ * add grant type
4811
+ * @param grantType
4812
+ */
4813
+ function addRequestTokenUse(parameters, tokenUse) {
4814
+ parameters.set(REQUESTED_TOKEN_USE, tokenUse);
4815
+ }
4816
+ /**
4817
+ * add grant type
4818
+ * @param grantType
4819
+ */
4820
+ function addGrantType(parameters, grantType) {
4821
+ parameters.set(GRANT_TYPE, grantType);
4822
+ }
4823
+ /**
4824
+ * add client info
4825
+ *
4826
+ */
4827
+ function addClientInfo(parameters) {
4828
+ parameters.set(CLIENT_INFO, "1");
4829
+ }
4830
+ function addInstanceAware(parameters) {
4831
+ if (!parameters.has(INSTANCE_AWARE)) {
4832
+ parameters.set(INSTANCE_AWARE, "true");
4833
+ }
4834
+ }
4835
+ /**
4836
+ * add extraQueryParams
4837
+ * @param eQParams
4838
+ */
4839
+ function addExtraQueryParameters(parameters, eQParams) {
4840
+ Object.entries(eQParams).forEach(([key, value]) => {
4841
+ if (!parameters.has(key) && value) {
4842
+ parameters.set(key, value);
4843
+ }
4844
+ });
4845
+ }
4846
+ function addClientCapabilitiesToClaims(claims, clientCapabilities) {
4847
+ let mergedClaims;
4848
+ // Parse provided claims into JSON object or initialize empty object
4849
+ if (!claims) {
4850
+ mergedClaims = {};
4851
+ }
4852
+ else {
4853
+ try {
4854
+ mergedClaims = JSON.parse(claims);
4855
+ }
4856
+ catch (e) {
4857
+ throw createClientConfigurationError(invalidClaims);
4858
+ }
4859
+ }
4860
+ if (clientCapabilities && clientCapabilities.length > 0) {
4861
+ if (!mergedClaims.hasOwnProperty(ClaimsRequestKeys.ACCESS_TOKEN)) {
4862
+ // Add access_token key to claims object
4863
+ mergedClaims[ClaimsRequestKeys.ACCESS_TOKEN] = {};
4864
+ }
4865
+ // Add xms_cc claim with provided clientCapabilities to access_token key
4866
+ mergedClaims[ClaimsRequestKeys.ACCESS_TOKEN][ClaimsRequestKeys.XMS_CC] =
4867
+ {
4868
+ values: clientCapabilities,
4869
+ };
4870
+ }
4871
+ return JSON.stringify(mergedClaims);
4872
+ }
4873
+ /**
4874
+ * adds `username` for Password Grant flow
4875
+ * @param username
4876
+ */
4877
+ function addUsername(parameters, username) {
4878
+ parameters.set(PasswordGrantConstants.username, username);
4879
+ }
4880
+ /**
4881
+ * adds `password` for Password Grant flow
4882
+ * @param password
4883
+ */
4884
+ function addPassword(parameters, password) {
4885
+ parameters.set(PasswordGrantConstants.password, password);
4886
+ }
4887
+ /**
4888
+ * add pop_jwk to query params
4889
+ * @param cnfString
4890
+ */
4891
+ function addPopToken(parameters, cnfString) {
4892
+ if (cnfString) {
4893
+ parameters.set(TOKEN_TYPE, AuthenticationScheme.POP);
4894
+ parameters.set(REQ_CNF, cnfString);
4895
+ }
4896
+ }
4897
+ /**
4898
+ * add SSH JWK and key ID to query params
4899
+ */
4900
+ function addSshJwk(parameters, sshJwkString) {
4901
+ if (sshJwkString) {
4902
+ parameters.set(TOKEN_TYPE, AuthenticationScheme.SSH);
4903
+ parameters.set(REQ_CNF, sshJwkString);
4904
+ }
4905
+ }
4906
+ /**
4907
+ * add server telemetry fields
4908
+ * @param serverTelemetryManager
4909
+ */
4910
+ function addServerTelemetry(parameters, serverTelemetryManager) {
4911
+ parameters.set(X_CLIENT_CURR_TELEM, serverTelemetryManager.generateCurrentRequestHeaderValue());
4912
+ parameters.set(X_CLIENT_LAST_TELEM, serverTelemetryManager.generateLastRequestHeaderValue());
4913
+ }
4914
+ /**
4915
+ * Adds parameter that indicates to the server that throttling is supported
4916
+ */
4917
+ function addThrottling(parameters) {
4918
+ parameters.set(X_MS_LIB_CAPABILITY, ThrottlingConstants.X_MS_LIB_CAPABILITY_VALUE);
4919
+ }
4920
+ /**
4921
+ * Adds logout_hint parameter for "silent" logout which prevent server account picker
4922
+ */
4923
+ function addLogoutHint(parameters, logoutHint) {
4924
+ parameters.set(LOGOUT_HINT, logoutHint);
4925
+ }
4926
+ function addBrokerParameters(parameters, brokerClientId, brokerRedirectUri) {
4927
+ if (!parameters.has(BROKER_CLIENT_ID)) {
4928
+ parameters.set(BROKER_CLIENT_ID, brokerClientId);
4929
+ }
4930
+ if (!parameters.has(BROKER_REDIRECT_URI)) {
4931
+ parameters.set(BROKER_REDIRECT_URI, brokerRedirectUri);
4932
+ }
4933
+ }
4934
+
4935
+ /*! @azure/msal-common v15.8.0 2025-07-01 */
4936
+ /*
4937
+ * Copyright (c) Microsoft Corporation. All rights reserved.
4938
+ * Licensed under the MIT License.
4939
+ */
4940
+ function isOpenIdConfigResponse(response) {
4941
+ return (response.hasOwnProperty("authorization_endpoint") &&
4942
+ response.hasOwnProperty("token_endpoint") &&
4943
+ response.hasOwnProperty("issuer") &&
4944
+ response.hasOwnProperty("jwks_uri"));
4945
+ }
4946
+
4947
+ /*! @azure/msal-common v15.8.0 2025-07-01 */
4948
+ /*
4949
+ * Copyright (c) Microsoft Corporation. All rights reserved.
4950
+ * Licensed under the MIT License.
4951
+ */
4952
+ function isCloudInstanceDiscoveryResponse(response) {
4953
+ return (response.hasOwnProperty("tenant_discovery_endpoint") &&
4954
+ response.hasOwnProperty("metadata"));
4955
+ }
4956
+
4957
+ /*! @azure/msal-common v15.8.0 2025-07-01 */
4958
+ /*
4959
+ * Copyright (c) Microsoft Corporation. All rights reserved.
4960
+ * Licensed under the MIT License.
4961
+ */
4962
+ function isCloudInstanceDiscoveryErrorResponse(response) {
4963
+ return (response.hasOwnProperty("error") &&
4964
+ response.hasOwnProperty("error_description"));
4965
+ }
4887
4966
 
4888
- /*! @azure/msal-common v15.7.0 2025-05-30 */
4967
+ /*! @azure/msal-common v15.8.0 2025-07-01 */
4889
4968
  /*
4890
4969
  * Copyright (c) Microsoft Corporation. All rights reserved.
4891
4970
  * Licensed under the MIT License.
@@ -4981,7 +5060,7 @@ const invokeAsync = (callback, eventName, logger, telemetryClient, correlationId
4981
5060
  };
4982
5061
  };
4983
5062
 
4984
- /*! @azure/msal-common v15.7.0 2025-05-30 */
5063
+ /*! @azure/msal-common v15.8.0 2025-07-01 */
4985
5064
 
4986
5065
  /*
4987
5066
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5087,7 +5166,7 @@ RegionDiscovery.IMDS_OPTIONS = {
5087
5166
  },
5088
5167
  };
5089
5168
 
5090
- /*! @azure/msal-common v15.7.0 2025-05-30 */
5169
+ /*! @azure/msal-common v15.8.0 2025-07-01 */
5091
5170
 
5092
5171
  /*
5093
5172
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5926,7 +6005,7 @@ function buildStaticAuthorityOptions(authOptions) {
5926
6005
  };
5927
6006
  }
5928
6007
 
5929
- /*! @azure/msal-common v15.7.0 2025-05-30 */
6008
+ /*! @azure/msal-common v15.8.0 2025-07-01 */
5930
6009
 
5931
6010
  /*
5932
6011
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5957,7 +6036,7 @@ async function createDiscoveredInstance(authorityUri, networkClient, cacheManage
5957
6036
  }
5958
6037
  }
5959
6038
 
5960
- /*! @azure/msal-common v15.7.0 2025-05-30 */
6039
+ /*! @azure/msal-common v15.8.0 2025-07-01 */
5961
6040
 
5962
6041
  /*
5963
6042
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5976,7 +6055,7 @@ class ServerError extends AuthError {
5976
6055
  }
5977
6056
  }
5978
6057
 
5979
- /*! @azure/msal-common v15.7.0 2025-05-30 */
6058
+ /*! @azure/msal-common v15.8.0 2025-07-01 */
5980
6059
  /*
5981
6060
  * Copyright (c) Microsoft Corporation. All rights reserved.
5982
6061
  * Licensed under the MIT License.
@@ -5997,7 +6076,7 @@ function getRequestThumbprint(clientId, request, homeAccountId) {
5997
6076
  };
5998
6077
  }
5999
6078
 
6000
- /*! @azure/msal-common v15.7.0 2025-05-30 */
6079
+ /*! @azure/msal-common v15.8.0 2025-07-01 */
6001
6080
 
6002
6081
  /*
6003
6082
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6017,12 +6096,12 @@ class ThrottlingUtils {
6017
6096
  * @param cacheManager
6018
6097
  * @param thumbprint
6019
6098
  */
6020
- static preProcess(cacheManager, thumbprint) {
6099
+ static preProcess(cacheManager, thumbprint, correlationId) {
6021
6100
  const key = ThrottlingUtils.generateThrottlingStorageKey(thumbprint);
6022
6101
  const value = cacheManager.getThrottlingCache(key);
6023
6102
  if (value) {
6024
6103
  if (value.throttleTime < Date.now()) {
6025
- cacheManager.removeItem(key);
6104
+ cacheManager.removeItem(key, correlationId);
6026
6105
  return;
6027
6106
  }
6028
6107
  throw new ServerError(value.errorCodes?.join(" ") || Constants$1.EMPTY_STRING, value.errorMessage, value.subError);
@@ -6034,7 +6113,7 @@ class ThrottlingUtils {
6034
6113
  * @param thumbprint
6035
6114
  * @param response
6036
6115
  */
6037
- static postProcess(cacheManager, thumbprint, response) {
6116
+ static postProcess(cacheManager, thumbprint, response, correlationId) {
6038
6117
  if (ThrottlingUtils.checkResponseStatus(response) ||
6039
6118
  ThrottlingUtils.checkResponseForRetryAfter(response)) {
6040
6119
  const thumbprintValue = {
@@ -6044,7 +6123,7 @@ class ThrottlingUtils {
6044
6123
  errorMessage: response.body.error_description,
6045
6124
  subError: response.body.suberror,
6046
6125
  };
6047
- cacheManager.setThrottlingCache(ThrottlingUtils.generateThrottlingStorageKey(thumbprint), thumbprintValue);
6126
+ cacheManager.setThrottlingCache(ThrottlingUtils.generateThrottlingStorageKey(thumbprint), thumbprintValue, correlationId);
6048
6127
  }
6049
6128
  }
6050
6129
  /**
@@ -6080,11 +6159,11 @@ class ThrottlingUtils {
6080
6159
  static removeThrottle(cacheManager, clientId, request, homeAccountIdentifier) {
6081
6160
  const thumbprint = getRequestThumbprint(clientId, request, homeAccountIdentifier);
6082
6161
  const key = this.generateThrottlingStorageKey(thumbprint);
6083
- cacheManager.removeItem(key);
6162
+ cacheManager.removeItem(key, request.correlationId);
6084
6163
  }
6085
6164
  }
6086
6165
 
6087
- /*! @azure/msal-common v15.7.0 2025-05-30 */
6166
+ /*! @azure/msal-common v15.8.0 2025-07-01 */
6088
6167
 
6089
6168
  /*
6090
6169
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6104,7 +6183,7 @@ class NetworkError extends AuthError {
6104
6183
  }
6105
6184
  }
6106
6185
 
6107
- /*! @azure/msal-common v15.7.0 2025-05-30 */
6186
+ /*! @azure/msal-common v15.8.0 2025-07-01 */
6108
6187
 
6109
6188
  /*
6110
6189
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6186,7 +6265,7 @@ class BaseClient {
6186
6265
  * @param correlationId - CorrelationId for telemetry
6187
6266
  */
6188
6267
  async sendPostRequest(thumbprint, tokenEndpoint, options, correlationId) {
6189
- ThrottlingUtils.preProcess(this.cacheManager, thumbprint);
6268
+ ThrottlingUtils.preProcess(this.cacheManager, thumbprint, correlationId);
6190
6269
  let response;
6191
6270
  try {
6192
6271
  response = await invokeAsync((this.networkClient.sendPostRequestAsync.bind(this.networkClient)), PerformanceEvents.NetworkClientSendPostRequestAsync, this.logger, this.performanceClient, correlationId)(tokenEndpoint, options);
@@ -6221,7 +6300,7 @@ class BaseClient {
6221
6300
  throw createClientAuthError(networkError);
6222
6301
  }
6223
6302
  }
6224
- ThrottlingUtils.postProcess(this.cacheManager, thumbprint, response);
6303
+ ThrottlingUtils.postProcess(this.cacheManager, thumbprint, response, correlationId);
6225
6304
  return response;
6226
6305
  }
6227
6306
  /**
@@ -6252,7 +6331,7 @@ class BaseClient {
6252
6331
  }
6253
6332
  }
6254
6333
 
6255
- /*! @azure/msal-common v15.7.0 2025-05-30 */
6334
+ /*! @azure/msal-common v15.8.0 2025-07-01 */
6256
6335
  /*
6257
6336
  * Copyright (c) Microsoft Corporation. All rights reserved.
6258
6337
  * Licensed under the MIT License.
@@ -6261,6 +6340,7 @@ class BaseClient {
6261
6340
  const noTokensFound = "no_tokens_found";
6262
6341
  const nativeAccountUnavailable = "native_account_unavailable";
6263
6342
  const refreshTokenExpired = "refresh_token_expired";
6343
+ const uxNotAllowed = "ux_not_allowed";
6264
6344
  // Codes potentially returned by server
6265
6345
  const interactionRequired = "interaction_required";
6266
6346
  const consentRequired = "consent_required";
@@ -6275,10 +6355,11 @@ var InteractionRequiredAuthErrorCodes = /*#__PURE__*/Object.freeze({
6275
6355
  loginRequired: loginRequired,
6276
6356
  nativeAccountUnavailable: nativeAccountUnavailable,
6277
6357
  noTokensFound: noTokensFound,
6278
- refreshTokenExpired: refreshTokenExpired
6358
+ refreshTokenExpired: refreshTokenExpired,
6359
+ uxNotAllowed: uxNotAllowed
6279
6360
  });
6280
6361
 
6281
- /*! @azure/msal-common v15.7.0 2025-05-30 */
6362
+ /*! @azure/msal-common v15.8.0 2025-07-01 */
6282
6363
 
6283
6364
  /*
6284
6365
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6292,6 +6373,7 @@ const InteractionRequiredServerErrorMessage = [
6292
6373
  consentRequired,
6293
6374
  loginRequired,
6294
6375
  badToken,
6376
+ uxNotAllowed,
6295
6377
  ];
6296
6378
  const InteractionRequiredAuthSubErrorMessage = [
6297
6379
  "message_only",
@@ -6306,6 +6388,7 @@ const InteractionRequiredAuthErrorMessages = {
6306
6388
  [nativeAccountUnavailable]: "The requested account is not available in the native broker. It may have been deleted or logged out. Please sign-in again using an interactive API.",
6307
6389
  [refreshTokenExpired]: "Refresh token has expired.",
6308
6390
  [badToken]: "Identity provider returned bad_token due to an expired or invalid refresh token. Please invoke an interactive API to resolve.",
6391
+ [uxNotAllowed]: "`canShowUI` flag in Edge was set to false. User interaction required on web page. Please invoke an interactive API to resolve.",
6309
6392
  };
6310
6393
  /**
6311
6394
  * Interaction required errors defined by the SDK
@@ -6366,7 +6449,7 @@ function createInteractionRequiredAuthError(errorCode) {
6366
6449
  return new InteractionRequiredAuthError(errorCode, InteractionRequiredAuthErrorMessages[errorCode]);
6367
6450
  }
6368
6451
 
6369
- /*! @azure/msal-common v15.7.0 2025-05-30 */
6452
+ /*! @azure/msal-common v15.8.0 2025-07-01 */
6370
6453
 
6371
6454
  /*
6372
6455
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6438,16 +6521,14 @@ class ProtocolUtils {
6438
6521
  }
6439
6522
  }
6440
6523
 
6441
- /*! @azure/msal-common v15.7.0 2025-05-30 */
6524
+ /*! @azure/msal-common v15.8.0 2025-07-01 */
6442
6525
 
6443
6526
  /*
6444
6527
  * Copyright (c) Microsoft Corporation. All rights reserved.
6445
6528
  * Licensed under the MIT License.
6446
6529
  */
6447
6530
  const KeyLocation = {
6448
- SW: "sw",
6449
- UHW: "uhw",
6450
- };
6531
+ SW: "sw"};
6451
6532
  /** @internal */
6452
6533
  class PopTokenGenerator {
6453
6534
  constructor(cryptoUtils, performanceClient) {
@@ -6522,7 +6603,7 @@ class PopTokenGenerator {
6522
6603
  }
6523
6604
  }
6524
6605
 
6525
- /*! @azure/msal-common v15.7.0 2025-05-30 */
6606
+ /*! @azure/msal-common v15.8.0 2025-07-01 */
6526
6607
  /*
6527
6608
  * Copyright (c) Microsoft Corporation. All rights reserved.
6528
6609
  * Licensed under the MIT License.
@@ -6549,7 +6630,7 @@ class PopTokenGenerator {
6549
6630
  }
6550
6631
  }
6551
6632
 
6552
- /*! @azure/msal-common v15.7.0 2025-05-30 */
6633
+ /*! @azure/msal-common v15.8.0 2025-07-01 */
6553
6634
 
6554
6635
  /*
6555
6636
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6662,7 +6743,7 @@ class ResponseHandler {
6662
6743
  !forceCacheRefreshTokenResponse &&
6663
6744
  cacheRecord.account) {
6664
6745
  const key = cacheRecord.account.generateAccountKey();
6665
- const account = this.cacheStorage.getAccount(key);
6746
+ const account = this.cacheStorage.getAccount(key, request.correlationId);
6666
6747
  if (!account) {
6667
6748
  this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache");
6668
6749
  return await ResponseHandler.generateAuthenticationResult(this.cryptoObj, authority, cacheRecord, false, request, idTokenClaims, requestStateObj, undefined, serverRequestId);
@@ -6697,7 +6778,7 @@ class ResponseHandler {
6697
6778
  let cachedAccount;
6698
6779
  if (serverTokenResponse.id_token && !!idTokenClaims) {
6699
6780
  cachedIdToken = createIdTokenEntity(this.homeAccountIdentifier, env, serverTokenResponse.id_token, this.clientId, claimsTenantId || "");
6700
- 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
6701
6782
  this.logger);
6702
6783
  }
6703
6784
  // AccessToken
@@ -6846,7 +6927,7 @@ class ResponseHandler {
6846
6927
  };
6847
6928
  }
6848
6929
  }
6849
- 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) {
6850
6931
  logger?.verbose("setCachedAccount called");
6851
6932
  // Check if base account is already cached
6852
6933
  const accountKeys = cacheStorage.getAccountKeys();
@@ -6855,7 +6936,7 @@ function buildAccountToCache(cacheStorage, authority, homeAccountId, base64Decod
6855
6936
  });
6856
6937
  let cachedAccount = null;
6857
6938
  if (baseAccountKey) {
6858
- cachedAccount = cacheStorage.getAccount(baseAccountKey);
6939
+ cachedAccount = cacheStorage.getAccount(baseAccountKey, correlationId);
6859
6940
  }
6860
6941
  const baseAccount = cachedAccount ||
6861
6942
  AccountEntity.createAccount({
@@ -6880,7 +6961,7 @@ function buildAccountToCache(cacheStorage, authority, homeAccountId, base64Decod
6880
6961
  return baseAccount;
6881
6962
  }
6882
6963
 
6883
- /*! @azure/msal-common v15.7.0 2025-05-30 */
6964
+ /*! @azure/msal-common v15.8.0 2025-07-01 */
6884
6965
 
6885
6966
  /*
6886
6967
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6947,7 +7028,7 @@ class RequestValidator {
6947
7028
  }
6948
7029
  }
6949
7030
 
6950
- /*! @azure/msal-common v15.7.0 2025-05-30 */
7031
+ /*! @azure/msal-common v15.8.0 2025-07-01 */
6951
7032
  /*
6952
7033
  * Copyright (c) Microsoft Corporation. All rights reserved.
6953
7034
  * Licensed under the MIT License.
@@ -6965,7 +7046,7 @@ async function getClientAssertion(clientAssertion, clientId, tokenEndpoint) {
6965
7046
  }
6966
7047
  }
6967
7048
 
6968
- /*! @azure/msal-common v15.7.0 2025-05-30 */
7049
+ /*! @azure/msal-common v15.8.0 2025-07-01 */
6969
7050
 
6970
7051
  /*
6971
7052
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7198,7 +7279,7 @@ class AuthorizationCodeClient extends BaseClient {
7198
7279
  }
7199
7280
  }
7200
7281
 
7201
- /*! @azure/msal-common v15.7.0 2025-05-30 */
7282
+ /*! @azure/msal-common v15.8.0 2025-07-01 */
7202
7283
 
7203
7284
  /*
7204
7285
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7271,7 +7352,7 @@ class RefreshTokenClient extends BaseClient {
7271
7352
  async acquireTokenWithCachedRefreshToken(request, foci) {
7272
7353
  this.performanceClient?.addQueueMeasurement(PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, request.correlationId);
7273
7354
  // fetches family RT or application RT based on FOCI value
7274
- const refreshToken = invoke(this.cacheManager.getRefreshToken.bind(this.cacheManager), PerformanceEvents.CacheManagerGetRefreshToken, this.logger, this.performanceClient, request.correlationId)(request.account, foci, undefined, this.performanceClient, request.correlationId);
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);
7275
7356
  if (!refreshToken) {
7276
7357
  throw createInteractionRequiredAuthError(noTokensFound);
7277
7358
  }
@@ -7301,7 +7382,7 @@ class RefreshTokenClient extends BaseClient {
7301
7382
  // Remove bad refresh token from cache
7302
7383
  this.logger.verbose("acquireTokenWithRefreshToken: bad refresh token, removing from cache");
7303
7384
  const badRefreshTokenKey = generateCredentialKey(refreshToken);
7304
- this.cacheManager.removeRefreshToken(badRefreshTokenKey);
7385
+ this.cacheManager.removeRefreshToken(badRefreshTokenKey, request.correlationId);
7305
7386
  }
7306
7387
  }
7307
7388
  throw e;
@@ -7407,7 +7488,7 @@ class RefreshTokenClient extends BaseClient {
7407
7488
  }
7408
7489
  }
7409
7490
 
7410
- /*! @azure/msal-common v15.7.0 2025-05-30 */
7491
+ /*! @azure/msal-common v15.8.0 2025-07-01 */
7411
7492
 
7412
7493
  /*
7413
7494
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7439,7 +7520,7 @@ class SilentFlowClient extends BaseClient {
7439
7520
  const requestTenantId = request.account.tenantId ||
7440
7521
  getTenantFromAuthorityString(request.authority);
7441
7522
  const tokenKeys = this.cacheManager.getTokenKeys();
7442
- const cachedAccessToken = this.cacheManager.getAccessToken(request.account, request, tokenKeys, requestTenantId, this.performanceClient, request.correlationId);
7523
+ const cachedAccessToken = this.cacheManager.getAccessToken(request.account, request, tokenKeys, requestTenantId);
7443
7524
  if (!cachedAccessToken) {
7444
7525
  // must refresh due to non-existent access_token
7445
7526
  this.setCacheOutcome(CacheOutcome.NO_CACHED_ACCESS_TOKEN, request.correlationId);
@@ -7459,9 +7540,9 @@ class SilentFlowClient extends BaseClient {
7459
7540
  }
7460
7541
  const environment = request.authority || this.authority.getPreferredCache();
7461
7542
  const cacheRecord = {
7462
- account: this.cacheManager.readAccountFromCache(request.account),
7543
+ account: this.cacheManager.readAccountFromCache(request.account, request.correlationId),
7463
7544
  accessToken: cachedAccessToken,
7464
- idToken: this.cacheManager.getIdToken(request.account, tokenKeys, requestTenantId, this.performanceClient, request.correlationId),
7545
+ idToken: this.cacheManager.getIdToken(request.account, request.correlationId, tokenKeys, requestTenantId, this.performanceClient),
7465
7546
  refreshToken: null,
7466
7547
  appMetadata: this.cacheManager.readAppMetadataFromCache(environment),
7467
7548
  };
@@ -7505,7 +7586,7 @@ class SilentFlowClient extends BaseClient {
7505
7586
  }
7506
7587
  }
7507
7588
 
7508
- /*! @azure/msal-common v15.7.0 2025-05-30 */
7589
+ /*! @azure/msal-common v15.8.0 2025-07-01 */
7509
7590
 
7510
7591
  /*
7511
7592
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7655,7 +7736,7 @@ function extractLoginHint(account) {
7655
7736
  return account.idTokenClaims?.login_hint || null;
7656
7737
  }
7657
7738
 
7658
- /*! @azure/msal-common v15.7.0 2025-05-30 */
7739
+ /*! @azure/msal-common v15.8.0 2025-07-01 */
7659
7740
 
7660
7741
  /*
7661
7742
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7794,7 +7875,7 @@ class ServerTelemetryManager {
7794
7875
  else {
7795
7876
  lastRequests.errors.push(SERVER_TELEM_CONSTANTS.UNKNOWN_ERROR);
7796
7877
  }
7797
- this.cacheManager.setServerTelemetry(this.telemetryCacheKey, lastRequests);
7878
+ this.cacheManager.setServerTelemetry(this.telemetryCacheKey, lastRequests, this.correlationId);
7798
7879
  return;
7799
7880
  }
7800
7881
  /**
@@ -7803,7 +7884,7 @@ class ServerTelemetryManager {
7803
7884
  incrementCacheHits() {
7804
7885
  const lastRequests = this.getLastRequests();
7805
7886
  lastRequests.cacheHits += 1;
7806
- this.cacheManager.setServerTelemetry(this.telemetryCacheKey, lastRequests);
7887
+ this.cacheManager.setServerTelemetry(this.telemetryCacheKey, lastRequests, this.correlationId);
7807
7888
  return lastRequests.cacheHits;
7808
7889
  }
7809
7890
  /**
@@ -7827,7 +7908,7 @@ class ServerTelemetryManager {
7827
7908
  const errorCount = lastRequests.errors.length;
7828
7909
  if (numErrorsFlushed === errorCount) {
7829
7910
  // All errors were sent on last request, clear Telemetry cache
7830
- this.cacheManager.removeItem(this.telemetryCacheKey);
7911
+ this.cacheManager.removeItem(this.telemetryCacheKey, this.correlationId);
7831
7912
  }
7832
7913
  else {
7833
7914
  // Partial data was flushed to server, construct a new telemetry cache item with errors that were not flushed
@@ -7836,7 +7917,7 @@ class ServerTelemetryManager {
7836
7917
  errors: lastRequests.errors.slice(numErrorsFlushed),
7837
7918
  cacheHits: 0,
7838
7919
  };
7839
- this.cacheManager.setServerTelemetry(this.telemetryCacheKey, serverTelemEntity);
7920
+ this.cacheManager.setServerTelemetry(this.telemetryCacheKey, serverTelemEntity, this.correlationId);
7840
7921
  }
7841
7922
  }
7842
7923
  /**
@@ -7903,7 +7984,7 @@ class ServerTelemetryManager {
7903
7984
  setNativeBrokerErrorCode(errorCode) {
7904
7985
  const lastRequests = this.getLastRequests();
7905
7986
  lastRequests.nativeBrokerErrorCode = errorCode;
7906
- this.cacheManager.setServerTelemetry(this.telemetryCacheKey, lastRequests);
7987
+ this.cacheManager.setServerTelemetry(this.telemetryCacheKey, lastRequests, this.correlationId);
7907
7988
  }
7908
7989
  getNativeBrokerErrorCode() {
7909
7990
  return this.getLastRequests().nativeBrokerErrorCode;
@@ -7911,7 +7992,7 @@ class ServerTelemetryManager {
7911
7992
  clearNativeBrokerErrorCode() {
7912
7993
  const lastRequests = this.getLastRequests();
7913
7994
  delete lastRequests.nativeBrokerErrorCode;
7914
- this.cacheManager.setServerTelemetry(this.telemetryCacheKey, lastRequests);
7995
+ this.cacheManager.setServerTelemetry(this.telemetryCacheKey, lastRequests, this.correlationId);
7915
7996
  }
7916
7997
  static makeExtraSkuString(params) {
7917
7998
  return makeExtraSkuString(params);
@@ -8133,6 +8214,7 @@ const ManagedIdentityQueryParameters = {
8133
8214
  */
8134
8215
  const ManagedIdentityEnvironmentVariableNames = {
8135
8216
  AZURE_POD_IDENTITY_AUTHORITY_HOST: "AZURE_POD_IDENTITY_AUTHORITY_HOST",
8217
+ DEFAULT_IDENTITY_CLIENT_ID: "DEFAULT_IDENTITY_CLIENT_ID",
8136
8218
  IDENTITY_ENDPOINT: "IDENTITY_ENDPOINT",
8137
8219
  IDENTITY_HEADER: "IDENTITY_HEADER",
8138
8220
  IDENTITY_SERVER_THUMBPRINT: "IDENTITY_SERVER_THUMBPRINT",
@@ -8170,7 +8252,6 @@ const HttpMethod = {
8170
8252
  POST: "post",
8171
8253
  };
8172
8254
  const ProxyStatus = {
8173
- SUCCESS: HttpStatus.SUCCESS,
8174
8255
  SUCCESS_RANGE_START: HttpStatus.SUCCESS_RANGE_START,
8175
8256
  SUCCESS_RANGE_END: HttpStatus.SUCCESS_RANGE_END,
8176
8257
  SERVER_ERROR: HttpStatus.SERVER_ERROR,
@@ -8225,7 +8306,6 @@ const ApiId = {
8225
8306
  * JWT constants
8226
8307
  */
8227
8308
  const JwtConstants = {
8228
- ALGORITHM: "alg",
8229
8309
  RSA_256: "RS256",
8230
8310
  PSS_256: "PS256",
8231
8311
  X5T_256: "x5t#S256",
@@ -9114,7 +9194,7 @@ class CryptoProvider {
9114
9194
  */
9115
9195
  class NodeStorage extends CacheManager {
9116
9196
  constructor(logger, clientId, cryptoImpl, staticAuthorityOptions) {
9117
- super(clientId, cryptoImpl, logger, staticAuthorityOptions);
9197
+ super(clientId, cryptoImpl, logger, new msalCommon.StubPerformanceClient(), staticAuthorityOptions);
9118
9198
  this.cache = {};
9119
9199
  this.changeEmitters = [];
9120
9200
  this.logger = logger;
@@ -9597,7 +9677,7 @@ class TokenCache {
9597
9677
  /**
9598
9678
  * API that retrieves all accounts currently in cache to the user
9599
9679
  */
9600
- async getAllAccounts() {
9680
+ async getAllAccounts(correlationId = new CryptoProvider().createNewGuid()) {
9601
9681
  this.logger.trace("getAllAccounts called");
9602
9682
  let cacheContext;
9603
9683
  try {
@@ -9605,7 +9685,7 @@ class TokenCache {
9605
9685
  cacheContext = new TokenCacheContext(this, false);
9606
9686
  await this.persistence.beforeCacheAccess(cacheContext);
9607
9687
  }
9608
- return this.storage.getAllAccounts();
9688
+ return this.storage.getAllAccounts({}, correlationId);
9609
9689
  }
9610
9690
  finally {
9611
9691
  if (this.persistence && cacheContext) {
@@ -9647,7 +9727,7 @@ class TokenCache {
9647
9727
  * API to remove a specific account and the relevant data from cache
9648
9728
  * @param account - AccountInfo passed by the user
9649
9729
  */
9650
- async removeAccount(account) {
9730
+ async removeAccount(account, correlationId) {
9651
9731
  this.logger.trace("removeAccount called");
9652
9732
  let cacheContext;
9653
9733
  try {
@@ -9655,7 +9735,7 @@ class TokenCache {
9655
9735
  cacheContext = new TokenCacheContext(this, true);
9656
9736
  await this.persistence.beforeCacheAccess(cacheContext);
9657
9737
  }
9658
- await this.storage.removeAccount(AccountEntity.generateAccountCacheKey(account));
9738
+ this.storage.removeAccount(AccountEntity.generateAccountCacheKey(account), correlationId || new GuidGenerator().generateGuid());
9659
9739
  }
9660
9740
  finally {
9661
9741
  if (this.persistence && cacheContext) {
@@ -9952,7 +10032,7 @@ class ClientAssertion {
9952
10032
 
9953
10033
  /* eslint-disable header/header */
9954
10034
  const name = "@azure/msal-node";
9955
- const version = "3.6.0";
10035
+ const version = "3.6.2";
9956
10036
 
9957
10037
  /*
9958
10038
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -10938,7 +11018,7 @@ class PublicClientApplication extends ClientApplication {
10938
11018
  };
10939
11019
  await this.nativeBrokerPlugin.signOut(signoutRequest);
10940
11020
  }
10941
- await this.getTokenCache().removeAccount(request.account);
11021
+ await this.getTokenCache().removeAccount(request.account, request.correlationId);
10942
11022
  }
10943
11023
  /**
10944
11024
  * Returns all cached accounts for this application. If brokering is enabled this request will be serviced by the broker.
@@ -11042,7 +11122,7 @@ class ClientCredentialClient extends BaseClient {
11042
11122
  await clientConfiguration.persistencePlugin.beforeCacheAccess(cacheContext);
11043
11123
  }
11044
11124
  const cachedAccessToken = this.readAccessTokenFromCache(authority, managedIdentityConfiguration.managedIdentityId?.id ||
11045
- clientConfiguration.authOptions.clientId, new ScopeSet(request.scopes || []), cacheManager);
11125
+ clientConfiguration.authOptions.clientId, new ScopeSet(request.scopes || []), cacheManager, request.correlationId);
11046
11126
  if (clientConfiguration.serializableCache &&
11047
11127
  clientConfiguration.persistencePlugin &&
11048
11128
  cacheContext) {
@@ -11079,7 +11159,7 @@ class ClientCredentialClient extends BaseClient {
11079
11159
  /**
11080
11160
  * Reads access token from the cache
11081
11161
  */
11082
- readAccessTokenFromCache(authority, id, scopeSet, cacheManager) {
11162
+ readAccessTokenFromCache(authority, id, scopeSet, cacheManager, correlationId) {
11083
11163
  const accessTokenFilter = {
11084
11164
  homeAccountId: Constants$1.EMPTY_STRING,
11085
11165
  environment: authority.canonicalAuthorityUrlComponents.HostNameAndPort,
@@ -11088,7 +11168,7 @@ class ClientCredentialClient extends BaseClient {
11088
11168
  realm: authority.tenant,
11089
11169
  target: ScopeSet.createSearchScopes(scopeSet.asArray()),
11090
11170
  };
11091
- const accessTokens = cacheManager.getAccessTokensByFilter(accessTokenFilter);
11171
+ const accessTokens = cacheManager.getAccessTokensByFilter(accessTokenFilter, correlationId);
11092
11172
  if (accessTokens.length < 1) {
11093
11173
  return null;
11094
11174
  }
@@ -11241,7 +11321,7 @@ class OnBehalfOfClient extends BaseClient {
11241
11321
  throw createClientAuthError(tokenRefreshRequired);
11242
11322
  }
11243
11323
  // fetch the idToken from cache
11244
- const cachedIdToken = this.readIdTokenFromCacheForOBO(cachedAccessToken.homeAccountId);
11324
+ const cachedIdToken = this.readIdTokenFromCacheForOBO(cachedAccessToken.homeAccountId, request.correlationId);
11245
11325
  let idTokenClaims;
11246
11326
  let cachedAccount = null;
11247
11327
  if (cachedIdToken) {
@@ -11254,7 +11334,7 @@ class OnBehalfOfClient extends BaseClient {
11254
11334
  username: Constants$1.EMPTY_STRING,
11255
11335
  localAccountId: localAccountId || Constants$1.EMPTY_STRING,
11256
11336
  };
11257
- cachedAccount = this.cacheManager.readAccountFromCache(accountInfo);
11337
+ cachedAccount = this.cacheManager.readAccountFromCache(accountInfo, request.correlationId);
11258
11338
  }
11259
11339
  // increment telemetry cache hit counter
11260
11340
  if (this.config.serverTelemetryManager) {
@@ -11273,7 +11353,7 @@ class OnBehalfOfClient extends BaseClient {
11273
11353
  * Certain use cases of OBO flow do not expect an idToken in the cache/or from the service
11274
11354
  * @param atHomeAccountId - account id
11275
11355
  */
11276
- readIdTokenFromCacheForOBO(atHomeAccountId) {
11356
+ readIdTokenFromCacheForOBO(atHomeAccountId, correlationId) {
11277
11357
  const idTokenFilter = {
11278
11358
  homeAccountId: atHomeAccountId,
11279
11359
  environment: this.authority.canonicalAuthorityUrlComponents.HostNameAndPort,
@@ -11281,7 +11361,7 @@ class OnBehalfOfClient extends BaseClient {
11281
11361
  clientId: this.config.authOptions.clientId,
11282
11362
  realm: this.authority.tenant,
11283
11363
  };
11284
- const idTokenMap = this.cacheManager.getIdTokensByFilter(idTokenFilter);
11364
+ const idTokenMap = this.cacheManager.getIdTokensByFilter(idTokenFilter, correlationId);
11285
11365
  // When acquiring a token on behalf of an application, there might not be an id token in the cache
11286
11366
  if (Object.values(idTokenMap).length < 1) {
11287
11367
  return null;
@@ -11312,7 +11392,7 @@ class OnBehalfOfClient extends BaseClient {
11312
11392
  requestedClaimsHash: request.requestedClaimsHash,
11313
11393
  userAssertionHash: this.userAssertionHash,
11314
11394
  };
11315
- const accessTokens = this.cacheManager.getAccessTokensByFilter(accessTokenFilter);
11395
+ const accessTokens = this.cacheManager.getAccessTokensByFilter(accessTokenFilter, request.correlationId);
11316
11396
  const numAccessTokens = accessTokens.length;
11317
11397
  if (numAccessTokens < 1) {
11318
11398
  return null;
@@ -12408,6 +12488,7 @@ class ServiceFabric extends BaseManagedIdentitySource {
12408
12488
  * Licensed under the MIT License.
12409
12489
  */
12410
12490
  const MACHINE_LEARNING_MSI_API_VERSION = "2017-09-01";
12491
+ const MANAGED_IDENTITY_MACHINE_LEARNING_UNSUPPORTED_ID_TYPE_ERROR = `Only client id is supported for user-assigned managed identity in ${ManagedIdentitySourceNames.MACHINE_LEARNING}.`; // referenced in unit test
12411
12492
  class MachineLearning extends BaseManagedIdentitySource {
12412
12493
  constructor(logger, nodeStorage, networkClient, cryptoProvider, disableInternalRetries, msiEndpoint, secret) {
12413
12494
  super(logger, nodeStorage, networkClient, cryptoProvider, disableInternalRetries);
@@ -12439,11 +12520,19 @@ class MachineLearning extends BaseManagedIdentitySource {
12439
12520
  MACHINE_LEARNING_MSI_API_VERSION;
12440
12521
  request.queryParameters[ManagedIdentityQueryParameters.RESOURCE] =
12441
12522
  resource;
12442
- if (managedIdentityId.idType !== ManagedIdentityIdType.SYSTEM_ASSIGNED) {
12523
+ if (managedIdentityId.idType === ManagedIdentityIdType.SYSTEM_ASSIGNED) {
12524
+ request.queryParameters[ManagedIdentityUserAssignedIdQueryParameterNames.MANAGED_IDENTITY_CLIENT_ID_2017] = process.env[ManagedIdentityEnvironmentVariableNames
12525
+ .DEFAULT_IDENTITY_CLIENT_ID]; // this environment variable is always set in an Azure Machine Learning source
12526
+ }
12527
+ else if (managedIdentityId.idType ===
12528
+ ManagedIdentityIdType.USER_ASSIGNED_CLIENT_ID) {
12443
12529
  request.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(managedIdentityId.idType, false, // isIMDS
12444
12530
  true // uses2017API
12445
12531
  )] = managedIdentityId.id;
12446
12532
  }
12533
+ else {
12534
+ throw new Error(MANAGED_IDENTITY_MACHINE_LEARNING_UNSUPPORTED_ID_TYPE_ERROR);
12535
+ }
12447
12536
  // bodyParameters calculated in BaseManagedIdentity.acquireTokenWithManagedIdentity
12448
12537
  return request;
12449
12538
  }