@azure/msal-node 5.1.2 → 5.1.4

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 +126 -98
  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.2 2026-04-01 */
1
+ /*! @azure/msal-node v5.1.4 2026-04-21 */
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.1 2026-04-01 */
153
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
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.1 2026-04-01 */
401
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
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.1 2026-04-01 */
454
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
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.1 2026-04-01 */
485
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
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.1 2026-04-01 */
505
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
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.1 2026-04-01 */
585
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
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.1 2026-04-01 */
608
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
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.1 2026-04-01 */
662
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
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.1 2026-04-01 */
750
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
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.1 2026-04-01 */
945
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
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.1 2026-04-01 */
1352
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
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.1 2026-04-01 */
1405
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
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.1 2026-04-01 */
1444
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
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.1 2026-04-01 */
1705
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
1695
1706
  /* eslint-disable header/header */
1696
1707
  const name$1 = "@azure/msal-common";
1697
- const version$1 = "16.4.1";
1708
+ const version$1 = "16.5.1";
1698
1709
 
1699
- /*! @azure/msal-common v16.4.1 2026-04-01 */
1710
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
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.1 2026-04-01 */
1730
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
1720
1731
  /*
1721
1732
  * Copyright (c) Microsoft Corporation. All rights reserved.
1722
1733
  * Licensed under the MIT License.
@@ -1757,6 +1768,7 @@ function buildTenantProfile(homeAccountId, localAccountId, tenantId, idTokenClai
1757
1768
  username: preferred_username || upn || "",
1758
1769
  loginHint: login_hint,
1759
1770
  isHomeTenant: tenantIdMatchesHomeTenant(tenantId, homeAccountId),
1771
+ upn: upn,
1760
1772
  };
1761
1773
  }
1762
1774
  else {
@@ -1784,7 +1796,7 @@ function updateAccountTenantProfileData(baseAccountInfo, tenantProfile, idTokenC
1784
1796
  }
1785
1797
  // ID token claims override passed in account info and tenant profile
1786
1798
  if (idTokenClaims) {
1787
- // Ignore isHomeTenant, loginHint, and sid which are part of tenant profile but not base account info
1799
+ // Ignore isHomeTenant which is a utility property of tenant profile but not required in base account info
1788
1800
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
1789
1801
  const { isHomeTenant, ...claimsSourcedTenantProfile } = buildTenantProfile(baseAccountInfo.homeAccountId, baseAccountInfo.localAccountId, baseAccountInfo.tenantId, idTokenClaims);
1790
1802
  updatedAccountInfo = {
@@ -1798,7 +1810,7 @@ function updateAccountTenantProfileData(baseAccountInfo, tenantProfile, idTokenC
1798
1810
  return updatedAccountInfo;
1799
1811
  }
1800
1812
 
1801
- /*! @azure/msal-common v16.4.1 2026-04-01 */
1813
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
1802
1814
 
1803
1815
  /*
1804
1816
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1878,7 +1890,7 @@ function checkMaxAge(authTime, maxAge) {
1878
1890
  }
1879
1891
  }
1880
1892
 
1881
- /*! @azure/msal-common v16.4.1 2026-04-01 */
1893
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
1882
1894
 
1883
1895
  /*
1884
1896
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2035,7 +2047,7 @@ class UrlString {
2035
2047
  }
2036
2048
  }
2037
2049
 
2038
- /*! @azure/msal-common v16.4.1 2026-04-01 */
2050
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
2039
2051
 
2040
2052
  /*
2041
2053
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2192,7 +2204,7 @@ function getCloudDiscoveryMetadataFromNetworkResponse(response, authorityHost) {
2192
2204
  return null;
2193
2205
  }
2194
2206
 
2195
- /*! @azure/msal-common v16.4.1 2026-04-01 */
2207
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
2196
2208
  /*
2197
2209
  * Copyright (c) Microsoft Corporation. All rights reserved.
2198
2210
  * Licensed under the MIT License.
@@ -2200,7 +2212,7 @@ function getCloudDiscoveryMetadataFromNetworkResponse(response, authorityHost) {
2200
2212
  const cacheQuotaExceeded = "cache_quota_exceeded";
2201
2213
  const cacheErrorUnknown = "cache_error_unknown";
2202
2214
 
2203
- /*! @azure/msal-common v16.4.1 2026-04-01 */
2215
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
2204
2216
 
