@azure/msal-node-extensions 1.5.24 → 1.5.26

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 (63) hide show
  1. package/bin/arm64/dpapi.node +0 -0
  2. package/bin/ia32/dpapi.node +0 -0
  3. package/bin/x64/dpapi.node +0 -0
  4. package/dist/Dpapi.mjs +1 -1
  5. package/dist/broker/NativeBrokerPlugin.mjs +20 -15
  6. package/dist/broker/NativeBrokerPlugin.mjs.map +1 -1
  7. package/dist/error/PersistenceError.mjs +1 -1
  8. package/dist/index.d.ts +0 -1
  9. package/dist/index.mjs +1 -2
  10. package/dist/index.mjs.map +1 -1
  11. package/dist/lib/msal-common/dist/constants/AADServerParamKeys.mjs +2 -2
  12. package/dist/lib/msal-common/dist/constants/AADServerParamKeys.mjs.map +1 -1
  13. package/dist/lib/msal-common/dist/error/AuthError.mjs +2 -2
  14. package/dist/lib/msal-common/dist/error/AuthError.mjs.map +1 -1
  15. package/dist/lib/msal-common/dist/error/ClientAuthError.mjs +4 -3
  16. package/dist/lib/msal-common/dist/error/ClientAuthError.mjs.map +1 -1
  17. package/dist/lib/msal-common/dist/error/ClientAuthErrorCodes.mjs +5 -4
  18. package/dist/lib/msal-common/dist/error/ClientAuthErrorCodes.mjs.map +1 -1
  19. package/dist/lib/msal-common/dist/error/ClientConfigurationError.mjs +4 -3
  20. package/dist/lib/msal-common/dist/error/ClientConfigurationError.mjs.map +1 -1
  21. package/dist/lib/msal-common/dist/error/ClientConfigurationErrorCodes.mjs +5 -4
  22. package/dist/lib/msal-common/dist/error/ClientConfigurationErrorCodes.mjs.map +1 -1
  23. package/dist/lib/msal-common/dist/error/InteractionRequiredAuthError.mjs +2 -2
  24. package/dist/lib/msal-common/dist/error/InteractionRequiredAuthError.mjs.map +1 -1
  25. package/dist/lib/msal-common/dist/error/PlatformBrokerError.mjs +50 -0
  26. package/dist/lib/msal-common/dist/error/PlatformBrokerError.mjs.map +1 -0
  27. package/dist/lib/msal-common/dist/error/ServerError.mjs +2 -2
  28. package/dist/lib/msal-common/dist/error/ServerError.mjs.map +1 -1
  29. package/dist/lib/msal-common/dist/logger/Logger.mjs +2 -2
  30. package/dist/lib/msal-common/dist/logger/Logger.mjs.map +1 -1
  31. package/dist/lib/msal-common/dist/telemetry/server/ServerTelemetryManager.mjs +2 -2
  32. package/dist/lib/msal-common/dist/telemetry/server/ServerTelemetryManager.mjs.map +1 -1
  33. package/dist/lib/msal-common/dist/utils/Constants.mjs +2 -2
  34. package/dist/lib/msal-common/dist/utils/Constants.mjs.map +1 -1
  35. package/dist/lib/msal-common/dist/utils/TimeUtils.mjs +2 -2
  36. package/dist/lib/msal-common/dist/utils/TimeUtils.mjs.map +1 -1
  37. package/dist/lock/CrossPlatformLock.mjs +1 -1
  38. package/dist/packageMetadata.d.ts +1 -1
  39. package/dist/packageMetadata.mjs +2 -2
  40. package/dist/persistence/BasePersistence.mjs +1 -1
  41. package/dist/persistence/DataProtectionScope.mjs +1 -1
  42. package/dist/persistence/FilePersistence.mjs +1 -1
  43. package/dist/persistence/FilePersistenceWithDataProtection.mjs +1 -1
  44. package/dist/persistence/KeychainPersistence.mjs +1 -1
  45. package/dist/persistence/LibSecretPersistence.mjs +1 -1
  46. package/dist/persistence/PersistenceCachePlugin.mjs +1 -1
  47. package/dist/persistence/PersistenceCreator.mjs +1 -1
  48. package/dist/utils/Constants.mjs +1 -1
  49. package/dist/utils/Environment.mjs +1 -1
  50. package/dist/utils/TypeGuards.mjs +1 -1
  51. package/lib/msal-node-extensions.cjs +81 -70
  52. package/lib/msal-node-extensions.cjs.map +1 -1
  53. package/lib/types/index.d.ts +0 -1
  54. package/lib/types/packageMetadata.d.ts +1 -1
  55. package/package.json +2 -2
  56. package/dist/error/NativeAuthError.d.ts +0 -6
  57. package/dist/error/NativeAuthError.mjs +0 -21
  58. package/dist/error/NativeAuthError.mjs.map +0 -1
  59. package/dist/utils/StringUtils.d.ts +0 -8
  60. package/dist/utils/StringUtils.mjs +0 -32
  61. package/dist/utils/StringUtils.mjs.map +0 -1
  62. package/lib/types/error/NativeAuthError.d.ts +0 -6
  63. package/lib/types/utils/StringUtils.d.ts +0 -8
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node-extensions v1.5.24 2025-10-29 */
1
+ /*! @azure/msal-node-extensions v1.5.26 2025-12-04 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
@@ -343,7 +343,7 @@ class PersistenceCachePlugin {
343
343
  }
344
344
  }
345
345
 
346
- /*! @azure/msal-common v15.13.1 2025-10-29 */
346
+ /*! @azure/msal-common v15.13.3 2025-12-04 */
347
347
  /*
348
348
  * Copyright (c) Microsoft Corporation. All rights reserved.
349
349
  * Licensed under the MIT License.
@@ -444,7 +444,7 @@ const CacheOutcome = {
444
444
  // When a token is found in the cache or the cache is not supposed to be hit when making the request
445
445
  NOT_APPLICABLE: "0"};
446
446
 
447
- /*! @azure/msal-common v15.13.1 2025-10-29 */
447
+ /*! @azure/msal-common v15.13.3 2025-12-04 */
448
448
  /**
449
449
  * General error class thrown by the MSAL.js library.
450
450
  */
