@azure/msal-node 5.0.5 → 5.1.0

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 (85) hide show
  1. package/README.md +2 -0
  2. package/dist/cache/CacheHelpers.mjs +1 -1
  3. package/dist/cache/NodeStorage.mjs +1 -1
  4. package/dist/cache/TokenCache.mjs +1 -1
  5. package/dist/cache/distributed/DistributedCachePlugin.mjs +1 -1
  6. package/dist/cache/serializer/Deserializer.d.ts.map +1 -1
  7. package/dist/cache/serializer/Deserializer.mjs +2 -1
  8. package/dist/cache/serializer/Deserializer.mjs.map +1 -1
  9. package/dist/cache/serializer/Serializer.d.ts.map +1 -1
  10. package/dist/cache/serializer/Serializer.mjs +2 -1
  11. package/dist/cache/serializer/Serializer.mjs.map +1 -1
  12. package/dist/cache/serializer/SerializerTypes.d.ts +1 -0
  13. package/dist/cache/serializer/SerializerTypes.d.ts.map +1 -1
  14. package/dist/client/BaseClient.mjs +1 -1
  15. package/dist/client/ClientApplication.d.ts.map +1 -1
  16. package/dist/client/ClientApplication.mjs +2 -1
  17. package/dist/client/ClientApplication.mjs.map +1 -1
  18. package/dist/client/ClientAssertion.mjs +1 -1
  19. package/dist/client/ClientCredentialClient.mjs +1 -1
  20. package/dist/client/ConfidentialClientApplication.mjs +1 -1
  21. package/dist/client/DeviceCodeClient.mjs +1 -1
  22. package/dist/client/ManagedIdentityApplication.mjs +1 -1
  23. package/dist/client/ManagedIdentityClient.mjs +1 -1
  24. package/dist/client/ManagedIdentitySources/AppService.mjs +1 -1
  25. package/dist/client/ManagedIdentitySources/AzureArc.mjs +1 -1
  26. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.mjs +1 -1
  27. package/dist/client/ManagedIdentitySources/CloudShell.mjs +1 -1
  28. package/dist/client/ManagedIdentitySources/Imds.mjs +1 -1
  29. package/dist/client/ManagedIdentitySources/MachineLearning.mjs +1 -1
  30. package/dist/client/ManagedIdentitySources/ServiceFabric.mjs +1 -1
  31. package/dist/client/OnBehalfOfClient.mjs +1 -1
  32. package/dist/client/PublicClientApplication.d.ts +13 -1
  33. package/dist/client/PublicClientApplication.d.ts.map +1 -1
  34. package/dist/client/PublicClientApplication.mjs +21 -2
  35. package/dist/client/PublicClientApplication.mjs.map +1 -1
  36. package/dist/client/UsernamePasswordClient.mjs +1 -1
  37. package/dist/config/Configuration.d.ts +4 -0
  38. package/dist/config/Configuration.d.ts.map +1 -1
  39. package/dist/config/Configuration.mjs +2 -1
  40. package/dist/config/Configuration.mjs.map +1 -1
  41. package/dist/config/ManagedIdentityId.mjs +1 -1
  42. package/dist/config/ManagedIdentityRequestParameters.mjs +1 -1
  43. package/dist/crypto/CryptoProvider.mjs +1 -1
  44. package/dist/crypto/GuidGenerator.mjs +1 -1
  45. package/dist/crypto/HashUtils.mjs +1 -1
  46. package/dist/crypto/PkceGenerator.mjs +1 -1
  47. package/dist/error/ClientAuthErrorCodes.mjs +1 -1
  48. package/dist/error/ManagedIdentityError.mjs +1 -1
  49. package/dist/error/ManagedIdentityErrorCodes.mjs +1 -1
  50. package/dist/error/NodeAuthError.mjs +1 -1
  51. package/dist/index.mjs +1 -1
  52. package/dist/internals.mjs +1 -1
  53. package/dist/network/HttpClient.mjs +1 -1
  54. package/dist/network/HttpClientWithRetries.mjs +1 -1
  55. package/dist/network/LoopbackClient.mjs +1 -1
  56. package/dist/packageMetadata.d.ts +1 -1
  57. package/dist/packageMetadata.mjs +2 -2
  58. package/dist/protocol/Authorize.mjs +1 -1
  59. package/dist/retry/DefaultManagedIdentityRetryPolicy.mjs +1 -1
  60. package/dist/retry/ExponentialRetryStrategy.mjs +1 -1
  61. package/dist/retry/ImdsRetryPolicy.mjs +1 -1
  62. package/dist/retry/LinearRetryStrategy.mjs +1 -1
  63. package/dist/utils/Constants.mjs +1 -1
  64. package/dist/utils/EncodingUtils.mjs +1 -1
  65. package/dist/utils/TimeUtils.mjs +1 -1
  66. package/lib/msal-node.cjs +147 -68
  67. package/lib/msal-node.cjs.map +1 -1
  68. package/lib/types/cache/serializer/Deserializer.d.ts.map +1 -1
  69. package/lib/types/cache/serializer/Serializer.d.ts.map +1 -1
  70. package/lib/types/cache/serializer/SerializerTypes.d.ts +1 -0
  71. package/lib/types/cache/serializer/SerializerTypes.d.ts.map +1 -1
  72. package/lib/types/client/ClientApplication.d.ts.map +1 -1
  73. package/lib/types/client/PublicClientApplication.d.ts +13 -1
  74. package/lib/types/client/PublicClientApplication.d.ts.map +1 -1
  75. package/lib/types/config/Configuration.d.ts +4 -0
  76. package/lib/types/config/Configuration.d.ts.map +1 -1
  77. package/lib/types/packageMetadata.d.ts +1 -1
  78. package/package.json +2 -2
  79. package/src/cache/serializer/Deserializer.ts +1 -0
  80. package/src/cache/serializer/Serializer.ts +1 -0
  81. package/src/cache/serializer/SerializerTypes.ts +1 -0
  82. package/src/client/ClientApplication.ts +1 -0
  83. package/src/client/PublicClientApplication.ts +29 -0
  84. package/src/config/Configuration.ts +5 -0
  85. package/src/packageMetadata.ts +1 -1
