@azure/msal-node-extensions 1.5.24 → 1.5.25

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 +2 -2
  20. package/dist/lib/msal-common/dist/error/ClientConfigurationError.mjs.map +1 -1
  21. package/dist/lib/msal-common/dist/error/ClientConfigurationErrorCodes.mjs +2 -2
  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 +78 -69
  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.25 2025-11-19 */
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.2 2025-11-19 */
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.2 2025-11-19 */
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.2 2025-11-19 */
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.2 2025-11-19 */
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.2 2025-11-19 */
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.2 2025-11-19 */
784
786
  /*
785
787
  * Copyright (c) Microsoft Corporation. All rights reserved.
786
788
  * Licensed under the MIT License.
@@ -809,7 +811,7 @@ const authorityMismatch = "authority_mismatch";
809
811
  const invalidRequestMethodForEAR = "invalid_request_method_for_EAR";
810
812
  const invalidAuthorizePostBodyParameters = "invalid_authorize_post_body_parameters";
811
813
 
812
- /*! @azure/msal-common v15.13.1 2025-10-29 */
814
+ /*! @azure/msal-common v15.13.2 2025-11-19 */
813
815
 
814
816
  /*
815
817
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -854,10 +856,10 @@ function createClientConfigurationError(errorCode) {
854
856
  return new ClientConfigurationError(errorCode);
855
857
  }
856
858
 
857
- /*! @azure/msal-common v15.13.1 2025-10-29 */
859
+ /*! @azure/msal-common v15.13.2 2025-11-19 */
858
860
  const X_CLIENT_EXTRA_SKU = "x-client-xtra-sku";
859
861
 
860
- /*! @azure/msal-common v15.13.1 2025-10-29 */
862
+ /*! @azure/msal-common v15.13.2 2025-11-19 */
861
863
  /**
862
864
  * Convert seconds to JS Date object. Seconds can be in a number or string format or undefined (will still return a date).
863
865
  * @param seconds
@@ -869,7 +871,7 @@ function toDateFromSeconds(seconds) {
869
871
  return new Date();
870
872
  }
871
873
 
872
- /*! @azure/msal-common v15.13.1 2025-10-29 */
874
+ /*! @azure/msal-common v15.13.2 2025-11-19 */
873
875
 
874
876
  /*
875
877
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -888,7 +890,7 @@ class ServerError extends AuthError {
888
890
  }
889
891
  }
890
892
 
891
- /*! @azure/msal-common v15.13.1 2025-10-29 */
893
+ /*! @azure/msal-common v15.13.2 2025-11-19 */
892
894
  /**
893
895
  * Error thrown when user interaction is required.
894
896
  */
@@ -905,7 +907,51 @@ class InteractionRequiredAuthError extends AuthError {
905
907
  }
906
908
  }
907
909
 
908
- /*! @azure/msal-common v15.13.1 2025-10-29 */
910
+ /*! @azure/msal-common v15.13.2 2025-11-19 */
911
+
912
+ /*
913
+ * Copyright (c) Microsoft Corporation. All rights reserved.
914
+ * Licensed under the MIT License.
915
+ */
916
+ /**
917
+ * Converts a numeric tag to a string representation
918
+ * @param tag - The numeric tag to convert
919
+ * @returns The string representation of the tag
920
+ */
921
+ function tagToString(tag) {
922
+ if (tag === 0) {
923
+ return "UNTAG";
924
+ }
925
+ const tagSymbolSpace = "abcdefghijklmnopqrstuvwxyz0123456789****************************";
926
+ let tagBuffer = "*****";
927
+ const chars = [
928
+ tagSymbolSpace[(tag >> 24) & 0x3f],
929
+ tagSymbolSpace[(tag >> 18) & 0x3f],
930
+ tagSymbolSpace[(tag >> 12) & 0x3f],
931
+ tagSymbolSpace[(tag >> 6) & 0x3f],
932
+ tagSymbolSpace[(tag >> 0) & 0x3f],
933
+ ];
934
+ tagBuffer = chars.join("");
935
+ return tagBuffer;
936
+ }
937
+ /**
938
+ * Error class for MSAL Runtime errors that preserves detailed broker information
939
+ */
940
+ class PlatformBrokerError extends AuthError {
941
+ constructor(errorStatus, errorContext, errorCode, errorTag) {
942
+ const tagString = tagToString(errorTag);
943
+ const enhancedErrorContext = errorContext
944
+ ? `${errorContext} (Error Code: ${errorCode}, Tag: ${tagString})`
945
+ : `(Error Code: ${errorCode}, Tag: ${tagString})`;
946
+ super(errorStatus, enhancedErrorContext);
947
+ this.name = "PlatformBrokerError";
948
+ this.statusCode = errorCode;
949
+ this.tag = tagString;
950
+ Object.setPrototypeOf(this, PlatformBrokerError.prototype);
951
+ }
952
+ }
953
+
954
+ /*! @azure/msal-common v15.13.2 2025-11-19 */
909
955
 
