@azure/msal-node 2.5.1 → 2.7.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 (265) hide show
  1. package/dist/cache/ITokenCache.d.ts +15 -15
  2. package/dist/cache/NodeStorage.cjs +423 -405
  3. package/dist/cache/NodeStorage.cjs.map +1 -1
  4. package/dist/cache/NodeStorage.d.ts +193 -182
  5. package/dist/cache/NodeStorage.d.ts.map +1 -1
  6. package/dist/cache/NodeStorage.mjs +424 -406
  7. package/dist/cache/NodeStorage.mjs.map +1 -1
  8. package/dist/cache/TokenCache.cjs +265 -265
  9. package/dist/cache/TokenCache.cjs.map +1 -1
  10. package/dist/cache/TokenCache.d.ts +90 -90
  11. package/dist/cache/TokenCache.mjs +265 -265
  12. package/dist/cache/TokenCache.mjs.map +1 -1
  13. package/dist/cache/distributed/DistributedCachePlugin.cjs +26 -26
  14. package/dist/cache/distributed/DistributedCachePlugin.cjs.map +1 -1
  15. package/dist/cache/distributed/DistributedCachePlugin.d.ts +10 -10
  16. package/dist/cache/distributed/DistributedCachePlugin.mjs +26 -26
  17. package/dist/cache/distributed/DistributedCachePlugin.mjs.map +1 -1
  18. package/dist/cache/distributed/ICacheClient.d.ts +17 -17
  19. package/dist/cache/distributed/IPartitionManager.d.ts +28 -28
  20. package/dist/cache/serializer/Deserializer.cjs +170 -167
  21. package/dist/cache/serializer/Deserializer.cjs.map +1 -1
  22. package/dist/cache/serializer/Deserializer.d.ts +42 -42
  23. package/dist/cache/serializer/Deserializer.d.ts.map +1 -1
  24. package/dist/cache/serializer/Deserializer.mjs +170 -167
  25. package/dist/cache/serializer/Deserializer.mjs.map +1 -1
  26. package/dist/cache/serializer/Serializer.cjs +137 -134
  27. package/dist/cache/serializer/Serializer.cjs.map +1 -1
  28. package/dist/cache/serializer/Serializer.d.ts +39 -39
  29. package/dist/cache/serializer/Serializer.d.ts.map +1 -1
  30. package/dist/cache/serializer/Serializer.mjs +137 -134
  31. package/dist/cache/serializer/Serializer.mjs.map +1 -1
  32. package/dist/cache/serializer/SerializerTypes.d.ts +102 -101
  33. package/dist/cache/serializer/SerializerTypes.d.ts.map +1 -1
  34. package/dist/client/ClientApplication.cjs +333 -333
  35. package/dist/client/ClientApplication.cjs.map +1 -1
  36. package/dist/client/ClientApplication.d.ts +142 -142
  37. package/dist/client/ClientApplication.d.ts.map +1 -1
  38. package/dist/client/ClientApplication.mjs +333 -333
  39. package/dist/client/ClientApplication.mjs.map +1 -1
  40. package/dist/client/ClientAssertion.cjs +116 -116
  41. package/dist/client/ClientAssertion.cjs.map +1 -1
  42. package/dist/client/ClientAssertion.d.ts +46 -46
  43. package/dist/client/ClientAssertion.mjs +116 -116
  44. package/dist/client/ClientAssertion.mjs.map +1 -1
  45. package/dist/client/ClientCredentialClient.cjs +194 -189
  46. package/dist/client/ClientCredentialClient.cjs.map +1 -1
  47. package/dist/client/ClientCredentialClient.d.ts +33 -33
  48. package/dist/client/ClientCredentialClient.d.ts.map +1 -1
  49. package/dist/client/ClientCredentialClient.mjs +195 -190
  50. package/dist/client/ClientCredentialClient.mjs.map +1 -1
  51. package/dist/client/ConfidentialClientApplication.cjs +163 -163
  52. package/dist/client/ConfidentialClientApplication.cjs.map +1 -1
  53. package/dist/client/ConfidentialClientApplication.d.ts +58 -58
  54. package/dist/client/ConfidentialClientApplication.mjs +163 -163
  55. package/dist/client/ConfidentialClientApplication.mjs.map +1 -1
  56. package/dist/client/DeviceCodeClient.cjs +207 -207
  57. package/dist/client/DeviceCodeClient.cjs.map +1 -1
  58. package/dist/client/DeviceCodeClient.d.ts +53 -53
  59. package/dist/client/DeviceCodeClient.mjs +207 -207
  60. package/dist/client/DeviceCodeClient.mjs.map +1 -1
  61. package/dist/client/IConfidentialClientApplication.d.ts +39 -39
  62. package/dist/client/IPublicClientApplication.d.ts +42 -42
  63. package/dist/client/ManagedIdentityApplication.cjs +96 -0
  64. package/dist/client/ManagedIdentityApplication.cjs.map +1 -0
  65. package/dist/client/ManagedIdentityApplication.d.ts +24 -0
  66. package/dist/client/ManagedIdentityApplication.d.ts.map +1 -0
  67. package/dist/client/ManagedIdentityApplication.mjs +94 -0
  68. package/dist/client/ManagedIdentityApplication.mjs.map +1 -0
  69. package/dist/client/ManagedIdentityClient.cjs +49 -0
  70. package/dist/client/ManagedIdentityClient.cjs.map +1 -0
  71. package/dist/client/ManagedIdentityClient.d.ts +25 -0
  72. package/dist/client/ManagedIdentityClient.d.ts.map +1 -0
  73. package/dist/client/ManagedIdentityClient.mjs +47 -0
  74. package/dist/client/ManagedIdentityClient.mjs.map +1 -0
  75. package/dist/client/ManagedIdentitySources/AppService.cjs +79 -0
  76. package/dist/client/ManagedIdentitySources/AppService.cjs.map +1 -0
  77. package/dist/client/ManagedIdentitySources/AppService.d.ts +17 -0
  78. package/dist/client/ManagedIdentitySources/AppService.d.ts.map +1 -0
  79. package/dist/client/ManagedIdentitySources/AppService.mjs +77 -0
  80. package/dist/client/ManagedIdentitySources/AppService.mjs.map +1 -0
  81. package/dist/client/ManagedIdentitySources/AzureArc.cjs +107 -0
  82. package/dist/client/ManagedIdentitySources/AzureArc.cjs.map +1 -0
  83. package/dist/client/ManagedIdentitySources/AzureArc.d.ts +19 -0
  84. package/dist/client/ManagedIdentitySources/AzureArc.d.ts.map +1 -0
  85. package/dist/client/ManagedIdentitySources/AzureArc.mjs +104 -0
  86. package/dist/client/ManagedIdentitySources/AzureArc.mjs.map +1 -0
  87. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.cjs +87 -0
  88. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.cjs.map +1 -0
  89. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.d.ts +19 -0
  90. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.d.ts.map +1 -0
  91. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.mjs +85 -0
  92. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.mjs.map +1 -0
  93. package/dist/client/ManagedIdentitySources/CloudShell.d.ts +7 -0
  94. package/dist/client/ManagedIdentitySources/CloudShell.d.ts.map +1 -0
  95. package/dist/client/ManagedIdentitySources/Imds.cjs +63 -0
  96. package/dist/client/ManagedIdentitySources/Imds.cjs.map +1 -0
  97. package/dist/client/ManagedIdentitySources/Imds.d.ts +13 -0
  98. package/dist/client/ManagedIdentitySources/Imds.d.ts.map +1 -0
  99. package/dist/client/ManagedIdentitySources/Imds.mjs +61 -0
  100. package/dist/client/ManagedIdentitySources/Imds.mjs.map +1 -0
  101. package/dist/client/ManagedIdentitySources/ServiceFabric.d.ts +7 -0
  102. package/dist/client/ManagedIdentitySources/ServiceFabric.d.ts.map +1 -0
  103. package/dist/client/OnBehalfOfClient.cjs +202 -202
  104. package/dist/client/OnBehalfOfClient.cjs.map +1 -1
  105. package/dist/client/OnBehalfOfClient.d.ts +47 -47
  106. package/dist/client/OnBehalfOfClient.mjs +202 -202
  107. package/dist/client/OnBehalfOfClient.mjs.map +1 -1
  108. package/dist/client/PublicClientApplication.cjs +229 -229
  109. package/dist/client/PublicClientApplication.cjs.map +1 -1
  110. package/dist/client/PublicClientApplication.d.ts +71 -71
  111. package/dist/client/PublicClientApplication.mjs +229 -229
  112. package/dist/client/PublicClientApplication.mjs.map +1 -1
  113. package/dist/client/UsernamePasswordClient.cjs +95 -95
  114. package/dist/client/UsernamePasswordClient.cjs.map +1 -1
  115. package/dist/client/UsernamePasswordClient.d.ts +25 -25
  116. package/dist/client/UsernamePasswordClient.mjs +95 -95
  117. package/dist/client/UsernamePasswordClient.mjs.map +1 -1
  118. package/dist/config/Configuration.cjs +88 -72
  119. package/dist/config/Configuration.cjs.map +1 -1
  120. package/dist/config/Configuration.d.ts +122 -107
  121. package/dist/config/Configuration.d.ts.map +1 -1
  122. package/dist/config/Configuration.mjs +88 -73
  123. package/dist/config/Configuration.mjs.map +1 -1
  124. package/dist/config/ManagedIdentityId.cjs +59 -0
  125. package/dist/config/ManagedIdentityId.cjs.map +1 -0
  126. package/dist/config/ManagedIdentityId.d.ts +12 -0
  127. package/dist/config/ManagedIdentityId.d.ts.map +1 -0
  128. package/dist/config/ManagedIdentityId.mjs +57 -0
  129. package/dist/config/ManagedIdentityId.mjs.map +1 -0
  130. package/dist/config/ManagedIdentityRequestParameters.cjs +38 -0
  131. package/dist/config/ManagedIdentityRequestParameters.cjs.map +1 -0
  132. package/dist/config/ManagedIdentityRequestParameters.d.ts +12 -0
  133. package/dist/config/ManagedIdentityRequestParameters.d.ts.map +1 -0
  134. package/dist/config/ManagedIdentityRequestParameters.mjs +36 -0
  135. package/dist/config/ManagedIdentityRequestParameters.mjs.map +1 -0
  136. package/dist/crypto/CryptoProvider.cjs +75 -75
  137. package/dist/crypto/CryptoProvider.cjs.map +1 -1
  138. package/dist/crypto/CryptoProvider.d.ts +52 -52
  139. package/dist/crypto/CryptoProvider.mjs +75 -75
  140. package/dist/crypto/CryptoProvider.mjs.map +1 -1
  141. package/dist/crypto/GuidGenerator.cjs +22 -22
  142. package/dist/crypto/GuidGenerator.cjs.map +1 -1
  143. package/dist/crypto/GuidGenerator.d.ts +14 -14
  144. package/dist/crypto/GuidGenerator.mjs +22 -22
  145. package/dist/crypto/GuidGenerator.mjs.map +1 -1
  146. package/dist/crypto/HashUtils.cjs +13 -13
  147. package/dist/crypto/HashUtils.cjs.map +1 -1
  148. package/dist/crypto/HashUtils.d.ts +8 -8
  149. package/dist/crypto/HashUtils.mjs +13 -13
  150. package/dist/crypto/HashUtils.mjs.map +1 -1
  151. package/dist/crypto/PkceGenerator.cjs +49 -49
  152. package/dist/crypto/PkceGenerator.cjs.map +1 -1
  153. package/dist/crypto/PkceGenerator.d.ts +22 -22
  154. package/dist/crypto/PkceGenerator.mjs +49 -49
  155. package/dist/crypto/PkceGenerator.mjs.map +1 -1
  156. package/dist/error/ManagedIdentityError.cjs +40 -0
  157. package/dist/error/ManagedIdentityError.cjs.map +1 -0
  158. package/dist/error/ManagedIdentityError.d.ts +22 -0
  159. package/dist/error/ManagedIdentityError.d.ts.map +1 -0
  160. package/dist/error/ManagedIdentityError.mjs +36 -0
  161. package/dist/error/ManagedIdentityError.mjs.map +1 -0
  162. package/dist/error/ManagedIdentityErrorCodes.cjs +28 -0
  163. package/dist/error/ManagedIdentityErrorCodes.cjs.map +1 -0
  164. package/dist/error/ManagedIdentityErrorCodes.d.ts +10 -0
  165. package/dist/error/ManagedIdentityErrorCodes.d.ts.map +1 -0
  166. package/dist/error/ManagedIdentityErrorCodes.mjs +18 -0
  167. package/dist/error/ManagedIdentityErrorCodes.mjs.map +1 -0
  168. package/dist/error/NodeAuthError.cjs +85 -85
  169. package/dist/error/NodeAuthError.cjs.map +1 -1
  170. package/dist/error/NodeAuthError.d.ts +65 -65
  171. package/dist/error/NodeAuthError.mjs +85 -85
  172. package/dist/error/NodeAuthError.mjs.map +1 -1
  173. package/dist/index.cjs +3 -1
  174. package/dist/index.cjs.map +1 -1
  175. package/dist/index.d.ts +44 -42
  176. package/dist/index.d.ts.map +1 -1
  177. package/dist/index.mjs +2 -1
  178. package/dist/index.mjs.map +1 -1
  179. package/dist/internals.cjs +8 -8
  180. package/dist/internals.cjs.map +1 -1
  181. package/dist/internals.d.ts +6 -6
  182. package/dist/internals.mjs +8 -8
  183. package/dist/internals.mjs.map +1 -1
  184. package/dist/network/HttpClient.cjs +283 -276
  185. package/dist/network/HttpClient.cjs.map +1 -1
  186. package/dist/network/HttpClient.d.ts +26 -25
  187. package/dist/network/HttpClient.d.ts.map +1 -1
  188. package/dist/network/HttpClient.mjs +283 -276
  189. package/dist/network/HttpClient.mjs.map +1 -1
  190. package/dist/network/ILoopbackClient.d.ts +10 -10
  191. package/dist/network/LoopbackClient.cjs +77 -77
  192. package/dist/network/LoopbackClient.cjs.map +1 -1
  193. package/dist/network/LoopbackClient.d.ts +21 -21
  194. package/dist/network/LoopbackClient.mjs +77 -77
  195. package/dist/network/LoopbackClient.mjs.map +1 -1
  196. package/dist/packageMetadata.cjs +4 -4
  197. package/dist/packageMetadata.cjs.map +1 -1
  198. package/dist/packageMetadata.d.ts +2 -2
  199. package/dist/packageMetadata.d.ts.map +1 -1
  200. package/dist/packageMetadata.mjs +4 -4
  201. package/dist/packageMetadata.mjs.map +1 -1
  202. package/dist/request/AuthorizationCodeRequest.d.ts +21 -21
  203. package/dist/request/AuthorizationUrlRequest.d.ts +33 -33
  204. package/dist/request/ClientCredentialRequest.d.ts +14 -14
  205. package/dist/request/DeviceCodeRequest.d.ts +15 -15
  206. package/dist/request/InteractiveRequest.d.ts +22 -22
  207. package/dist/request/ManagedIdentityRequest.d.ts +9 -0
  208. package/dist/request/ManagedIdentityRequest.d.ts.map +1 -0
  209. package/dist/request/ManagedIdentityRequestParams.d.ts +10 -0
  210. package/dist/request/ManagedIdentityRequestParams.d.ts.map +1 -0
  211. package/dist/request/OnBehalfOfRequest.d.ts +14 -14
  212. package/dist/request/RefreshTokenRequest.d.ts +17 -17
  213. package/dist/request/SignOutRequest.d.ts +5 -5
  214. package/dist/request/SilentFlowRequest.d.ts +16 -16
  215. package/dist/request/UsernamePasswordRequest.d.ts +19 -19
  216. package/dist/response/ManagedIdentityTokenResponse.d.ts +25 -0
  217. package/dist/response/ManagedIdentityTokenResponse.d.ts.map +1 -0
  218. package/dist/utils/Constants.cjs +109 -80
  219. package/dist/utils/Constants.cjs.map +1 -1
  220. package/dist/utils/Constants.d.ts +106 -86
  221. package/dist/utils/Constants.d.ts.map +1 -1
  222. package/dist/utils/Constants.mjs +100 -81
  223. package/dist/utils/Constants.mjs.map +1 -1
  224. package/dist/utils/EncodingUtils.cjs +44 -44
  225. package/dist/utils/EncodingUtils.cjs.map +1 -1
  226. package/dist/utils/EncodingUtils.d.ts +26 -26
  227. package/dist/utils/EncodingUtils.mjs +44 -44
  228. package/dist/utils/EncodingUtils.mjs.map +1 -1
  229. package/dist/utils/NetworkUtils.cjs +38 -38
  230. package/dist/utils/NetworkUtils.cjs.map +1 -1
  231. package/dist/utils/NetworkUtils.d.ts +5 -5
  232. package/dist/utils/NetworkUtils.mjs +38 -38
  233. package/dist/utils/NetworkUtils.mjs.map +1 -1
  234. package/package.json +3 -3
  235. package/src/cache/NodeStorage.ts +24 -7
  236. package/src/cache/TokenCache.ts +1 -1
  237. package/src/cache/serializer/Deserializer.ts +5 -0
  238. package/src/cache/serializer/Serializer.ts +5 -0
  239. package/src/cache/serializer/SerializerTypes.ts +1 -0
  240. package/src/client/ClientApplication.ts +10 -9
  241. package/src/client/ClientCredentialClient.ts +72 -27
  242. package/src/client/ConfidentialClientApplication.ts +2 -2
  243. package/src/client/DeviceCodeClient.ts +1 -1
  244. package/src/client/ManagedIdentityApplication.ts +194 -0
  245. package/src/client/ManagedIdentityClient.ts +111 -0
  246. package/src/client/ManagedIdentitySources/AppService.ts +151 -0
  247. package/src/client/ManagedIdentitySources/AzureArc.ts +208 -0
  248. package/src/client/ManagedIdentitySources/BaseManagedIdentitySource.ts +169 -0
  249. package/src/client/ManagedIdentitySources/CloudShell.ts +19 -0
  250. package/src/client/ManagedIdentitySources/Imds.ts +112 -0
  251. package/src/client/ManagedIdentitySources/ServiceFabric.ts +19 -0
  252. package/src/client/OnBehalfOfClient.ts +5 -5
  253. package/src/client/PublicClientApplication.ts +1 -1
  254. package/src/config/Configuration.ts +47 -1
  255. package/src/config/ManagedIdentityId.ts +73 -0
  256. package/src/config/ManagedIdentityRequestParameters.ts +53 -0
  257. package/src/error/ManagedIdentityError.ts +46 -0
  258. package/src/error/ManagedIdentityErrorCodes.ts +15 -0
  259. package/src/index.ts +4 -0
  260. package/src/network/HttpClient.ts +17 -5
  261. package/src/packageMetadata.ts +1 -1
  262. package/src/request/ManagedIdentityRequest.ts +15 -0
  263. package/src/request/ManagedIdentityRequestParams.ts +14 -0
  264. package/src/response/ManagedIdentityTokenResponse.ts +33 -0
  265. package/src/utils/Constants.ts +27 -0
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.5.1 2023-11-07 */
1
+ /*! @azure/msal-node v2.7.0-alpha.0 2023-12-15 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
@@ -7,82 +7,82 @@ 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
- 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 redirectUri = this.getRedirectUri();
40
- const parsedUrl = new URL(url, redirectUri);
41
- const authCodeResponse = msalCommon.UrlUtils.getDeserializedResponse(parsedUrl.search) || {};
42
- if (authCodeResponse.code) {
43
- res.writeHead(msalCommon.HttpStatus.REDIRECT, {
44
- location: redirectUri,
45
- }); // Prevent auth code from being saved in the browser history
46
- res.end();
47
- }
48
- resolve(authCodeResponse);
49
- });
50
- this.server.listen(0); // Listen on any available port
51
- });
52
- }
53
- /**
54
- * Get the port that the loopback server is running on
55
- * @returns
56
- */
57
- getRedirectUri() {
58
- if (!this.server || !this.server.listening) {
59
- throw NodeAuthError.NodeAuthError.createNoLoopbackServerExistsError();
60
- }
61
- const address = this.server.address();
62
- if (!address || typeof address === "string" || !address.port) {
63
- this.closeServer();
64
- throw NodeAuthError.NodeAuthError.createInvalidLoopbackAddressTypeError();
65
- }
66
- const port = address && address.port;
67
- return `${Constants.Constants.HTTP_PROTOCOL}${Constants.Constants.LOCALHOST}:${port}`;
68
- }
69
- /**
70
- * Close the loopback server
71
- */
72
- closeServer() {
73
- if (this.server) {
74
- // Only stops accepting new connections, server will close once open/idle connections are closed.
75
- this.server.close();
76
- if (typeof this.server.closeAllConnections === "function") {
77
- /*
78
- * Close open/idle connections. This API is available in Node versions 18.2 and higher
79
- */
80
- this.server.closeAllConnections();
81
- }
82
- this.server.unref();
83
- this.server = undefined;
84
- }
85
- }
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 redirectUri = this.getRedirectUri();
40
+ const parsedUrl = new URL(url, redirectUri);
41
+ const authCodeResponse = msalCommon.UrlUtils.getDeserializedResponse(parsedUrl.search) || {};
42
+ if (authCodeResponse.code) {
43
+ res.writeHead(msalCommon.HttpStatus.REDIRECT, {
44
+ location: redirectUri,
45
+ }); // Prevent auth code from being saved in the browser history
46
+ res.end();
47
+ }
48
+ resolve(authCodeResponse);
49
+ });
50
+ this.server.listen(0); // Listen on any available port
51
+ });
52
+ }
53
+ /**
54
+ * Get the port that the loopback server is running on
55
+ * @returns
56
+ */
57
+ getRedirectUri() {
58
+ if (!this.server || !this.server.listening) {
59
+ throw NodeAuthError.NodeAuthError.createNoLoopbackServerExistsError();
60
+ }
61
+ const address = this.server.address();
62
+ if (!address || typeof address === "string" || !address.port) {
63
+ this.closeServer();
64
+ throw NodeAuthError.NodeAuthError.createInvalidLoopbackAddressTypeError();
65
+ }
66
+ const port = address && address.port;
67
+ return `${Constants.Constants.HTTP_PROTOCOL}${Constants.Constants.LOCALHOST}:${port}`;
68
+ }
69
+ /**
70
+ * Close the loopback server
71
+ */
72
+ closeServer() {
73
+ if (this.server) {
74
+ // Only stops accepting new connections, server will close once open/idle connections are closed.
75
+ this.server.close();
76
+ if (typeof this.server.closeAllConnections === "function") {
77
+ /*
78
+ * Close open/idle connections. This API is available in Node versions 18.2 and higher
79
+ */
80
+ this.server.closeAllConnections();
81
+ }
82
+ this.server.unref();
83
+ this.server = undefined;
84
+ }
85
+ }
86
86
  }