2205
2217
  /*
2206
2218
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2238,7 +2250,7 @@ function createCacheError(e) {
2238
2250
  }
2239
2251
  }
2240
2252
 
2241
- /*! @azure/msal-common v16.4.1 2026-04-01 */
2253
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
2242
2254
 
2243
2255
  /*
2244
2256
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2276,7 +2288,7 @@ function buildClientInfoFromHomeAccountId(homeAccountId) {
2276
2288
  };
2277
2289
  }
2278
2290
 
2279
- /*! @azure/msal-common v16.4.1 2026-04-01 */
2291
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
2280
2292
  /*
2281
2293
  * Copyright (c) Microsoft Corporation. All rights reserved.
2282
2294
  * Licensed under the MIT License.
@@ -2291,7 +2303,7 @@ const AuthorityType = {
2291
2303
  Ciam: 3,
2292
2304
  };
2293
2305
 
2294
- /*! @azure/msal-common v16.4.1 2026-04-01 */
2306
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
2295
2307
  /*
2296
2308
  * Copyright (c) Microsoft Corporation. All rights reserved.
2297
2309
  * Licensed under the MIT License.
@@ -2313,7 +2325,7 @@ function getTenantIdFromIdTokenClaims(idTokenClaims) {
2313
2325
  return null;
2314
2326
  }
2315
2327
 
2316
- /*! @azure/msal-common v16.4.1 2026-04-01 */
2328
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
2317
2329
  /*
2318
2330
  * Copyright (c) Microsoft Corporation. All rights reserved.
2319
2331
  * Licensed under the MIT License.
@@ -2337,7 +2349,7 @@ const ProtocolMode = {
2337
2349
  EAR: "EAR",
2338
2350
  };
2339
2351
 
2340
- /*! @azure/msal-common v16.4.1 2026-04-01 */
2352
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
2341
2353
  /**
2342
2354
  * Returns the AccountInfo interface for this account.
2343
2355
  */
@@ -2480,7 +2492,7 @@ function isAccountEntity(entity) {
2480
2492
  entity.hasOwnProperty("authorityType"));
2481
2493
  }
2482
2494
 
2483
- /*! @azure/msal-common v16.4.1 2026-04-01 */
2495
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
2484
2496
 