910
956
  /*
911
957
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1789,51 +1835,9 @@ class PersistenceCreator {
1789
1835
  }
1790
1836
  }
1791
1837
 
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
1838
  /* eslint-disable header/header */
1835
1839
  const name = "@azure/msal-node-extensions";
1836
- const version = "1.5.24";
1840
+ const version = "1.5.25";
1837
1841
 
1838
1842
  /*
1839
1843
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2262,31 +2266,37 @@ class NativeBrokerPlugin {
2262
2266
  typeof error === "object" &&
2263
2267
  this.isMsalRuntimeError(error)) {
2264
2268
  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})`;
2269
+ const msalNodeRuntimeError = new PlatformBrokerError(msalNodeRuntime.ErrorStatus[errorStatus], errorContext, errorCode, errorTag);
2270
+ let wrappedError;
2269
2271
  switch (errorStatus) {
2270
2272
  case msalNodeRuntime.ErrorStatus.InteractionRequired:
2271
2273
  case msalNodeRuntime.ErrorStatus.AccountUnusable:
2272
- return new InteractionRequiredAuthError(ErrorCodes.INTERATION_REQUIRED_ERROR_CODE, enhancedErrorContext);
2274
+ wrappedError = new InteractionRequiredAuthError(ErrorCodes.INTERATION_REQUIRED_ERROR_CODE, msalNodeRuntimeError.message);
2275
+ break;
2273
2276
  case msalNodeRuntime.ErrorStatus.NoNetwork:
2274
2277
  case msalNodeRuntime.ErrorStatus.NetworkTemporarilyUnavailable:
2275
- return createClientAuthError(noNetworkConnectivity);
2278
+ wrappedError = createClientAuthError(noNetworkConnectivity);
2279
+ break;
2276
2280
  case msalNodeRuntime.ErrorStatus.ServerTemporarilyUnavailable:
2277
- return new ServerError(ErrorCodes.SERVER_UNAVAILABLE, errorContext);
2281
+ wrappedError = new ServerError(ErrorCodes.SERVER_UNAVAILABLE, errorContext);
2282
+ break;
2278
2283
  case msalNodeRuntime.ErrorStatus.UserCanceled:
2279
- return createClientAuthError(userCanceled);
2284
+ wrappedError = createClientAuthError(userCanceled);
2285
+ break;
2280
2286
  case msalNodeRuntime.ErrorStatus.AuthorityUntrusted:
2281
- return createClientConfigurationError(untrustedAuthority);
2287
+ wrappedError = createClientConfigurationError(untrustedAuthority);
2288
+ break;
2282
2289
  case msalNodeRuntime.ErrorStatus.UserSwitched:
2283
2290
  // Not an error case, if there's customer demand we can surface this as a response property
2284
2291
  return null;
2285
2292
  case msalNodeRuntime.ErrorStatus.AccountNotFound:
2286
- return createClientAuthError(noAccountFound);
2293
+ wrappedError = createClientAuthError(noAccountFound);
2294
+ break;
2287
2295
  default:
2288
- return new NativeAuthError(msalNodeRuntime.ErrorStatus[errorStatus], enhancedErrorContext, errorCode, errorTag);
2296
+ wrappedError = createClientAuthError(platformBrokerError);
2289
2297
  }
2298
+ wrappedError.platformBrokerError = msalNodeRuntimeError;
2299
+ return wrappedError;
2290
2300
  }
2291
2301
  throw error;
2292
2302
  }
@@ -2301,5 +2311,4 @@ exports.LibSecretPersistence = LibSecretPersistence;
2301
2311
  exports.NativeBrokerPlugin = NativeBrokerPlugin;
2302
2312
  exports.PersistenceCachePlugin = PersistenceCachePlugin;
2303
2313
  exports.PersistenceCreator = PersistenceCreator;
2304
- exports.StringUtils = StringUtils;
2305
2314
  //# sourceMappingURL=msal-node-extensions.cjs.map