87
87
 
88
88
  exports.LoopbackClient = LoopbackClient;
@@ -1 +1 @@
1
- {"version":3,"file":"LoopbackClient.cjs","sources":["../../src/network/LoopbackClient.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;AAKA;AASA;AAEA;;;AAQO;AACG;AAkDN;;;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;AAetB,YAAA,IAAA,CAAA,MAAA,GAAA,IAAA,CAAA,YAAA,CAAA,CAAA,GAAA,EAAA,GAAA,KAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"LoopbackClient.cjs","sources":["../../src/network/LoopbackClient.ts"],"sourcesContent":[null],"names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22 +1,22 @@
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
- }
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,86 +1,86 @@
1
- /*! @azure/msal-node v2.5.1 2023-11-07 */
1
+ /*! @azure/msal-node v2.7.0-alpha.0 2023-12-15 */
2
2
  'use strict';
3
3
  import { Constants, UrlUtils, HttpStatus } from '@azure/msal-common';
4
4
  import http from 'http';
5
5
  import { NodeAuthError } from '../error/NodeAuthError.mjs';
6
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
- 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 redirectUri = this.getRedirectUri();
38
- const parsedUrl = new URL(url, redirectUri);
39
- const authCodeResponse = UrlUtils.getDeserializedResponse(parsedUrl.search) || {};
40
- if (authCodeResponse.code) {
41
- res.writeHead(HttpStatus.REDIRECT, {
42
- location: redirectUri,
43
- }); // Prevent auth code from being saved in the browser history
44
- res.end();
45
- }
46
- resolve(authCodeResponse);
47
- });
48
- this.server.listen(0); // Listen on any available port
49
- });
50
- }
51
- /**
52
- * Get the port that the loopback server is running on
53
- * @returns
54
- */
55
- getRedirectUri() {
56
- if (!this.server || !this.server.listening) {
57
- throw NodeAuthError.createNoLoopbackServerExistsError();
58
- }
59
- const address = this.server.address();
60
- if (!address || typeof address === "string" || !address.port) {
61
- this.closeServer();
62
- throw NodeAuthError.createInvalidLoopbackAddressTypeError();
63
- }
64
- const port = address && address.port;
65
- return `${Constants$1.HTTP_PROTOCOL}${Constants$1.LOCALHOST}:${port}`;
66
- }
67
- /**
68
- * Close the loopback server
69
- */
70
- closeServer() {
71
- if (this.server) {
72
- // Only stops accepting new connections, server will close once open/idle connections are closed.
73
- this.server.close();
74
- if (typeof this.server.closeAllConnections === "function") {
75
- /*
76
- * Close open/idle connections. This API is available in Node versions 18.2 and higher
77
- */
78
- this.server.closeAllConnections();
79
- }
80
- this.server.unref();
81
- this.server = undefined;
82
- }
83
- }
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 redirectUri = this.getRedirectUri();
38
+ const parsedUrl = new URL(url, redirectUri);
39
+ const authCodeResponse = UrlUtils.getDeserializedResponse(parsedUrl.search) || {};
40
+ if (authCodeResponse.code) {
41
+ res.writeHead(HttpStatus.REDIRECT, {
42
+ location: redirectUri,
43
+ }); // Prevent auth code from being saved in the browser history
44
+ res.end();
45
+ }
46
+ resolve(authCodeResponse);
47
+ });
48
+ this.server.listen(0); // Listen on any available port
49
+ });
50
+ }
51
+ /**
52
+ * Get the port that the loopback server is running on
53
+ * @returns
54
+ */
55
+ getRedirectUri() {
56
+ if (!this.server || !this.server.listening) {
57
+ throw NodeAuthError.createNoLoopbackServerExistsError();
58
+ }
59
+ const address = this.server.address();
60
+ if (!address || typeof address === "string" || !address.port) {
61
+ this.closeServer();
62
+ throw NodeAuthError.createInvalidLoopbackAddressTypeError();
63
+ }
64
+ const port = address && address.port;
65
+ return `${Constants$1.HTTP_PROTOCOL}${Constants$1.LOCALHOST}:${port}`;
66
+ }
67
+ /**
68
+ * Close the loopback server
69
+ */
70
+ closeServer() {
71
+ if (this.server) {
72
+ // Only stops accepting new connections, server will close once open/idle connections are closed.
73
+ this.server.close();
74
+ if (typeof this.server.closeAllConnections === "function") {
75
+ /*
76
+ * Close open/idle connections. This API is available in Node versions 18.2 and higher
77
+ */
78
+ this.server.closeAllConnections();
79
+ }
80
+ this.server.unref();
81
+ this.server = undefined;
82
+ }
83
+ }
84
84
  }