@@ -465,7 +465,7 @@ class AuthError extends Error {
465
465
  }
466
466
  }
467
467
 
468
- /*! @azure/msal-common v15.13.1 2025-10-29 */
468
+ /*! @azure/msal-common v15.13.3 2025-12-04 */
469
469
  /*
470
470
  * Copyright (c) Microsoft Corporation. All rights reserved.
471
471
  * Licensed under the MIT License.
@@ -513,9 +513,10 @@ const noNetworkConnectivity = "no_network_connectivity";
513
513
  const userCanceled = "user_canceled";
514
514
  const missingTenantIdError = "missing_tenant_id_error";
515
515
  const methodNotImplemented = "method_not_implemented";
516
- const nestedAppAuthBridgeDisabled = "nested_app_auth_bridge_disabled";
516
+ const nestedAppAuthBridgeDisabled = "nested_app_auth_bridge_disabled";
517
+ const platformBrokerError = "platform_broker_error";
517
518
 
518
- /*! @azure/msal-common v15.13.1 2025-10-29 */
519
+ /*! @azure/msal-common v15.13.3 2025-12-04 */
519
520
 
520
521
  /*
521
522
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -572,6 +573,7 @@ const ClientAuthErrorMessages = {
572
573
  [missingTenantIdError]: "A tenant id - not common, organizations, or consumers - must be specified when using the client_credentials flow.",
573
574
  [methodNotImplemented]: "This method has not been implemented",
574
575
  [nestedAppAuthBridgeDisabled]: "The nested app auth bridge is disabled",
576
+ [platformBrokerError]: "An error occurred in the native broker. See the platformBrokerError property for details.",
575
577
  };
576
578
  /**
577
579
  * Error thrown when there is an error in the client code running on the browser.
@@ -589,7 +591,7 @@ function createClientAuthError(errorCode, additionalMessage) {
589
591
  return new ClientAuthError(errorCode, additionalMessage);
590
592
  }
591
593
 
592
- /*! @azure/msal-common v15.13.1 2025-10-29 */
594
+ /*! @azure/msal-common v15.13.3 2025-12-04 */
593
595
 
