@azure/msal-node 2.1.0 → 2.2.0-alpha.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 (134) hide show
  1. package/dist/cache/ITokenCache.d.ts +15 -15
  2. package/dist/cache/NodeStorage.cjs +401 -401
  3. package/dist/cache/NodeStorage.d.ts +182 -182
  4. package/dist/cache/NodeStorage.mjs +401 -401
  5. package/dist/cache/TokenCache.cjs +265 -265
  6. package/dist/cache/TokenCache.d.ts +90 -90
  7. package/dist/cache/TokenCache.mjs +265 -265
  8. package/dist/cache/distributed/DistributedCachePlugin.cjs +26 -26
  9. package/dist/cache/distributed/DistributedCachePlugin.d.ts +10 -10
  10. package/dist/cache/distributed/DistributedCachePlugin.mjs +26 -26
  11. package/dist/cache/distributed/ICacheClient.d.ts +17 -17
  12. package/dist/cache/distributed/IPartitionManager.d.ts +28 -28
  13. package/dist/cache/serializer/Deserializer.cjs +173 -173
  14. package/dist/cache/serializer/Deserializer.d.ts +42 -42
  15. package/dist/cache/serializer/Deserializer.mjs +173 -173
  16. package/dist/cache/serializer/Serializer.cjs +134 -134
  17. package/dist/cache/serializer/Serializer.d.ts +39 -39
  18. package/dist/cache/serializer/Serializer.mjs +134 -134
  19. package/dist/cache/serializer/SerializerTypes.d.ts +101 -101
  20. package/dist/client/ClientApplication.cjs +333 -333
  21. package/dist/client/ClientApplication.cjs.map +1 -1
  22. package/dist/client/ClientApplication.d.ts +142 -142
  23. package/dist/client/ClientApplication.d.ts.map +1 -1
  24. package/dist/client/ClientApplication.mjs +334 -334
  25. package/dist/client/ClientApplication.mjs.map +1 -1
  26. package/dist/client/ClientAssertion.cjs +116 -116
  27. package/dist/client/ClientAssertion.cjs.map +1 -1
  28. package/dist/client/ClientAssertion.d.ts +46 -46
  29. package/dist/client/ClientAssertion.d.ts.map +1 -1
  30. package/dist/client/ClientAssertion.mjs +117 -117
  31. package/dist/client/ClientAssertion.mjs.map +1 -1
  32. package/dist/client/ClientCredentialClient.cjs +189 -190
  33. package/dist/client/ClientCredentialClient.cjs.map +1 -1
  34. package/dist/client/ClientCredentialClient.d.ts +33 -34
  35. package/dist/client/ClientCredentialClient.d.ts.map +1 -1
  36. package/dist/client/ClientCredentialClient.mjs +190 -191
  37. package/dist/client/ClientCredentialClient.mjs.map +1 -1
  38. package/dist/client/ConfidentialClientApplication.cjs +163 -163
  39. package/dist/client/ConfidentialClientApplication.cjs.map +1 -1
  40. package/dist/client/ConfidentialClientApplication.d.ts +58 -58
  41. package/dist/client/ConfidentialClientApplication.d.ts.map +1 -1
  42. package/dist/client/ConfidentialClientApplication.mjs +164 -164
  43. package/dist/client/ConfidentialClientApplication.mjs.map +1 -1
  44. package/dist/client/DeviceCodeClient.cjs +207 -207
  45. package/dist/client/DeviceCodeClient.cjs.map +1 -1
  46. package/dist/client/DeviceCodeClient.d.ts +53 -53
  47. package/dist/client/DeviceCodeClient.d.ts.map +1 -1
  48. package/dist/client/DeviceCodeClient.mjs +208 -208
  49. package/dist/client/DeviceCodeClient.mjs.map +1 -1
  50. package/dist/client/IConfidentialClientApplication.d.ts +39 -39
  51. package/dist/client/IPublicClientApplication.d.ts +42 -42
  52. package/dist/client/OnBehalfOfClient.cjs +202 -202
  53. package/dist/client/OnBehalfOfClient.cjs.map +1 -1
  54. package/dist/client/OnBehalfOfClient.d.ts +47 -47
  55. package/dist/client/OnBehalfOfClient.d.ts.map +1 -1
  56. package/dist/client/OnBehalfOfClient.mjs +203 -203
  57. package/dist/client/OnBehalfOfClient.mjs.map +1 -1
  58. package/dist/client/PublicClientApplication.cjs +229 -182
  59. package/dist/client/PublicClientApplication.cjs.map +1 -1
  60. package/dist/client/PublicClientApplication.d.ts +71 -65
  61. package/dist/client/PublicClientApplication.d.ts.map +1 -1
  62. package/dist/client/PublicClientApplication.mjs +231 -184
  63. package/dist/client/PublicClientApplication.mjs.map +1 -1
  64. package/dist/client/UsernamePasswordClient.cjs +95 -95
  65. package/dist/client/UsernamePasswordClient.d.ts +25 -25
  66. package/dist/client/UsernamePasswordClient.mjs +95 -95
  67. package/dist/config/Configuration.cjs +72 -72
  68. package/dist/config/Configuration.d.ts +107 -107
  69. package/dist/config/Configuration.mjs +72 -72
  70. package/dist/crypto/CryptoProvider.cjs +75 -75
  71. package/dist/crypto/CryptoProvider.d.ts +52 -52
  72. package/dist/crypto/CryptoProvider.mjs +75 -75
  73. package/dist/crypto/GuidGenerator.cjs +22 -22
  74. package/dist/crypto/GuidGenerator.d.ts +14 -14
  75. package/dist/crypto/GuidGenerator.mjs +22 -22
  76. package/dist/crypto/HashUtils.cjs +13 -13
  77. package/dist/crypto/HashUtils.d.ts +8 -8
  78. package/dist/crypto/HashUtils.mjs +13 -13
  79. package/dist/crypto/PkceGenerator.cjs +49 -49
  80. package/dist/crypto/PkceGenerator.d.ts +22 -22
  81. package/dist/crypto/PkceGenerator.mjs +49 -49
  82. package/dist/error/NodeAuthError.cjs +85 -85
  83. package/dist/error/NodeAuthError.d.ts +65 -65
  84. package/dist/error/NodeAuthError.mjs +85 -85
  85. package/dist/index.cjs +17 -1
  86. package/dist/index.cjs.map +1 -1
  87. package/dist/index.d.ts +42 -42
  88. package/dist/index.d.ts.map +1 -1
  89. package/dist/index.mjs +2 -2
  90. package/dist/internals.cjs +8 -8
  91. package/dist/internals.d.ts +6 -6
  92. package/dist/internals.mjs +8 -8
  93. package/dist/network/HttpClient.cjs +276 -276
  94. package/dist/network/HttpClient.d.ts +25 -25
  95. package/dist/network/HttpClient.mjs +276 -276
  96. package/dist/network/ILoopbackClient.d.ts +10 -10
  97. package/dist/network/LoopbackClient.cjs +75 -84
  98. package/dist/network/LoopbackClient.cjs.map +1 -1
  99. package/dist/network/LoopbackClient.d.ts +21 -21
  100. package/dist/network/LoopbackClient.d.ts.map +1 -1
  101. package/dist/network/LoopbackClient.mjs +76 -85
  102. package/dist/network/LoopbackClient.mjs.map +1 -1
  103. package/dist/packageMetadata.cjs +3 -3
  104. package/dist/packageMetadata.d.ts +2 -2
  105. package/dist/packageMetadata.mjs +3 -3
  106. package/dist/request/AuthorizationCodeRequest.d.ts +21 -21
  107. package/dist/request/AuthorizationUrlRequest.d.ts +33 -33
  108. package/dist/request/ClientCredentialRequest.d.ts +14 -14
  109. package/dist/request/DeviceCodeRequest.d.ts +15 -15
  110. package/dist/request/InteractiveRequest.d.ts +22 -22
  111. package/dist/request/OnBehalfOfRequest.d.ts +14 -14
  112. package/dist/request/RefreshTokenRequest.d.ts +17 -17
  113. package/dist/request/SignOutRequest.d.ts +5 -5
  114. package/dist/request/SilentFlowRequest.d.ts +16 -16
  115. package/dist/request/UsernamePasswordRequest.d.ts +19 -19
  116. package/dist/utils/Constants.cjs +80 -80
  117. package/dist/utils/Constants.d.ts +86 -86
  118. package/dist/utils/Constants.mjs +80 -80
  119. package/dist/utils/EncodingUtils.cjs +44 -44
  120. package/dist/utils/EncodingUtils.d.ts +26 -26
  121. package/dist/utils/EncodingUtils.mjs +44 -44
  122. package/dist/utils/NetworkUtils.cjs +38 -38
  123. package/dist/utils/NetworkUtils.d.ts +5 -5
  124. package/dist/utils/NetworkUtils.mjs +38 -38
  125. package/package.json +2 -2
  126. package/src/client/ClientApplication.ts +3 -2
  127. package/src/client/ClientAssertion.ts +7 -2
  128. package/src/client/ClientCredentialClient.ts +32 -34
  129. package/src/client/ConfidentialClientApplication.ts +11 -4
  130. package/src/client/DeviceCodeClient.ts +16 -7
  131. package/src/client/OnBehalfOfClient.ts +11 -4
  132. package/src/client/PublicClientApplication.ts +69 -13
  133. package/src/index.ts +4 -0
  134. package/src/network/LoopbackClient.ts +17 -33
