@azure/msal-node 2.0.2 → 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 (218) hide show
  1. package/README.md +3 -1
  2. package/dist/cache/ITokenCache.d.ts +15 -15
  3. package/dist/cache/NodeStorage.cjs +401 -401
  4. package/dist/cache/NodeStorage.cjs.map +1 -1
  5. package/dist/cache/NodeStorage.d.ts +182 -182
  6. package/dist/cache/NodeStorage.d.ts.map +1 -1
  7. package/dist/cache/NodeStorage.mjs +401 -401
  8. package/dist/cache/NodeStorage.mjs.map +1 -1
  9. package/dist/cache/TokenCache.cjs +265 -269
  10. package/dist/cache/TokenCache.cjs.map +1 -1
  11. package/dist/cache/TokenCache.d.ts +90 -90
  12. package/dist/cache/TokenCache.d.ts.map +1 -1
  13. package/dist/cache/TokenCache.mjs +266 -270
  14. package/dist/cache/TokenCache.mjs.map +1 -1
  15. package/dist/cache/distributed/DistributedCachePlugin.cjs +26 -26
  16. package/dist/cache/distributed/DistributedCachePlugin.cjs.map +1 -1
  17. package/dist/cache/distributed/DistributedCachePlugin.d.ts +10 -10
  18. package/dist/cache/distributed/DistributedCachePlugin.d.ts.map +1 -1
  19. package/dist/cache/distributed/DistributedCachePlugin.mjs +26 -26
  20. package/dist/cache/distributed/DistributedCachePlugin.mjs.map +1 -1
  21. package/dist/cache/distributed/ICacheClient.d.ts +17 -17
  22. package/dist/cache/distributed/IPartitionManager.d.ts +28 -28
  23. package/dist/cache/serializer/Deserializer.cjs +173 -175
  24. package/dist/cache/serializer/Deserializer.cjs.map +1 -1
  25. package/dist/cache/serializer/Deserializer.d.ts +42 -42
  26. package/dist/cache/serializer/Deserializer.d.ts.map +1 -1
  27. package/dist/cache/serializer/Deserializer.mjs +174 -176
  28. package/dist/cache/serializer/Deserializer.mjs.map +1 -1
  29. package/dist/cache/serializer/Serializer.cjs +134 -134
  30. package/dist/cache/serializer/Serializer.cjs.map +1 -1
  31. package/dist/cache/serializer/Serializer.d.ts +39 -39
  32. package/dist/cache/serializer/Serializer.d.ts.map +1 -1
  33. package/dist/cache/serializer/Serializer.mjs +134 -134
  34. package/dist/cache/serializer/Serializer.mjs.map +1 -1
  35. package/dist/cache/serializer/SerializerTypes.d.ts +101 -101
  36. package/dist/client/ClientApplication.cjs +333 -333
  37. package/dist/client/ClientApplication.cjs.map +1 -1
  38. package/dist/client/ClientApplication.d.ts +142 -142
  39. package/dist/client/ClientApplication.d.ts.map +1 -1
  40. package/dist/client/ClientApplication.mjs +334 -334
  41. package/dist/client/ClientApplication.mjs.map +1 -1
  42. package/dist/client/ClientAssertion.cjs +116 -116
  43. package/dist/client/ClientAssertion.cjs.map +1 -1
  44. package/dist/client/ClientAssertion.d.ts +46 -46
  45. package/dist/client/ClientAssertion.d.ts.map +1 -1
  46. package/dist/client/ClientAssertion.mjs +117 -117
  47. package/dist/client/ClientAssertion.mjs.map +1 -1
  48. package/dist/client/ClientCredentialClient.cjs +189 -168
  49. package/dist/client/ClientCredentialClient.cjs.map +1 -1
  50. package/dist/client/ClientCredentialClient.d.ts +33 -33
  51. package/dist/client/ClientCredentialClient.d.ts.map +1 -1
  52. package/dist/client/ClientCredentialClient.mjs +190 -169
  53. package/dist/client/ClientCredentialClient.mjs.map +1 -1
  54. package/dist/client/ConfidentialClientApplication.cjs +163 -164
  55. package/dist/client/ConfidentialClientApplication.cjs.map +1 -1
  56. package/dist/client/ConfidentialClientApplication.d.ts +58 -58
  57. package/dist/client/ConfidentialClientApplication.d.ts.map +1 -1
  58. package/dist/client/ConfidentialClientApplication.mjs +164 -165
  59. package/dist/client/ConfidentialClientApplication.mjs.map +1 -1
  60. package/dist/client/DeviceCodeClient.cjs +207 -207
  61. package/dist/client/DeviceCodeClient.cjs.map +1 -1
  62. package/dist/client/DeviceCodeClient.d.ts +53 -53
  63. package/dist/client/DeviceCodeClient.d.ts.map +1 -1
  64. package/dist/client/DeviceCodeClient.mjs +208 -208
  65. package/dist/client/DeviceCodeClient.mjs.map +1 -1
  66. package/dist/client/IConfidentialClientApplication.d.ts +39 -39
  67. package/dist/client/IConfidentialClientApplication.d.ts.map +1 -1
  68. package/dist/client/IPublicClientApplication.d.ts +42 -42
  69. package/dist/client/IPublicClientApplication.d.ts.map +1 -1
  70. package/dist/client/OnBehalfOfClient.cjs +203 -204
  71. package/dist/client/OnBehalfOfClient.cjs.map +1 -1
  72. package/dist/client/OnBehalfOfClient.d.ts +47 -47
  73. package/dist/client/OnBehalfOfClient.d.ts.map +1 -1
  74. package/dist/client/OnBehalfOfClient.mjs +204 -205
  75. package/dist/client/OnBehalfOfClient.mjs.map +1 -1
  76. package/dist/client/PublicClientApplication.cjs +229 -175
  77. package/dist/client/PublicClientApplication.cjs.map +1 -1
  78. package/dist/client/PublicClientApplication.d.ts +71 -65
  79. package/dist/client/PublicClientApplication.d.ts.map +1 -1
  80. package/dist/client/PublicClientApplication.mjs +232 -178
  81. package/dist/client/PublicClientApplication.mjs.map +1 -1
  82. package/dist/client/UsernamePasswordClient.cjs +95 -95
  83. package/dist/client/UsernamePasswordClient.cjs.map +1 -1
  84. package/dist/client/UsernamePasswordClient.d.ts +25 -25
  85. package/dist/client/UsernamePasswordClient.d.ts.map +1 -1
  86. package/dist/client/UsernamePasswordClient.mjs +95 -95
  87. package/dist/client/UsernamePasswordClient.mjs.map +1 -1
  88. package/dist/config/Configuration.cjs +72 -72
  89. package/dist/config/Configuration.cjs.map +1 -1
  90. package/dist/config/Configuration.d.ts +107 -107
  91. package/dist/config/Configuration.mjs +72 -72
  92. package/dist/config/Configuration.mjs.map +1 -1
  93. package/dist/crypto/CryptoProvider.cjs +75 -75
  94. package/dist/crypto/CryptoProvider.cjs.map +1 -1
  95. package/dist/crypto/CryptoProvider.d.ts +52 -52
  96. package/dist/crypto/CryptoProvider.mjs +75 -75
  97. package/dist/crypto/CryptoProvider.mjs.map +1 -1
  98. package/dist/crypto/GuidGenerator.cjs +22 -22
  99. package/dist/crypto/GuidGenerator.cjs.map +1 -1
  100. package/dist/crypto/GuidGenerator.d.ts +14 -14
  101. package/dist/crypto/GuidGenerator.mjs +22 -22
  102. package/dist/crypto/GuidGenerator.mjs.map +1 -1
  103. package/dist/crypto/HashUtils.cjs +13 -13
  104. package/dist/crypto/HashUtils.cjs.map +1 -1
  105. package/dist/crypto/HashUtils.d.ts +8 -8
  106. package/dist/crypto/HashUtils.mjs +13 -13
  107. package/dist/crypto/HashUtils.mjs.map +1 -1
  108. package/dist/crypto/PkceGenerator.cjs +49 -49
  109. package/dist/crypto/PkceGenerator.cjs.map +1 -1
  110. package/dist/crypto/PkceGenerator.d.ts +22 -22
  111. package/dist/crypto/PkceGenerator.mjs +49 -49
  112. package/dist/crypto/PkceGenerator.mjs.map +1 -1
  113. package/dist/error/NodeAuthError.cjs +85 -85
  114. package/dist/error/NodeAuthError.cjs.map +1 -1
  115. package/dist/error/NodeAuthError.d.ts +65 -65
  116. package/dist/error/NodeAuthError.mjs +85 -85
  117. package/dist/error/NodeAuthError.mjs.map +1 -1
  118. package/dist/index.cjs +17 -1
  119. package/dist/index.cjs.map +1 -1
  120. package/dist/index.d.ts +42 -42
  121. package/dist/index.d.ts.map +1 -1
  122. package/dist/index.mjs +2 -2
  123. package/dist/internals.cjs +8 -8
  124. package/dist/internals.cjs.map +1 -1
  125. package/dist/internals.d.ts +6 -6
  126. package/dist/internals.d.ts.map +1 -1
  127. package/dist/internals.mjs +8 -8
  128. package/dist/internals.mjs.map +1 -1
  129. package/dist/network/HttpClient.cjs +277 -276
  130. package/dist/network/HttpClient.cjs.map +1 -1
  131. package/dist/network/HttpClient.d.ts +25 -25
  132. package/dist/network/HttpClient.d.ts.map +1 -1
  133. package/dist/network/HttpClient.mjs +278 -277
  134. package/dist/network/HttpClient.mjs.map +1 -1
  135. package/dist/network/ILoopbackClient.d.ts +10 -10
  136. package/dist/network/LoopbackClient.cjs +75 -84
  137. package/dist/network/LoopbackClient.cjs.map +1 -1
  138. package/dist/network/LoopbackClient.d.ts +21 -21
  139. package/dist/network/LoopbackClient.d.ts.map +1 -1
  140. package/dist/network/LoopbackClient.mjs +77 -86
  141. package/dist/network/LoopbackClient.mjs.map +1 -1
  142. package/dist/packageMetadata.cjs +4 -4
  143. package/dist/packageMetadata.cjs.map +1 -1
  144. package/dist/packageMetadata.d.ts +2 -2
  145. package/dist/packageMetadata.mjs +4 -4
  146. package/dist/packageMetadata.mjs.map +1 -1
  147. package/dist/request/AuthorizationCodeRequest.d.ts +21 -21
  148. package/dist/request/AuthorizationUrlRequest.d.ts +33 -33
  149. package/dist/request/ClientCredentialRequest.d.ts +14 -14
  150. package/dist/request/DeviceCodeRequest.d.ts +15 -15
  151. package/dist/request/InteractiveRequest.d.ts +22 -22
  152. package/dist/request/InteractiveRequest.d.ts.map +1 -1
  153. package/dist/request/OnBehalfOfRequest.d.ts +14 -14
  154. package/dist/request/RefreshTokenRequest.d.ts +17 -17
  155. package/dist/request/SignOutRequest.d.ts +5 -5
  156. package/dist/request/SilentFlowRequest.d.ts +16 -16
  157. package/dist/request/UsernamePasswordRequest.d.ts +19 -19
  158. package/dist/utils/Constants.cjs +80 -90
  159. package/dist/utils/Constants.cjs.map +1 -1
  160. package/dist/utils/Constants.d.ts +86 -96
  161. package/dist/utils/Constants.d.ts.map +1 -1
  162. package/dist/utils/Constants.mjs +81 -90
  163. package/dist/utils/Constants.mjs.map +1 -1
  164. package/dist/utils/EncodingUtils.cjs +44 -44
  165. package/dist/utils/EncodingUtils.cjs.map +1 -1
  166. package/dist/utils/EncodingUtils.d.ts +26 -26
  167. package/dist/utils/EncodingUtils.mjs +44 -44
  168. package/dist/utils/EncodingUtils.mjs.map +1 -1
  169. package/dist/utils/NetworkUtils.cjs +38 -38
  170. package/dist/utils/NetworkUtils.cjs.map +1 -1
  171. package/dist/utils/NetworkUtils.d.ts +5 -5
  172. package/dist/utils/NetworkUtils.mjs +38 -38
  173. package/dist/utils/NetworkUtils.mjs.map +1 -1
  174. package/package.json +8 -5
  175. package/src/cache/ITokenCache.ts +24 -0
  176. package/src/cache/NodeStorage.ts +533 -0
  177. package/src/cache/TokenCache.ts +358 -0
  178. package/src/cache/distributed/DistributedCachePlugin.ts +56 -0
  179. package/src/cache/distributed/ICacheClient.ts +23 -0
  180. package/src/cache/distributed/IPartitionManager.ts +35 -0
  181. package/src/cache/serializer/Deserializer.ts +218 -0
  182. package/src/cache/serializer/Serializer.ts +173 -0
  183. package/src/cache/serializer/SerializerTypes.ts +121 -0
  184. package/src/client/ClientApplication.ts +596 -0
  185. package/src/client/ClientAssertion.ts +165 -0
  186. package/src/client/ClientCredentialClient.ts +346 -0
  187. package/src/client/ConfidentialClientApplication.ts +268 -0
  188. package/src/client/DeviceCodeClient.ts +369 -0
  189. package/src/client/IConfidentialClientApplication.ts +72 -0
  190. package/src/client/IPublicClientApplication.ts +72 -0
  191. package/src/client/OnBehalfOfClient.ts +368 -0
  192. package/src/client/PublicClientApplication.ts +339 -0
  193. package/src/client/UsernamePasswordClient.ts +180 -0
  194. package/src/config/Configuration.ts +201 -0
  195. package/src/crypto/CryptoProvider.ts +98 -0
  196. package/src/crypto/GuidGenerator.ts +28 -0
  197. package/src/crypto/HashUtils.ts +17 -0
  198. package/src/crypto/PkceGenerator.ts +63 -0
  199. package/src/error/NodeAuthError.ts +117 -0
  200. package/src/index.ts +125 -0
  201. package/src/internals.ts +12 -0
  202. package/src/network/HttpClient.ts +425 -0
  203. package/src/network/ILoopbackClient.ts +19 -0
  204. package/src/network/LoopbackClient.ts +110 -0
  205. package/src/packageMetadata.ts +3 -0
  206. package/src/request/AuthorizationCodeRequest.ts +39 -0
  207. package/src/request/AuthorizationUrlRequest.ts +50 -0
  208. package/src/request/ClientCredentialRequest.ts +29 -0
  209. package/src/request/DeviceCodeRequest.ts +34 -0
  210. package/src/request/InteractiveRequest.ts +39 -0
  211. package/src/request/OnBehalfOfRequest.ts +30 -0
  212. package/src/request/RefreshTokenRequest.ts +34 -0
  213. package/src/request/SignOutRequest.ts +11 -0
  214. package/src/request/SilentFlowRequest.ts +32 -0
  215. package/src/request/UsernamePasswordRequest.ts +36 -0
  216. package/src/utils/Constants.ts +103 -0
  217. package/src/utils/EncodingUtils.ts +50 -0
  218. package/src/utils/NetworkUtils.ts +49 -0
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.0.2 2023-08-18 */
1
+ /*! @azure/msal-node v2.2.0-alpha.0 2023-09-20 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
@@ -7,89 +7,80 @@ var http = require('http');
7
7
  var NodeAuthError = require('../error/NodeAuthError.cjs');
8
8
  var Constants = require('../utils/Constants.cjs');
9
9
 
10
- /*
11
- * Copyright (c) Microsoft Corporation. All rights reserved.
12
- * Licensed under the MIT License.
13
- */
14
- class LoopbackClient {
15
- /**
16
- * Spins up a loopback server which returns the server response when the localhost redirectUri is hit
17
- * @param successTemplate
18
- * @param errorTemplate
19
- * @returns
20
- */
21
- async listenForAuthCode(successTemplate, errorTemplate) {
22
- if (!!this.server) {
23
- throw NodeAuthError.NodeAuthError.createLoopbackServerAlreadyExistsError();
24
- }
25
- const authCodeListener = new Promise((resolve, reject) => {
26
- this.server = http.createServer(async (req, res) => {
27
- const url = req.url;
28
- if (!url) {
29
- res.end(errorTemplate ||
30
- "Error occurred loading redirectUrl");
31
- reject(NodeAuthError.NodeAuthError.createUnableToLoadRedirectUrlError());
32
- return;
33
- }
34
- else if (url === msalCommon.Constants.FORWARD_SLASH) {
35
- res.end(successTemplate ||
36
- "Auth code was successfully acquired. You can close this window now.");
37
- return;
38
- }
39
- const authCodeResponse = msalCommon.UrlString.getDeserializedQueryString(url);
40
- if (authCodeResponse.code) {
41
- const redirectUri = await this.getRedirectUri();
42
- res.writeHead(Constants.HttpStatus.REDIRECT, {
43
- location: redirectUri,
44
- }); // Prevent auth code from being saved in the browser history
45
- res.end();
46
- }
47
- resolve(authCodeResponse);
48
- });
49
- this.server.listen(0); // Listen on any available port
50
- });
51
- // Wait for server to be listening
52
- await new Promise((resolve) => {
53
- let ticks = 0;
54
- const id = setInterval(() => {
55
- if (Constants.LOOPBACK_SERVER_CONSTANTS.TIMEOUT_MS /
56
- Constants.LOOPBACK_SERVER_CONSTANTS.INTERVAL_MS <
57
- ticks) {
58
- throw NodeAuthError.NodeAuthError.createLoopbackServerTimeoutError();
59
- }
60
- if (this.server.listening) {
61
- clearInterval(id);
62
- resolve();
63
- }
64
- ticks++;
65
- }, Constants.LOOPBACK_SERVER_CONSTANTS.INTERVAL_MS);
66
- });
67
- return authCodeListener;
68
- }
69
- /**
70
- * Get the port that the loopback server is running on
71
- * @returns
72
- */
73
- getRedirectUri() {
74
- if (!this.server) {
75
- throw NodeAuthError.NodeAuthError.createNoLoopbackServerExistsError();
76
- }
77
- const address = this.server.address();
78
- if (!address || typeof address === "string" || !address.port) {
79
- this.closeServer();
80
- throw NodeAuthError.NodeAuthError.createInvalidLoopbackAddressTypeError();
81
- }
82
- const port = address && address.port;
83
- return `${Constants.Constants.HTTP_PROTOCOL}${Constants.Constants.LOCALHOST}:${port}`;
84
- }
85
- /**
86
- * Close the loopback server
87
- */
88
- closeServer() {
89
- if (!!this.server) {
90
- this.server.close();
91
- }
92
- }
10
+ /*
11
+ * Copyright (c) Microsoft Corporation. All rights reserved.
12
+ * Licensed under the MIT License.
13
+ */
14
+ class LoopbackClient {
15
+ /**
16
+ * Spins up a loopback server which returns the server response when the localhost redirectUri is hit
17
+ * @param successTemplate
18
+ * @param errorTemplate
19
+ * @returns
20
+ */
21
+ async listenForAuthCode(successTemplate, errorTemplate) {
22
+ if (this.server) {
23
+ throw NodeAuthError.NodeAuthError.createLoopbackServerAlreadyExistsError();
24
+ }
25
+ return new Promise((resolve, reject) => {
26
+ this.server = http.createServer((req, res) => {
27
+ const url = req.url;
28
+ if (!url) {
29
+ res.end(errorTemplate ||
30
+ "Error occurred loading redirectUrl");
31
+ reject(NodeAuthError.NodeAuthError.createUnableToLoadRedirectUrlError());
32
+ return;
33
+ }
34
+ else if (url === msalCommon.Constants.FORWARD_SLASH) {
35
+ res.end(successTemplate ||
36
+ "Auth code was successfully acquired. You can close this window now.");
37
+ return;
38
+ }
39
+ const authCodeResponse = msalCommon.UrlString.getDeserializedQueryString(url);
40
+ if (authCodeResponse.code) {
41
+ const redirectUri = this.getRedirectUri();
42
+ res.writeHead(msalCommon.HttpStatus.REDIRECT, {
43
+ location: redirectUri,
44
+ }); // Prevent auth code from being saved in the browser history
45
+ res.end();
46
+ }
47
+ resolve(authCodeResponse);
48
+ });
49
+ this.server.listen(0); // Listen on any available port
50
+ });
51
+ }
52
+ /**
53
+ * Get the port that the loopback server is running on
54
+ * @returns
55
+ */
56
+ getRedirectUri() {
57
+ if (!this.server || !this.server.listening) {
58
+ throw NodeAuthError.NodeAuthError.createNoLoopbackServerExistsError();
59
+ }
60
+ const address = this.server.address();
61
+ if (!address || typeof address === "string" || !address.port) {
62
+ this.closeServer();
63
+ throw NodeAuthError.NodeAuthError.createInvalidLoopbackAddressTypeError();
64
+ }
65
+ const port = address && address.port;
66
+ return `${Constants.Constants.HTTP_PROTOCOL}${Constants.Constants.LOCALHOST}:${port}`;
67
+ }
68
+ /**
69
+ * Close the loopback server
70
+ */
71
+ closeServer() {
72
+ if (this.server) {
73
+ // Only stops accepting new connections, server will close once open/idle connections are closed.
74
+ this.server.close();
75
+ if (typeof this.server.closeAllConnections === "function") {
76
+ /*
77
+ * Close open/idle connections. This API is available in Node versions 18.2 and higher
78
+ */
79
+ this.server.closeAllConnections();
80
+ }
81
+ this.server = undefined;
82
+ }
83
+ }
93
84
  }
94
85
 
95
86
  exports.LoopbackClient = LoopbackClient;
@@ -1 +1 @@
1
- {"version":3,"file":"LoopbackClient.cjs","sources":["../../src/network/LoopbackClient.ts"],"sourcesContent":[null],"names":["NodeAuthError","CommonConstants","UrlString","HttpStatus","LOOPBACK_SERVER_CONSTANTS","Constants"],"mappings":";;;;;;;;;AAAA;;;AAGG;MAgBU,cAAc,CAAA;AAGvB;;;;;AAKG;AACH,IAAA,MAAM,iBAAiB,C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AE;AACf,YAAA,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;AACvB,SAAA;KACJ;AACJ;;;;"}
1
+ {"version":3,"file":"LoopbackClient.cjs","sources":["../../src/network/LoopbackClient.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;AAKA;AASA;AAEA;;;AAQO;AACG;AA+CN;;;AAGG;AACH,IAAA,MAAA,iBAAwB,CAAA,eAAA,EAAA,aAAA,EAAA;AAgBxB,QAAA,IAAA,IAAA,CAAA,MAAA,EAAA;;AAEG,SAAA;AACH,QAAA,OAAW,IAAI,OAAI,CAAA,CAAA,OAAA,EAAA,MAAA,KAAA;AActB,YAAA,IAAA,CAAA,MAAA,GAAA,IAAA,CAAA,YAAA,CAAA,CAAA,GAAA,EAAA,GAAA,KAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,22 +1,22 @@
1
- import { ServerAuthorizationCodeResponse } from "@azure/msal-common";
2
- import { ILoopbackClient } from "./ILoopbackClient";
3
- export declare class LoopbackClient implements ILoopbackClient {
4
- private server;
5
- /**
6
- * Spins up a loopback server which returns the server response when the localhost redirectUri is hit
7
- * @param successTemplate
8
- * @param errorTemplate
9
- * @returns
10
- */
11
- listenForAuthCode(successTemplate?: string, errorTemplate?: string): Promise<ServerAuthorizationCodeResponse>;
12
- /**
13
- * Get the port that the loopback server is running on
14
- * @returns
15
- */
16
- getRedirectUri(): string;
17
- /**
18
- * Close the loopback server
19
- */
20
- closeServer(): void;
21
- }
1
+ import { ServerAuthorizationCodeResponse } from "@azure/msal-common";
2
+ import { ILoopbackClient } from "./ILoopbackClient.js";
3
+ export declare class LoopbackClient implements ILoopbackClient {
4
+ private server;
5
+ /**
6
+ * Spins up a loopback server which returns the server response when the localhost redirectUri is hit
7
+ * @param successTemplate
8
+ * @param errorTemplate
9
+ * @returns
10
+ */
11
+ listenForAuthCode(successTemplate?: string, errorTemplate?: string): Promise<ServerAuthorizationCodeResponse>;
12
+ /**
13
+ * Get the port that the loopback server is running on
14
+ * @returns
15
+ */
16
+ getRedirectUri(): string;
17
+ /**
18
+ * Close the loopback server
19
+ */
20
+ closeServer(): void;
21
+ }
22
22
  //# sourceMappingURL=LoopbackClient.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"LoopbackClient.d.ts","sourceRoot":"","sources":["../../src/network/LoopbackClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAEH,+BAA+B,EAElC,MAAM,oBAAoB,CAAC;AAQ5B,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,qBAAa,cAAe,YAAW,eAAe;IAClD,OAAO,CAAC,MAAM,CAAc;IAE5B;;;;;OAKG;IACG,iBAAiB,CACnB,eAAe,CAAC,EAAE,MAAM,EACxB,aAAa,CAAC,EAAE,MAAM,GACvB,OAAO,CAAC,+BAA+B,CAAC;IAqE3C;;;OAGG;IACH,cAAc,IAAI,MAAM;IAgBxB;;OAEG;IACH,WAAW,IAAI,IAAI;CAKtB"}
1
+ {"version":3,"file":"LoopbackClient.d.ts","sourceRoot":"","sources":["../../src/network/LoopbackClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAEH,+BAA+B,EAGlC,MAAM,oBAAoB,CAAC;AAI5B,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,qBAAa,cAAe,YAAW,eAAe;IAClD,OAAO,CAAC,MAAM,CAA0B;IAExC;;;;;OAKG;IACG,iBAAiB,CACnB,eAAe,CAAC,EAAE,MAAM,EACxB,aAAa,CAAC,EAAE,MAAM,GACvB,OAAO,CAAC,+BAA+B,CAAC;IA4C3C;;;OAGG;IACH,cAAc,IAAI,MAAM;IAgBxB;;OAEG;IACH,WAAW,IAAI,IAAI;CActB"}
@@ -1,93 +1,84 @@
1
- /*! @azure/msal-node v2.0.2 2023-08-18 */
1
+ /*! @azure/msal-node v2.2.0-alpha.0 2023-09-20 */
2
2
  'use strict';
3
- import { Constants, UrlString } from '@azure/msal-common';
3
+ import { Constants, UrlString, HttpStatus } from '@azure/msal-common';
4
4
  import http from 'http';
5
5
  import { NodeAuthError } from '../error/NodeAuthError.mjs';
6
- import { HttpStatus, LOOPBACK_SERVER_CONSTANTS, Constants as Constants$1 } from '../utils/Constants.mjs';
6
+ import { Constants as Constants$1 } from '../utils/Constants.mjs';
7
7
 
8
- /*
9
- * Copyright (c) Microsoft Corporation. All rights reserved.
10
- * Licensed under the MIT License.
11
- */
12
- class LoopbackClient {
13
- /**
14
- * Spins up a loopback server which returns the server response when the localhost redirectUri is hit
15
- * @param successTemplate
16
- * @param errorTemplate
17
- * @returns
18
- */
19
- async listenForAuthCode(successTemplate, errorTemplate) {
20
- if (!!this.server) {
21
- throw NodeAuthError.createLoopbackServerAlreadyExistsError();
22
- }
23
- const authCodeListener = new Promise((resolve, reject) => {
24
- this.server = http.createServer(async (req, res) => {
25
- const url = req.url;
26
- if (!url) {
27
- res.end(errorTemplate ||
28
- "Error occurred loading redirectUrl");
29
- reject(NodeAuthError.createUnableToLoadRedirectUrlError());
30
- return;
31
- }
32
- else if (url === Constants.FORWARD_SLASH) {
33
- res.end(successTemplate ||
34
- "Auth code was successfully acquired. You can close this window now.");
35
- return;
36
- }
37
- const authCodeResponse = UrlString.getDeserializedQueryString(url);
38
- if (authCodeResponse.code) {
39
- const redirectUri = await this.getRedirectUri();
40
- res.writeHead(HttpStatus.REDIRECT, {
41
- location: redirectUri,
42
- }); // Prevent auth code from being saved in the browser history
43
- res.end();
44
- }
45
- resolve(authCodeResponse);
46
- });
47
- this.server.listen(0); // Listen on any available port
48
- });
49
- // Wait for server to be listening
50
- await new Promise((resolve) => {
51
- let ticks = 0;
52
- const id = setInterval(() => {
53
- if (LOOPBACK_SERVER_CONSTANTS.TIMEOUT_MS /
54
- LOOPBACK_SERVER_CONSTANTS.INTERVAL_MS <
55
- ticks) {
56
- throw NodeAuthError.createLoopbackServerTimeoutError();
57
- }
58
- if (this.server.listening) {
59
- clearInterval(id);
60
- resolve();
61
- }
62
- ticks++;
63
- }, LOOPBACK_SERVER_CONSTANTS.INTERVAL_MS);
64
- });
65
- return authCodeListener;
66
- }
67
- /**
68
- * Get the port that the loopback server is running on
69
- * @returns
70
- */
71
- getRedirectUri() {
72
- if (!this.server) {
73
- throw NodeAuthError.createNoLoopbackServerExistsError();
74
- }
75
- const address = this.server.address();
76
- if (!address || typeof address === "string" || !address.port) {
77
- this.closeServer();
78
- throw NodeAuthError.createInvalidLoopbackAddressTypeError();
79
- }
80
- const port = address && address.port;
81
- return `${Constants$1.HTTP_PROTOCOL}${Constants$1.LOCALHOST}:${port}`;
82
- }
83
- /**
84
- * Close the loopback server
85
- */
86
- closeServer() {
87
- if (!!this.server) {
88
- this.server.close();
89
- }
90
- }
8
+ /*
9
+ * Copyright (c) Microsoft Corporation. All rights reserved.
10
+ * Licensed under the MIT License.
11
+ */
12
+ class LoopbackClient {
13
+ /**
14
+ * Spins up a loopback server which returns the server response when the localhost redirectUri is hit
15
+ * @param successTemplate
16
+ * @param errorTemplate
17
+ * @returns
18
+ */
19
+ async listenForAuthCode(successTemplate, errorTemplate) {
20
+ if (this.server) {
21
+ throw NodeAuthError.createLoopbackServerAlreadyExistsError();
22
+ }
23
+ return new Promise((resolve, reject) => {
24
+ this.server = http.createServer((req, res) => {
25
+ const url = req.url;
26
+ if (!url) {
27
+ res.end(errorTemplate ||
28
+ "Error occurred loading redirectUrl");
29
+ reject(NodeAuthError.createUnableToLoadRedirectUrlError());
30
+ return;
31
+ }
32
+ else if (url === Constants.FORWARD_SLASH) {
33
+ res.end(successTemplate ||
34
+ "Auth code was successfully acquired. You can close this window now.");
35
+ return;
36
+ }
37
+ const authCodeResponse = UrlString.getDeserializedQueryString(url);
38
+ if (authCodeResponse.code) {
39
+ const redirectUri = this.getRedirectUri();
40
+ res.writeHead(HttpStatus.REDIRECT, {
41
+ location: redirectUri,
42
+ }); // Prevent auth code from being saved in the browser history
43
+ res.end();
44
+ }
45
+ resolve(authCodeResponse);
46
+ });
47
+ this.server.listen(0); // Listen on any available port
48
+ });
49
+ }
50
+ /**
51
+ * Get the port that the loopback server is running on
52
+ * @returns
53
+ */
54
+ getRedirectUri() {
55
+ if (!this.server || !this.server.listening) {
56
+ throw NodeAuthError.createNoLoopbackServerExistsError();
57
+ }
58
+ const address = this.server.address();
59
+ if (!address || typeof address === "string" || !address.port) {
60
+ this.closeServer();
61
+ throw NodeAuthError.createInvalidLoopbackAddressTypeError();
62
+ }
63
+ const port = address && address.port;
64
+ return `${Constants$1.HTTP_PROTOCOL}${Constants$1.LOCALHOST}:${port}`;
65
+ }
66
+ /**
67
+ * Close the loopback server
68
+ */
69
+ closeServer() {
70
+ if (this.server) {
71
+ // Only stops accepting new connections, server will close once open/idle connections are closed.
72
+ this.server.close();
73
+ if (typeof this.server.closeAllConnections === "function") {
74
+ /*
75
+ * Close open/idle connections. This API is available in Node versions 18.2 and higher
76
+ */
77
+ this.server.closeAllConnections();
78
+ }
79
+ this.server = undefined;
80
+ }
81
+ }
91
82
  }
92
83
 
93
84
  export { LoopbackClient };
@@ -1 +1 @@
1
- {"version":3,"file":"LoopbackClient.mjs","sources":["../../src/network/LoopbackClient.ts"],"sourcesContent":[null],"names":["CommonConstants","Constants"],"mappings":";;;;;;;AAAA;;;AAGG;MAgBU,cAAc,CAAA;AAGvB;;;;;AAKG;AACH,IAAA,MAAM,iBAAiB,CACnB,eAAwB,EACxB,aAAsB,EAAA;AAEtB,QAAA,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE;AACf,YAAA,MAAM,aAAa,CAAC,sCAAsC,EAAE,CAAC;AAChE,SAAA;QAED,MAAM,gBAAgB,GAAG,IAAI,OAAO,CAChC,CAAC,OAAO,EAAE,MAAM,KAAI;AAChB,YAAA,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,YAAY,CAC3B,OACI,GAAyB,EACzB,GAAwB,KACxB;AACA,gBAAA,MAAM,GAAG,GAAG,GAAG,CAA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OAAA,EAAA,MAAA,KAAA;AActB,YAAA,IAAA,CAAA,MAAA,GAAA,IAAA,CAAA,YAAA,CAAA,CAAA,GAAA,EAAA,GAAA,KAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,10 +1,10 @@
1
- /*! @azure/msal-node v2.0.2 2023-08-18 */
1
+ /*! @azure/msal-node v2.2.0-alpha.0 2023-09-20 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
5
- /* eslint-disable header/header */
6
- const name = "@azure/msal-node";
7
- const version = "2.0.2";
5
+ /* eslint-disable header/header */
6
+ const name = "@azure/msal-node";
7
+ const version = "2.1.0";
8
8
 
9
9
  exports.name = name;
10
10
  exports.version = version;
@@ -1 +1 @@
1
- {"version":3,"file":"packageMetadata.cjs","sources":["../src/packageMetadata.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAAA;AACO,MAAM,IAAI,GAAG,mBAAmB;AAChC,MAAM,OAAO,GAAG;;;;;"}
1
+ {"version":3,"file":"packageMetadata.cjs","sources":["../src/packageMetadata.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AACA;AACO,MAAA,IAAA,GAAA,mBAAwB;;;;;;"}
@@ -1,3 +1,3 @@
1
- export declare const name = "@azure/msal-node";
2
- export declare const version = "2.0.2";
1
+ export declare const name = "@azure/msal-node";
2
+ export declare const version = "2.1.0";
3
3
  //# sourceMappingURL=packageMetadata.d.ts.map
@@ -1,8 +1,8 @@
1
- /*! @azure/msal-node v2.0.2 2023-08-18 */
1
+ /*! @azure/msal-node v2.2.0-alpha.0 2023-09-20 */
2
2
  'use strict';
3
- /* eslint-disable header/header */
4
- const name = "@azure/msal-node";
5
- const version = "2.0.2";
3
+ /* eslint-disable header/header */
4
+ const name = "@azure/msal-node";
5
+ const version = "2.1.0";
6
6
 
7
7
  export { name, version };
8
8
  //# sourceMappingURL=packageMetadata.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageMetadata.mjs","sources":["../src/packageMetadata.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;AACO,MAAM,IAAI,GAAG,mBAAmB;AAChC,MAAM,OAAO,GAAG;;;;"}
1
+ {"version":3,"file":"packageMetadata.mjs","sources":["../src/packageMetadata.ts"],"sourcesContent":[null],"names":[],"mappings":";;AACA;AACO,MAAA,IAAA,GAAA,mBAAwB;;;;;"}
@@ -1,22 +1,22 @@
1
- import { CommonAuthorizationCodeRequest } from "@azure/msal-common";
2
- /**
3
- * Request object passed by user to acquire a token from the server exchanging a valid authorization code (second leg of OAuth2.0 Authorization Code flow)
4
- *
5
- * - scopes - Array of scopes the application is requesting access to.
6
- * - claims - A stringified claims request which will be added to all /authorize and /token calls
7
- * - authority: - URL of the authority, the security token service (STS) from which MSAL will acquire tokens. If authority is set on client application object, this will override that value. Overriding the value will cause for authority validation to happen each time. If the same authority will be used for all request, set on the application object instead of the requests.
8
- * - correlationId - Unique GUID set per request to trace a request end-to-end for telemetry purposes.
9
- * - redirectUri - The redirect URI of your app, where the authority will redirect to after the user inputs credentials and consents. It must exactly match one of the redirect URIs you registered in the portal.
10
- * - tokenQueryParameters - String to string map of custom query parameters added to the /token call
11
- * - code - The authorization_code that the user acquired in the first leg of the flow.
12
- * - codeVerifier - The same code_verifier that was used to obtain the authorization_code. Required if PKCE was used in the authorization code grant request.For more information, see the PKCE RFC: https://tools.ietf.org/html/rfc7636
13
- * - state - Unique GUID generated by the user that is cached by the user and sent to the server during the first leg of the flow. This string is sent back by the server with the authorization code. The user cached state is then compared with the state received from the server to mitigate the risk of CSRF attacks. See https://datatracker.ietf.org/doc/html/rfc6819#section-3.6.
14
- * @public
15
- */
16
- export type AuthorizationCodeRequest = Partial<Omit<CommonAuthorizationCodeRequest, "scopes" | "redirectUri" | "code" | "authenticationScheme" | "resourceRequestMethod" | "resourceRequestUri" | "requestedClaimsHash" | "storeInCache">> & {
17
- scopes: Array<string>;
18
- redirectUri: string;
19
- code: string;
20
- state?: string;
21
- };
1
+ import { CommonAuthorizationCodeRequest } from "@azure/msal-common";
2
+ /**
3
+ * Request object passed by user to acquire a token from the server exchanging a valid authorization code (second leg of OAuth2.0 Authorization Code flow)
4
+ *
5
+ * - scopes - Array of scopes the application is requesting access to.
6
+ * - claims - A stringified claims request which will be added to all /authorize and /token calls
7
+ * - authority: - URL of the authority, the security token service (STS) from which MSAL will acquire tokens. If authority is set on client application object, this will override that value. Overriding the value will cause for authority validation to happen each time. If the same authority will be used for all request, set on the application object instead of the requests.
8
+ * - correlationId - Unique GUID set per request to trace a request end-to-end for telemetry purposes.
9
+ * - redirectUri - The redirect URI of your app, where the authority will redirect to after the user inputs credentials and consents. It must exactly match one of the redirect URIs you registered in the portal.
10
+ * - tokenQueryParameters - String to string map of custom query parameters added to the /token call
11
+ * - code - The authorization_code that the user acquired in the first leg of the flow.
12
+ * - codeVerifier - The same code_verifier that was used to obtain the authorization_code. Required if PKCE was used in the authorization code grant request.For more information, see the PKCE RFC: https://tools.ietf.org/html/rfc7636
13
+ * - state - Unique GUID generated by the user that is cached by the user and sent to the server during the first leg of the flow. This string is sent back by the server with the authorization code. The user cached state is then compared with the state received from the server to mitigate the risk of CSRF attacks. See https://datatracker.ietf.org/doc/html/rfc6819#section-3.6.
14
+ * @public
15
+ */
16
+ export type AuthorizationCodeRequest = Partial<Omit<CommonAuthorizationCodeRequest, "scopes" | "redirectUri" | "code" | "authenticationScheme" | "resourceRequestMethod" | "resourceRequestUri" | "requestedClaimsHash" | "storeInCache">> & {
17
+ scopes: Array<string>;
18
+ redirectUri: string;
19
+ code: string;
20
+ state?: string;
21
+ };
22
22
  //# sourceMappingURL=AuthorizationCodeRequest.d.ts.map
@@ -1,34 +1,34 @@
1
- import { CommonAuthorizationUrlRequest } from "@azure/msal-common";
2
- /**
3
- * Request object passed by user to retrieve a Code from the server (first leg of authorization code grant flow)
4
- *
5
- * - scopes - Array of scopes the application is requesting access to.
6
- * - claims - A stringified claims request which will be added to all /authorize and /token calls
7
- * - authority - Url of the authority which the application acquires tokens from.
8
- * - correlationId - Unique GUID set per request to trace a request end-to-end for telemetry purposes.
9
- * - redirectUri - The redirect URI where authentication responses can be received by your application. It must exactly match one of the redirect URIs registered in the Azure portal.
10
- * - extraScopesToConsent - Scopes for a different resource when the user needs consent upfront.
11
- * - responseMode - Specifies the method that should be used to send the authentication result to your app. Can be query, form_post, or fragment. If no value is passed in, it defaults to query.
12
- * - codeChallenge - Used to secure authorization code grant via Proof of Key for Code Exchange (PKCE). For more information, see the PKCE RCF:https://tools.ietf.org/html/rfc7636
13
- * - codeChallengeMethod - The method used to encode the code verifier for the code challenge parameter. Can be "plain" or "S256". If excluded, code challenge is assumed to be plaintext. For more information, see the PKCE RCF: https://tools.ietf.org/html/rfc7636
14
- * - state - A value included in the request that is also returned in the token response. A randomly generated unique value is typically used for preventing cross site request forgery attacks. The state is also used to encode information about the user's state in the app before the authentication request occurred.
15
- * - prompt - Indicates the type of user interaction that is required.
16
- * login: will force the user to enter their credentials on that request, negating single-sign on
17
- * none: will ensure that the user isn't presented with any interactive prompt. if request can't be completed via single-sign on, the endpoint will return an interaction_required error
18
- * consent: will the trigger the OAuth consent dialog after the user signs in, asking the user to grant permissions to the app
19
- * select_account: will interrupt single sign-=on providing account selection experience listing all the accounts in session or any remembered accounts or an option to choose to use a different account
20
- * create: will direct the user to the account creation experience instead of the log in experience
21
- * - account - AccountInfo obtained from a getAccount API. Will be used in certain scenarios to generate login_hint if both loginHint and sid params are not provided.
22
- * - loginHint - Can be used to pre-fill the username/email address field of the sign-in page for the user, if you know the username/email address ahead of time. Often apps use this parameter during re-authentication, having already extracted the username from a previous sign-in using the preferred_username claim.
23
- * - sid - Session ID, unique identifier for the session. Available as an optional claim on ID tokens.
24
- * - domainHint - Provides a hint about the tenant or domain that the user should use to sign in. The value of the domain hint is a registered domain for the tenant.
25
- * - extraQueryParameters - String to string map of custom query parameters added to the /authorize call
26
- * - tokenQueryParameters - String to string map of custom query parameters added to the /token call
27
- * - nonce - A value included in the request that is returned in the id token. A randomly generated unique value is typically used to mitigate replay attacks.
28
- * @public
29
- */
30
- export type AuthorizationUrlRequest = Partial<Omit<CommonAuthorizationUrlRequest, "scopes" | "redirectUri" | "resourceRequestMethod" | "resourceRequestUri" | "authenticationScheme" | "requestedClaimsHash" | "storeInCache">> & {
31
- scopes: Array<string>;
32
- redirectUri: string;
33
- };
1
+ import { CommonAuthorizationUrlRequest } from "@azure/msal-common";
2
+ /**
3
+ * Request object passed by user to retrieve a Code from the server (first leg of authorization code grant flow)
4
+ *
5
+ * - scopes - Array of scopes the application is requesting access to.
6
+ * - claims - A stringified claims request which will be added to all /authorize and /token calls
7
+ * - authority - Url of the authority which the application acquires tokens from.
8
+ * - correlationId - Unique GUID set per request to trace a request end-to-end for telemetry purposes.
9
+ * - redirectUri - The redirect URI where authentication responses can be received by your application. It must exactly match one of the redirect URIs registered in the Azure portal.
10
+ * - extraScopesToConsent - Scopes for a different resource when the user needs consent upfront.
11
+ * - responseMode - Specifies the method that should be used to send the authentication result to your app. Can be query, form_post, or fragment. If no value is passed in, it defaults to query.
12
+ * - codeChallenge - Used to secure authorization code grant via Proof of Key for Code Exchange (PKCE). For more information, see the PKCE RCF:https://tools.ietf.org/html/rfc7636
13
+ * - codeChallengeMethod - The method used to encode the code verifier for the code challenge parameter. Can be "plain" or "S256". If excluded, code challenge is assumed to be plaintext. For more information, see the PKCE RCF: https://tools.ietf.org/html/rfc7636
14
+ * - state - A value included in the request that is also returned in the token response. A randomly generated unique value is typically used for preventing cross site request forgery attacks. The state is also used to encode information about the user's state in the app before the authentication request occurred.
15
+ * - prompt - Indicates the type of user interaction that is required.
16
+ * login: will force the user to enter their credentials on that request, negating single-sign on
17
+ * none: will ensure that the user isn't presented with any interactive prompt. if request can't be completed via single-sign on, the endpoint will return an interaction_required error
18
+ * consent: will the trigger the OAuth consent dialog after the user signs in, asking the user to grant permissions to the app
19
+ * select_account: will interrupt single sign-=on providing account selection experience listing all the accounts in session or any remembered accounts or an option to choose to use a different account
20
+ * create: will direct the user to the account creation experience instead of the log in experience
21
+ * - account - AccountInfo obtained from a getAccount API. Will be used in certain scenarios to generate login_hint if both loginHint and sid params are not provided.
22
+ * - loginHint - Can be used to pre-fill the username/email address field of the sign-in page for the user, if you know the username/email address ahead of time. Often apps use this parameter during re-authentication, having already extracted the username from a previous sign-in using the preferred_username claim.
23
+ * - sid - Session ID, unique identifier for the session. Available as an optional claim on ID tokens.
24
+ * - domainHint - Provides a hint about the tenant or domain that the user should use to sign in. The value of the domain hint is a registered domain for the tenant.
25
+ * - extraQueryParameters - String to string map of custom query parameters added to the /authorize call
26
+ * - tokenQueryParameters - String to string map of custom query parameters added to the /token call
27
+ * - nonce - A value included in the request that is returned in the id token. A randomly generated unique value is typically used to mitigate replay attacks.
28
+ * @public
29
+ */
30
+ export type AuthorizationUrlRequest = Partial<Omit<CommonAuthorizationUrlRequest, "scopes" | "redirectUri" | "resourceRequestMethod" | "resourceRequestUri" | "authenticationScheme" | "requestedClaimsHash" | "storeInCache">> & {
31
+ scopes: Array<string>;
32
+ redirectUri: string;
33
+ };
34
34
  //# sourceMappingURL=AuthorizationUrlRequest.d.ts.map
@@ -1,15 +1,15 @@
1
- import { CommonClientCredentialRequest } from "@azure/msal-common";
2
- /**
3
- * CommonClientCredentialRequest
4
- * - scopes - Array of scopes the application is requesting access to. Typically contains only the .default scope for a single resource. See: https://learn.microsoft.com/azure/active-directory/develop/scopes-oidc#the-default-scope
5
- * - authority - URL of the authority, the security token service (STS) from which MSAL will acquire tokens.
6
- * - correlationId - Unique GUID set per request to trace a request end-to-end for telemetry purposes.
7
- * - skipCache - Skip token cache lookup and force request to authority to get a a new token. Defaults to false.
8
- * - clientAssertion - A Base64Url-encoded signed JWT assertion string used in the Client Credential flow
9
- * - tokenQueryParameters - String to string map of custom query parameters added to the /token call
10
- * @public
11
- */
12
- export type ClientCredentialRequest = Partial<Omit<CommonClientCredentialRequest, "resourceRequestMethod" | "resourceRequestUri" | "requestedClaimsHash" | "clientAssertion" | "storeInCache">> & {
13
- clientAssertion?: string;
14
- };
1
+ import { CommonClientCredentialRequest } from "@azure/msal-common";
2
+ /**
3
+ * CommonClientCredentialRequest
4
+ * - scopes - Array of scopes the application is requesting access to. Typically contains only the .default scope for a single resource. See: https://learn.microsoft.com/azure/active-directory/develop/scopes-oidc#the-default-scope
5
+ * - authority - URL of the authority, the security token service (STS) from which MSAL will acquire tokens.
6
+ * - correlationId - Unique GUID set per request to trace a request end-to-end for telemetry purposes.
7
+ * - skipCache - Skip token cache lookup and force request to authority to get a a new token. Defaults to false.
8
+ * - clientAssertion - A Base64Url-encoded signed JWT assertion string used in the Client Credential flow
9
+ * - tokenQueryParameters - String to string map of custom query parameters added to the /token call
10
+ * @public
11
+ */
12
+ export type ClientCredentialRequest = Partial<Omit<CommonClientCredentialRequest, "resourceRequestMethod" | "resourceRequestUri" | "requestedClaimsHash" | "clientAssertion" | "storeInCache">> & {
13
+ clientAssertion?: string;
14
+ };
15
15
  //# sourceMappingURL=ClientCredentialRequest.d.ts.map