package/lib/msal-node.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v5.0.5 2026-02-24 */
1
+ /*! @azure/msal-node v5.1.0 2026-03-13 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
@@ -93,6 +93,7 @@ class Serializer {
93
93
  key_id: atEntity.keyId,
94
94
  token_type: atEntity.tokenType,
95
95
  userAssertionHash: atEntity.userAssertionHash,
96
+ resource: atEntity.resource,
96
97
  };
97
98
  });
98
99
  return accessTokens;
@@ -149,7 +150,7 @@ class Serializer {
149
150
  }
150
151
  }
151
152
 
152
- /*! @azure/msal-common v16.1.0 2026-02-24 */
153
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
153
154
  /*
154
155
  * Copyright (c) Microsoft Corporation. All rights reserved.
155
156
  * Licensed under the MIT License.
@@ -397,7 +398,7 @@ const EncodingTypes = {
397
398
  UTF8: "utf-8",
398
399
  };
399
400
 
400
- /*! @azure/msal-common v16.1.0 2026-02-24 */
401
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
401
402
  /*
402
403
  * Copyright (c) Microsoft Corporation. All rights reserved.
403
404
  * Licensed under the MIT License.
@@ -446,9 +447,10 @@ const DOMAIN_HINT = "domain_hint";
446
447
  const X_CLIENT_EXTRA_SKU = "x-client-xtra-sku";
447
448
  const BROKER_CLIENT_ID = "brk_client_id";
448
449
  const BROKER_REDIRECT_URI = "brk_redirect_uri";
449
- const INSTANCE_AWARE = "instance_aware";
450
+ const INSTANCE_AWARE = "instance_aware";
451
+ const RESOURCE = "resource";
450
452
 
451
- /*! @azure/msal-common v16.1.0 2026-02-24 */
453
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
452
454
  /*
453
455
  * Copyright (c) Microsoft Corporation. All rights reserved.
454
456
  * Licensed under the MIT License.
@@ -479,7 +481,7 @@ function createAuthError(code, additionalMessage) {
479
481
  return new AuthError(code, additionalMessage || getDefaultErrorMessage(code));
480
482
  }
481
483
 
482
- /*! @azure/msal-common v16.1.0 2026-02-24 */
484
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
483
485
 
484
486
  /*
485
487
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -499,7 +501,7 @@ function createClientConfigurationError(errorCode) {
499
501
  return new ClientConfigurationError(errorCode);
500
502
  }
501
503
 
502
- /*! @azure/msal-common v16.1.0 2026-02-24 */
504
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
503
505
  /*
504
506
  * Copyright (c) Microsoft Corporation. All rights reserved.
505
507
  * Licensed under the MIT License.
@@ -579,7 +581,7 @@ class StringUtils {
579
581
  }
580
582
  }
581
583
 
582
- /*! @azure/msal-common v16.1.0 2026-02-24 */
584
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
583
585
 
584
586
  /*
585
587
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -602,7 +604,7 @@ function createClientAuthError(errorCode, additionalMessage) {
602
604
  return new ClientAuthError(errorCode, additionalMessage);
603
605
  }
604
606
 
605
- /*! @azure/msal-common v16.1.0 2026-02-24 */
607
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
606
608
  /*
607
609
  * Copyright (c) Microsoft Corporation. All rights reserved.
608
610
  * Licensed under the MIT License.
@@ -656,7 +658,7 @@ var ClientConfigurationErrorCodes = /*#__PURE__*/Object.freeze({
656
658
  urlParseError: urlParseError
657
659
  });
658
660
 