2485
2497
  /*
2486
2498
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2617,6 +2629,19 @@ class CacheManager {
2617
2629
  !(tenantProfile.isHomeTenant === tenantProfileFilter.isHomeTenant)) {
2618
2630
  return false;
2619
2631
  }
2632
+ if (!!tenantProfileFilter.username &&
2633
+ !(this.matchUsername(tenantProfile.username, tenantProfileFilter.username) ||
2634
+ !this.matchUsername(tenantProfile.upn, tenantProfileFilter.username))) {
2635
+ return false;
2636
+ }
2637
+ if (!!tenantProfileFilter.loginHint &&
2638
+ !this.matchLoginHintWithTenantProfile(tenantProfile, tenantProfileFilter.loginHint)) {
2639
+ return false;
2640
+ }
2641
+ if (!!tenantProfileFilter.upn &&
2642
+ !(tenantProfile.upn === tenantProfileFilter.upn)) {
2643
+ return false;
2644
+ }
2620
2645
  return true;
2621
2646
  }
2622
2647
  idTokenClaimsMatchTenantProfileFilter(idTokenClaims, tenantProfileFilter) {
@@ -2631,7 +2656,8 @@ class CacheManager {
2631
2656
  return false;
2632
2657
  }
2633
2658
  if (!!tenantProfileFilter.username &&
2634
- !this.matchUsername(idTokenClaims.preferred_username, tenantProfileFilter.username)) {
2659
+ !this.matchUsername(idTokenClaims.preferred_username, tenantProfileFilter.username) &&
2660
+ !this.matchUsername(idTokenClaims.upn, tenantProfileFilter.username)) {
2635
2661
  return false;
2636
2662
  }
2637
2663
  if (!!tenantProfileFilter.name &&
@@ -2732,10 +2758,6 @@ class CacheManager {
2732
2758
  !this.matchHomeAccountId(entity, accountFilter.homeAccountId)) {
2733
2759
  return;
2734
2760
  }
2735
- if (!!accountFilter.username &&
2736
- !this.matchUsername(entity.username, accountFilter.username)) {
2737
- return;
2738
- }
2739
2761
  if (!!accountFilter.environment &&
2740
2762
  !this.matchEnvironment(entity, accountFilter.environment, correlationId)) {
2741
2763
  return;
@@ -2756,6 +2778,9 @@ class CacheManager {
2756
2778
  const tenantProfileFilter = {
2757
2779
  localAccountId: accountFilter?.localAccountId,
2758
2780
  name: accountFilter?.name,
2781
+ username: accountFilter?.username,
2782
+ loginHint: accountFilter?.loginHint,
2783
+ upn: accountFilter?.upn,
2759
2784
  };
2760
2785
  const matchingTenantProfiles = entity.tenantProfiles?.filter((tenantProfile) => {
2761
2786
  return this.tenantProfileMatchesFilter(tenantProfile, tenantProfileFilter);
@@ -3006,11 +3031,11 @@ class CacheManager {
3006
3031
  const numHomeIdTokens = homeIdTokenMap.size;
3007
3032
  if (numHomeIdTokens < 1) {
3008
3033
  this.commonLogger.info("CacheManager:getIdToken - Multiple ID tokens found for account but none match account entity tenant id, returning first result", correlationId);
3009
- return idTokenMap.values().next().value;
3034
+ return idTokenMap.values().next().value ?? null;
3010
3035
  }
3011
3036
  else if (numHomeIdTokens === 1) {
3012
3037
  this.commonLogger.info("CacheManager:getIdToken - Multiple ID tokens found for account, defaulting to home tenant profile", correlationId);
3013
- return homeIdTokenMap.values().next().value;
3038
+ return homeIdTokenMap.values().next().value ?? null;
3014
3039
  }
3015
3040
  else {
3016
3041
  // Multiple ID tokens for home tenant profile, remove all and return null
@@ -3026,7 +3051,7 @@ class CacheManager {
3026
3051
  return null;
3027
3052
  }
3028
3053
  this.commonLogger.info("CacheManager:getIdToken - Returning ID token", correlationId);
3029
- return idTokenMap.values().next().value;
3054
+ return idTokenMap.values().next().value ?? null;
3030
3055
  }
3031
3056
  /**
3032
3057
  * Gets all idTokens matching the given filter
@@ -3338,6 +3363,17 @@ class CacheManager {
3338
3363
  typeof cachedUsername === "string" &&
3339
3364
  filterUsername?.toLowerCase() === cachedUsername.toLowerCase());
3340
3365
  }
3366
+ /**
3367
+ * helper to match loginhints
3368
+ * @param entity
3369
+ * @param loginHint
3370
+ * @returns
3371
+ */
3372
+ matchLoginHintWithTenantProfile(tenantProfile, loginHintFilter) {
3373
+ return (tenantProfile.loginHint === loginHintFilter ||
3374
+ tenantProfile.username === loginHintFilter ||
3375
+ tenantProfile.upn === loginHintFilter);
3376
+ }
3341
3377
  /**
3342
3378
  * helper to match assertion
3343
3379
  * @param value
@@ -3430,6 +3466,10 @@ class CacheManager {
3430
3466
  if (tokenClaims.upn === loginHint) {
3431
3467
  return true;
3432
3468
  }
3469
+ // check login hint against list of emails in token claims
3470
+ if (tokenClaims.emails && tokenClaims.emails.includes(loginHint)) {
3471
+ return true;
3472
+ }
3433
3473
  return false;
3434
3474
  }
3435
3475
  /**
@@ -3581,7 +3621,7 @@ class DefaultStorageClass extends CacheManager {
3581
3621
  }
3582
3622
  }
3583
3623
 
3584
- /*! @azure/msal-common v16.4.1 2026-04-01 */
3624
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
3585
3625
  /*
3586
3626
  * Copyright (c) Microsoft Corporation. All rights reserved.
3587
3627
  * Licensed under the MIT License.
@@ -3595,7 +3635,7 @@ class DefaultStorageClass extends CacheManager {
3595
3635
  const PerformanceEventStatus = {
3596
3636
  InProgress: 1};
3597
3637
 
3598
- /*! @azure/msal-common v16.4.1 2026-04-01 */
3638
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
3599
3639
 