594
596
  /*
595
597
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -780,7 +782,7 @@ class Logger {
780
782
  }
781
783
  }
782
784
 
783
- /*! @azure/msal-common v15.13.1 2025-10-29 */
785
+ /*! @azure/msal-common v15.13.3 2025-12-04 */
784
786
  /*
785
787
  * Copyright (c) Microsoft Corporation. All rights reserved.
786
788
  * Licensed under the MIT License.
@@ -807,9 +809,10 @@ const cannotSetOIDCOptions = "cannot_set_OIDCOptions";
807
809
  const cannotAllowPlatformBroker = "cannot_allow_platform_broker";
808
810
  const authorityMismatch = "authority_mismatch";
809
811
  const invalidRequestMethodForEAR = "invalid_request_method_for_EAR";
810
- const invalidAuthorizePostBodyParameters = "invalid_authorize_post_body_parameters";
812
+ const invalidAuthorizePostBodyParameters = "invalid_authorize_post_body_parameters";
813
+ const invalidPlatformBrokerConfiguration = "invalid_platform_broker_configuration";
811
814
 
812
- /*! @azure/msal-common v15.13.1 2025-10-29 */
815
+ /*! @azure/msal-common v15.13.3 2025-12-04 */
813
816
 
814
817
  /*
815
818
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -839,6 +842,7 @@ const ClientConfigurationErrorMessages = {
839
842
  [authorityMismatch]: "Authority mismatch error. Authority provided in login request or PublicClientApplication config does not match the environment of the provided account. Please use a matching account or make an interactive request to login to this authority.",
840
843
  [invalidAuthorizePostBodyParameters]: "Invalid authorize post body parameters provided. If you are using authorizePostBodyParameters, the request method must be POST. Please check the request method and parameters.",
841
844
  [invalidRequestMethodForEAR]: "Invalid request method for EAR protocol mode. The request method cannot be GET when using EAR protocol mode. Please change the request method to POST.",
845
+ [invalidPlatformBrokerConfiguration]: "Invalid platform broker configuration. `allowPlatformBrokerWithDOM` can only be enabled when `allowPlatformBroker` is enabled.",
842
846
  };
843
847
  /**
844
848
  * Error thrown when there is an error in configuration of the MSAL.js library.
@@ -854,10 +858,10 @@ function createClientConfigurationError(errorCode) {
854
858
  return new ClientConfigurationError(errorCode);
855
859
  }
856
860
 
857
- /*! @azure/msal-common v15.13.1 2025-10-29 */
861
+ /*! @azure/msal-common v15.13.3 2025-12-04 */
858
862
  const X_CLIENT_EXTRA_SKU = "x-client-xtra-sku";
859
863
 
860
- /*! @azure/msal-common v15.13.1 2025-10-29 */
864
+ /*! @azure/msal-common v15.13.3 2025-12-04 */
861
865
  /**
862
866
  * Convert seconds to JS Date object. Seconds can be in a number or string format or undefined (will still return a date).
863
867
  * @param seconds
@@ -869,7 +873,7 @@ function toDateFromSeconds(seconds) {
869
873
  return new Date();
870
874
  }
871
875
 
872
- /*! @azure/msal-common v15.13.1 2025-10-29 */
876
+ /*! @azure/msal-common v15.13.3 2025-12-04 */
873
877
 
874
878
  /*
875
879
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -888,7 +892,7 @@ class ServerError extends AuthError {
888
892
  }
889
893
  }
890
894
 
891
- /*! @azure/msal-common v15.13.1 2025-10-29 */
895
+ /*! @azure/msal-common v15.13.3 2025-12-04 */
892
896
  /**
893
897
  * Error thrown when user interaction is required.
894
898
  */
@@ -905,7 +909,51 @@ class InteractionRequiredAuthError extends AuthError {
905
909
  }
906
910
  }
907
911
 