85
85
 
86
86
  export { LoopbackClient };
@@ -1 +1 @@
1
- {"version":3,"file":"LoopbackClient.mjs","sources":["../../src/network/LoopbackClient.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;AAKA;AASA;AAEA;;;AAQO;AACG;AAkDN;;;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;AAetB,YAAA,IAAA,CAAA,MAAA,GAAA,IAAA,CAAA,YAAA,CAAA,CAAA,GAAA,EAAA,GAAA,KAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"LoopbackClient.mjs","sources":["../../src/network/LoopbackClient.ts"],"sourcesContent":[null],"names":["CommonConstants","Constants"],"mappings":";;;;;;;AAAA;;;AAGG;MAaU,cAAc,CAAA;AAGvB;;;;;AAKG;AACH,IAAA,MAAM,iBAAiB,CACnB,eAAwB,EACxB,aAAsB,EAAA;QAEtB,IAAI,IAAI,CAAC,MAAM,EAAE;AACb,YAAA,MAAM,aAAa,CAAC,sCAAsC,EAAE,CAAC;AAChE,SAAA;QAED,OAAO,IAAI,OAAO,CACd,CAAC,OAAO,EAAE,MAAM,KAAI;AAChB,YAAA,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,YAAY,CAC3B,CAAC,GAAyB,EAAE,GAAwB,KAAI;AACpD,gBAAA,MAAM,GAAG,GAAG,GAAG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AAO,OAAO,KAAK,QAAQ,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE;YAC1D,IAAI,CAAC,WAAW,EAAE,CAAC;AACnB,YAAA,MAAM,aAAa,CAAC,qCAAqC,EAAE,CAAC;AAC/D,SAAA;AAED,QAAA,MAAM,IAAI,GAAG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;QAErC,OAAO,CAAA,EAAGC,WAAS,CAAC,aAAa,CAAA,EAAGA,WAAS,CAAC,SAAS,CAAA,CAAA,EAAI,IAAI,CAAA,CAAE,CAAC;KACrE;AAED;;AAEG;IACH,WAAW,GAAA;QACP,IAAI,IAAI,CAAC,MAAM,EAAE;;AAEb,YAAA,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;YAEpB,IAAI,OAAO,IAAI,CAAC,MAAM,CAAC,mBAAmB,KAAK,UAAU,EAAE;AACvD;;AAEG;AACH,gBAAA,IAAI,CAAC,MAAM,CAAC,mBAAmB,EAAE,CAAC;AACrC,aAAA;AACD,YAAA,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;AACpB,YAAA,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;AAC3B,SAAA;KACJ;AACJ;;;;"}
@@ -1,10 +1,10 @@
1
- /*! @azure/msal-node v2.5.1 2023-11-07 */
1
+ /*! @azure/msal-node v2.7.0-alpha.0 2023-12-15 */
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.5.1";
5
+ /* eslint-disable header/header */
6
+ const name = "@azure/msal-node";
7
+ const version = "2.7.0-alpha.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":";;;;AACA;AACO,MAAA,IAAA,GAAA,mBAAwB;;;;;;"}
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,3 +1,3 @@
1
- export declare const name = "@azure/msal-node";
2
- export declare const version = "2.5.1";
1
+ export declare const name = "@azure/msal-node";
2
+ export declare const version = "2.7.0-alpha.0";
3
3
  //# sourceMappingURL=packageMetadata.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageMetadata.d.ts","sourceRoot":"","sources":["../src/packageMetadata.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,IAAI,qBAAqB,CAAC;AACvC,eAAO,MAAM,OAAO,UAAU,CAAC"}
1
+ {"version":3,"file":"packageMetadata.d.ts","sourceRoot":"","sources":["../src/packageMetadata.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,IAAI,qBAAqB,CAAC;AACvC,eAAO,MAAM,OAAO,kBAAkB,CAAC"}
@@ -1,8 +1,8 @@
1
- /*! @azure/msal-node v2.5.1 2023-11-07 */
1
+ /*! @azure/msal-node v2.7.0-alpha.0 2023-12-15 */
2
2
  'use strict';
3
- /* eslint-disable header/header */
4
- const name = "@azure/msal-node";
5
- const version = "2.5.1";
3
+ /* eslint-disable header/header */
4
+ const name = "@azure/msal-node";
5
+ const version = "2.7.0-alpha.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":";;AACA;AACO,MAAA,IAAA,GAAA,mBAAwB;;;;;"}
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,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