3600
3640
  /*
3601
3641
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3650,7 +3690,7 @@ class StubPerformanceClient {
3650
3690
  }
3651
3691
  }
3652
3692
 
3653
- /*! @azure/msal-common v16.4.1 2026-04-01 */
3693
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
3654
3694
 
3655
3695
  /*
3656
3696
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3745,7 +3785,7 @@ function isOidcProtocolMode(config) {
3745
3785
  return (config.authOptions.authority.options.protocolMode === ProtocolMode.OIDC);
3746
3786
  }
3747
3787
 
3748
- /*! @azure/msal-common v16.4.1 2026-04-01 */
3788
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
3749
3789
  /*
3750
3790
  * Copyright (c) Microsoft Corporation. All rights reserved.
3751
3791
  * Licensed under the MIT License.
@@ -3772,7 +3812,7 @@ function isOidcProtocolMode(config) {
3772
3812
  }
3773
3813
  }
3774
3814
 
3775
- /*! @azure/msal-common v16.4.1 2026-04-01 */
3815
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
3776
3816
  /*
3777
3817
  * Copyright (c) Microsoft Corporation. All rights reserved.
3778
3818
  * Licensed under the MIT License.
@@ -3827,7 +3867,7 @@ function delay(t, value) {
3827
3867
  return new Promise((resolve) => setTimeout(() => resolve(value), t));
3828
3868
  }
3829
3869
 
3830
- /*! @azure/msal-common v16.4.1 2026-04-01 */
3870
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
3831
3871
 
3832
3872
  /*
3833
3873
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4086,7 +4126,7 @@ function isAuthorityMetadataExpired(metadata) {
4086
4126
  return metadata.expiresAt <= nowSeconds();
4087
4127
  }
4088
4128
 
4089
- /*! @azure/msal-common v16.4.1 2026-04-01 */
4129
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
4090
4130
  /*
4091
4131
  * Copyright (c) Microsoft Corporation. All rights reserved.
4092
4132
  * Licensed under the MIT License.
@@ -4148,7 +4188,7 @@ const RegionDiscoveryGetCurrentVersion = "regionDiscoveryGetCurrentVersion";
4148
4188
  */
4149
4189
  const CacheManagerGetRefreshToken = "cacheManagerGetRefreshToken";
4150
4190
 
4151
- /*! @azure/msal-common v16.4.1 2026-04-01 */
4191
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
4152
4192
  /*
4153
4193
  * Copyright (c) Microsoft Corporation. All rights reserved.
4154
4194
  * Licensed under the MIT License.
@@ -4241,7 +4281,7 @@ const invokeAsync = (callback, eventName, logger, telemetryClient, correlationId
4241
4281
  };
4242
4282
  };
4243
4283
 
4244
- /*! @azure/msal-common v16.4.1 2026-04-01 */
4284
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
4245
4285
 
4246
4286
  /*
4247
4287
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4321,7 +4361,7 @@ class PopTokenGenerator {
4321
4361
  }
4322
4362
  }
4323
4363
 
4324
- /*! @azure/msal-common v16.4.1 2026-04-01 */
4364
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
4325
4365
  /*
4326
4366
  * Copyright (c) Microsoft Corporation. All rights reserved.
4327
4367
  * Licensed under the MIT License.
@@ -4385,7 +4425,7 @@ var InteractionRequiredAuthErrorCodes = /*#__PURE__*/Object.freeze({
4385
4425
  uxNotAllowed: uxNotAllowed
4386
4426
  });