908
- /*! @azure/msal-common v15.13.1 2025-10-29 */
912
+ /*! @azure/msal-common v15.13.3 2025-12-04 */
913
+
914
+ /*
915
+ * Copyright (c) Microsoft Corporation. All rights reserved.
916
+ * Licensed under the MIT License.
917
+ */
918
+ /**
919
+ * Converts a numeric tag to a string representation
920
+ * @param tag - The numeric tag to convert
921
+ * @returns The string representation of the tag
922
+ */
923
+ function tagToString(tag) {
924
+ if (tag === 0) {
925
+ return "UNTAG";
926
+ }
927
+ const tagSymbolSpace = "abcdefghijklmnopqrstuvwxyz0123456789****************************";
928
+ let tagBuffer = "*****";
929
+ const chars = [
930
+ tagSymbolSpace[(tag >> 24) & 0x3f],
931
+ tagSymbolSpace[(tag >> 18) & 0x3f],
932
+ tagSymbolSpace[(tag >> 12) & 0x3f],
933
+ tagSymbolSpace[(tag >> 6) & 0x3f],
934
+ tagSymbolSpace[(tag >> 0) & 0x3f],
935
+ ];
936
+ tagBuffer = chars.join("");
937
+ return tagBuffer;
938
+ }
939
+ /**
940
+ * Error class for MSAL Runtime errors that preserves detailed broker information
941
+ */
942
+ class PlatformBrokerError extends AuthError {
943
+ constructor(errorStatus, errorContext, errorCode, errorTag) {
944
+ const tagString = tagToString(errorTag);
945
+ const enhancedErrorContext = errorContext
946
+ ? `${errorContext} (Error Code: ${errorCode}, Tag: ${tagString})`
947
+ : `(Error Code: ${errorCode}, Tag: ${tagString})`;
948
+ super(errorStatus, enhancedErrorContext);
949
+ this.name = "PlatformBrokerError";
950
+ this.statusCode = errorCode;
951
+ this.tag = tagString;
952
+ Object.setPrototypeOf(this, PlatformBrokerError.prototype);
953
+ }
954
+ }
955
+
956
+ /*! @azure/msal-common v15.13.3 2025-12-04 */
909
957
 
910
958
  /*
911
959
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1789,51 +1837,9 @@ class PersistenceCreator {
1789
1837
  }
1790
1838
  }
1791
1839
 
1792
- /*
1793
- * Copyright (c) Microsoft Corporation. All rights reserved.
1794
- * Licensed under the MIT License.
1795
- */
1796
- class StringUtils {
1797
- /**
1798
- * Converts a numeric tag to a string representation
1799
- * @param tag - The numeric tag to convert
1800
- * @returns The string representation of the tag
1801
- */
1802
- static tagToString(tag) {
1803
- if (tag === 0) {
1804
- return "UNTAG";
1805
- }
1806
- const tagSymbolSpace = "abcdefghijklmnopqrstuvwxyz0123456789****************************";
1807
- let tagBuffer = "*****";
1808
- const chars = [
1809
- tagSymbolSpace[(tag >> 24) & 0x3f],
1810
- tagSymbolSpace[(tag >> 18) & 0x3f],
1811
- tagSymbolSpace[(tag >> 12) & 0x3f],
1812
- tagSymbolSpace[(tag >> 6) & 0x3f],
1813
- tagSymbolSpace[(tag >> 0) & 0x3f],
1814
- ];
1815
- tagBuffer = chars.join("");
1816
- return tagBuffer;
1817
- }
1818
- }
1819
-
1820
- /*
1821
- * Copyright (c) Microsoft Corporation. All rights reserved.
1822
- * Licensed under the MIT License.
1823
- */
1824
- class NativeAuthError extends AuthError {
1825
- constructor(errorStatus, errorContext, errorCode, errorTag) {
1826
- super(errorStatus, errorContext);
1827
- this.name = "NativeAuthError";
1828
- this.statusCode = errorCode;
1829
- this.tag = StringUtils.tagToString(errorTag);
1830
- Object.setPrototypeOf(this, NativeAuthError.prototype);
1831
- }
1832
- }
1833
-
1834
1840
  /* eslint-disable header/header */