@@ -1,84 +1,84 @@
1
- /*! @azure/msal-node v2.1.0 2023-09-05 */
1
+ /*! @azure/msal-node v2.2.0-alpha.0 2023-09-20 */
2
2
  'use strict';
3
- /*
4
- * Copyright (c) Microsoft Corporation. All rights reserved.
5
- * Licensed under the MIT License.
6
- */
7
- /**
8
- * http methods
9
- */
10
- const HttpMethod = {
11
- GET: "get",
12
- POST: "post",
13
- };
14
- const ProxyStatus = {
15
- SUCCESS_RANGE_START: 200,
16
- SUCCESS_RANGE_END: 299,
17
- SERVER_ERROR: 500,
18
- };
19
- /**
20
- * Constants used for region discovery
21
- */
22
- const REGION_ENVIRONMENT_VARIABLE = "REGION_NAME";
23
- /**
24
- * Constant used for PKCE
25
- */
26
- const RANDOM_OCTET_SIZE = 32;
27
- /**
28
- * Constants used in PKCE
29
- */
30
- const Hash = {
31
- SHA256: "sha256",
32
- };
33
- /**
34
- * Constants for encoding schemes
35
- */
36
- const CharSet = {
37
- CV_CHARSET: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",
38
- };
39
- /**
40
- * Constants
41
- */
42
- const Constants = {
43
- MSAL_SKU: "msal.js.node",
44
- JWT_BEARER_ASSERTION_TYPE: "urn:ietf:params:oauth:client-assertion-type:jwt-bearer",
45
- AUTHORIZATION_PENDING: "authorization_pending",
46
- HTTP_PROTOCOL: "http://",
47
- LOCALHOST: "localhost",
48
- };
49
- /**
50
- * API Codes for Telemetry purposes.
51
- * Before adding a new code you must claim it in the MSAL Telemetry tracker as these number spaces are shared across all MSALs
52
- * 0-99 Silent Flow
53
- * 600-699 Device Code Flow
54
- * 800-899 Auth Code Flow
55
- */
56
- const ApiId = {
57
- acquireTokenSilent: 62,
58
- acquireTokenByUsernamePassword: 371,
59
- acquireTokenByDeviceCode: 671,
60
- acquireTokenByClientCredential: 771,
61
- acquireTokenByCode: 871,
62
- acquireTokenByRefreshToken: 872,
63
- };
64
- /**
65
- * JWT constants
66
- */
67
- const JwtConstants = {
68
- ALGORITHM: "alg",
69
- RSA_256: "RS256",
70
- X5T: "x5t",
71
- X5C: "x5c",
72
- AUDIENCE: "aud",
73
- EXPIRATION_TIME: "exp",
74
- ISSUER: "iss",
75
- SUBJECT: "sub",
76
- NOT_BEFORE: "nbf",
77
- JWT_ID: "jti",
78
- };
79
- const LOOPBACK_SERVER_CONSTANTS = {
80
- INTERVAL_MS: 100,
81
- TIMEOUT_MS: 5000,
3
+ /*
4
+ * Copyright (c) Microsoft Corporation. All rights reserved.
5
+ * Licensed under the MIT License.
6
+ */
7
+ /**
8
+ * http methods
9
+ */
10
+ const HttpMethod = {
11
+ GET: "get",
12
+ POST: "post",
13
+ };
14
+ const ProxyStatus = {
15
+ SUCCESS_RANGE_START: 200,
16
+ SUCCESS_RANGE_END: 299,
17
+ SERVER_ERROR: 500,
18
+ };
19
+ /**
20
+ * Constants used for region discovery
21
+ */
22
+ const REGION_ENVIRONMENT_VARIABLE = "REGION_NAME";
23
+ /**
24
+ * Constant used for PKCE
25
+ */
26
+ const RANDOM_OCTET_SIZE = 32;
27
+ /**
28
+ * Constants used in PKCE
29
+ */
30
+ const Hash = {
31
+ SHA256: "sha256",
32
+ };
33
+ /**
34
+ * Constants for encoding schemes
35
+ */
36
+ const CharSet = {
37
+ CV_CHARSET: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",
38
+ };
39
+ /**
40
+ * Constants
41
+ */
42
+ const Constants = {
43
+ MSAL_SKU: "msal.js.node",
44
+ JWT_BEARER_ASSERTION_TYPE: "urn:ietf:params:oauth:client-assertion-type:jwt-bearer",
45
+ AUTHORIZATION_PENDING: "authorization_pending",
46
+ HTTP_PROTOCOL: "http://",
47
+ LOCALHOST: "localhost",
48
+ };
49
+ /**
50
+ * API Codes for Telemetry purposes.
51
+ * Before adding a new code you must claim it in the MSAL Telemetry tracker as these number spaces are shared across all MSALs
52
+ * 0-99 Silent Flow
53
+ * 600-699 Device Code Flow
54
+ * 800-899 Auth Code Flow
55
+ */
56
+ const ApiId = {
57
+ acquireTokenSilent: 62,
58
+ acquireTokenByUsernamePassword: 371,
59
+ acquireTokenByDeviceCode: 671,
60
+ acquireTokenByClientCredential: 771,
61
+ acquireTokenByCode: 871,
62
+ acquireTokenByRefreshToken: 872,
63
+ };
64
+ /**
65
+ * JWT constants
66
+ */
67
+ const JwtConstants = {
68
+ ALGORITHM: "alg",
69
+ RSA_256: "RS256",
70
+ X5T: "x5t",
71
+ X5C: "x5c",
72
+ AUDIENCE: "aud",
73
+ EXPIRATION_TIME: "exp",
74
+ ISSUER: "iss",
75
+ SUBJECT: "sub",
76
+ NOT_BEFORE: "nbf",
77
+ JWT_ID: "jti",
78
+ };
79
+ const LOOPBACK_SERVER_CONSTANTS = {
80
+ INTERVAL_MS: 100,
81
+ TIMEOUT_MS: 5000,
82
82
  };
83
83
 
84
84
  export { ApiId, CharSet, Constants, Hash, HttpMethod, JwtConstants, LOOPBACK_SERVER_CONSTANTS, ProxyStatus, RANDOM_OCTET_SIZE, REGION_ENVIRONMENT_VARIABLE };
@@ -1,52 +1,52 @@
1
- /*! @azure/msal-node v2.1.0 2023-09-05 */
1
+ /*! @azure/msal-node v2.2.0-alpha.0 2023-09-20 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
5
5
  var msalCommon = require('@azure/msal-common');
6
6
 
7
- /*
8
- * Copyright (c) Microsoft Corporation. All rights reserved.
9
- * Licensed under the MIT License.
10
- */
11
- class EncodingUtils {
12
- /**
13
- * 'utf8': Multibyte encoded Unicode characters. Many web pages and other document formats use UTF-8.
14
- * 'base64': Base64 encoding.
15
- *
16
- * @param str text
17
- */
18
- static base64Encode(str, encoding) {
19
- return Buffer.from(str, encoding).toString("base64");
20
- }
21
- /**
22
- * encode a URL
23
- * @param str
24
- */
25
- static base64EncodeUrl(str, encoding) {
26
- return EncodingUtils.base64Encode(str, encoding)
27
- .replace(/=/g, msalCommon.Constants.EMPTY_STRING)
28
- .replace(/\+/g, "-")
29
- .replace(/\//g, "_");
30
- }
31
- /**
32
- * 'utf8': Multibyte encoded Unicode characters. Many web pages and other document formats use UTF-8.
33
- * 'base64': Base64 encoding.
34
- *
35
- * @param base64Str Base64 encoded text
36
- */
37
- static base64Decode(base64Str) {
38
- return Buffer.from(base64Str, "base64").toString("utf8");
39
- }
40
- /**
41
- * @param base64Str Base64 encoded Url
42
- */
43
- static base64DecodeUrl(base64Str) {
44
- let str = base64Str.replace(/-/g, "+").replace(/_/g, "/");
45
- while (str.length % 4) {
46
- str += "=";
47
- }
48
- return EncodingUtils.base64Decode(str);
49
- }
7
+ /*
8
+ * Copyright (c) Microsoft Corporation. All rights reserved.
9
+ * Licensed under the MIT License.
10
+ */
11
+ class EncodingUtils {
12
+ /**
13
+ * 'utf8': Multibyte encoded Unicode characters. Many web pages and other document formats use UTF-8.
14
+ * 'base64': Base64 encoding.
15
+ *
16
+ * @param str text
17
+ */
18
+ static base64Encode(str, encoding) {
19
+ return Buffer.from(str, encoding).toString("base64");
20
+ }
21
+ /**
22
+ * encode a URL
23
+ * @param str
24
+ */
25
+ static base64EncodeUrl(str, encoding) {
26
+ return EncodingUtils.base64Encode(str, encoding)
27
+ .replace(/=/g, msalCommon.Constants.EMPTY_STRING)
28
+ .replace(/\+/g, "-")
29
+ .replace(/\//g, "_");
30
+ }
31
+ /**
32
+ * 'utf8': Multibyte encoded Unicode characters. Many web pages and other document formats use UTF-8.
33
+ * 'base64': Base64 encoding.
34
+ *
35
+ * @param base64Str Base64 encoded text
36
+ */
37
+ static base64Decode(base64Str) {
38
+ return Buffer.from(base64Str, "base64").toString("utf8");
39
+ }
40
+ /**
41
+ * @param base64Str Base64 encoded Url
42
+ */
43
+ static base64DecodeUrl(base64Str) {
44
+ let str = base64Str.replace(/-/g, "+").replace(/_/g, "/");
45
+ while (str.length % 4) {
46
+ str += "=";
47
+ }
48
+ return EncodingUtils.base64Decode(str);
49
+ }
50
50
  }
51
51
 
52
52
  exports.EncodingUtils = EncodingUtils;
@@ -1,27 +1,27 @@
1
- /// <reference types="node" />
2
- export declare class EncodingUtils {
3
- /**
4
- * 'utf8': Multibyte encoded Unicode characters. Many web pages and other document formats use UTF-8.
5
- * 'base64': Base64 encoding.
6
- *
7
- * @param str text
8
- */
9
- static base64Encode(str: string, encoding?: BufferEncoding): string;
10
- /**
11
- * encode a URL
12
- * @param str
13
- */
14
- static base64EncodeUrl(str: string, encoding?: BufferEncoding): string;
15
- /**
16
- * 'utf8': Multibyte encoded Unicode characters. Many web pages and other document formats use UTF-8.
17
- * 'base64': Base64 encoding.
18
- *
19
- * @param base64Str Base64 encoded text
20
- */
21
- static base64Decode(base64Str: string): string;
22
- /**
23
- * @param base64Str Base64 encoded Url
24
- */
25
- static base64DecodeUrl(base64Str: string): string;
26
- }
1
+ /// <reference types="node" />
2
+ export declare class EncodingUtils {
3
+ /**
4
+ * 'utf8': Multibyte encoded Unicode characters. Many web pages and other document formats use UTF-8.
5
+ * 'base64': Base64 encoding.
6
+ *
7
+ * @param str text
8
+ */
9
+ static base64Encode(str: string, encoding?: BufferEncoding): string;
10
+ /**
11
+ * encode a URL
12
+ * @param str
13
+ */
14
+ static base64EncodeUrl(str: string, encoding?: BufferEncoding): string;
15
+ /**
16
+ * 'utf8': Multibyte encoded Unicode characters. Many web pages and other document formats use UTF-8.
17
+ * 'base64': Base64 encoding.
18
+ *
19
+ * @param base64Str Base64 encoded text
20
+ */
21
+ static base64Decode(base64Str: string): string;
22
+ /**
23
+ * @param base64Str Base64 encoded Url
24
+ */
25
+ static base64DecodeUrl(base64Str: string): string;
26
+ }
27
27
  //# sourceMappingURL=EncodingUtils.d.ts.map
@@ -1,50 +1,50 @@
1
- /*! @azure/msal-node v2.1.0 2023-09-05 */
1
+ /*! @azure/msal-node v2.2.0-alpha.0 2023-09-20 */
2
2
  'use strict';
3
3
  import { Constants } from '@azure/msal-common';
4
4
 
5
- /*
6
- * Copyright (c) Microsoft Corporation. All rights reserved.
7
- * Licensed under the MIT License.
8
- */
9
- class EncodingUtils {
10
- /**
11
- * 'utf8': Multibyte encoded Unicode characters. Many web pages and other document formats use UTF-8.
12
- * 'base64': Base64 encoding.
13
- *
14
- * @param str text
15
- */
16
- static base64Encode(str, encoding) {
17
- return Buffer.from(str, encoding).toString("base64");
18
- }
19
- /**
20
- * encode a URL
21
- * @param str
22
- */
23
- static base64EncodeUrl(str, encoding) {
24
- return EncodingUtils.base64Encode(str, encoding)
25
- .replace(/=/g, Constants.EMPTY_STRING)
26
- .replace(/\+/g, "-")
27
- .replace(/\//g, "_");
28
- }
29
- /**
30
- * 'utf8': Multibyte encoded Unicode characters. Many web pages and other document formats use UTF-8.
31
- * 'base64': Base64 encoding.
32
- *
33
- * @param base64Str Base64 encoded text
34
- */
35
- static base64Decode(base64Str) {
36
- return Buffer.from(base64Str, "base64").toString("utf8");
37
- }
38
- /**
39
- * @param base64Str Base64 encoded Url
40
- */
41
- static base64DecodeUrl(base64Str) {
42
- let str = base64Str.replace(/-/g, "+").replace(/_/g, "/");
43
- while (str.length % 4) {
44
- str += "=";
45
- }
46
- return EncodingUtils.base64Decode(str);
47
- }
5
+ /*
6
+ * Copyright (c) Microsoft Corporation. All rights reserved.
7
+ * Licensed under the MIT License.
8
+ */
9
+ class EncodingUtils {
10
+ /**
11
+ * 'utf8': Multibyte encoded Unicode characters. Many web pages and other document formats use UTF-8.
12
+ * 'base64': Base64 encoding.
13
+ *
14
+ * @param str text
15
+ */
16
+ static base64Encode(str, encoding) {
17
+ return Buffer.from(str, encoding).toString("base64");
18
+ }
19
+ /**
20
+ * encode a URL
21
+ * @param str
22
+ */
23
+ static base64EncodeUrl(str, encoding) {
24
+ return EncodingUtils.base64Encode(str, encoding)
25
+ .replace(/=/g, Constants.EMPTY_STRING)
26
+ .replace(/\+/g, "-")
27
+ .replace(/\//g, "_");
28
+ }
29
+ /**
30
+ * 'utf8': Multibyte encoded Unicode characters. Many web pages and other document formats use UTF-8.
31
+ * 'base64': Base64 encoding.
32
+ *
33
+ * @param base64Str Base64 encoded text
34
+ */
35
+ static base64Decode(base64Str) {
36
+ return Buffer.from(base64Str, "base64").toString("utf8");
37
+ }
38
+ /**
39
+ * @param base64Str Base64 encoded Url
40
+ */
41
+ static base64DecodeUrl(base64Str) {
42
+ let str = base64Str.replace(/-/g, "+").replace(/_/g, "/");
43
+ while (str.length % 4) {
44
+ str += "=";
45
+ }
46
+ return EncodingUtils.base64Decode(str);
47
+ }
48
48
  }
49
49
 
50
50
  export { EncodingUtils };
@@ -1,44 +1,44 @@
1
- /*! @azure/msal-node v2.1.0 2023-09-05 */
1
+ /*! @azure/msal-node v2.2.0-alpha.0 2023-09-20 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
5
- /*
6
- * Copyright (c) Microsoft Corporation. All rights reserved.
7
- * Licensed under the MIT License.
8
- */
9
- class NetworkUtils {
10
- static getNetworkResponse(headers, body, statusCode) {
11
- return {
12
- headers: headers,
13
- body: body,
14
- status: statusCode,
15
- };
16
- }
17
- /*
18
- * Utility function that converts a URL object into an ordinary options object as expected by the
19
- * http.request and https.request APIs.
20
- * https://github.com/nodejs/node/blob/main/lib/internal/url.js#L1090
21
- */
22
- static urlToHttpOptions(url) {
23
- const options = {
24
- protocol: url.protocol,
25
- hostname: url.hostname && url.hostname.startsWith("[")
26
- ? url.hostname.slice(1, -1)
27
- : url.hostname,
28
- hash: url.hash,
29
- search: url.search,
30
- pathname: url.pathname,
31
- path: `${url.pathname || ""}${url.search || ""}`,
32
- href: url.href,
33
- };
34
- if (url.port !== "") {
35
- options.port = Number(url.port);
36
- }
37
- if (url.username || url.password) {
38
- options.auth = `${decodeURIComponent(url.username)}:${decodeURIComponent(url.password)}`;
39
- }
40
- return options;
41
- }
5
+ /*
6
+ * Copyright (c) Microsoft Corporation. All rights reserved.
7
+ * Licensed under the MIT License.
8
+ */
9
+ class NetworkUtils {
10
+ static getNetworkResponse(headers, body, statusCode) {
11
+ return {
12
+ headers: headers,
13
+ body: body,
14
+ status: statusCode,
15
+ };
16
+ }
17
+ /*
18
+ * Utility function that converts a URL object into an ordinary options object as expected by the
19
+ * http.request and https.request APIs.
20
+ * https://github.com/nodejs/node/blob/main/lib/internal/url.js#L1090
21
+ */
22
+ static urlToHttpOptions(url) {
23
+ const options = {
24
+ protocol: url.protocol,
25
+ hostname: url.hostname && url.hostname.startsWith("[")
26
+ ? url.hostname.slice(1, -1)
27
+ : url.hostname,
28
+ hash: url.hash,
29
+ search: url.search,
30
+ pathname: url.pathname,
31
+ path: `${url.pathname || ""}${url.search || ""}`,
32
+ href: url.href,
33
+ };
34
+ if (url.port !== "") {
35
+ options.port = Number(url.port);
36
+ }
37
+ if (url.username || url.password) {
38
+ options.auth = `${decodeURIComponent(url.username)}:${decodeURIComponent(url.password)}`;
39
+ }
40
+ return options;
41
+ }
42
42
  }
43
43
 
44
44
  exports.NetworkUtils = NetworkUtils;
@@ -1,6 +1,6 @@
1
- import { NetworkResponse, UrlToHttpRequestOptions } from "@azure/msal-common";
2
- export declare class NetworkUtils {
3
- static getNetworkResponse<T>(headers: Record<string, string>, body: T, statusCode: number): NetworkResponse<T>;
4
- static urlToHttpOptions(url: URL): UrlToHttpRequestOptions;
5
- }
1
+ import { NetworkResponse, UrlToHttpRequestOptions } from "@azure/msal-common";
2
+ export declare class NetworkUtils {
3
+ static getNetworkResponse<T>(headers: Record<string, string>, body: T, statusCode: number): NetworkResponse<T>;
4
+ static urlToHttpOptions(url: URL): UrlToHttpRequestOptions;
5
+ }
6
6
  //# sourceMappingURL=NetworkUtils.d.ts.map
@@ -1,42 +1,42 @@
1
- /*! @azure/msal-node v2.1.0 2023-09-05 */
1
+ /*! @azure/msal-node v2.2.0-alpha.0 2023-09-20 */
2
2
  'use strict';
3
- /*
4
- * Copyright (c) Microsoft Corporation. All rights reserved.
5
- * Licensed under the MIT License.
6
- */
7
- class NetworkUtils {
8
- static getNetworkResponse(headers, body, statusCode) {
9
- return {
10
- headers: headers,
11
- body: body,
12
- status: statusCode,
13
- };
14
- }
15
- /*
16
- * Utility function that converts a URL object into an ordinary options object as expected by the
17
- * http.request and https.request APIs.
18
- * https://github.com/nodejs/node/blob/main/lib/internal/url.js#L1090
19
- */
20
- static urlToHttpOptions(url) {
21
- const options = {
22
- protocol: url.protocol,
23
- hostname: url.hostname && url.hostname.startsWith("[")
24
- ? url.hostname.slice(1, -1)
25
- : url.hostname,
26
- hash: url.hash,
27
- search: url.search,
28
- pathname: url.pathname,
29
- path: `${url.pathname || ""}${url.search || ""}`,
30
- href: url.href,
31
- };
32
- if (url.port !== "") {
33
- options.port = Number(url.port);
34
- }
35
- if (url.username || url.password) {
36
- options.auth = `${decodeURIComponent(url.username)}:${decodeURIComponent(url.password)}`;
37
- }
38
- return options;
39
- }
3
+ /*
4
+ * Copyright (c) Microsoft Corporation. All rights reserved.
5
+ * Licensed under the MIT License.
6
+ */
7
+ class NetworkUtils {
8
+ static getNetworkResponse(headers, body, statusCode) {
9
+ return {
10
+ headers: headers,
11
+ body: body,
12
+ status: statusCode,
13
+ };
14
+ }
15
+ /*
16
+ * Utility function that converts a URL object into an ordinary options object as expected by the
17
+ * http.request and https.request APIs.
18
+ * https://github.com/nodejs/node/blob/main/lib/internal/url.js#L1090
19
+ */
20
+ static urlToHttpOptions(url) {
21
+ const options = {
22
+ protocol: url.protocol,
23
+ hostname: url.hostname && url.hostname.startsWith("[")
24
+ ? url.hostname.slice(1, -1)
25
+ : url.hostname,
26
+ hash: url.hash,
27
+ search: url.search,
28
+ pathname: url.pathname,
29
+ path: `${url.pathname || ""}${url.search || ""}`,
30
+ href: url.href,
31
+ };
32
+ if (url.port !== "") {
33
+ options.port = Number(url.port);
34
+ }
35
+ if (url.username || url.password) {
36
+ options.auth = `${decodeURIComponent(url.username)}:${decodeURIComponent(url.password)}`;
37
+ }
38
+ return options;
39
+ }
40
40
  }
41
41
 
42
42
  export { NetworkUtils };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@azure/msal-node",
4
- "version": "2.1.0",
4
+ "version": "2.2.0-alpha.0",
5
5
  "author": {
6
6
  "name": "Microsoft",
7
7
  "email": "nugetaad@microsoft.com",
@@ -77,7 +77,7 @@
77
77
  "yargs": "^17.3.1"
78
78
  },
79
79
  "dependencies": {
80
- "@azure/msal-common": "14.0.3",
80
+ "@azure/msal-common": "14.1.0-alpha.0",
81
81
  "jsonwebtoken": "^9.0.0",
82
82
  "uuid": "^8.3.0"
83
83
  },
@@ -28,9 +28,10 @@ import {
28
28
  AuthError,
29
29
  AzureCloudOptions,
30
30
  AuthorizationCodePayload,
31
- ClientAuthError,
32
31
  Constants,
33
32
  StringUtils,
33
+ createClientAuthError,
34
+ ClientAuthErrorCodes,
34
35
  } from "@azure/msal-common";
35
36
  import {
36
37
  Configuration,
@@ -367,7 +368,7 @@ export abstract class ClientApplication {
367
368
  }
368
369
 
369
370
  if (state !== cachedState) {
370
- throw ClientAuthError.createStateMismatchError();
371
+ throw createClientAuthError(ClientAuthErrorCodes.stateMismatch);
371
372
  }
372
373
  }
373
374
 
@@ -4,7 +4,12 @@
4
4
  */
5
5
 
6
6
  import jwt from "jsonwebtoken";
7
- import { TimeUtils, ClientAuthError, Constants } from "@azure/msal-common";
7
+ import {
8
+ TimeUtils,
9
+ Constants,
10
+ createClientAuthError,
11
+ ClientAuthErrorCodes,
12
+ } from "@azure/msal-common";
8
13
  import { CryptoProvider } from "../crypto/CryptoProvider.js";
9
14
  import { EncodingUtils } from "../utils/EncodingUtils.js";
10
15
  import { JwtConstants } from "../utils/Constants.js";
@@ -86,7 +91,7 @@ export class ClientAssertion {
86
91
  return this.jwt;
87
92
  }
88
93
 
89
- throw ClientAuthError.createInvalidAssertionError();
94
+ throw createClientAuthError(ClientAuthErrorCodes.invalidAssertion);
90
95
  }
91
96
 
92
97
  /**