@azure/msal-node 5.1.1 → 5.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/cache/CacheHelpers.mjs +1 -1
  2. package/dist/cache/NodeStorage.mjs +1 -1
  3. package/dist/cache/TokenCache.mjs +1 -1
  4. package/dist/cache/distributed/DistributedCachePlugin.mjs +1 -1
  5. package/dist/cache/serializer/Deserializer.mjs +1 -1
  6. package/dist/cache/serializer/Serializer.mjs +1 -1
  7. package/dist/client/BaseClient.mjs +1 -1
  8. package/dist/client/ClientApplication.mjs +1 -1
  9. package/dist/client/ClientAssertion.mjs +1 -1
  10. package/dist/client/ClientCredentialClient.mjs +1 -1
  11. package/dist/client/ConfidentialClientApplication.mjs +1 -1
  12. package/dist/client/DeviceCodeClient.mjs +1 -1
  13. package/dist/client/ManagedIdentityApplication.mjs +1 -1
  14. package/dist/client/ManagedIdentityClient.mjs +1 -1
  15. package/dist/client/ManagedIdentitySources/AppService.mjs +1 -1
  16. package/dist/client/ManagedIdentitySources/AzureArc.mjs +1 -1
  17. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.mjs +1 -1
  18. package/dist/client/ManagedIdentitySources/CloudShell.mjs +1 -1
  19. package/dist/client/ManagedIdentitySources/Imds.mjs +1 -1
  20. package/dist/client/ManagedIdentitySources/MachineLearning.mjs +1 -1
  21. package/dist/client/ManagedIdentitySources/ServiceFabric.mjs +1 -1
  22. package/dist/client/OnBehalfOfClient.mjs +1 -1
  23. package/dist/client/PublicClientApplication.mjs +1 -1
  24. package/dist/client/UsernamePasswordClient.mjs +1 -1
  25. package/dist/config/Configuration.mjs +1 -1
  26. package/dist/config/ManagedIdentityId.mjs +1 -1
  27. package/dist/config/ManagedIdentityRequestParameters.mjs +1 -1
  28. package/dist/crypto/CryptoProvider.mjs +1 -1
  29. package/dist/crypto/GuidGenerator.mjs +1 -1
  30. package/dist/crypto/HashUtils.mjs +1 -1
  31. package/dist/crypto/PkceGenerator.mjs +1 -1
  32. package/dist/error/ClientAuthErrorCodes.mjs +1 -1
  33. package/dist/error/ManagedIdentityError.mjs +1 -1
  34. package/dist/error/ManagedIdentityErrorCodes.mjs +1 -1
  35. package/dist/error/NodeAuthError.mjs +1 -1
  36. package/dist/index.mjs +1 -1
  37. package/dist/internals.mjs +1 -1
  38. package/dist/network/HttpClient.mjs +1 -1
  39. package/dist/network/HttpClientWithRetries.mjs +1 -1
  40. package/dist/network/LoopbackClient.mjs +1 -1
  41. package/dist/packageMetadata.d.ts +1 -1
  42. package/dist/packageMetadata.mjs +2 -2
  43. package/dist/protocol/Authorize.mjs +1 -1
  44. package/dist/retry/DefaultManagedIdentityRetryPolicy.mjs +1 -1
  45. package/dist/retry/ExponentialRetryStrategy.mjs +1 -1
  46. package/dist/retry/ImdsRetryPolicy.mjs +1 -1
  47. package/dist/retry/LinearRetryStrategy.mjs +1 -1
  48. package/dist/utils/Constants.mjs +1 -1
  49. package/dist/utils/EncodingUtils.mjs +1 -1
  50. package/dist/utils/TimeUtils.mjs +1 -1
  51. package/lib/msal-node.cjs +557 -551
  52. package/lib/msal-node.cjs.map +1 -1
  53. package/lib/types/packageMetadata.d.ts +1 -1
  54. package/package.json +2 -2
  55. package/src/packageMetadata.ts +1 -1
package/lib/msal-node.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v5.1.1 2026-03-18 */
1
+ /*! @azure/msal-node v5.1.3 2026-04-16 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
@@ -150,7 +150,7 @@ class Serializer {
150
150
  }
151
151
  }
152
152
 
153
- /*! @azure/msal-common v16.4.0 2026-03-18 */
153
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
154
154
  /*
155
155
  * Copyright (c) Microsoft Corporation. All rights reserved.
156
156
  * Licensed under the MIT License.
@@ -398,7 +398,7 @@ const EncodingTypes = {
398
398
  UTF8: "utf-8",
399
399
  };
400
400
 
401
- /*! @azure/msal-common v16.4.0 2026-03-18 */
401
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
402
402
  /*
403
403
  * Copyright (c) Microsoft Corporation. All rights reserved.
404
404
  * Licensed under the MIT License.
@@ -451,7 +451,7 @@ const INSTANCE_AWARE = "instance_aware";
451
451
  const RESOURCE = "resource";
452
452
  const CLI_DATA = "clidata";
453
453
 
454
- /*! @azure/msal-common v16.4.0 2026-03-18 */
454
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
455
455
  /*
456
456
  * Copyright (c) Microsoft Corporation. All rights reserved.
457
457
  * Licensed under the MIT License.
@@ -482,7 +482,7 @@ function createAuthError(code, additionalMessage) {
482
482
  return new AuthError(code, additionalMessage || getDefaultErrorMessage(code));
483
483
  }
484
484
 
485
- /*! @azure/msal-common v16.4.0 2026-03-18 */
485
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
486
486
 
487
487
  /*
488
488
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -502,7 +502,7 @@ function createClientConfigurationError(errorCode) {
502
502
  return new ClientConfigurationError(errorCode);
503
503
  }
504
504
 
505
- /*! @azure/msal-common v16.4.0 2026-03-18 */
505
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
506
506
  /*
507
507
  * Copyright (c) Microsoft Corporation. All rights reserved.
508
508
  * Licensed under the MIT License.
@@ -582,7 +582,7 @@ class StringUtils {
582
582
  }
583
583
  }
584
584
 
585
- /*! @azure/msal-common v16.4.0 2026-03-18 */
585
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
586
586
 
587
587
  /*
588
588
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -605,7 +605,7 @@ function createClientAuthError(errorCode, additionalMessage) {
605
605
  return new ClientAuthError(errorCode, additionalMessage);
606
606
  }
607
607
 
608
- /*! @azure/msal-common v16.4.0 2026-03-18 */
608
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
609
609
  /*
610
610
  * Copyright (c) Microsoft Corporation. All rights reserved.
611
611
  * Licensed under the MIT License.
@@ -659,7 +659,7 @@ var ClientConfigurationErrorCodes = /*#__PURE__*/Object.freeze({
659
659
  urlParseError: urlParseError
660
660
  });
661
661
 
662
- /*! @azure/msal-common v16.4.0 2026-03-18 */
662
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
663
663
  /*
664
664
  * Copyright (c) Microsoft Corporation. All rights reserved.
665
665
  * Licensed under the MIT License.
@@ -747,7 +747,7 @@ var ClientAuthErrorCodes = /*#__PURE__*/Object.freeze({
747
747
  userCanceled: userCanceled
748
748
  });
749
749
 
750
- /*! @azure/msal-common v16.4.0 2026-03-18 */
750
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
751
751
 
752
752
  /*
753
753
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -942,7 +942,7 @@ class ScopeSet {
942
942
  }
943
943
  }
944
944
 
945
- /*! @azure/msal-common v16.4.0 2026-03-18 */
945
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
946
946
 