4387
4427
 
4388
- /*! @azure/msal-common v16.4.1 2026-04-01 */
4428
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
4389
4429
 
4390
4430
  /*
4391
4431
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4453,7 +4493,7 @@ function createInteractionRequiredAuthError(errorCode, errorMessage) {
4453
4493
  return new InteractionRequiredAuthError(errorCode, errorMessage);
4454
4494
  }
4455
4495
 
4456
- /*! @azure/msal-common v16.4.1 2026-04-01 */
4496
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
4457
4497
 
4458
4498
  /*
4459
4499
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4472,7 +4512,7 @@ class ServerError extends AuthError {
4472
4512
  }
4473
4513
  }
4474
4514
 
4475
- /*! @azure/msal-common v16.4.1 2026-04-01 */
4515
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
4476
4516
  /**
4477
4517
  * Parses the state into the RequestStateObject, which contains the LibraryState info and the state passed by the user.
4478
4518
  * @param base64Decode
@@ -4504,7 +4544,7 @@ function parseRequestState(base64Decode, state) {
4504
4544
  }
4505
4545
  }
4506
4546
 
4507
- /*! @azure/msal-common v16.4.1 2026-04-01 */
4547
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
4508
4548
 
4509
4549
  /*
4510
4550
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4852,7 +4892,7 @@ function buildAccountToCache(cacheStorage, authority, homeAccountId, base64Decod
4852
4892
  return baseAccount;
4853
4893
  }
4854
4894
 
4855
- /*! @azure/msal-common v16.4.1 2026-04-01 */
4895
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
4856
4896
  /*
4857
4897
  * Copyright (c) Microsoft Corporation. All rights reserved.
4858
4898
  * Licensed under the MIT License.
@@ -4862,7 +4902,7 @@ const CcsCredentialType = {
4862
4902
  UPN: "UPN",
4863
4903
  };
4864
4904
 
4865
- /*! @azure/msal-common v16.4.1 2026-04-01 */
4905
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
4866
4906
  /*
4867
4907
  * Copyright (c) Microsoft Corporation. All rights reserved.
4868
4908
  * Licensed under the MIT License.
@@ -4880,7 +4920,7 @@ async function getClientAssertion(clientAssertion, clientId, tokenEndpoint) {
4880
4920
  }
4881
4921
  }
4882
4922
 
4883
- /*! @azure/msal-common v16.4.1 2026-04-01 */
4923
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
4884
4924
  /*
4885
4925
  * Copyright (c) Microsoft Corporation. All rights reserved.
4886
4926
  * Licensed under the MIT License.
@@ -4901,7 +4941,7 @@ function getRequestThumbprint(clientId, request, homeAccountId) {
4901
4941
  };
4902
4942
  }
4903
4943
 
4904
- /*! @azure/msal-common v16.4.1 2026-04-01 */
4944
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
4905
4945
 
4906
4946
  /*
4907
4947
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4987,7 +5027,7 @@ class ThrottlingUtils {
4987
5027
  }
4988
5028
  }
4989
5029
 
4990
- /*! @azure/msal-common v16.4.1 2026-04-01 */
5030
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
4991
5031
 
4992
5032
  /*
4993
5033
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5018,7 +5058,7 @@ function createNetworkError(error, httpStatus, responseHeaders, additionalError)
5018
5058
  return new NetworkError(error, httpStatus, responseHeaders);
5019
5059
  }
5020
5060
 
5021
- /*! @azure/msal-common v16.4.1 2026-04-01 */
5061
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
5022
5062
 