1835
1841
  const name = "@azure/msal-node-extensions";
1836
- const version = "1.5.24";
1842
+ const version = "1.5.26";
1837
1843
 
1838
1844
  /*
1839
1845
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2262,31 +2268,37 @@ class NativeBrokerPlugin {
2262
2268
  typeof error === "object" &&
2263
2269
  this.isMsalRuntimeError(error)) {
2264
2270
  const { errorCode, errorStatus, errorContext, errorTag } = error;
2265
- const tagString = StringUtils.tagToString(errorTag);
2266
- const enhancedErrorContext = errorContext
2267
- ? `${errorContext} (Error Code: ${errorCode}, Tag: ${tagString})`
2268
- : `(Error Code: ${errorCode}, Tag: ${tagString})`;
2271
+ const msalNodeRuntimeError = new PlatformBrokerError(msalNodeRuntime.ErrorStatus[errorStatus], errorContext, errorCode, errorTag);
2272
+ let wrappedError;
2269
2273
  switch (errorStatus) {
2270
2274
  case msalNodeRuntime.ErrorStatus.InteractionRequired:
2271
2275
  case msalNodeRuntime.ErrorStatus.AccountUnusable:
2272
- return new InteractionRequiredAuthError(ErrorCodes.INTERATION_REQUIRED_ERROR_CODE, enhancedErrorContext);
2276
+ wrappedError = new InteractionRequiredAuthError(ErrorCodes.INTERATION_REQUIRED_ERROR_CODE, msalNodeRuntimeError.message);
2277
+ break;
2273
2278
  case msalNodeRuntime.ErrorStatus.NoNetwork:
2274
2279
  case msalNodeRuntime.ErrorStatus.NetworkTemporarilyUnavailable:
2275
- return createClientAuthError(noNetworkConnectivity);
2280
+ wrappedError = createClientAuthError(noNetworkConnectivity);
2281
+ break;
2276
2282
  case msalNodeRuntime.ErrorStatus.ServerTemporarilyUnavailable:
2277
- return new ServerError(ErrorCodes.SERVER_UNAVAILABLE, errorContext);
2283
+ wrappedError = new ServerError(ErrorCodes.SERVER_UNAVAILABLE, errorContext);
2284
+ break;
2278
2285
  case msalNodeRuntime.ErrorStatus.UserCanceled:
2279
- return createClientAuthError(userCanceled);
2286
+ wrappedError = createClientAuthError(userCanceled);
2287
+ break;
2280
2288
  case msalNodeRuntime.ErrorStatus.AuthorityUntrusted:
2281
- return createClientConfigurationError(untrustedAuthority);
2289
+ wrappedError = createClientConfigurationError(untrustedAuthority);
2290
+ break;
2282
2291
  case msalNodeRuntime.ErrorStatus.UserSwitched:
2283
2292
  // Not an error case, if there's customer demand we can surface this as a response property
2284
2293
  return null;
2285
2294
  case msalNodeRuntime.ErrorStatus.AccountNotFound:
2286
- return createClientAuthError(noAccountFound);
2295
+ wrappedError = createClientAuthError(noAccountFound);
2296
+ break;
2287
2297
  default:
2288
- return new NativeAuthError(msalNodeRuntime.ErrorStatus[errorStatus], enhancedErrorContext, errorCode, errorTag);
2298
+ wrappedError = createClientAuthError(platformBrokerError);
2289
2299
  }
2300
+ wrappedError.platformBrokerError = msalNodeRuntimeError;
2301
+ return wrappedError;
2290
2302
  }
2291
2303
  throw error;
2292
2304
  }
@@ -2301,5 +2313,4 @@ exports.LibSecretPersistence = LibSecretPersistence;
2301
2313
  exports.NativeBrokerPlugin = NativeBrokerPlugin;
2302
2314
  exports.PersistenceCachePlugin = PersistenceCachePlugin;
2303
2315
  exports.PersistenceCreator = PersistenceCreator;
2304
- exports.StringUtils = StringUtils;
2305
2316
  //# sourceMappingURL=msal-node-extensions.cjs.map