659
- /*! @azure/msal-common v16.1.0 2026-02-24 */
661
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
660
662
  /*
661
663
  * Copyright (c) Microsoft Corporation. All rights reserved.
662
664
  * Licensed under the MIT License.
@@ -697,7 +699,9 @@ const noNetworkConnectivity = "no_network_connectivity";
697
699
  const userCanceled = "user_canceled";
698
700
  const methodNotImplemented = "method_not_implemented";
699
701
  const nestedAppAuthBridgeDisabled = "nested_app_auth_bridge_disabled";
700
- const platformBrokerError = "platform_broker_error";
702
+ const platformBrokerError = "platform_broker_error";
703
+ const resourceParameterRequired = "resource_parameter_required";
704
+ const misplacedResourceParam = "misplaced_resource_parameter";
701
705
 
702
706
  var ClientAuthErrorCodes = /*#__PURE__*/Object.freeze({
703
707
  __proto__: null,
@@ -718,6 +722,7 @@ var ClientAuthErrorCodes = /*#__PURE__*/Object.freeze({
718
722
  keyIdMissing: keyIdMissing,
719
723
  maxAgeTranspired: maxAgeTranspired,
720
724
  methodNotImplemented: methodNotImplemented,
725
+ misplacedResourceParam: misplacedResourceParam,
721
726
  multipleMatchingAppMetadata: multipleMatchingAppMetadata,
722
727
  multipleMatchingTokens: multipleMatchingTokens,
723
728
  nestedAppAuthBridgeDisabled: nestedAppAuthBridgeDisabled,
@@ -731,6 +736,7 @@ var ClientAuthErrorCodes = /*#__PURE__*/Object.freeze({
731
736
  openIdConfigError: openIdConfigError,
732
737
  platformBrokerError: platformBrokerError,
733
738
  requestCannotBeMade: requestCannotBeMade,
739
+ resourceParameterRequired: resourceParameterRequired,
734
740
  stateMismatch: stateMismatch,
735
741
  stateNotFound: stateNotFound,
736
742
  tokenClaimsCnfRequiredForSignedJwt: tokenClaimsCnfRequiredForSignedJwt,
@@ -740,7 +746,7 @@ var ClientAuthErrorCodes = /*#__PURE__*/Object.freeze({
740
746
  userCanceled: userCanceled
741
747
  });
742
748
 
743
- /*! @azure/msal-common v16.1.0 2026-02-24 */
749
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
744
750
 
745
751
  /*
746
752
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -935,7 +941,7 @@ class ScopeSet {
935
941
  }
936
942
  }
937
943
 
938
- /*! @azure/msal-common v16.1.0 2026-02-24 */
944
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
939
945
 
940
946
  /*
941
947
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1318,9 +1324,14 @@ function addBrokerParameters(parameters, brokerClientId, brokerRedirectUri) {
1318
1324
  if (!parameters.has(BROKER_REDIRECT_URI)) {
1319
1325
  parameters.set(BROKER_REDIRECT_URI, brokerRedirectUri);
1320
1326
  }
1327
+ }
1328
+ function addResource(parameters, resource) {
1329
+ if (resource) {
1330
+ parameters.set(RESOURCE, resource);
1331
+ }
1321
1332
  }
1322
1333
 
1323
- /*! @azure/msal-common v16.1.0 2026-02-24 */
1334
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
1324
1335
  /**
1325
1336
  * Parses hash string from given string. Returns empty string if no hash symbol is found.
1326
1337
  * @param hashString
@@ -1373,7 +1384,7 @@ function mapToQueryString(parameters) {
1373
1384
  return queryParameterArray.join("&");
1374
1385
  }
1375
1386
 
1376
- /*! @azure/msal-common v16.1.0 2026-02-24 */
1387
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
1377
1388
 
1378
1389
  /*
1379
1390
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1412,7 +1423,7 @@ const DEFAULT_CRYPTO_IMPLEMENTATION = {
1412
1423
  },
1413
1424
  };
1414
1425
 
1415
- /*! @azure/msal-common v16.1.0 2026-02-24 */
1426
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
1416
1427
  /*
1417
1428
  * Copyright (c) Microsoft Corporation. All rights reserved.
1418
1429
  * Licensed under the MIT License.
@@ -1673,12 +1684,12 @@ class Logger {
1673
1684
  }
1674
1685
  }
1675
1686
 
1676
- /*! @azure/msal-common v16.1.0 2026-02-24 */
1687
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
1677
1688
  /* eslint-disable header/header */
1678
1689
  const name$1 = "@azure/msal-common";
1679
- const version$1 = "16.1.0";
1690
+ const version$1 = "16.3.0";
1680
1691
 
1681
- /*! @azure/msal-common v16.1.0 2026-02-24 */
1692
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
1682
1693
  /*
1683
1694
  * Copyright (c) Microsoft Corporation. All rights reserved.
1684
1695
  * Licensed under the MIT License.
@@ -1698,7 +1709,7 @@ const AzureCloudInstance = {
1698
1709
  AzureUsGovernment: "https://login.microsoftonline.us",
1699
1710
  };
1700
1711
 
1701
- /*! @azure/msal-common v16.1.0 2026-02-24 */
1712
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
1702
1713
  /*
1703
1714
  * Copyright (c) Microsoft Corporation. All rights reserved.
1704
1715
  * Licensed under the MIT License.
@@ -1780,7 +1791,7 @@ function updateAccountTenantProfileData(baseAccountInfo, tenantProfile, idTokenC
1780
1791
  return updatedAccountInfo;
1781
1792
  }
1782
1793
 
1783
- /*! @azure/msal-common v16.1.0 2026-02-24 */
1794
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
1784
1795
 
1785
1796
  /*
1786
1797
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1860,7 +1871,7 @@ function checkMaxAge(authTime, maxAge) {
1860
1871
  }
1861
1872
  }
1862
1873
 
1863
- /*! @azure/msal-common v16.1.0 2026-02-24 */
1874
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
1864
1875
 
1865
1876
  /*
1866
1877
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2017,7 +2028,7 @@ class UrlString {
2017
2028
  }
2018
2029
  }
2019
2030
 
2020
- /*! @azure/msal-common v16.1.0 2026-02-24 */
2031
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
2021
2032
 
2022
2033
  /*
2023
2034
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2174,7 +2185,7 @@ function getCloudDiscoveryMetadataFromNetworkResponse(response, authorityHost) {
2174
2185
  return null;
2175
2186
  }
2176
2187
 
2177
- /*! @azure/msal-common v16.1.0 2026-02-24 */
2188
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
2178
2189
  /*
2179
2190
  * Copyright (c) Microsoft Corporation. All rights reserved.
2180
2191
  * Licensed under the MIT License.
@@ -2182,7 +2193,7 @@ function getCloudDiscoveryMetadataFromNetworkResponse(response, authorityHost) {
2182
2193
  const cacheQuotaExceeded = "cache_quota_exceeded";
2183
2194
  const cacheErrorUnknown = "cache_error_unknown";
2184
2195
 
2185
- /*! @azure/msal-common v16.1.0 2026-02-24 */
2196
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
2186
2197
 
2187
2198
  /*
2188
2199
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2220,7 +2231,7 @@ function createCacheError(e) {
2220
2231
  }
2221
2232
  }
2222
2233
 
2223
- /*! @azure/msal-common v16.1.0 2026-02-24 */
2234
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
2224
2235
 
2225
2236
  /*
2226
2237
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2258,7 +2269,7 @@ function buildClientInfoFromHomeAccountId(homeAccountId) {
2258
2269
  };
2259
2270
  }
2260
2271
 
2261
- /*! @azure/msal-common v16.1.0 2026-02-24 */
2272
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
2262
2273
  /*
2263
2274
  * Copyright (c) Microsoft Corporation. All rights reserved.
2264
2275
  * Licensed under the MIT License.
@@ -2273,7 +2284,7 @@ const AuthorityType = {
2273
2284
  Ciam: 3,
2274
2285
  };
2275
2286
 
2276
- /*! @azure/msal-common v16.1.0 2026-02-24 */
2287
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
2277
2288
  /*
2278
2289
  * Copyright (c) Microsoft Corporation. All rights reserved.
2279
2290
  * Licensed under the MIT License.
@@ -2295,7 +2306,7 @@ function getTenantIdFromIdTokenClaims(idTokenClaims) {
2295
2306
  return null;
2296
2307
  }
2297
2308
 
2298
- /*! @azure/msal-common v16.1.0 2026-02-24 */
2309
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
2299
2310
  /*
2300
2311
  * Copyright (c) Microsoft Corporation. All rights reserved.
2301
2312
  * Licensed under the MIT License.
@@ -2319,7 +2330,7 @@ const ProtocolMode = {
2319
2330
  EAR: "EAR",
2320
2331
  };
2321
2332
 
2322
- /*! @azure/msal-common v16.1.0 2026-02-24 */
2333
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
2323
2334
  /**
2324
2335
  * Returns the AccountInfo interface for this account.
2325
2336
  */
@@ -2462,7 +2473,7 @@ function isAccountEntity(entity) {
2462
2473
  entity.hasOwnProperty("authorityType"));
2463
2474
  }
2464
2475
 
2465
- /*! @azure/msal-common v16.1.0 2026-02-24 */
2476
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
2466
2477
 
2467
2478
  /*
2468
2479
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3558,7 +3569,7 @@ class DefaultStorageClass extends CacheManager {
3558
3569
  }
3559
3570
  }
3560
3571
 
3561
- /*! @azure/msal-common v16.1.0 2026-02-24 */
3572
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
3562
3573
  /*
3563
3574
  * Copyright (c) Microsoft Corporation. All rights reserved.
3564
3575
  * Licensed under the MIT License.
@@ -3572,7 +3583,7 @@ class DefaultStorageClass extends CacheManager {
3572
3583
  const PerformanceEventStatus = {
3573
3584
  InProgress: 1};
3574
3585
 
3575
- /*! @azure/msal-common v16.1.0 2026-02-24 */
3586
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
3576
3587
 
3577
3588
  /*
3578
3589
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3627,7 +3638,7 @@ class StubPerformanceClient {
3627
3638
  }
3628
3639
  }
3629
3640
 
3630
- /*! @azure/msal-common v16.1.0 2026-02-24 */
3641
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
3631
3642
 
3632
3643
  /*
3633
3644
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3710,6 +3721,7 @@ function buildAuthOptions(authOptions) {
3710
3721
  clientCapabilities: [],
3711
3722
  azureCloudOptions: DEFAULT_AZURE_CLOUD_OPTIONS,
3712
3723
  instanceAware: false,
3724
+ isMcp: false,
3713
3725
  ...authOptions,
3714
3726
  };
3715
3727
  }
@@ -3721,7 +3733,7 @@ function isOidcProtocolMode(config) {
3721
3733
  return (config.authOptions.authority.options.protocolMode === ProtocolMode.OIDC);
3722
3734
  }
3723
3735
 
3724
- /*! @azure/msal-common v16.1.0 2026-02-24 */
3736
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
3725
3737
 
3726
3738
  /*
3727
3739
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3740,7 +3752,7 @@ class ServerError extends AuthError {
3740
3752
  }
3741
3753
  }
3742
3754
 
3743
- /*! @azure/msal-common v16.1.0 2026-02-24 */
3755
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
3744
3756
  /*
3745
3757
  * Copyright (c) Microsoft Corporation. All rights reserved.
3746
3758
  * Licensed under the MIT License.
@@ -3804,7 +3816,7 @@ var InteractionRequiredAuthErrorCodes = /*#__PURE__*/Object.freeze({
3804
3816
  uxNotAllowed: uxNotAllowed
3805
3817
  });
3806
3818
 
3807
- /*! @azure/msal-common v16.1.0 2026-02-24 */
3819
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
3808
3820
 
3809
3821
  /*
3810
3822
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3872,7 +3884,7 @@ function createInteractionRequiredAuthError(errorCode, errorMessage) {
3872
3884
  return new InteractionRequiredAuthError(errorCode, errorMessage);
3873
3885
  }
3874
3886
 
3875
- /*! @azure/msal-common v16.1.0 2026-02-24 */
3887
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
3876
3888
  /**
3877
3889
  * Parses the state into the RequestStateObject, which contains the LibraryState info and the state passed by the user.
3878
3890
  * @param base64Decode
@@ -3904,7 +3916,7 @@ function parseRequestState(base64Decode, state) {
3904
3916
  }
3905
3917
  }
3906
3918
 
3907
- /*! @azure/msal-common v16.1.0 2026-02-24 */
3919
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
3908
3920
  /*
3909
3921
  * Copyright (c) Microsoft Corporation. All rights reserved.
3910
3922
  * Licensed under the MIT License.
@@ -3959,7 +3971,7 @@ function delay(t, value) {
3959
3971
  return new Promise((resolve) => setTimeout(() => resolve(value), t));
3960
3972
  }
3961
3973
 
3962
- /*! @azure/msal-common v16.1.0 2026-02-24 */
3974
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
3963
3975
  /*
3964
3976
  * Copyright (c) Microsoft Corporation. All rights reserved.
3965
3977
  * Licensed under the MIT License.
@@ -4021,7 +4033,7 @@ const RegionDiscoveryGetCurrentVersion = "regionDiscoveryGetCurrentVersion";
4021
4033
  */
4022
4034
  const CacheManagerGetRefreshToken = "cacheManagerGetRefreshToken";
4023
4035
 
4024
- /*! @azure/msal-common v16.1.0 2026-02-24 */
4036
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
4025
4037
  /*
4026
4038
  * Copyright (c) Microsoft Corporation. All rights reserved.
4027
4039
  * Licensed under the MIT License.
@@ -4044,8 +4056,7 @@ const invoke = (callback, eventName, logger, telemetryClient, correlationId) =>
4044
4056
  const inProgressEvent = telemetryClient.startMeasurement(eventName, correlationId);
4045
4057
  if (correlationId) {
4046
4058
  // Track number of times this API is called in a single request
4047
- const eventCount = eventName + "CallCount";
4048
- telemetryClient.incrementFields({ [eventCount]: 1 }, correlationId);
4059
+ telemetryClient.incrementFields({ [`ext.${eventName}CallCount`]: 1 }, correlationId);
4049
4060
  }
4050
4061
  try {
4051
4062
  const result = callback(...args);
@@ -4089,8 +4100,7 @@ const invokeAsync = (callback, eventName, logger, telemetryClient, correlationId
4089
4100
  const inProgressEvent = telemetryClient.startMeasurement(eventName, correlationId);
4090
4101
  if (correlationId) {
4091
4102
  // Track number of times this API is called in a single request
4092
- const eventCount = eventName + "CallCount";
4093
- telemetryClient.incrementFields({ [eventCount]: 1 }, correlationId);
4103
+ telemetryClient.incrementFields({ [`ext.${eventName}CallCount`]: 1 }, correlationId);
4094
4104
  }
4095
4105
  return callback(...args)
4096
4106
  .then((response) => {
@@ -4116,7 +4126,7 @@ const invokeAsync = (callback, eventName, logger, telemetryClient, correlationId
4116
4126
  };
4117
4127
  };
4118
4128
 
4119
- /*! @azure/msal-common v16.1.0 2026-02-24 */
4129
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
4120
4130
 
4121
4131
  /*
4122
4132
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4196,7 +4206,7 @@ class PopTokenGenerator {
4196
4206
  }
4197
4207
  }
4198
4208
 
4199
- /*! @azure/msal-common v16.1.0 2026-02-24 */
4209
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
4200
4210
  /*
4201
4211
  * Copyright (c) Microsoft Corporation. All rights reserved.
4202
4212
  * Licensed under the MIT License.
@@ -4223,7 +4233,7 @@ class PopTokenGenerator {
4223
4233
  }
4224
4234
  }
4225
4235
 
4226
- /*! @azure/msal-common v16.1.0 2026-02-24 */
4236
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
4227
4237
 
4228
4238
  /*
4229
4239
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4482,7 +4492,7 @@ function isAuthorityMetadataExpired(metadata) {
4482
4492
  return metadata.expiresAt <= nowSeconds();
4483
4493
  }
4484
4494
 
4485
- /*! @azure/msal-common v16.1.0 2026-02-24 */
4495
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
4486
4496
 
4487
4497
  /*
4488
4498
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4667,6 +4677,11 @@ class ResponseHandler {
4667
4677
  : undefined;
4668
4678
  // non AAD scenarios can have empty realm
4669
4679
  cachedAccessToken = createAccessTokenEntity(this.homeAccountIdentifier, env, serverTokenResponse.access_token, this.clientId, claimsTenantId || authority.tenant || "", responseScopes.printScopes(), tokenExpirationSeconds, extendedTokenExpirationSeconds, this.cryptoObj.base64Decode, refreshOnSeconds, serverTokenResponse.token_type, userAssertionHash, serverTokenResponse.key_id);
4680
+ // Set resource (to be used for MCP scenarios)
4681
+ const resource = request.resource || null;
4682
+ if (resource) {
4683
+ cachedAccessToken.resource = resource;
4684
+ }
4670
4685
  }
4671
4686
  // refreshToken
4672
4687
  let cachedRefreshToken = null;
@@ -4818,7 +4833,7 @@ function buildAccountToCache(cacheStorage, authority, homeAccountId, base64Decod
4818
4833
  return baseAccount;
4819
4834
  }
4820
4835
 
4821
- /*! @azure/msal-common v16.1.0 2026-02-24 */
4836
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
4822
4837
  /*
4823
4838
  * Copyright (c) Microsoft Corporation. All rights reserved.
4824
4839
  * Licensed under the MIT License.
@@ -4828,7 +4843,7 @@ const CcsCredentialType = {
4828
4843
  UPN: "UPN",
4829
4844
  };
4830
4845
 
4831
- /*! @azure/msal-common v16.1.0 2026-02-24 */
4846
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
4832
4847
  /*
4833
4848
  * Copyright (c) Microsoft Corporation. All rights reserved.
4834
4849
  * Licensed under the MIT License.
@@ -4846,7 +4861,7 @@ async function getClientAssertion(clientAssertion, clientId, tokenEndpoint) {
4846
4861
  }
4847
4862
  }
4848
4863
 
4849
- /*! @azure/msal-common v16.1.0 2026-02-24 */
4864
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
4850
4865
  /*
4851
4866
  * Copyright (c) Microsoft Corporation. All rights reserved.
4852
4867
  * Licensed under the MIT License.
@@ -4867,7 +4882,7 @@ function getRequestThumbprint(clientId, request, homeAccountId) {
4867
4882
  };
4868
4883
  }
4869
4884
 
4870
- /*! @azure/msal-common v16.1.0 2026-02-24 */
4885
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
4871
4886
 
4872
4887
  /*
4873
4888
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4953,7 +4968,7 @@ class ThrottlingUtils {
4953
4968
  }
4954
4969
  }
4955
4970
 
4956
- /*! @azure/msal-common v16.1.0 2026-02-24 */
4971
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
4957
4972
 
4958
4973
  /*
4959
4974
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4984,7 +4999,7 @@ function createNetworkError(error, httpStatus, responseHeaders, additionalError)
4984
4999
  return new NetworkError(error, httpStatus, responseHeaders);
4985
5000
  }
4986
5001
 
4987
- /*! @azure/msal-common v16.1.0 2026-02-24 */
5002
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
4988
5003
 
4989
5004
  /*
4990
5005
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5098,7 +5113,7 @@ async function sendPostRequest(thumbprint, tokenEndpoint, options, correlationId
5098
5113
  return response;
5099
5114
  }
5100
5115
 
5101
- /*! @azure/msal-common v16.1.0 2026-02-24 */
5116
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
5102
5117
  /*
5103
5118
  * Copyright (c) Microsoft Corporation. All rights reserved.
5104
5119
  * Licensed under the MIT License.
@@ -5110,7 +5125,7 @@ function isOpenIdConfigResponse(response) {
5110
5125
  response.hasOwnProperty("jwks_uri"));
5111
5126
  }
5112
5127
 
5113
- /*! @azure/msal-common v16.1.0 2026-02-24 */
5128
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
5114
5129
  /*
5115
5130
  * Copyright (c) Microsoft Corporation. All rights reserved.
5116
5131
  * Licensed under the MIT License.
@@ -5120,7 +5135,7 @@ function isCloudInstanceDiscoveryResponse(response) {
5120
5135
  response.hasOwnProperty("metadata"));
5121
5136
  }
5122
5137
 
5123
- /*! @azure/msal-common v16.1.0 2026-02-24 */
5138
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
5124
5139
  /*
5125
5140
  * Copyright (c) Microsoft Corporation. All rights reserved.
5126
5141
  * Licensed under the MIT License.
@@ -5130,7 +5145,7 @@ function isCloudInstanceDiscoveryErrorResponse(response) {
5130
5145
  response.hasOwnProperty("error_description"));
5131
5146
  }
5132
5147
 
5133
- /*! @azure/msal-common v16.1.0 2026-02-24 */
5148
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
5134
5149
 
5135
5150
  /*
5136
5151
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5235,7 +5250,7 @@ RegionDiscovery.IMDS_OPTIONS = {
5235
5250
  },
5236
5251
  };
5237
5252
 
5238
- /*! @azure/msal-common v16.1.0 2026-02-24 */
5253
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
5239
5254
 
5240
5255
  /*
5241
5256
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6058,7 +6073,7 @@ function buildStaticAuthorityOptions(authOptions) {
6058
6073
  };
6059
6074
  }
6060
6075
 
6061
- /*! @azure/msal-common v16.1.0 2026-02-24 */
6076
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
6062
6077
 
6063
6078
  /*
6064
6079
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6092,7 +6107,7 @@ async function createDiscoveredInstance(authorityUri, networkClient, cacheManage
6092
6107
  }
6093
6108
  }
6094
6109
 
6095
- /*! @azure/msal-common v16.1.0 2026-02-24 */
6110
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
6096
6111
 
6097
6112
  /*
6098
6113
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6212,6 +6227,7 @@ class AuthorizationCodeClient {
6212
6227
  }
6213
6228
  // Add scope array, parameter builder will add default scopes and dedupe
6214
6229
  addScopes(parameters, request.scopes, true, this.oidcDefaultScopes);
6230
+ addResource(parameters, request.resource);
6215
6231
  // add code: user set, not validated
6216
6232
  addAuthorizationCode(parameters, request.code);
6217
6233
  // Add library metadata
@@ -6352,7 +6368,7 @@ class AuthorizationCodeClient {
6352
6368
  }
6353
6369
  }
6354
6370
 
6355
- /*! @azure/msal-common v16.1.0 2026-02-24 */
6371
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
6356
6372
 
6357
6373
  /*
6358
6374
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6577,7 +6593,7 @@ class RefreshTokenClient {
6577
6593
  }
6578
6594
  }
6579
6595
 
6580
- /*! @azure/msal-common v16.1.0 2026-02-24 */
6596
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
6581
6597
 
6582
6598
  /*
6583
6599
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6633,6 +6649,13 @@ class SilentFlowClient {
6633
6649
  this.setCacheOutcome(CacheOutcome.CACHED_ACCESS_TOKEN_EXPIRED, request.correlationId);
6634
6650
  throw createClientAuthError(tokenRefreshRequired);
6635
6651
  }
6652
+ else if (request.resource) {
6653
+ // cached access token must have a resource that matches the request resource for MCP scenarios
6654
+ if (cachedAccessToken.resource !== request.resource) {
6655
+ this.setCacheOutcome(CacheOutcome.NO_CACHED_ACCESS_TOKEN, request.correlationId);
6656
+ throw createClientAuthError(tokenRefreshRequired);
6657
+ }
6658
+ }
6636
6659
  else if (cachedAccessToken.refreshOn &&
6637
6660
  isTokenExpired(cachedAccessToken.refreshOn, 0)) {
6638
6661
  // must refresh (in the background) due to the refresh_in value
@@ -6686,7 +6709,7 @@ class SilentFlowClient {
6686
6709
  }
6687
6710
  }
6688
6711
 
6689
- /*! @azure/msal-common v16.1.0 2026-02-24 */
6712
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
6690
6713
 
6691
6714
  /*
6692
6715
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6712,6 +6735,7 @@ function getStandardAuthorizeRequestParameters(authOptions, request, logger, per
6712
6735
  ...(request.extraScopesToConsent || []),
6713
6736
  ];
6714
6737
  addScopes(parameters, requestScopes, true, authOptions.authority.options.OIDCOptions?.defaultScopes);
6738
+ addResource(parameters, request.resource);
6715
6739
  addRedirectUri(parameters, request.redirectUri);
6716
6740
  addCorrelationId(parameters, correlationId);
6717
6741
  // add response_mode. If not passed in it defaults to query.
@@ -6836,7 +6860,40 @@ function extractLoginHint(account) {
6836
6860
  return account.loginHint || account.idTokenClaims?.login_hint || null;
6837
6861
  }
6838
6862
 
6839
- /*! @azure/msal-common v16.1.0 2026-02-24 */
6863
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
6864
+
6865
+ /*
6866
+ * Copyright (c) Microsoft Corporation. All rights reserved.
6867
+ * Licensed under the MIT License.
6868
+ */
6869
+ /**
6870
+ * Helper to enforce resource parameter presence in token requests when isMcp is set in the configuration.
6871
+ * If resource parameter is set in both the request and in extraQueryParameters or extraParameters, an error will be thrown.
6872
+ * This is used for MCP flows.
6873
+ * @param isMcp - Flag indicating if application is an MCP app, from configuration
6874
+ * @param request - Auth request
6875
+ */
6876
+ function enforceResourceParameter(isMcp, request) {
6877
+ if (!isMcp) {
6878
+ return;
6879
+ }
6880
+ if (request.resource &&
6881
+ (containsResourceParam(request.extraParameters) ||
6882
+ containsResourceParam(request.extraQueryParameters))) {
6883
+ throw createClientAuthError(misplacedResourceParam);
6884
+ }
6885
+ if (!request.resource) {
6886
+ throw createClientAuthError(resourceParameterRequired);
6887
+ }
6888
+ }
6889
+ function containsResourceParam(params) {
6890
+ if (!params) {
6891
+ return false;
6892
+ }
6893
+ return Object.prototype.hasOwnProperty.call(params, "resource");
6894
+ }
6895
+
6896
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
6840
6897
  /*
6841
6898
  * Copyright (c) Microsoft Corporation. All rights reserved.
6842
6899
  * Licensed under the MIT License.
@@ -6853,7 +6910,7 @@ var AuthErrorCodes = /*#__PURE__*/Object.freeze({
6853
6910
  unexpectedError: unexpectedError
6854
6911
  });
6855
6912
 
6856
- /*! @azure/msal-common v16.1.0 2026-02-24 */
6913
+ /*! @azure/msal-common v16.3.0 2026-03-13 */
6857
6914
 
6858
6915
  /*
6859
6916
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7210,6 +7267,7 @@ class Deserializer {
7210
7267
  keyId: serializedAT.key_id,
7211
7268
  tokenType: serializedAT.token_type,
7212
7269
  userAssertionHash: serializedAT.userAssertionHash,
7270
+ resource: serializedAT.resource,
7213
7271
  lastUpdatedAt: Date.now().toString(),
7214
7272
  };
7215
7273
  atObjects[key] = accessToken;
@@ -7853,6 +7911,7 @@ const DEFAULT_AUTH_OPTIONS = {
7853
7911
  azureCloudInstance: AzureCloudInstance.None,
7854
7912
  tenant: "",
7855
7913
  },
7914
+ isMcp: false,
7856
7915
  };
7857
7916
  const DEFAULT_LOGGER_OPTIONS = {
7858
7917
  loggerCallback: () => {
@@ -9054,7 +9113,7 @@ class ClientAssertion {
9054
9113
 
9055
9114
  /* eslint-disable header/header */
9056
9115
  const name = "@azure/msal-node";
9057
- const version = "5.0.5";
9116
+ const version = "5.1.0";
9058
9117
 
9059
9118
  /*
9060
9119
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -9507,6 +9566,7 @@ class ClientApplication {
9507
9566
  authority: discoveredAuthority,
9508
9567
  clientCapabilities: this.config.auth.clientCapabilities,
9509
9568
  redirectUri,
9569
+ isMcp: this.config.auth.isMcp,
9510
9570
  },
9511
9571
  loggerOptions: {
9512
9572
  logLevel: this.config.system.loggerOptions.logLevel,
@@ -9958,6 +10018,7 @@ class PublicClientApplication extends ClientApplication {
9958
10018
  */
9959
10019
  async acquireTokenByDeviceCode(request) {
9960
10020
  this.logger.info("acquireTokenByDeviceCode called", request.correlationId || "");
10021
+ enforceResourceParameter(this.config.auth.isMcp, request);
9961
10022
  const validRequest = Object.assign(request, await this.initializeBaseRequest(request));
9962
10023
  const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenByDeviceCode, validRequest.correlationId);
9963
10024
  try {
@@ -9981,6 +10042,7 @@ class PublicClientApplication extends ClientApplication {
9981
10042
  async acquireTokenInteractive(request) {
9982
10043
  const correlationId = request.correlationId || this.cryptoProvider.createNewGuid();
9983
10044
  this.logger.trace("acquireTokenInteractive called", correlationId);
10045
+ enforceResourceParameter(this.config.auth.isMcp, request);
9984
10046
  const { openBrowser, successTemplate, errorTemplate, windowHandle, loopbackClient: customLoopbackClient, ...remainingProperties } = request;
9985
10047
  if (this.nativeBrokerPlugin) {
9986
10048
  const brokerRequest = {
@@ -10065,6 +10127,7 @@ class PublicClientApplication extends ClientApplication {
10065
10127
  async acquireTokenSilent(request) {
10066
10128
  const correlationId = request.correlationId || this.cryptoProvider.createNewGuid();
10067
10129
  this.logger.trace("acquireTokenSilent called", correlationId);
10130
+ enforceResourceParameter(this.config.auth.isMcp, request);
10068
10131
  if (this.nativeBrokerPlugin) {
10069
10132
  const brokerRequest = {
10070
10133
  ...request,
@@ -10092,6 +10155,22 @@ class PublicClientApplication extends ClientApplication {
10092
10155
  }
10093
10156
  return super.acquireTokenSilent(request);
10094
10157
  }
10158
+ /**
10159
+ * Acquires a token by exchanging the authorization code received from the first step of OAuth 2.0 Authorization Code Flow.
10160
+ * In MCP mode, a resource parameter is required on the request.
10161
+ */
10162
+ async acquireTokenByCode(request, authCodePayLoad) {
10163
+ enforceResourceParameter(this.config.auth.isMcp, request);
10164
+ return super.acquireTokenByCode(request, authCodePayLoad);
10165
+ }
10166
+ /**
10167
+ * Acquires a token by exchanging the refresh token provided for a new set of tokens.
10168
+ * In MCP mode, a resource parameter is required on the request.
10169
+ */
10170
+ async acquireTokenByRefreshToken(request) {
10171
+ enforceResourceParameter(this.config.auth.isMcp, request);
10172
+ return super.acquireTokenByRefreshToken(request);
10173
+ }
10095
10174
  /**
10096
10175
  * Removes cache artifacts associated with the given account
10097
10176
  * @param request - developer provided SignOutRequest