5023
5063
  /*
5024
5064
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5132,7 +5172,7 @@ async function sendPostRequest(thumbprint, tokenEndpoint, options, correlationId
5132
5172
  return response;
5133
5173
  }
5134
5174
 
5135
- /*! @azure/msal-common v16.4.1 2026-04-01 */
5175
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
5136
5176
  /*
5137
5177
  * Copyright (c) Microsoft Corporation. All rights reserved.
5138
5178
  * Licensed under the MIT License.
@@ -5144,7 +5184,7 @@ function isOpenIdConfigResponse(response) {
5144
5184
  response.hasOwnProperty("jwks_uri"));
5145
5185
  }
5146
5186
 
5147
- /*! @azure/msal-common v16.4.1 2026-04-01 */
5187
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
5148
5188
  /*
5149
5189
  * Copyright (c) Microsoft Corporation. All rights reserved.
5150
5190
  * Licensed under the MIT License.
@@ -5154,7 +5194,7 @@ function isCloudInstanceDiscoveryResponse(response) {
5154
5194
  response.hasOwnProperty("metadata"));
5155
5195
  }
5156
5196
 
5157
- /*! @azure/msal-common v16.4.1 2026-04-01 */
5197
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
5158
5198
  /*
5159
5199
  * Copyright (c) Microsoft Corporation. All rights reserved.
5160
5200
  * Licensed under the MIT License.
@@ -5164,7 +5204,7 @@ function isCloudInstanceDiscoveryErrorResponse(response) {
5164
5204
  response.hasOwnProperty("error_description"));
5165
5205
  }
5166
5206
 
5167
- /*! @azure/msal-common v16.4.1 2026-04-01 */
5207
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
5168
5208
 
5169
5209
  /*
5170
5210
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5269,7 +5309,7 @@ RegionDiscovery.IMDS_OPTIONS = {
5269
5309
  },
5270
5310
  };
5271
5311
 
5272
- /*! @azure/msal-common v16.4.1 2026-04-01 */
5312
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
5273
5313
 
5274
5314
  /*
5275
5315
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6092,7 +6132,7 @@ function buildStaticAuthorityOptions(authOptions) {
6092
6132
  };
6093
6133
  }
6094
6134
 
6095
- /*! @azure/msal-common v16.4.1 2026-04-01 */
6135
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
6096
6136
 
6097
6137
  /*
6098
6138
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6126,7 +6166,7 @@ async function createDiscoveredInstance(authorityUri, networkClient, cacheManage
6126
6166
  }
6127
6167
  }
6128
6168
 
6129
- /*! @azure/msal-common v16.4.1 2026-04-01 */
6169
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
6130
6170
 
6131
6171
  /*
6132
6172
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6291,11 +6331,6 @@ class AuthorizationCodeClient {
6291
6331
  throw createClientConfigurationError(missingSshJwk);
6292
6332
  }
6293
6333
  }
6294
- if (!StringUtils.isEmptyObj(request.claims) ||
6295
- (this.config.authOptions.clientCapabilities &&
6296
- this.config.authOptions.clientCapabilities.length > 0)) {
6297
- addClaims(parameters, request.claims, this.config.authOptions.clientCapabilities);
6298
- }
6299
6334
  let ccsCred = undefined;
6300
6335
  if (request.clientInfo) {
6301
6336
  try {
@@ -6344,6 +6379,7 @@ class AuthorizationCodeClient {
6344
6379
  });
6345
6380
  }
6346
6381
  instrumentBrokerParams(parameters, request.correlationId, this.performanceClient);
6382
+ addClaims(parameters, request.claims, this.config.authOptions.clientCapabilities, request.skipBrokerClaims);
6347
6383
  return mapToQueryString(parameters);
6348
6384
  }
6349
6385
  /**
@@ -6387,7 +6423,7 @@ class AuthorizationCodeClient {
6387
6423
  }
6388
6424
  }
6389
6425
 
6390
- /*! @azure/msal-common v16.4.1 2026-04-01 */
6426
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
6391
6427
 