947
947
  /*
948
948
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1057,18 +1057,29 @@ function addSid(parameters, sid) {
1057
1057
  parameters.set(SID, sid);
1058
1058
  }
1059
1059
  /**
1060
- * add claims
1061
- * @param claims
1062
- */
1063
- function addClaims(parameters, claims, clientCapabilities) {
1064
- const mergedClaims = addClientCapabilitiesToClaims(claims, clientCapabilities);
1065
- try {
1066
- JSON.parse(mergedClaims);
1067
- }
1068
- catch (e) {
1069
- throw createClientConfigurationError(invalidClaims);
1060
+ * Adds claims to request parameters, conditionally excluding clientCapabilities
1061
+ * when skipBrokerClaims is true and a brokered flow is in effect.
1062
+ * @param parameters - The request parameters map
1063
+ * @param claims - The claims string from the request
1064
+ * @param clientCapabilities - The client capabilities from configuration
1065
+ * @param skipBrokerClaims - When true and BROKER_CLIENT_ID is present, excludes clientCapabilities from claims
1066
+ */
1067
+ function addClaims(parameters, claims, clientCapabilities, skipBrokerClaims) {
1068
+ // Skip clientCapabilities if skipBrokerClaims is set to true and this is a brokered authentication flow
1069
+ const configClaims = skipBrokerClaims && parameters.has(BROKER_CLIENT_ID)
1070
+ ? undefined
1071
+ : clientCapabilities;
1072
+ if (!StringUtils.isEmptyObj(claims) ||
1073
+ (configClaims && configClaims.length > 0)) {
1074
+ const mergedClaims = addClientCapabilitiesToClaims(claims, configClaims);
1075
+ try {
1076
+ JSON.parse(mergedClaims);
1077
+ }
1078
+ catch (e) {
1079
+ throw createClientConfigurationError(invalidClaims);
1080
+ }
1081
+ parameters.set(CLAIMS, mergedClaims);
1070
1082
  }
1071
- parameters.set(CLAIMS, mergedClaims);
1072
1083
  }
1073
1084
  /**
1074
1085
  * add correlationId
@@ -1338,7 +1349,7 @@ function addResource(parameters, resource) {
1338
1349
  }
1339
1350
  }
1340
1351
 
1341
- /*! @azure/msal-common v16.4.0 2026-03-18 */
1352
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
1342
1353
  /**
1343
1354
  * Parses hash string from given string. Returns empty string if no hash symbol is found.
1344
1355
  * @param hashString
@@ -1391,7 +1402,7 @@ function mapToQueryString(parameters) {
1391
1402
  return queryParameterArray.join("&");
1392
1403
  }
1393
1404
 
1394
- /*! @azure/msal-common v16.4.0 2026-03-18 */
1405
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
1395
1406
 
1396
1407
  /*
1397
1408
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1430,7 +1441,7 @@ const DEFAULT_CRYPTO_IMPLEMENTATION = {
1430
1441
  },
1431
1442
  };
1432
1443
 
1433
- /*! @azure/msal-common v16.4.0 2026-03-18 */
1444
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
1434
1445
  /*
1435
1446
  * Copyright (c) Microsoft Corporation. All rights reserved.
1436
1447
  * Licensed under the MIT License.
@@ -1691,12 +1702,12 @@ class Logger {
1691
1702
  }
1692
1703
  }
1693
1704
 
1694
- /*! @azure/msal-common v16.4.0 2026-03-18 */
1705
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
1695
1706
  /* eslint-disable header/header */
1696
1707
  const name$1 = "@azure/msal-common";
1697
- const version$1 = "16.4.0";
1708
+ const version$1 = "16.5.0";
1698
1709
 
1699
- /*! @azure/msal-common v16.4.0 2026-03-18 */
1710
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
1700
1711
  /*
1701
1712
  * Copyright (c) Microsoft Corporation. All rights reserved.
1702
1713
  * Licensed under the MIT License.
@@ -1716,7 +1727,7 @@ const AzureCloudInstance = {
1716
1727
  AzureUsGovernment: "https://login.microsoftonline.us",
1717
1728
  };
1718
1729
 
1719
- /*! @azure/msal-common v16.4.0 2026-03-18 */
1730
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
1720
1731
  /*
1721
1732
  * Copyright (c) Microsoft Corporation. All rights reserved.
1722
1733
  * Licensed under the MIT License.
@@ -1798,7 +1809,7 @@ function updateAccountTenantProfileData(baseAccountInfo, tenantProfile, idTokenC
1798
1809
  return updatedAccountInfo;
1799
1810
  }
1800
1811
 
1801
- /*! @azure/msal-common v16.4.0 2026-03-18 */
1812
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
1802
1813
 
1803
1814
  /*
1804
1815
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1878,7 +1889,7 @@ function checkMaxAge(authTime, maxAge) {
1878
1889
  }
1879
1890
  }
1880
1891
 
1881
- /*! @azure/msal-common v16.4.0 2026-03-18 */
1892
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
1882
1893
 
1883
1894
  /*
1884
1895
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2035,7 +2046,7 @@ class UrlString {
2035
2046
  }
2036
2047
  }
2037
2048
 
2038
- /*! @azure/msal-common v16.4.0 2026-03-18 */
2049
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
2039
2050
 
2040
2051
  /*
2041
2052
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2192,7 +2203,7 @@ function getCloudDiscoveryMetadataFromNetworkResponse(response, authorityHost) {
2192
2203
  return null;
2193
2204
  }
2194
2205
 
2195
- /*! @azure/msal-common v16.4.0 2026-03-18 */
2206
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
2196
2207
  /*
2197
2208
  * Copyright (c) Microsoft Corporation. All rights reserved.
2198
2209
  * Licensed under the MIT License.
@@ -2200,7 +2211,7 @@ function getCloudDiscoveryMetadataFromNetworkResponse(response, authorityHost) {
2200
2211
  const cacheQuotaExceeded = "cache_quota_exceeded";
2201
2212
  const cacheErrorUnknown = "cache_error_unknown";
2202
2213
 
2203
- /*! @azure/msal-common v16.4.0 2026-03-18 */
2214
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
2204
2215
 
2205
2216
  /*
2206
2217
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2238,7 +2249,7 @@ function createCacheError(e) {
2238
2249
  }
2239
2250
  }
2240
2251
 
2241
- /*! @azure/msal-common v16.4.0 2026-03-18 */
2252
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
2242
2253
 
2243
2254
  /*
2244
2255
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2276,7 +2287,7 @@ function buildClientInfoFromHomeAccountId(homeAccountId) {
2276
2287
  };
2277
2288
  }
2278
2289
 
2279
- /*! @azure/msal-common v16.4.0 2026-03-18 */
2290
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
2280
2291
  /*
2281
2292
  * Copyright (c) Microsoft Corporation. All rights reserved.
2282
2293
  * Licensed under the MIT License.
@@ -2291,7 +2302,7 @@ const AuthorityType = {
2291
2302
  Ciam: 3,
2292
2303
  };
2293
2304
 
2294
- /*! @azure/msal-common v16.4.0 2026-03-18 */
2305
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
2295
2306
  /*
2296
2307
  * Copyright (c) Microsoft Corporation. All rights reserved.
2297
2308
  * Licensed under the MIT License.
@@ -2313,7 +2324,7 @@ function getTenantIdFromIdTokenClaims(idTokenClaims) {
2313
2324
  return null;
2314
2325
  }
2315
2326
 
2316
- /*! @azure/msal-common v16.4.0 2026-03-18 */
2327
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
2317
2328
  /*
2318
2329
  * Copyright (c) Microsoft Corporation. All rights reserved.
2319
2330
  * Licensed under the MIT License.
@@ -2337,7 +2348,7 @@ const ProtocolMode = {
2337
2348
  EAR: "EAR",
2338
2349
  };
2339
2350
 
2340
- /*! @azure/msal-common v16.4.0 2026-03-18 */
2351
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
2341
2352
  /**
2342
2353
  * Returns the AccountInfo interface for this account.
2343
2354
  */
@@ -2480,7 +2491,7 @@ function isAccountEntity(entity) {
2480
2491
  entity.hasOwnProperty("authorityType"));
2481
2492
  }
2482
2493
 
2483
- /*! @azure/msal-common v16.4.0 2026-03-18 */
2494
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
2484
2495
 
2485
2496
  /*
2486
2497
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3581,7 +3592,7 @@ class DefaultStorageClass extends CacheManager {
3581
3592
  }
3582
3593
  }
3583
3594
 
3584
- /*! @azure/msal-common v16.4.0 2026-03-18 */
3595
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
3585
3596
  /*
3586
3597
  * Copyright (c) Microsoft Corporation. All rights reserved.
3587
3598
  * Licensed under the MIT License.
@@ -3595,7 +3606,7 @@ class DefaultStorageClass extends CacheManager {
3595
3606
  const PerformanceEventStatus = {
3596
3607
  InProgress: 1};
3597
3608
 
3598
- /*! @azure/msal-common v16.4.0 2026-03-18 */
3609
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
3599
3610
 
3600
3611
  /*
3601
3612
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3650,7 +3661,7 @@ class StubPerformanceClient {
3650
3661
  }
3651
3662
  }
3652
3663
 
3653
- /*! @azure/msal-common v16.4.0 2026-03-18 */
3664
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
3654
3665
 
3655
3666
  /*
3656
3667
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3745,190 +3756,34 @@ function isOidcProtocolMode(config) {
3745
3756
  return (config.authOptions.authority.options.protocolMode === ProtocolMode.OIDC);
3746
3757
  }
3747
3758
 
3748
- /*! @azure/msal-common v16.4.0 2026-03-18 */
3749
-
3750
- /*
3751
- * Copyright (c) Microsoft Corporation. All rights reserved.
3752
- * Licensed under the MIT License.
3753
- */
3754
- /**
3755
- * Error thrown when there is an error with the server code, for example, unavailability.
3756
- */
3757
- class ServerError extends AuthError {
3758
- constructor(errorCode, errorMessage, subError, errorNo, status) {
3759
- super(errorCode, errorMessage, subError);
3760
- this.name = "ServerError";
3761
- this.errorNo = errorNo;
3762
- this.status = status;
3763
- Object.setPrototypeOf(this, ServerError.prototype);
3764
- }
3765
- }
3766
-
3767
- /*! @azure/msal-common v16.4.0 2026-03-18 */
3768
- /*
3769
- * Copyright (c) Microsoft Corporation. All rights reserved.
3770
- * Licensed under the MIT License.
3771
- */
3772
- /**
3773
- * MSAL-defined interaction required error code indicating no tokens are found in cache.
3774
- * @public
3775
- */
3776
- const noTokensFound = "no_tokens_found";
3777
- /**
3778
- * MSAL-defined error code indicating a native account is unavailable on the platform.
3779
- * @public
3780
- */
3781
- const nativeAccountUnavailable = "native_account_unavailable";
3782
- /**
3783
- * MSAL-defined error code indicating the refresh token has expired and user interaction is needed.
3784
- * @public
3785
- */
3786
- const refreshTokenExpired = "refresh_token_expired";
3787
- /**
3788
- * MSAL-defined error code indicating UI/UX is not allowed (e.g., blocked by policy), requiring alternate interaction.
3789
- * @public
3790
- */
3791
- const uxNotAllowed = "ux_not_allowed";
3792
- /**
3793
- * Server-originated error code indicating interaction is required to complete the request.
3794
- * @public
3795
- */
3796
- const interactionRequired = "interaction_required";
3797
- /**
3798
- * Server-originated error code indicating user consent is required.
3799
- * @public
3800
- */
3801
- const consentRequired = "consent_required";
3802
- /**
3803
- * Server-originated error code indicating user login is required.
3804
- * @public
3805
- */
3806
- const loginRequired = "login_required";
3807
- /**
3808
- * Server-originated error code indicating the token is invalid or corrupted.
3809
- * @public
3810
- */
3811
- const badToken = "bad_token";
3812
- /**
3813
- * Server-originated error code indicating the user is in an interrupted state and interaction is required.
3814
- * @public
3815
- */
3816
- const interruptedUser = "interrupted_user";
3817
-
3818
- var InteractionRequiredAuthErrorCodes = /*#__PURE__*/Object.freeze({
3819
- __proto__: null,
3820
- badToken: badToken,
3821
- consentRequired: consentRequired,
3822
- interactionRequired: interactionRequired,
3823
- interruptedUser: interruptedUser,
3824
- loginRequired: loginRequired,
3825
- nativeAccountUnavailable: nativeAccountUnavailable,
3826
- noTokensFound: noTokensFound,
3827
- refreshTokenExpired: refreshTokenExpired,
3828
- uxNotAllowed: uxNotAllowed
3829
- });
3830
-
3831
- /*! @azure/msal-common v16.4.0 2026-03-18 */
3832
-
3759
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
3833
3760
  /*
3834
3761
  * Copyright (c) Microsoft Corporation. All rights reserved.
3835
3762
  * Licensed under the MIT License.
3836
3763
  */
3837
3764
  /**
3838
- * InteractionRequiredServerErrorMessage contains string constants used by error codes and messages returned by the server indicating interaction is required
3839
- */
3840
- const InteractionRequiredServerErrorMessage = [
3841
- interactionRequired,
3842
- consentRequired,
3843
- loginRequired,
3844
- badToken,
3845
- uxNotAllowed,
3846
- interruptedUser,
3847
- ];
3848
- const InteractionRequiredAuthSubErrorMessage = [
3849
- "message_only",
3850
- "additional_action",
3851
- "basic_action",
3852
- "user_password_expired",
3853
- "consent_required",
3854
- "bad_token",
3855
- "ux_not_allowed",
3856
- "interrupted_user",
3857
- ];
3858
- /**
3859
- * Error thrown when user interaction is required.
3860
- */
3861
- class InteractionRequiredAuthError extends AuthError {
3862
- constructor(errorCode, errorMessage, subError, timestamp, traceId, correlationId, claims, errorNo) {
3863
- super(errorCode, errorMessage, subError);
3864
- Object.setPrototypeOf(this, InteractionRequiredAuthError.prototype);
3865
- this.timestamp = timestamp || "";
3866
- this.traceId = traceId || "";
3867
- this.correlationId = correlationId || "";
3868
- this.claims = claims || "";
3869
- this.name = "InteractionRequiredAuthError";
3870
- this.errorNo = errorNo;
3871
- }
3872
- }
3873
- /**
3874
- * Helper function used to determine if an error thrown by the server requires interaction to resolve
3875
- * @param errorCode
3876
- * @param errorString
3877
- * @param subError
3878
- */
3879
- function isInteractionRequiredError(errorCode, errorString, subError) {
3880
- const isInteractionRequiredErrorCode = !!errorCode &&
3881
- InteractionRequiredServerErrorMessage.indexOf(errorCode) > -1;
3882
- const isInteractionRequiredSubError = !!subError &&
3883
- InteractionRequiredAuthSubErrorMessage.indexOf(subError) > -1;
3884
- const isInteractionRequiredErrorDesc = !!errorString &&
3885
- InteractionRequiredServerErrorMessage.some((irErrorCode) => {
3886
- return errorString.indexOf(irErrorCode) > -1;
3887
- });
3888
- return (isInteractionRequiredErrorCode ||
3889
- isInteractionRequiredErrorDesc ||
3890
- isInteractionRequiredSubError);
3891
- }
3892
- /**
3893
- * Creates an InteractionRequiredAuthError
3894
- */
3895
- function createInteractionRequiredAuthError(errorCode, errorMessage) {
3896
- return new InteractionRequiredAuthError(errorCode, errorMessage);
3897
- }
3898
-
3899
- /*! @azure/msal-common v16.4.0 2026-03-18 */
3900
- /**
3901
- * Parses the state into the RequestStateObject, which contains the LibraryState info and the state passed by the user.
3902
- * @param base64Decode
3903
- * @param state
3904
- */
3905
- function parseRequestState(base64Decode, state) {
3906
- if (!base64Decode) {
3907
- throw createClientAuthError(noCryptoObject);
3908
- }
3909
- if (!state) {
3910
- throw createClientAuthError(invalidState);
3765
+ * This class instance helps track the memory changes facilitating
3766
+ * decisions to read from and write to the persistent cache
3767
+ */ class TokenCacheContext {
3768
+ constructor(tokenCache, hasChanged) {
3769
+ this.cache = tokenCache;
3770
+ this.hasChanged = hasChanged;
3911
3771
  }
3912
- try {
3913
- // Split the state between library state and user passed state and decode them separately
3914
- const splitState = state.split(RESOURCE_DELIM);
3915
- const libraryState = splitState[0];
3916
- const userState = splitState.length > 1
3917
- ? splitState.slice(1).join(RESOURCE_DELIM)
3918
- : "";
3919
- const libraryStateString = base64Decode(libraryState);
3920
- const libraryStateObj = JSON.parse(libraryStateString);
3921
- return {
3922
- userRequestState: userState || "",
3923
- libraryState: libraryStateObj,
3924
- };
3772
+ /**
3773
+ * boolean which indicates the changes in cache
3774
+ */
3775
+ get cacheHasChanged() {
3776
+ return this.hasChanged;
3925
3777
  }
3926
- catch (e) {
3927
- throw createClientAuthError(invalidState);
3778
+ /**
3779
+ * function to retrieve the token cache
3780
+ */
3781
+ get tokenCache() {
3782
+ return this.cache;
3928
3783
  }
3929
3784
  }
3930
3785
 
3931
- /*! @azure/msal-common v16.4.0 2026-03-18 */
3786
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
3932
3787
  /*
3933
3788
  * Copyright (c) Microsoft Corporation. All rights reserved.
3934
3789
  * Licensed under the MIT License.
@@ -3983,50 +3838,309 @@ function delay(t, value) {
3983
3838
  return new Promise((resolve) => setTimeout(() => resolve(value), t));
3984
3839
  }
3985
3840
 
3986
- /*! @azure/msal-common v16.4.0 2026-03-18 */
3841
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
3842
+
3987
3843
  /*
3988
3844
  * Copyright (c) Microsoft Corporation. All rights reserved.
3989
3845
  * Licensed under the MIT License.
3990
3846
  */
3991
3847
  /**
3992
- * Time spent sending/waiting for the response of a request to the token endpoint
3993
- */
3994
- const NetworkClientSendPostRequestAsync = "networkClientSendPostRequestAsync";
3995
- const RefreshTokenClientExecutePostToTokenEndpoint = "refreshTokenClientExecutePostToTokenEndpoint";
3996
- const AuthorizationCodeClientExecutePostToTokenEndpoint = "authorizationCodeClientExecutePostToTokenEndpoint";
3997
- /**
3998
- * Time spent on the network for refresh token acquisition
3999
- */
4000
- const RefreshTokenClientExecuteTokenRequest = "refreshTokenClientExecuteTokenRequest";
4001
- /**
4002
- * Time taken for acquiring refresh token , records RT size
4003
- */
4004
- const RefreshTokenClientAcquireToken = "refreshTokenClientAcquireToken";
4005
- /**
4006
- * Time taken for acquiring cached refresh token
4007
- */
4008
- const RefreshTokenClientAcquireTokenWithCachedRefreshToken = "refreshTokenClientAcquireTokenWithCachedRefreshToken";
4009
- /**
4010
- * Helper function to create token request body in RefreshTokenClient (msal-common).
4011
- */
4012
- const RefreshTokenClientCreateTokenRequestBody = "refreshTokenClientCreateTokenRequestBody";
4013
- const SilentFlowClientGenerateResultFromCacheRecord = "silentFlowClientGenerateResultFromCacheRecord";
4014
- /**
4015
- * APIs in Authorization Code Client (msal-common)
4016
- */
4017
- const AuthClientExecuteTokenRequest = "authClientExecuteTokenRequest";
4018
- const AuthClientCreateTokenRequestBody = "authClientCreateTokenRequestBody";
4019
- const UpdateTokenEndpointAuthority = "updateTokenEndpointAuthority";
4020
- /**
4021
- * Generate functions in PopTokenGenerator (msal-common)
3848
+ * Create IdTokenEntity
3849
+ * @param homeAccountId
3850
+ * @param authenticationResult
3851
+ * @param clientId
3852
+ * @param authority
4022
3853
  */
4023
- const PopTokenGenerateCnf = "popTokenGenerateCnf";
3854
+ function createIdTokenEntity(homeAccountId, environment, idToken, clientId, tenantId) {
3855
+ const idTokenEntity = {
3856
+ credentialType: CredentialType.ID_TOKEN,
3857
+ homeAccountId: homeAccountId,
3858
+ environment: environment,
3859
+ clientId: clientId,
3860
+ secret: idToken,
3861
+ realm: tenantId,
3862
+ lastUpdatedAt: Date.now().toString(), // Set the last updated time to now
3863
+ };
3864
+ return idTokenEntity;
3865
+ }
4024
3866
  /**
4025
- * handleServerTokenResponse API in ResponseHandler (msal-common)
3867
+ * Create AccessTokenEntity
3868
+ * @param homeAccountId
3869
+ * @param environment
3870
+ * @param accessToken
3871
+ * @param clientId
3872
+ * @param tenantId
3873
+ * @param scopes
3874
+ * @param expiresOn
3875
+ * @param extExpiresOn
4026
3876
  */
4027
- const HandleServerTokenResponse = "handleServerTokenResponse";
4028
- /**
4029
- * Authority functions
3877
+ function createAccessTokenEntity(homeAccountId, environment, accessToken, clientId, tenantId, scopes, expiresOn, extExpiresOn, base64Decode, refreshOn, tokenType, userAssertionHash, keyId) {
3878
+ const atEntity = {
3879
+ homeAccountId: homeAccountId,
3880
+ credentialType: CredentialType.ACCESS_TOKEN,
3881
+ secret: accessToken,
3882
+ cachedAt: nowSeconds().toString(),
3883
+ expiresOn: expiresOn.toString(),
3884
+ extendedExpiresOn: extExpiresOn.toString(),
3885
+ environment: environment,
3886
+ clientId: clientId,
3887
+ realm: tenantId,
3888
+ target: scopes,
3889
+ tokenType: tokenType || AuthenticationScheme.BEARER,
3890
+ lastUpdatedAt: Date.now().toString(), // Set the last updated time to now
3891
+ };
3892
+ if (userAssertionHash) {
3893
+ atEntity.userAssertionHash = userAssertionHash;
3894
+ }
3895
+ if (refreshOn) {
3896
+ atEntity.refreshOn = refreshOn.toString();
3897
+ }
3898
+ /*
3899
+ * Create Access Token With Auth Scheme instead of regular access token
3900
+ * Cast to lower to handle "bearer" from ADFS
3901
+ */
3902
+ if (atEntity.tokenType?.toLowerCase() !==
3903
+ AuthenticationScheme.BEARER.toLowerCase()) {
3904
+ atEntity.credentialType =
3905
+ CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME;
3906
+ switch (atEntity.tokenType) {
3907
+ case AuthenticationScheme.POP:
3908
+ // Make sure keyId is present and add it to credential
3909
+ const tokenClaims = extractTokenClaims(accessToken, base64Decode);
3910
+ if (!tokenClaims?.cnf?.kid) {
3911
+ throw createClientAuthError(tokenClaimsCnfRequiredForSignedJwt);
3912
+ }
3913
+ atEntity.keyId = tokenClaims.cnf.kid;
3914
+ break;
3915
+ case AuthenticationScheme.SSH:
3916
+ atEntity.keyId = keyId;
3917
+ }
3918
+ }
3919
+ return atEntity;
3920
+ }
3921
+ /**
3922
+ * Create RefreshTokenEntity
3923
+ * @param homeAccountId
3924
+ * @param authenticationResult
3925
+ * @param clientId
3926
+ * @param authority
3927
+ */
3928
+ function createRefreshTokenEntity(homeAccountId, environment, refreshToken, clientId, familyId, userAssertionHash, expiresOn) {
3929
+ const rtEntity = {
3930
+ credentialType: CredentialType.REFRESH_TOKEN,
3931
+ homeAccountId: homeAccountId,
3932
+ environment: environment,
3933
+ clientId: clientId,
3934
+ secret: refreshToken,
3935
+ lastUpdatedAt: Date.now().toString(),
3936
+ };
3937
+ if (userAssertionHash) {
3938
+ rtEntity.userAssertionHash = userAssertionHash;
3939
+ }
3940
+ if (familyId) {
3941
+ rtEntity.familyId = familyId;
3942
+ }
3943
+ if (expiresOn) {
3944
+ rtEntity.expiresOn = expiresOn.toString();
3945
+ }
3946
+ return rtEntity;
3947
+ }
3948
+ function isCredentialEntity(entity) {
3949
+ return (entity.hasOwnProperty("homeAccountId") &&
3950
+ entity.hasOwnProperty("environment") &&
3951
+ entity.hasOwnProperty("credentialType") &&
3952
+ entity.hasOwnProperty("clientId") &&
3953
+ entity.hasOwnProperty("secret"));
3954
+ }
3955
+ /**
3956
+ * Validates an entity: checks for all expected params
3957
+ * @param entity
3958
+ */
3959
+ function isAccessTokenEntity(entity) {
3960
+ if (!entity) {
3961
+ return false;
3962
+ }
3963
+ return (isCredentialEntity(entity) &&
3964
+ entity.hasOwnProperty("realm") &&
3965
+ entity.hasOwnProperty("target") &&
3966
+ (entity["credentialType"] === CredentialType.ACCESS_TOKEN ||
3967
+ entity["credentialType"] ===
3968
+ CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME));
3969
+ }
3970
+ /**
3971
+ * Validates an entity: checks for all expected params
3972
+ * @param entity
3973
+ */
3974
+ function isIdTokenEntity(entity) {
3975
+ if (!entity) {
3976
+ return false;
3977
+ }
3978
+ return (isCredentialEntity(entity) &&
3979
+ entity.hasOwnProperty("realm") &&
3980
+ entity["credentialType"] === CredentialType.ID_TOKEN);
3981
+ }
3982
+ /**
3983
+ * Validates an entity: checks for all expected params
3984
+ * @param entity
3985
+ */
3986
+ function isRefreshTokenEntity(entity) {
3987
+ if (!entity) {
3988
+ return false;
3989
+ }
3990
+ return (isCredentialEntity(entity) &&
3991
+ entity["credentialType"] === CredentialType.REFRESH_TOKEN);
3992
+ }
3993
+ /**
3994
+ * validates if a given cache entry is "Telemetry", parses <key,value>
3995
+ * @param key
3996
+ * @param entity
3997
+ */
3998
+ function isServerTelemetryEntity(key, entity) {
3999
+ const validateKey = key.indexOf(SERVER_TELEM_CACHE_KEY) === 0;
4000
+ let validateEntity = true;
4001
+ if (entity) {
4002
+ validateEntity =
4003
+ entity.hasOwnProperty("failedRequests") &&
4004
+ entity.hasOwnProperty("errors") &&
4005
+ entity.hasOwnProperty("cacheHits");
4006
+ }
4007
+ return validateKey && validateEntity;
4008
+ }
4009
+ /**
4010
+ * validates if a given cache entry is "Throttling", parses <key,value>
4011
+ * @param key
4012
+ * @param entity
4013
+ */
4014
+ function isThrottlingEntity(key, entity) {
4015
+ let validateKey = false;
4016
+ if (key) {
4017
+ validateKey = key.indexOf(THROTTLING_PREFIX) === 0;
4018
+ }
4019
+ let validateEntity = true;
4020
+ if (entity) {
4021
+ validateEntity = entity.hasOwnProperty("throttleTime");
4022
+ }
4023
+ return validateKey && validateEntity;
4024
+ }
4025
+ /**
4026
+ * Generate AppMetadata Cache Key as per the schema: appmetadata-<environment>-<client_id>
4027
+ */
4028
+ function generateAppMetadataKey({ environment, clientId, }) {
4029
+ const appMetaDataKeyArray = [
4030
+ APP_METADATA,
4031
+ environment,
4032
+ clientId,
4033
+ ];
4034
+ return appMetaDataKeyArray
4035
+ .join(CACHE_KEY_SEPARATOR)
4036
+ .toLowerCase();
4037
+ }
4038
+ /*
4039
+ * Validates an entity: checks for all expected params
4040
+ * @param entity
4041
+ */
4042
+ function isAppMetadataEntity(key, entity) {
4043
+ if (!entity) {
4044
+ return false;
4045
+ }
4046
+ return (key.indexOf(APP_METADATA) === 0 &&
4047
+ entity.hasOwnProperty("clientId") &&
4048
+ entity.hasOwnProperty("environment"));
4049
+ }
4050
+ /**
4051
+ * Validates an entity: checks for all expected params
4052
+ * @param entity
4053
+ */
4054
+ function isAuthorityMetadataEntity(key, entity) {
4055
+ if (!entity) {
4056
+ return false;
4057
+ }
4058
+ return (key.indexOf(AUTHORITY_METADATA_CACHE_KEY) === 0 &&
4059
+ entity.hasOwnProperty("aliases") &&
4060
+ entity.hasOwnProperty("preferred_cache") &&
4061
+ entity.hasOwnProperty("preferred_network") &&
4062
+ entity.hasOwnProperty("canonical_authority") &&
4063
+ entity.hasOwnProperty("authorization_endpoint") &&
4064
+ entity.hasOwnProperty("token_endpoint") &&
4065
+ entity.hasOwnProperty("issuer") &&
4066
+ entity.hasOwnProperty("aliasesFromNetwork") &&
4067
+ entity.hasOwnProperty("endpointsFromNetwork") &&
4068
+ entity.hasOwnProperty("expiresAt") &&
4069
+ entity.hasOwnProperty("jwks_uri"));
4070
+ }
4071
+ /**
4072
+ * Reset the exiresAt value
4073
+ */
4074
+ function generateAuthorityMetadataExpiresAt() {
4075
+ return (nowSeconds() +
4076
+ AUTHORITY_METADATA_REFRESH_TIME_SECONDS);
4077
+ }
4078
+ function updateAuthorityEndpointMetadata(authorityMetadata, updatedValues, fromNetwork) {
4079
+ authorityMetadata.authorization_endpoint =
4080
+ updatedValues.authorization_endpoint;
4081
+ authorityMetadata.token_endpoint = updatedValues.token_endpoint;
4082
+ authorityMetadata.end_session_endpoint = updatedValues.end_session_endpoint;
4083
+ authorityMetadata.issuer = updatedValues.issuer;
4084
+ authorityMetadata.endpointsFromNetwork = fromNetwork;
4085
+ authorityMetadata.jwks_uri = updatedValues.jwks_uri;
4086
+ }
4087
+ function updateCloudDiscoveryMetadata(authorityMetadata, updatedValues, fromNetwork) {
4088
+ authorityMetadata.aliases = updatedValues.aliases;
4089
+ authorityMetadata.preferred_cache = updatedValues.preferred_cache;
4090
+ authorityMetadata.preferred_network = updatedValues.preferred_network;
4091
+ authorityMetadata.aliasesFromNetwork = fromNetwork;
4092
+ }
4093
+ /**
4094
+ * Returns whether or not the data needs to be refreshed
4095
+ */
4096
+ function isAuthorityMetadataExpired(metadata) {
4097
+ return metadata.expiresAt <= nowSeconds();
4098
+ }
4099
+
4100
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
4101
+ /*
4102
+ * Copyright (c) Microsoft Corporation. All rights reserved.
4103
+ * Licensed under the MIT License.
4104
+ */
4105
+ /**
4106
+ * Time spent sending/waiting for the response of a request to the token endpoint
4107
+ */
4108
+ const NetworkClientSendPostRequestAsync = "networkClientSendPostRequestAsync";
4109
+ const RefreshTokenClientExecutePostToTokenEndpoint = "refreshTokenClientExecutePostToTokenEndpoint";
4110
+ const AuthorizationCodeClientExecutePostToTokenEndpoint = "authorizationCodeClientExecutePostToTokenEndpoint";
4111
+ /**
4112
+ * Time spent on the network for refresh token acquisition
4113
+ */
4114
+ const RefreshTokenClientExecuteTokenRequest = "refreshTokenClientExecuteTokenRequest";
4115
+ /**
4116
+ * Time taken for acquiring refresh token , records RT size
4117
+ */
4118
+ const RefreshTokenClientAcquireToken = "refreshTokenClientAcquireToken";
4119
+ /**
4120
+ * Time taken for acquiring cached refresh token
4121
+ */
4122
+ const RefreshTokenClientAcquireTokenWithCachedRefreshToken = "refreshTokenClientAcquireTokenWithCachedRefreshToken";
4123
+ /**
4124
+ * Helper function to create token request body in RefreshTokenClient (msal-common).
4125
+ */
4126
+ const RefreshTokenClientCreateTokenRequestBody = "refreshTokenClientCreateTokenRequestBody";
4127
+ const SilentFlowClientGenerateResultFromCacheRecord = "silentFlowClientGenerateResultFromCacheRecord";
4128
+ /**
4129
+ * APIs in Authorization Code Client (msal-common)
4130
+ */
4131
+ const AuthClientExecuteTokenRequest = "authClientExecuteTokenRequest";
4132
+ const AuthClientCreateTokenRequestBody = "authClientCreateTokenRequestBody";
4133
+ const UpdateTokenEndpointAuthority = "updateTokenEndpointAuthority";
4134
+ /**
4135
+ * Generate functions in PopTokenGenerator (msal-common)
4136
+ */
4137
+ const PopTokenGenerateCnf = "popTokenGenerateCnf";
4138
+ /**
4139
+ * handleServerTokenResponse API in ResponseHandler (msal-common)
4140
+ */
4141
+ const HandleServerTokenResponse = "handleServerTokenResponse";
4142
+ /**
4143
+ * Authority functions
4030
4144
  */
4031
4145
  const AuthorityResolveEndpointsAsync = "authorityResolveEndpointsAsync";
4032
4146
  const AuthorityGetCloudDiscoveryMetadataFromNetwork = "authorityGetCloudDiscoveryMetadataFromNetwork";
@@ -4045,7 +4159,7 @@ const RegionDiscoveryGetCurrentVersion = "regionDiscoveryGetCurrentVersion";
4045
4159
  */
4046
4160
  const CacheManagerGetRefreshToken = "cacheManagerGetRefreshToken";
4047
4161
 
4048
- /*! @azure/msal-common v16.4.0 2026-03-18 */
4162
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
4049
4163
  /*
4050
4164
  * Copyright (c) Microsoft Corporation. All rights reserved.
4051
4165
  * Licensed under the MIT License.
@@ -4138,7 +4252,7 @@ const invokeAsync = (callback, eventName, logger, telemetryClient, correlationId
4138
4252
  };
4139
4253
  };
4140
4254
 
4141
- /*! @azure/msal-common v16.4.0 2026-03-18 */
4255
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
4142
4256
 
4143
4257
  /*
4144
4258
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4218,293 +4332,190 @@ class PopTokenGenerator {
4218
4332
  }
4219
4333
  }
4220
4334
 
4221
- /*! @azure/msal-common v16.4.0 2026-03-18 */
4335
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
4222
4336
  /*
4223
4337
  * Copyright (c) Microsoft Corporation. All rights reserved.
4224
4338
  * Licensed under the MIT License.
4225
4339
  */
4226
4340
  /**
4227
- * This class instance helps track the memory changes facilitating
4228
- * decisions to read from and write to the persistent cache
4229
- */ class TokenCacheContext {
4230
- constructor(tokenCache, hasChanged) {
4231
- this.cache = tokenCache;
4232
- this.hasChanged = hasChanged;
4233
- }
4234
- /**
4235
- * boolean which indicates the changes in cache
4236
- */
4237
- get cacheHasChanged() {
4238
- return this.hasChanged;
4239
- }
4240
- /**
4241
- * function to retrieve the token cache
4242
- */
4243
- get tokenCache() {
4244
- return this.cache;
4245
- }
4246
- }
4247
-
4248
- /*! @azure/msal-common v16.4.0 2026-03-18 */
4249
-
4250
- /*
4251
- * Copyright (c) Microsoft Corporation. All rights reserved.
4252
- * Licensed under the MIT License.
4341
+ * MSAL-defined interaction required error code indicating no tokens are found in cache.
4342
+ * @public
4253
4343
  */
4344
+ const noTokensFound = "no_tokens_found";
4254
4345
  /**
4255
- * Create IdTokenEntity
4256
- * @param homeAccountId
4257
- * @param authenticationResult
4258
- * @param clientId
4259
- * @param authority
4346
+ * MSAL-defined error code indicating a native account is unavailable on the platform.
4347
+ * @public
4260
4348
  */
4261
- function createIdTokenEntity(homeAccountId, environment, idToken, clientId, tenantId) {
4262
- const idTokenEntity = {
4263
- credentialType: CredentialType.ID_TOKEN,
4264
- homeAccountId: homeAccountId,
4265
- environment: environment,
4266
- clientId: clientId,
4267
- secret: idToken,
4268
- realm: tenantId,
4269
- lastUpdatedAt: Date.now().toString(), // Set the last updated time to now
4270
- };
4271
- return idTokenEntity;
4272
- }
4349
+ const nativeAccountUnavailable = "native_account_unavailable";
4273
4350
  /**
4274
- * Create AccessTokenEntity
4275
- * @param homeAccountId
4276
- * @param environment
4277
- * @param accessToken
4278
- * @param clientId
4279
- * @param tenantId
4280
- * @param scopes
4281
- * @param expiresOn
4282
- * @param extExpiresOn
4351
+ * MSAL-defined error code indicating the refresh token has expired and user interaction is needed.
4352
+ * @public
4283
4353
  */
4284
- function createAccessTokenEntity(homeAccountId, environment, accessToken, clientId, tenantId, scopes, expiresOn, extExpiresOn, base64Decode, refreshOn, tokenType, userAssertionHash, keyId) {
4285
- const atEntity = {
4286
- homeAccountId: homeAccountId,
4287
- credentialType: CredentialType.ACCESS_TOKEN,
4288
- secret: accessToken,
4289
- cachedAt: nowSeconds().toString(),
4290
- expiresOn: expiresOn.toString(),
4291
- extendedExpiresOn: extExpiresOn.toString(),
4292
- environment: environment,
4293
- clientId: clientId,
4294
- realm: tenantId,
4295
- target: scopes,
4296
- tokenType: tokenType || AuthenticationScheme.BEARER,
4297
- lastUpdatedAt: Date.now().toString(), // Set the last updated time to now
4298
- };
4299
- if (userAssertionHash) {
4300
- atEntity.userAssertionHash = userAssertionHash;
4301
- }
4302
- if (refreshOn) {
4303
- atEntity.refreshOn = refreshOn.toString();
4304
- }
4305
- /*
4306
- * Create Access Token With Auth Scheme instead of regular access token
4307
- * Cast to lower to handle "bearer" from ADFS
4308
- */
4309
- if (atEntity.tokenType?.toLowerCase() !==
4310
- AuthenticationScheme.BEARER.toLowerCase()) {
4311
- atEntity.credentialType =
4312
- CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME;
4313
- switch (atEntity.tokenType) {
4314
- case AuthenticationScheme.POP:
4315
- // Make sure keyId is present and add it to credential
4316
- const tokenClaims = extractTokenClaims(accessToken, base64Decode);
4317
- if (!tokenClaims?.cnf?.kid) {
4318
- throw createClientAuthError(tokenClaimsCnfRequiredForSignedJwt);
4319
- }
4320
- atEntity.keyId = tokenClaims.cnf.kid;
4321
- break;
4322
- case AuthenticationScheme.SSH:
4323
- atEntity.keyId = keyId;
4324
- }
4325
- }
4326
- return atEntity;
4327
- }
4354
+ const refreshTokenExpired = "refresh_token_expired";
4328
4355
  /**
4329
- * Create RefreshTokenEntity
4330
- * @param homeAccountId
4331
- * @param authenticationResult
4332
- * @param clientId
4333
- * @param authority
4356
+ * MSAL-defined error code indicating UI/UX is not allowed (e.g., blocked by policy), requiring alternate interaction.
4357
+ * @public
4334
4358
  */
4335
- function createRefreshTokenEntity(homeAccountId, environment, refreshToken, clientId, familyId, userAssertionHash, expiresOn) {
4336
- const rtEntity = {
4337
- credentialType: CredentialType.REFRESH_TOKEN,
4338
- homeAccountId: homeAccountId,
4339
- environment: environment,
4340
- clientId: clientId,
4341
- secret: refreshToken,
4342
- lastUpdatedAt: Date.now().toString(),
4343
- };
4344
- if (userAssertionHash) {
4345
- rtEntity.userAssertionHash = userAssertionHash;
4346
- }
4347
- if (familyId) {
4348
- rtEntity.familyId = familyId;
4349
- }
4350
- if (expiresOn) {
4351
- rtEntity.expiresOn = expiresOn.toString();
4352
- }
4353
- return rtEntity;
4354
- }
4355
- function isCredentialEntity(entity) {
4356
- return (entity.hasOwnProperty("homeAccountId") &&
4357
- entity.hasOwnProperty("environment") &&
4358
- entity.hasOwnProperty("credentialType") &&
4359
- entity.hasOwnProperty("clientId") &&
4360
- entity.hasOwnProperty("secret"));
4361
- }
4359
+ const uxNotAllowed = "ux_not_allowed";
4360
+ /**
4361
+ * Server-originated error code indicating interaction is required to complete the request.
4362
+ * @public
4363
+ */
4364
+ const interactionRequired = "interaction_required";
4365
+ /**
4366
+ * Server-originated error code indicating user consent is required.
4367
+ * @public
4368
+ */
4369
+ const consentRequired = "consent_required";
4370
+ /**
4371
+ * Server-originated error code indicating user login is required.
4372
+ * @public
4373
+ */
4374
+ const loginRequired = "login_required";
4362
4375
  /**
4363
- * Validates an entity: checks for all expected params
4364
- * @param entity
4376
+ * Server-originated error code indicating the token is invalid or corrupted.
4377
+ * @public
4365
4378
  */
4366
- function isAccessTokenEntity(entity) {
4367
- if (!entity) {
4368
- return false;
4369
- }
4370
- return (isCredentialEntity(entity) &&
4371
- entity.hasOwnProperty("realm") &&
4372
- entity.hasOwnProperty("target") &&
4373
- (entity["credentialType"] === CredentialType.ACCESS_TOKEN ||
4374
- entity["credentialType"] ===
4375
- CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME));
4376
- }
4379
+ const badToken = "bad_token";
4377
4380
  /**
4378
- * Validates an entity: checks for all expected params
4379
- * @param entity
4381
+ * Server-originated error code indicating the user is in an interrupted state and interaction is required.
4382
+ * @public
4383
+ */
4384
+ const interruptedUser = "interrupted_user";
4385
+
4386
+ var InteractionRequiredAuthErrorCodes = /*#__PURE__*/Object.freeze({
4387
+ __proto__: null,
4388
+ badToken: badToken,
4389
+ consentRequired: consentRequired,
4390
+ interactionRequired: interactionRequired,
4391
+ interruptedUser: interruptedUser,
4392
+ loginRequired: loginRequired,
4393
+ nativeAccountUnavailable: nativeAccountUnavailable,
4394
+ noTokensFound: noTokensFound,
4395
+ refreshTokenExpired: refreshTokenExpired,
4396
+ uxNotAllowed: uxNotAllowed
4397
+ });
4398
+
4399
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
4400
+
4401
+ /*
4402
+ * Copyright (c) Microsoft Corporation. All rights reserved.
4403
+ * Licensed under the MIT License.
4380
4404
  */
4381
- function isIdTokenEntity(entity) {
4382
- if (!entity) {
4383
- return false;
4384
- }
4385
- return (isCredentialEntity(entity) &&
4386
- entity.hasOwnProperty("realm") &&
4387
- entity["credentialType"] === CredentialType.ID_TOKEN);
4388
- }
4389
4405
  /**
4390
- * Validates an entity: checks for all expected params
4391
- * @param entity
4406
+ * InteractionRequiredServerErrorMessage contains string constants used by error codes and messages returned by the server indicating interaction is required
4392
4407
  */
4393
- function isRefreshTokenEntity(entity) {
4394
- if (!entity) {
4395
- return false;
4396
- }
4397
- return (isCredentialEntity(entity) &&
4398
- entity["credentialType"] === CredentialType.REFRESH_TOKEN);
4399
- }
4408
+ const InteractionRequiredServerErrorMessage = [
4409
+ interactionRequired,
4410
+ consentRequired,
4411
+ loginRequired,
4412
+ badToken,
4413
+ uxNotAllowed,
4414
+ interruptedUser,
4415
+ ];
4416
+ const InteractionRequiredAuthSubErrorMessage = [
4417
+ "message_only",
4418
+ "additional_action",
4419
+ "basic_action",
4420
+ "user_password_expired",
4421
+ "consent_required",
4422
+ "bad_token",
4423
+ "ux_not_allowed",
4424
+ "interrupted_user",
4425
+ ];
4400
4426
  /**
4401
- * validates if a given cache entry is "Telemetry", parses <key,value>
4402
- * @param key
4403
- * @param entity
4427
+ * Error thrown when user interaction is required.
4404
4428
  */
4405
- function isServerTelemetryEntity(key, entity) {
4406
- const validateKey = key.indexOf(SERVER_TELEM_CACHE_KEY) === 0;
4407
- let validateEntity = true;
4408
- if (entity) {
4409
- validateEntity =
4410
- entity.hasOwnProperty("failedRequests") &&
4411
- entity.hasOwnProperty("errors") &&
4412
- entity.hasOwnProperty("cacheHits");
4429
+ class InteractionRequiredAuthError extends AuthError {
4430
+ constructor(errorCode, errorMessage, subError, timestamp, traceId, correlationId, claims, errorNo) {
4431
+ super(errorCode, errorMessage, subError);
4432
+ Object.setPrototypeOf(this, InteractionRequiredAuthError.prototype);
4433
+ this.timestamp = timestamp || "";
4434
+ this.traceId = traceId || "";
4435
+ this.correlationId = correlationId || "";
4436
+ this.claims = claims || "";
4437
+ this.name = "InteractionRequiredAuthError";
4438
+ this.errorNo = errorNo;
4413
4439
  }
4414
- return validateKey && validateEntity;
4415
4440
  }
4416
4441
  /**
4417
- * validates if a given cache entry is "Throttling", parses <key,value>
4418
- * @param key
4419
- * @param entity
4442
+ * Helper function used to determine if an error thrown by the server requires interaction to resolve
4443
+ * @param errorCode
4444
+ * @param errorString
4445
+ * @param subError
4420
4446
  */
4421
- function isThrottlingEntity(key, entity) {
4422
- let validateKey = false;
4423
- if (key) {
4424
- validateKey = key.indexOf(THROTTLING_PREFIX) === 0;
4425
- }
4426
- let validateEntity = true;
4427
- if (entity) {
4428
- validateEntity = entity.hasOwnProperty("throttleTime");
4429
- }
4430
- return validateKey && validateEntity;
4447
+ function isInteractionRequiredError(errorCode, errorString, subError) {
4448
+ const isInteractionRequiredErrorCode = !!errorCode &&
4449
+ InteractionRequiredServerErrorMessage.indexOf(errorCode) > -1;
4450
+ const isInteractionRequiredSubError = !!subError &&
4451
+ InteractionRequiredAuthSubErrorMessage.indexOf(subError) > -1;
4452
+ const isInteractionRequiredErrorDesc = !!errorString &&
4453
+ InteractionRequiredServerErrorMessage.some((irErrorCode) => {
4454
+ return errorString.indexOf(irErrorCode) > -1;
4455
+ });
4456
+ return (isInteractionRequiredErrorCode ||
4457
+ isInteractionRequiredErrorDesc ||
4458
+ isInteractionRequiredSubError);
4431
4459
  }
4432
4460
  /**
4433
- * Generate AppMetadata Cache Key as per the schema: appmetadata-<environment>-<client_id>
4461
+ * Creates an InteractionRequiredAuthError
4434
4462
  */
4435
- function generateAppMetadataKey({ environment, clientId, }) {
4436
- const appMetaDataKeyArray = [
4437
- APP_METADATA,
4438
- environment,
4439
- clientId,
4440
- ];
4441
- return appMetaDataKeyArray
4442
- .join(CACHE_KEY_SEPARATOR)
4443
- .toLowerCase();
4444
- }
4463
+ function createInteractionRequiredAuthError(errorCode, errorMessage) {
4464
+ return new InteractionRequiredAuthError(errorCode, errorMessage);
4465
+ }
4466
+
4467
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
4468
+
4445
4469
  /*
4446
- * Validates an entity: checks for all expected params
4447
- * @param entity
4470
+ * Copyright (c) Microsoft Corporation. All rights reserved.
4471
+ * Licensed under the MIT License.
4448
4472
  */
4449
- function isAppMetadataEntity(key, entity) {
4450
- if (!entity) {
4451
- return false;
4452
- }
4453
- return (key.indexOf(APP_METADATA) === 0 &&
4454
- entity.hasOwnProperty("clientId") &&
4455
- entity.hasOwnProperty("environment"));
4456
- }
4457
4473
  /**
4458
- * Validates an entity: checks for all expected params
4459
- * @param entity
4474
+ * Error thrown when there is an error with the server code, for example, unavailability.
4460
4475
  */
4461
- function isAuthorityMetadataEntity(key, entity) {
4462
- if (!entity) {
4463
- return false;
4476
+ class ServerError extends AuthError {
4477
+ constructor(errorCode, errorMessage, subError, errorNo, status) {
4478
+ super(errorCode, errorMessage, subError);
4479
+ this.name = "ServerError";
4480
+ this.errorNo = errorNo;
4481
+ this.status = status;
4482
+ Object.setPrototypeOf(this, ServerError.prototype);
4464
4483
  }
4465
- return (key.indexOf(AUTHORITY_METADATA_CACHE_KEY) === 0 &&
4466
- entity.hasOwnProperty("aliases") &&
4467
- entity.hasOwnProperty("preferred_cache") &&
4468
- entity.hasOwnProperty("preferred_network") &&
4469
- entity.hasOwnProperty("canonical_authority") &&
4470
- entity.hasOwnProperty("authorization_endpoint") &&
4471
- entity.hasOwnProperty("token_endpoint") &&
4472
- entity.hasOwnProperty("issuer") &&
4473
- entity.hasOwnProperty("aliasesFromNetwork") &&
4474
- entity.hasOwnProperty("endpointsFromNetwork") &&
4475
- entity.hasOwnProperty("expiresAt") &&
4476
- entity.hasOwnProperty("jwks_uri"));
4477
- }
4478
- /**
4479
- * Reset the exiresAt value
4480
- */
4481
- function generateAuthorityMetadataExpiresAt() {
4482
- return (nowSeconds() +
4483
- AUTHORITY_METADATA_REFRESH_TIME_SECONDS);
4484
- }
4485
- function updateAuthorityEndpointMetadata(authorityMetadata, updatedValues, fromNetwork) {
4486
- authorityMetadata.authorization_endpoint =
4487
- updatedValues.authorization_endpoint;
4488
- authorityMetadata.token_endpoint = updatedValues.token_endpoint;
4489
- authorityMetadata.end_session_endpoint = updatedValues.end_session_endpoint;
4490
- authorityMetadata.issuer = updatedValues.issuer;
4491
- authorityMetadata.endpointsFromNetwork = fromNetwork;
4492
- authorityMetadata.jwks_uri = updatedValues.jwks_uri;
4493
- }
4494
- function updateCloudDiscoveryMetadata(authorityMetadata, updatedValues, fromNetwork) {
4495
- authorityMetadata.aliases = updatedValues.aliases;
4496
- authorityMetadata.preferred_cache = updatedValues.preferred_cache;
4497
- authorityMetadata.preferred_network = updatedValues.preferred_network;
4498
- authorityMetadata.aliasesFromNetwork = fromNetwork;
4499
- }
4484
+ }
4485
+
4486
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
4500
4487
  /**
4501
- * Returns whether or not the data needs to be refreshed
4488
+ * Parses the state into the RequestStateObject, which contains the LibraryState info and the state passed by the user.
4489
+ * @param base64Decode
4490
+ * @param state
4502
4491
  */
4503
- function isAuthorityMetadataExpired(metadata) {
4504
- return metadata.expiresAt <= nowSeconds();
4492
+ function parseRequestState(base64Decode, state) {
4493
+ if (!base64Decode) {
4494
+ throw createClientAuthError(noCryptoObject);
4495
+ }
4496
+ if (!state) {
4497
+ throw createClientAuthError(invalidState);
4498
+ }
4499
+ try {
4500
+ // Split the state between library state and user passed state and decode them separately
4501
+ const splitState = state.split(RESOURCE_DELIM);
4502
+ const libraryState = splitState[0];
4503
+ const userState = splitState.length > 1
4504
+ ? splitState.slice(1).join(RESOURCE_DELIM)
4505
+ : "";
4506
+ const libraryStateString = base64Decode(libraryState);
4507
+ const libraryStateObj = JSON.parse(libraryStateString);
4508
+ return {
4509
+ userRequestState: userState || "",
4510
+ libraryState: libraryStateObj,
4511
+ };
4512
+ }
4513
+ catch (e) {
4514
+ throw createClientAuthError(invalidState);
4515
+ }
4505
4516
  }
4506
4517
 
4507
- /*! @azure/msal-common v16.4.0 2026-03-18 */
4518
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
4508
4519
 
4509
4520
  /*
4510
4521
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4660,7 +4671,7 @@ class ResponseHandler {
4660
4671
  if (serverTokenResponse.id_token && !!idTokenClaims) {
4661
4672
  cachedIdToken = createIdTokenEntity(this.homeAccountIdentifier, env, serverTokenResponse.id_token, this.clientId, claimsTenantId || "");
4662
4673
  cachedAccount = buildAccountToCache(this.cacheStorage, authority, this.homeAccountIdentifier, this.cryptoObj.base64Decode, request.correlationId, idTokenClaims, serverTokenResponse.client_info, env, claimsTenantId, authCodePayload, undefined, // nativeAccountId
4663
- this.logger);
4674
+ this.logger, this.performanceClient);
4664
4675
  }
4665
4676
  // AccessToken
4666
4677
  let cachedAccessToken = null;
@@ -4811,17 +4822,24 @@ class ResponseHandler {
4811
4822
  };
4812
4823
  }
4813
4824
  }
4814
- function buildAccountToCache(cacheStorage, authority, homeAccountId, base64Decode, correlationId, idTokenClaims, clientInfo, environment, claimsTenantId, authCodePayload, nativeAccountId, logger) {
4825
+ function buildAccountToCache(cacheStorage, authority, homeAccountId, base64Decode, correlationId, idTokenClaims, clientInfo, environment, claimsTenantId, authCodePayload, nativeAccountId, logger, performanceClient) {
4815
4826
  logger?.verbose("setCachedAccount called", correlationId);
4816
- // Check if base account is already cached
4817
- const accountKeys = cacheStorage.getAccountKeys();
4818
- const baseAccountKey = accountKeys.find((accountKey) => {
4819
- return accountKey.startsWith(homeAccountId);
4820
- });
4821
- let cachedAccount = null;
4822
- if (baseAccountKey) {
4823
- cachedAccount = cacheStorage.getAccount(baseAccountKey, correlationId);
4827
+ /*
4828
+ * Check if base account is already cached. Filter by homeAccountId (identifies
4829
+ * the user's home identity) and environment (identifies the cloud) — the two
4830
+ * tenant-agnostic properties that uniquely locate a base AccountEntity.
4831
+ */
4832
+ const accountEnvironment = environment || authority.getPreferredCache();
4833
+ const matchedAccounts = cacheStorage.getAccountsFilteredBy({ homeAccountId, environment: accountEnvironment }, correlationId);
4834
+ performanceClient?.addFields({ cacheMatchedAccounts: matchedAccounts.length }, correlationId);
4835
+ if (matchedAccounts.length > 1) {
4836
+ /*
4837
+ * Base accounts are expected to be unique for a given homeAccountId in normal cache usage.
4838
+ * If multiple matches exist, ignore the cache hit rather than arbitrarily choosing one.
4839
+ */
4840
+ logger?.warning("Multiple base accounts matched homeAccountId. Ignoring cached account and creating a new base account.", correlationId);
4824
4841
  }
4842
+ const cachedAccount = matchedAccounts.length === 1 ? matchedAccounts[0] : null;
4825
4843
  const baseAccount = cachedAccount ||
4826
4844
  createAccountEntity({
4827
4845
  homeAccountId,
@@ -4845,7 +4863,7 @@ function buildAccountToCache(cacheStorage, authority, homeAccountId, base64Decod
4845
4863
  return baseAccount;
4846
4864
  }
4847
4865
 
4848
- /*! @azure/msal-common v16.4.0 2026-03-18 */
4866
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
4849
4867
  /*
4850
4868
  * Copyright (c) Microsoft Corporation. All rights reserved.
4851
4869
  * Licensed under the MIT License.
@@ -4855,7 +4873,7 @@ const CcsCredentialType = {
4855
4873
  UPN: "UPN",
4856
4874
  };
4857
4875
 
4858
- /*! @azure/msal-common v16.4.0 2026-03-18 */
4876
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
4859
4877
  /*
4860
4878
  * Copyright (c) Microsoft Corporation. All rights reserved.
4861
4879
  * Licensed under the MIT License.
@@ -4873,7 +4891,7 @@ async function getClientAssertion(clientAssertion, clientId, tokenEndpoint) {
4873
4891
  }
4874
4892
  }
4875
4893
 
4876
- /*! @azure/msal-common v16.4.0 2026-03-18 */
4894
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
4877
4895
  /*
4878
4896
  * Copyright (c) Microsoft Corporation. All rights reserved.
4879
4897
  * Licensed under the MIT License.
@@ -4894,7 +4912,7 @@ function getRequestThumbprint(clientId, request, homeAccountId) {
4894
4912
  };
4895
4913
  }
4896
4914
 
4897
- /*! @azure/msal-common v16.4.0 2026-03-18 */
4915
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
4898
4916
 
4899
4917
  /*
4900
4918
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4980,7 +4998,7 @@ class ThrottlingUtils {
4980
4998
  }
4981
4999
  }
4982
5000
 
4983
- /*! @azure/msal-common v16.4.0 2026-03-18 */
5001
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
4984
5002
 
4985
5003
  /*
4986
5004
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5011,7 +5029,7 @@ function createNetworkError(error, httpStatus, responseHeaders, additionalError)
5011
5029
  return new NetworkError(error, httpStatus, responseHeaders);
5012
5030
  }
5013
5031
 
5014
- /*! @azure/msal-common v16.4.0 2026-03-18 */
5032
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
5015
5033
 
5016
5034
  /*
5017
5035
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5125,7 +5143,7 @@ async function sendPostRequest(thumbprint, tokenEndpoint, options, correlationId
5125
5143
  return response;
5126
5144
  }
5127
5145
 
5128
- /*! @azure/msal-common v16.4.0 2026-03-18 */
5146
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
5129
5147
  /*
5130
5148
  * Copyright (c) Microsoft Corporation. All rights reserved.
5131
5149
  * Licensed under the MIT License.
@@ -5137,7 +5155,7 @@ function isOpenIdConfigResponse(response) {
5137
5155
  response.hasOwnProperty("jwks_uri"));
5138
5156
  }
5139
5157
 
5140
- /*! @azure/msal-common v16.4.0 2026-03-18 */
5158
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
5141
5159
  /*
5142
5160
  * Copyright (c) Microsoft Corporation. All rights reserved.
5143
5161
  * Licensed under the MIT License.
@@ -5147,7 +5165,7 @@ function isCloudInstanceDiscoveryResponse(response) {
5147
5165
  response.hasOwnProperty("metadata"));
5148
5166
  }
5149
5167
 
5150
- /*! @azure/msal-common v16.4.0 2026-03-18 */
5168
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
5151
5169
  /*
5152
5170
  * Copyright (c) Microsoft Corporation. All rights reserved.
5153
5171
  * Licensed under the MIT License.
@@ -5157,7 +5175,7 @@ function isCloudInstanceDiscoveryErrorResponse(response) {
5157
5175
  response.hasOwnProperty("error_description"));
5158
5176
  }
5159
5177
 
5160
- /*! @azure/msal-common v16.4.0 2026-03-18 */
5178
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
5161
5179
 
5162
5180
  /*
5163
5181
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5262,7 +5280,7 @@ RegionDiscovery.IMDS_OPTIONS = {
5262
5280
  },
5263
5281
  };
5264
5282
 
5265
- /*! @azure/msal-common v16.4.0 2026-03-18 */
5283
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
5266
5284
 
5267
5285
  /*
5268
5286
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6085,7 +6103,7 @@ function buildStaticAuthorityOptions(authOptions) {
6085
6103
  };
6086
6104
  }
6087
6105
 
6088
- /*! @azure/msal-common v16.4.0 2026-03-18 */
6106
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
6089
6107
 
6090
6108
  /*
6091
6109
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6119,7 +6137,7 @@ async function createDiscoveredInstance(authorityUri, networkClient, cacheManage
6119
6137
  }
6120
6138
  }
6121
6139
 
6122
- /*! @azure/msal-common v16.4.0 2026-03-18 */
6140
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
6123
6141
 
6124
6142
  /*
6125
6143
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6284,11 +6302,6 @@ class AuthorizationCodeClient {
6284
6302
  throw createClientConfigurationError(missingSshJwk);
6285
6303
  }
6286
6304
  }
6287
- if (!StringUtils.isEmptyObj(request.claims) ||
6288
- (this.config.authOptions.clientCapabilities &&
6289
- this.config.authOptions.clientCapabilities.length > 0)) {
6290
- addClaims(parameters, request.claims, this.config.authOptions.clientCapabilities);
6291
- }
6292
6305
  let ccsCred = undefined;
6293
6306
  if (request.clientInfo) {
6294
6307
  try {
@@ -6337,6 +6350,7 @@ class AuthorizationCodeClient {
6337
6350
  });
6338
6351
  }
6339
6352
  instrumentBrokerParams(parameters, request.correlationId, this.performanceClient);
6353
+ addClaims(parameters, request.claims, this.config.authOptions.clientCapabilities, request.skipBrokerClaims);
6340
6354
  return mapToQueryString(parameters);
6341
6355
  }
6342
6356
  /**
@@ -6380,7 +6394,7 @@ class AuthorizationCodeClient {
6380
6394
  }
6381
6395
  }
6382
6396
 
6383
- /*! @azure/msal-common v16.4.0 2026-03-18 */
6397
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
6384
6398
 
6385
6399
  /*
6386
6400
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6570,11 +6584,6 @@ class RefreshTokenClient {
6570
6584
  throw createClientConfigurationError(missingSshJwk);
6571
6585
  }
6572
6586
  }
6573
- if (!StringUtils.isEmptyObj(request.claims) ||
6574
- (this.config.authOptions.clientCapabilities &&
6575
- this.config.authOptions.clientCapabilities.length > 0)) {
6576
- addClaims(parameters, request.claims, this.config.authOptions.clientCapabilities);
6577
- }
6578
6587
  if (this.config.systemOptions.preventCorsPreflight &&
6579
6588
  request.ccsCredential) {
6580
6589
  switch (request.ccsCredential.type) {
@@ -6601,11 +6610,12 @@ class RefreshTokenClient {
6601
6610
  });
6602
6611
  }
6603
6612
  instrumentBrokerParams(parameters, request.correlationId, this.performanceClient);
6613
+ addClaims(parameters, request.claims, this.config.authOptions.clientCapabilities, request.skipBrokerClaims);
6604
6614
  return mapToQueryString(parameters);
6605
6615
  }
6606
6616
  }
6607
6617
 
6608
- /*! @azure/msal-common v16.4.0 2026-03-18 */
6618
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
6609
6619
 
6610
6620
  /*
6611
6621
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6721,7 +6731,7 @@ class SilentFlowClient {
6721
6731
  }
6722
6732
  }
6723
6733
 
6724
- /*! @azure/msal-common v16.4.0 2026-03-18 */
6734
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
6725
6735
 
6726
6736
  /*
6727
6737
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6837,14 +6847,10 @@ function getStandardAuthorizeRequestParameters(authOptions, request, logger, per
6837
6847
  if (request.state) {
6838
6848
  addState(parameters, request.state);
6839
6849
  }
6840
- if (request.claims ||
6841
- (authOptions.clientCapabilities &&
6842
- authOptions.clientCapabilities.length > 0)) {
6843
- addClaims(parameters, request.claims, authOptions.clientCapabilities);
6844
- }
6845
6850
  if (request.embeddedClientId) {
6846
6851
  addBrokerParameters(parameters, authOptions.clientId, authOptions.redirectUri);
6847
6852
  }
6853
+ addClaims(parameters, request.claims, authOptions.clientCapabilities, request.skipBrokerClaims);
6848
6854
  // If extraQueryParameters includes instance_aware its value will be added when extraQueryParameters are added
6849
6855
  if (authOptions.instanceAware &&
6850
6856
  (!request.extraQueryParameters ||
@@ -6874,7 +6880,7 @@ function extractLoginHint(account) {
6874
6880
  return account.loginHint || account.idTokenClaims?.login_hint || null;
6875
6881
  }
6876
6882
 
6877
- /*! @azure/msal-common v16.4.0 2026-03-18 */
6883
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
6878
6884
 
6879
6885
  /*
6880
6886
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6907,7 +6913,7 @@ function containsResourceParam(params) {
6907
6913
  return Object.prototype.hasOwnProperty.call(params, "resource");
6908
6914
  }
6909
6915
 
6910
- /*! @azure/msal-common v16.4.0 2026-03-18 */
6916
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
6911
6917
  /*
6912
6918
  * Copyright (c) Microsoft Corporation. All rights reserved.
6913
6919
  * Licensed under the MIT License.
@@ -6924,7 +6930,7 @@ var AuthErrorCodes = /*#__PURE__*/Object.freeze({
6924
6930
  unexpectedError: unexpectedError
6925
6931
  });
6926
6932
 
6927
- /*! @azure/msal-common v16.4.0 2026-03-18 */
6933
+ /*! @azure/msal-common v16.5.0 2026-04-16 */
6928
6934
 
6929
6935
  /*
6930
6936
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -9127,7 +9133,7 @@ class ClientAssertion {
9127
9133
 
9128
9134
  /* eslint-disable header/header */
9129
9135
  const name = "@azure/msal-node";
9130
- const version = "5.1.1";
9136
+ const version = "5.1.3";
9131
9137
 
9132
9138
  /*
9133
9139
  * Copyright (c) Microsoft Corporation. All rights reserved.