6392
6428
  /*
6393
6429
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6577,11 +6613,6 @@ class RefreshTokenClient {
6577
6613
  throw createClientConfigurationError(missingSshJwk);
6578
6614
  }
6579
6615
  }
6580
- if (!StringUtils.isEmptyObj(request.claims) ||
6581
- (this.config.authOptions.clientCapabilities &&
6582
- this.config.authOptions.clientCapabilities.length > 0)) {
6583
- addClaims(parameters, request.claims, this.config.authOptions.clientCapabilities);
6584
- }
6585
6616
  if (this.config.systemOptions.preventCorsPreflight &&
6586
6617
  request.ccsCredential) {
6587
6618
  switch (request.ccsCredential.type) {
@@ -6608,11 +6639,12 @@ class RefreshTokenClient {
6608
6639
  });
6609
6640
  }
6610
6641
  instrumentBrokerParams(parameters, request.correlationId, this.performanceClient);
6642
+ addClaims(parameters, request.claims, this.config.authOptions.clientCapabilities, request.skipBrokerClaims);
6611
6643
  return mapToQueryString(parameters);
6612
6644
  }
6613
6645
  }
6614
6646
 
6615
- /*! @azure/msal-common v16.4.1 2026-04-01 */
6647
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
6616
6648
 
6617
6649
  /*
6618
6650
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6728,7 +6760,7 @@ class SilentFlowClient {
6728
6760
  }
6729
6761
  }
6730
6762
 
6731
- /*! @azure/msal-common v16.4.1 2026-04-01 */
6763
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
6732
6764
 
6733
6765
  /*
6734
6766
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6844,14 +6876,10 @@ function getStandardAuthorizeRequestParameters(authOptions, request, logger, per
6844
6876
  if (request.state) {
6845
6877
  addState(parameters, request.state);
6846
6878
  }
6847
- if (request.claims ||
6848
- (authOptions.clientCapabilities &&
6849
- authOptions.clientCapabilities.length > 0)) {
6850
- addClaims(parameters, request.claims, authOptions.clientCapabilities);
6851
- }
6852
6879
  if (request.embeddedClientId) {
6853
6880
  addBrokerParameters(parameters, authOptions.clientId, authOptions.redirectUri);
6854
6881
  }
6882
+ addClaims(parameters, request.claims, authOptions.clientCapabilities, request.skipBrokerClaims);
6855
6883
  // If extraQueryParameters includes instance_aware its value will be added when extraQueryParameters are added
6856
6884
  if (authOptions.instanceAware &&
6857
6885
  (!request.extraQueryParameters ||
@@ -6881,7 +6909,7 @@ function extractLoginHint(account) {
6881
6909
  return account.loginHint || account.idTokenClaims?.login_hint || null;
6882
6910
  }
6883
6911
 
6884
- /*! @azure/msal-common v16.4.1 2026-04-01 */
6912
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
6885
6913
 
6886
6914
  /*
6887
6915
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6914,7 +6942,7 @@ function containsResourceParam(params) {
6914
6942
  return Object.prototype.hasOwnProperty.call(params, "resource");
6915
6943
  }
6916
6944
 
6917
- /*! @azure/msal-common v16.4.1 2026-04-01 */
6945
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
6918
6946
  /*
6919
6947
  * Copyright (c) Microsoft Corporation. All rights reserved.
6920
6948
  * Licensed under the MIT License.
@@ -6931,7 +6959,7 @@ var AuthErrorCodes = /*#__PURE__*/Object.freeze({
6931
6959
  unexpectedError: unexpectedError
6932
6960
  });
6933
6961
 
6934
- /*! @azure/msal-common v16.4.1 2026-04-01 */
6962
+ /*! @azure/msal-common v16.5.1 2026-04-21 */
6935
6963
 
6936
6964
  /*
6937
6965
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -9134,7 +9162,7 @@ class ClientAssertion {
9134
9162
 
9135
9163
  /* eslint-disable header/header */
9136
9164
  const name = "@azure/msal-node";
9137
- const version = "5.1.2";
9165
+ const version = "5.1.4";
9138
9166
 
9139
9167
  /*
9140
9168
  * Copyright (c) Microsoft Corporation. All rights reserved.