@azure/msal-node 5.0.0-alpha.0 → 5.0.0-beta.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 (252) hide show
  1. package/dist/cache/CacheHelpers.mjs +1 -1
  2. package/dist/cache/NodeStorage.mjs +1 -1
  3. package/dist/cache/NodeStorage.mjs.map +1 -1
  4. package/dist/cache/TokenCache.mjs +1 -1
  5. package/dist/cache/TokenCache.mjs.map +1 -1
  6. package/dist/cache/distributed/DistributedCachePlugin.mjs +1 -1
  7. package/dist/cache/distributed/DistributedCachePlugin.mjs.map +1 -1
  8. package/dist/cache/serializer/Deserializer.mjs +1 -1
  9. package/dist/cache/serializer/Deserializer.mjs.map +1 -1
  10. package/dist/cache/serializer/Serializer.mjs +1 -1
  11. package/dist/cache/serializer/Serializer.mjs.map +1 -1
  12. package/dist/client/BaseClient.d.ts +42 -0
  13. package/dist/client/BaseClient.d.ts.map +1 -0
  14. package/dist/client/BaseClient.mjs +68 -0
  15. package/dist/client/BaseClient.mjs.map +1 -0
  16. package/dist/client/ClientApplication.mjs +1 -1
  17. package/dist/client/ClientApplication.mjs.map +1 -1
  18. package/dist/client/ClientAssertion.mjs +1 -1
  19. package/dist/client/ClientAssertion.mjs.map +1 -1
  20. package/dist/client/ClientCredentialClient.d.ts +2 -1
  21. package/dist/client/ClientCredentialClient.d.ts.map +1 -1
  22. package/dist/client/ClientCredentialClient.mjs +4 -3
  23. package/dist/client/ClientCredentialClient.mjs.map +1 -1
  24. package/dist/client/ConfidentialClientApplication.mjs +1 -1
  25. package/dist/client/ConfidentialClientApplication.mjs.map +1 -1
  26. package/dist/client/DeviceCodeClient.d.ts +2 -1
  27. package/dist/client/DeviceCodeClient.d.ts.map +1 -1
  28. package/dist/client/DeviceCodeClient.mjs +6 -5
  29. package/dist/client/DeviceCodeClient.mjs.map +1 -1
  30. package/dist/client/ManagedIdentityApplication.mjs +1 -1
  31. package/dist/client/ManagedIdentityApplication.mjs.map +1 -1
  32. package/dist/client/ManagedIdentityClient.mjs +1 -1
  33. package/dist/client/ManagedIdentityClient.mjs.map +1 -1
  34. package/dist/client/ManagedIdentitySources/AppService.d.ts +54 -0
  35. package/dist/client/ManagedIdentitySources/AppService.d.ts.map +1 -1
  36. package/dist/client/ManagedIdentitySources/AppService.mjs +55 -1
  37. package/dist/client/ManagedIdentitySources/AppService.mjs.map +1 -1
  38. package/dist/client/ManagedIdentitySources/AzureArc.d.ts +81 -0
  39. package/dist/client/ManagedIdentitySources/AzureArc.d.ts.map +1 -1
  40. package/dist/client/ManagedIdentitySources/AzureArc.mjs +82 -1
  41. package/dist/client/ManagedIdentitySources/AzureArc.mjs.map +1 -1
  42. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.d.ts +93 -2
  43. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.d.ts.map +1 -1
  44. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.mjs +81 -1
  45. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.mjs.map +1 -1
  46. package/dist/client/ManagedIdentitySources/CloudShell.d.ts +54 -0
  47. package/dist/client/ManagedIdentitySources/CloudShell.d.ts.map +1 -1
  48. package/dist/client/ManagedIdentitySources/CloudShell.mjs +55 -1
  49. package/dist/client/ManagedIdentitySources/CloudShell.mjs.map +1 -1
  50. package/dist/client/ManagedIdentitySources/Imds.d.ts +44 -22
  51. package/dist/client/ManagedIdentitySources/Imds.d.ts.map +1 -1
  52. package/dist/client/ManagedIdentitySources/Imds.mjs +44 -22
  53. package/dist/client/ManagedIdentitySources/Imds.mjs.map +1 -1
  54. package/dist/client/ManagedIdentitySources/MachineLearning.d.ts +65 -0
  55. package/dist/client/ManagedIdentitySources/MachineLearning.d.ts.map +1 -1
  56. package/dist/client/ManagedIdentitySources/MachineLearning.mjs +66 -1
  57. package/dist/client/ManagedIdentitySources/MachineLearning.mjs.map +1 -1
  58. package/dist/client/ManagedIdentitySources/ServiceFabric.d.ts +56 -22
  59. package/dist/client/ManagedIdentitySources/ServiceFabric.d.ts.map +1 -1
  60. package/dist/client/ManagedIdentitySources/ServiceFabric.mjs +57 -23
  61. package/dist/client/ManagedIdentitySources/ServiceFabric.mjs.map +1 -1
  62. package/dist/client/OnBehalfOfClient.d.ts +2 -1
  63. package/dist/client/OnBehalfOfClient.d.ts.map +1 -1
  64. package/dist/client/OnBehalfOfClient.mjs +4 -3
  65. package/dist/client/OnBehalfOfClient.mjs.map +1 -1
  66. package/dist/client/PublicClientApplication.d.ts.map +1 -1
  67. package/dist/client/PublicClientApplication.mjs +21 -5
  68. package/dist/client/PublicClientApplication.mjs.map +1 -1
  69. package/dist/client/UsernamePasswordClient.d.ts +2 -1
  70. package/dist/client/UsernamePasswordClient.d.ts.map +1 -1
  71. package/dist/client/UsernamePasswordClient.mjs +4 -3
  72. package/dist/client/UsernamePasswordClient.mjs.map +1 -1
  73. package/dist/config/Configuration.d.ts +0 -6
  74. package/dist/config/Configuration.d.ts.map +1 -1
  75. package/dist/config/Configuration.mjs +3 -5
  76. package/dist/config/Configuration.mjs.map +1 -1
  77. package/dist/config/ManagedIdentityId.mjs +1 -1
  78. package/dist/config/ManagedIdentityId.mjs.map +1 -1
  79. package/dist/config/ManagedIdentityRequestParameters.mjs +3 -3
  80. package/dist/config/ManagedIdentityRequestParameters.mjs.map +1 -1
  81. package/dist/crypto/CryptoProvider.mjs +1 -1
  82. package/dist/crypto/CryptoProvider.mjs.map +1 -1
  83. package/dist/crypto/GuidGenerator.mjs +1 -1
  84. package/dist/crypto/GuidGenerator.mjs.map +1 -1
  85. package/dist/crypto/HashUtils.mjs +1 -1
  86. package/dist/crypto/HashUtils.mjs.map +1 -1
  87. package/dist/crypto/PkceGenerator.mjs +1 -1
  88. package/dist/crypto/PkceGenerator.mjs.map +1 -1
  89. package/dist/error/ClientAuthErrorCodes.mjs +1 -1
  90. package/dist/error/ManagedIdentityError.mjs +1 -1
  91. package/dist/error/ManagedIdentityError.mjs.map +1 -1
  92. package/dist/error/ManagedIdentityErrorCodes.mjs +1 -1
  93. package/dist/error/ManagedIdentityErrorCodes.mjs.map +1 -1
  94. package/dist/error/NodeAuthError.d.ts +8 -0
  95. package/dist/error/NodeAuthError.d.ts.map +1 -1
  96. package/dist/error/NodeAuthError.mjs +11 -1
  97. package/dist/error/NodeAuthError.mjs.map +1 -1
  98. package/dist/index.d.ts +0 -6
  99. package/dist/index.d.ts.map +1 -1
  100. package/dist/index.mjs +1 -7
  101. package/dist/index.mjs.map +1 -1
  102. package/dist/internals.mjs +1 -1
  103. package/dist/network/HttpClient.d.ts +54 -14
  104. package/dist/network/HttpClient.d.ts.map +1 -1
  105. package/dist/network/HttpClient.mjs +140 -262
  106. package/dist/network/HttpClient.mjs.map +1 -1
  107. package/dist/network/HttpClientWithRetries.mjs +1 -1
  108. package/dist/network/HttpClientWithRetries.mjs.map +1 -1
  109. package/dist/network/LoopbackClient.mjs +1 -1
  110. package/dist/network/LoopbackClient.mjs.map +1 -1
  111. package/dist/packageMetadata.d.ts +1 -1
  112. package/dist/packageMetadata.d.ts.map +1 -1
  113. package/dist/packageMetadata.mjs +2 -2
  114. package/dist/protocol/Authorize.mjs +2 -2
  115. package/dist/protocol/Authorize.mjs.map +1 -1
  116. package/dist/request/AuthorizationCodeRequest.d.ts +2 -1
  117. package/dist/request/AuthorizationCodeRequest.d.ts.map +1 -1
  118. package/dist/request/AuthorizationUrlRequest.d.ts +2 -2
  119. package/dist/request/ClientCredentialRequest.d.ts +0 -1
  120. package/dist/request/ClientCredentialRequest.d.ts.map +1 -1
  121. package/dist/request/CommonClientCredentialRequest.d.ts +3 -2
  122. package/dist/request/CommonClientCredentialRequest.d.ts.map +1 -1
  123. package/dist/request/CommonDeviceCodeRequest.d.ts +3 -2
  124. package/dist/request/CommonDeviceCodeRequest.d.ts.map +1 -1
  125. package/dist/request/CommonOnBehalfOfRequest.d.ts +1 -2
  126. package/dist/request/CommonOnBehalfOfRequest.d.ts.map +1 -1
  127. package/dist/request/CommonUsernamePasswordRequest.d.ts +2 -1
  128. package/dist/request/CommonUsernamePasswordRequest.d.ts.map +1 -1
  129. package/dist/request/InteractiveRequest.d.ts +1 -1
  130. package/dist/request/InteractiveRequest.d.ts.map +1 -1
  131. package/dist/request/OnBehalfOfRequest.d.ts +0 -1
  132. package/dist/request/OnBehalfOfRequest.d.ts.map +1 -1
  133. package/dist/request/RefreshTokenRequest.d.ts +2 -1
  134. package/dist/request/RefreshTokenRequest.d.ts.map +1 -1
  135. package/dist/request/SilentFlowRequest.d.ts +2 -1
  136. package/dist/request/SilentFlowRequest.d.ts.map +1 -1
  137. package/dist/request/UsernamePasswordRequest.d.ts +2 -1
  138. package/dist/request/UsernamePasswordRequest.d.ts.map +1 -1
  139. package/dist/retry/DefaultManagedIdentityRetryPolicy.mjs +1 -1
  140. package/dist/retry/DefaultManagedIdentityRetryPolicy.mjs.map +1 -1
  141. package/dist/retry/ExponentialRetryStrategy.mjs +1 -1
  142. package/dist/retry/ExponentialRetryStrategy.mjs.map +1 -1
  143. package/dist/retry/ImdsRetryPolicy.mjs +1 -1
  144. package/dist/retry/ImdsRetryPolicy.mjs.map +1 -1
  145. package/dist/retry/LinearRetryStrategy.mjs +1 -1
  146. package/dist/retry/LinearRetryStrategy.mjs.map +1 -1
  147. package/dist/utils/Constants.d.ts +2 -9
  148. package/dist/utils/Constants.d.ts.map +1 -1
  149. package/dist/utils/Constants.mjs +4 -12
  150. package/dist/utils/Constants.mjs.map +1 -1
  151. package/dist/utils/EncodingUtils.mjs +1 -1
  152. package/dist/utils/EncodingUtils.mjs.map +1 -1
  153. package/dist/utils/TimeUtils.mjs +1 -1
  154. package/dist/utils/TimeUtils.mjs.map +1 -1
  155. package/lib/msal-node.cjs +5747 -5335
  156. package/lib/msal-node.cjs.map +1 -1
  157. package/lib/types/client/BaseClient.d.ts +42 -0
  158. package/lib/types/client/BaseClient.d.ts.map +1 -0
  159. package/lib/types/client/ClientCredentialClient.d.ts +2 -1
  160. package/lib/types/client/ClientCredentialClient.d.ts.map +1 -1
  161. package/lib/types/client/DeviceCodeClient.d.ts +2 -1
  162. package/lib/types/client/DeviceCodeClient.d.ts.map +1 -1
  163. package/lib/types/client/ManagedIdentitySources/AppService.d.ts +54 -0
  164. package/lib/types/client/ManagedIdentitySources/AppService.d.ts.map +1 -1
  165. package/lib/types/client/ManagedIdentitySources/AzureArc.d.ts +81 -0
  166. package/lib/types/client/ManagedIdentitySources/AzureArc.d.ts.map +1 -1
  167. package/lib/types/client/ManagedIdentitySources/BaseManagedIdentitySource.d.ts +93 -2
  168. package/lib/types/client/ManagedIdentitySources/BaseManagedIdentitySource.d.ts.map +1 -1
  169. package/lib/types/client/ManagedIdentitySources/CloudShell.d.ts +54 -0
  170. package/lib/types/client/ManagedIdentitySources/CloudShell.d.ts.map +1 -1
  171. package/lib/types/client/ManagedIdentitySources/Imds.d.ts +44 -22
  172. package/lib/types/client/ManagedIdentitySources/Imds.d.ts.map +1 -1
  173. package/lib/types/client/ManagedIdentitySources/MachineLearning.d.ts +65 -0
  174. package/lib/types/client/ManagedIdentitySources/MachineLearning.d.ts.map +1 -1
  175. package/lib/types/client/ManagedIdentitySources/ServiceFabric.d.ts +56 -22
  176. package/lib/types/client/ManagedIdentitySources/ServiceFabric.d.ts.map +1 -1
  177. package/lib/types/client/OnBehalfOfClient.d.ts +2 -1
  178. package/lib/types/client/OnBehalfOfClient.d.ts.map +1 -1
  179. package/lib/types/client/PublicClientApplication.d.ts.map +1 -1
  180. package/lib/types/client/UsernamePasswordClient.d.ts +2 -1
  181. package/lib/types/client/UsernamePasswordClient.d.ts.map +1 -1
  182. package/lib/types/config/Configuration.d.ts +0 -6
  183. package/lib/types/config/Configuration.d.ts.map +1 -1
  184. package/lib/types/error/NodeAuthError.d.ts +8 -0
  185. package/lib/types/error/NodeAuthError.d.ts.map +1 -1
  186. package/lib/types/index.d.ts +0 -6
  187. package/lib/types/index.d.ts.map +1 -1
  188. package/lib/types/network/HttpClient.d.ts +54 -14
  189. package/lib/types/network/HttpClient.d.ts.map +1 -1
  190. package/lib/types/packageMetadata.d.ts +1 -1
  191. package/lib/types/packageMetadata.d.ts.map +1 -1
  192. package/lib/types/request/AuthorizationCodeRequest.d.ts +2 -1
  193. package/lib/types/request/AuthorizationCodeRequest.d.ts.map +1 -1
  194. package/lib/types/request/AuthorizationUrlRequest.d.ts +2 -2
  195. package/lib/types/request/ClientCredentialRequest.d.ts +0 -1
  196. package/lib/types/request/ClientCredentialRequest.d.ts.map +1 -1
  197. package/lib/types/request/CommonClientCredentialRequest.d.ts +3 -2
  198. package/lib/types/request/CommonClientCredentialRequest.d.ts.map +1 -1
  199. package/lib/types/request/CommonDeviceCodeRequest.d.ts +3 -2
  200. package/lib/types/request/CommonDeviceCodeRequest.d.ts.map +1 -1
  201. package/lib/types/request/CommonOnBehalfOfRequest.d.ts +1 -2
  202. package/lib/types/request/CommonOnBehalfOfRequest.d.ts.map +1 -1
  203. package/lib/types/request/CommonUsernamePasswordRequest.d.ts +2 -1
  204. package/lib/types/request/CommonUsernamePasswordRequest.d.ts.map +1 -1
  205. package/lib/types/request/InteractiveRequest.d.ts +1 -1
  206. package/lib/types/request/InteractiveRequest.d.ts.map +1 -1
  207. package/lib/types/request/OnBehalfOfRequest.d.ts +0 -1
  208. package/lib/types/request/OnBehalfOfRequest.d.ts.map +1 -1
  209. package/lib/types/request/RefreshTokenRequest.d.ts +2 -1
  210. package/lib/types/request/RefreshTokenRequest.d.ts.map +1 -1
  211. package/lib/types/request/SilentFlowRequest.d.ts +2 -1
  212. package/lib/types/request/SilentFlowRequest.d.ts.map +1 -1
  213. package/lib/types/request/UsernamePasswordRequest.d.ts +2 -1
  214. package/lib/types/request/UsernamePasswordRequest.d.ts.map +1 -1
  215. package/lib/types/utils/Constants.d.ts +2 -9
  216. package/lib/types/utils/Constants.d.ts.map +1 -1
  217. package/package.json +88 -88
  218. package/src/client/BaseClient.ts +158 -0
  219. package/src/client/ClientCredentialClient.ts +2 -3
  220. package/src/client/DeviceCodeClient.ts +4 -5
  221. package/src/client/ManagedIdentitySources/AppService.ts +54 -0
  222. package/src/client/ManagedIdentitySources/AzureArc.ts +81 -0
  223. package/src/client/ManagedIdentitySources/BaseManagedIdentitySource.ts +92 -2
  224. package/src/client/ManagedIdentitySources/CloudShell.ts +54 -0
  225. package/src/client/ManagedIdentitySources/Imds.ts +43 -21
  226. package/src/client/ManagedIdentitySources/MachineLearning.ts +65 -0
  227. package/src/client/ManagedIdentitySources/ServiceFabric.ts +56 -22
  228. package/src/client/OnBehalfOfClient.ts +2 -3
  229. package/src/client/PublicClientApplication.ts +22 -4
  230. package/src/client/UsernamePasswordClient.ts +2 -3
  231. package/src/config/Configuration.ts +2 -14
  232. package/src/config/ManagedIdentityRequestParameters.ts +2 -2
  233. package/src/error/NodeAuthError.ts +14 -0
  234. package/src/index.ts +0 -8
  235. package/src/network/HttpClient.ts +166 -372
  236. package/src/packageMetadata.ts +1 -1
  237. package/src/protocol/Authorize.ts +1 -1
  238. package/src/request/AuthorizationCodeRequest.ts +2 -1
  239. package/src/request/AuthorizationUrlRequest.ts +2 -2
  240. package/src/request/ClientCredentialRequest.ts +0 -1
  241. package/src/request/CommonClientCredentialRequest.ts +6 -2
  242. package/src/request/CommonDeviceCodeRequest.ts +3 -6
  243. package/src/request/CommonOnBehalfOfRequest.ts +4 -2
  244. package/src/request/CommonUsernamePasswordRequest.ts +2 -1
  245. package/src/request/InteractiveRequest.ts +1 -4
  246. package/src/request/OnBehalfOfRequest.ts +0 -1
  247. package/src/request/RefreshTokenRequest.ts +2 -1
  248. package/src/request/SilentFlowRequest.ts +2 -1
  249. package/src/request/UsernamePasswordRequest.ts +2 -1
  250. package/src/utils/Constants.ts +2 -11
  251. package/dist/utils/NetworkUtils.mjs +0 -43
  252. package/dist/utils/NetworkUtils.mjs.map +0 -1
@@ -6,7 +6,8 @@ import { CommonRefreshTokenRequest } from "@azure/msal-common/node";
6
6
  * - authority - URL of the authority, the security token service (STS) from which MSAL will acquire tokens.
7
7
  * - correlationId - Unique GUID set per request to trace a request end-to-end for telemetry purposes.
8
8
  * - refreshToken - A refresh token returned from a previous request to the Identity provider.
9
- * - tokenQueryParameters - String to string map of custom query parameters added to the /token call
9
+ * - extraQueryParameters - String to string map of custom query parameters added to outgoing token service requests
10
+ * - extraParameters - String to string map of custom query parameters added to outgoing token service requests
10
11
  * - forceCache - Force MSAL to cache a refresh token flow response when there is no account in the cache. Used for migration scenarios.
11
12
  * @public
12
13
  */
@@ -1 +1 @@
1
- {"version":3,"file":"RefreshTokenRequest.d.ts","sourceRoot":"","sources":["../../../src/request/RefreshTokenRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AAEpE;;;;;;;;;;GAUG;AACH,MAAM,MAAM,mBAAmB,GAAG,OAAO,CACrC,IAAI,CACA,yBAAyB,EACvB,QAAQ,GACR,cAAc,GACd,sBAAsB,GACtB,uBAAuB,GACvB,oBAAoB,GACpB,cAAc,CACnB,CACJ,GAAG;IACA,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC"}
1
+ {"version":3,"file":"RefreshTokenRequest.d.ts","sourceRoot":"","sources":["../../../src/request/RefreshTokenRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AAEpE;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,mBAAmB,GAAG,OAAO,CACrC,IAAI,CACA,yBAAyB,EACvB,QAAQ,GACR,cAAc,GACd,sBAAsB,GACtB,uBAAuB,GACvB,oBAAoB,GACpB,cAAc,CACnB,CACJ,GAAG;IACA,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC"}
@@ -5,7 +5,8 @@ import { AccountInfo, CommonSilentFlowRequest } from "@azure/msal-common/node";
5
5
  * - claims - A stringified claims request which will be added to all /authorize and /token calls. When included on a silent request, cache lookup will be skipped and token will be refreshed.
6
6
  * - authority - Url of the authority which the application acquires tokens from.
7
7
  * - correlationId - Unique GUID set per request to trace a request end-to-end for telemetry purposes.
8
- * - tokenQueryParameters - String to string map of custom query parameters added to the /token call
8
+ * - extraQueryParameters - String to string map of custom query parameters added to outgoing token service requests
9
+ * - extraParameters - String to string map of custom query parameters added to outgoing token service requests
9
10
  * - account - Account entity to lookup the credentials.
10
11
  * - forceRefresh - Forces silent requests to make network calls if true.
11
12
  * @public
@@ -1 +1 @@
1
- {"version":3,"file":"SilentFlowRequest.d.ts","sourceRoot":"","sources":["../../../src/request/SilentFlowRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAE/E;;;;;;;;;;GAUG;AACH,MAAM,MAAM,iBAAiB,GAAG,OAAO,CACnC,IAAI,CAAC,uBAAuB,EAAE,SAAS,GAAG,QAAQ,GAAG,cAAc,CAAC,CACvE,GAAG;IACA,OAAO,EAAE,WAAW,CAAC;IACrB,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACzB,CAAC"}
1
+ {"version":3,"file":"SilentFlowRequest.d.ts","sourceRoot":"","sources":["../../../src/request/SilentFlowRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAE/E;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,iBAAiB,GAAG,OAAO,CACnC,IAAI,CAAC,uBAAuB,EAAE,SAAS,GAAG,QAAQ,GAAG,cAAc,CAAC,CACvE,GAAG;IACA,OAAO,EAAE,WAAW,CAAC;IACrB,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACzB,CAAC"}
@@ -9,7 +9,8 @@ import { CommonUsernamePasswordRequest } from "./CommonUsernamePasswordRequest.j
9
9
  * - correlationId - Unique GUID set per request to trace a request end-to-end for telemetry purposes.
10
10
  * - username - username of the client
11
11
  * - password - credentials
12
- * - tokenQueryParameters - String to string map of custom query parameters added to the /token call
12
+ * - extraQueryParameters - String to string map of custom query parameters added to outgoing token service requests
13
+ * - extraParameters - String to string map of custom query parameters added to outgoing token service requests
13
14
  * @public
14
15
  */
15
16
  export type UsernamePasswordRequest = Partial<Omit<CommonUsernamePasswordRequest, "scopes" | "resourceRequestMethod" | "resourceRequestUri" | "username" | "password" | "storeInCache">> & {
@@ -1 +1 @@
1
- {"version":3,"file":"UsernamePasswordRequest.d.ts","sourceRoot":"","sources":["../../../src/request/UsernamePasswordRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AAEnF;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,uBAAuB,GAAG,OAAO,CACzC,IAAI,CACA,6BAA6B,EAC3B,QAAQ,GACR,uBAAuB,GACvB,oBAAoB,GACpB,UAAU,GACV,UAAU,GACV,cAAc,CACnB,CACJ,GAAG;IACA,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CACpB,CAAC"}
1
+ {"version":3,"file":"UsernamePasswordRequest.d.ts","sourceRoot":"","sources":["../../../src/request/UsernamePasswordRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AAEnF;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,uBAAuB,GAAG,OAAO,CACzC,IAAI,CACA,6BAA6B,EAC3B,QAAQ,GACR,uBAAuB,GACvB,oBAAoB,GACpB,UAAU,GACV,UAAU,GACV,cAAc,CACnB,CACJ,GAAG;IACA,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CACpB,CAAC"}
@@ -69,17 +69,10 @@ export type ManagedIdentityIdType = (typeof ManagedIdentityIdType)[keyof typeof
69
69
  * http methods
70
70
  */
71
71
  export declare const HttpMethod: {
72
- readonly GET: "get";
73
- readonly POST: "post";
72
+ readonly GET: "GET";
73
+ readonly POST: "POST";
74
74
  };
75
75
  export type HttpMethod = (typeof HttpMethod)[keyof typeof HttpMethod];
76
- export declare const ProxyStatus: {
77
- readonly SUCCESS: number;
78
- readonly SUCCESS_RANGE_START: number;
79
- readonly SUCCESS_RANGE_END: number;
80
- readonly SERVER_ERROR: number;
81
- };
82
- export type ProxyStatus = (typeof ProxyStatus)[keyof typeof ProxyStatus];
83
76
  /**
84
77
  * Constants used for region discovery
85
78
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Constants.d.ts","sourceRoot":"","sources":["../../../src/utils/Constants.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,iCAAiC,EAAE,MAAM,+CAA+C,CAAC;AAClG,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAG9D,eAAO,MAAM,2BAA2B,qCAAqC,CAAC;AAC9E,eAAO,MAAM,+BAA+B,qBAAqB,CAAC;AAClE,eAAO,MAAM,sCAAsC,QAA0E,CAAC;AAE9H;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;CAKzB,CAAC;AACX,MAAM,MAAM,sBAAsB,GAC9B,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,OAAO,sBAAsB,CAAC,CAAC;AAEzE;;GAEG;AACH,eAAO,MAAM,8BAA8B;;;;;CAKjC,CAAC;AACX,MAAM,MAAM,8BAA8B,GACtC,CAAC,OAAO,8BAA8B,CAAC,CAAC,MAAM,OAAO,8BAA8B,CAAC,CAAC;AAEzF;;GAEG;AACH,eAAO,MAAM,uCAAuC;;;;;;;;;CAS1C,CAAC;AACX,MAAM,MAAM,uCAAuC,GAC/C,CAAC,OAAO,uCAAuC,CAAC,CAAC,MAAM,OAAO,uCAAuC,CAAC,CAAC;AAE3G;;;GAGG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;CAQ7B,CAAC;AACX;;;GAGG;AACH,MAAM,MAAM,0BAA0B,GAClC,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,OAAO,0BAA0B,CAAC,CAAC;AAEjF;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;CAKxB,CAAC;AACX,MAAM,MAAM,qBAAqB,GAC7B,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,OAAO,qBAAqB,CAAC,CAAC;AAEvE;;GAEG;AACH,eAAO,MAAM,UAAU;;;CAGb,CAAC;AACX,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,OAAO,UAAU,CAAC,CAAC;AAEtE,eAAO,MAAM,WAAW;;;;;CAKd,CAAC;AACX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,OAAO,WAAW,CAAC,CAAC;AAEzE;;GAEG;AACH,eAAO,MAAM,2BAA2B,gBAAgB,CAAC;AACzD,eAAO,MAAM,iBAAiB,sBAAsB,CAAC;AAErD;;GAEG;AACH,eAAO,MAAM,iBAAiB,KAAK,CAAC;AAEpC;;GAEG;AACH,eAAO,MAAM,IAAI;;CAEhB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,OAAO;;CAGnB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,KAAK;;;;CAIjB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,SAAS;;;;;;CAOrB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,KAAK;;;;;;;CAOjB,CAAC;AACF,MAAM,MAAM,KAAK,GAAG,CAAC,OAAO,KAAK,CAAC,CAAC,MAAM,OAAO,KAAK,CAAC,CAAC;AAEvD;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;CAaxB,CAAC;AAEF,eAAO,MAAM,yBAAyB;;;CAGrC,CAAC;AAEF,eAAO,MAAM,oCAAoC,EAAE,MAAa,CAAC;AAEjE,MAAM,MAAM,aAAa,GAAG,iCAAiC,GAAG,eAAe,CAAC"}
1
+ {"version":3,"file":"Constants.d.ts","sourceRoot":"","sources":["../../../src/utils/Constants.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iCAAiC,EAAE,MAAM,+CAA+C,CAAC;AAClG,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAG9D,eAAO,MAAM,2BAA2B,qCAAqC,CAAC;AAC9E,eAAO,MAAM,+BAA+B,qBAAqB,CAAC;AAClE,eAAO,MAAM,sCAAsC,QAA0E,CAAC;AAE9H;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;CAKzB,CAAC;AACX,MAAM,MAAM,sBAAsB,GAC9B,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,OAAO,sBAAsB,CAAC,CAAC;AAEzE;;GAEG;AACH,eAAO,MAAM,8BAA8B;;;;;CAKjC,CAAC;AACX,MAAM,MAAM,8BAA8B,GACtC,CAAC,OAAO,8BAA8B,CAAC,CAAC,MAAM,OAAO,8BAA8B,CAAC,CAAC;AAEzF;;GAEG;AACH,eAAO,MAAM,uCAAuC;;;;;;;;;CAS1C,CAAC;AACX,MAAM,MAAM,uCAAuC,GAC/C,CAAC,OAAO,uCAAuC,CAAC,CAAC,MAAM,OAAO,uCAAuC,CAAC,CAAC;AAE3G;;;GAGG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;CAQ7B,CAAC;AACX;;;GAGG;AACH,MAAM,MAAM,0BAA0B,GAClC,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,OAAO,0BAA0B,CAAC,CAAC;AAEjF;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;CAKxB,CAAC;AACX,MAAM,MAAM,qBAAqB,GAC7B,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,OAAO,qBAAqB,CAAC,CAAC;AAEvE;;GAEG;AACH,eAAO,MAAM,UAAU;;;CAGb,CAAC;AACX,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,OAAO,UAAU,CAAC,CAAC;AAEtE;;GAEG;AACH,eAAO,MAAM,2BAA2B,gBAAgB,CAAC;AACzD,eAAO,MAAM,iBAAiB,sBAAsB,CAAC;AAErD;;GAEG;AACH,eAAO,MAAM,iBAAiB,KAAK,CAAC;AAEpC;;GAEG;AACH,eAAO,MAAM,IAAI;;CAEhB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,OAAO;;CAGnB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,KAAK;;;;CAIjB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,SAAS;;;;;;CAOrB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,KAAK;;;;;;;CAOjB,CAAC;AACF,MAAM,MAAM,KAAK,GAAG,CAAC,OAAO,KAAK,CAAC,CAAC,MAAM,OAAO,KAAK,CAAC,CAAC;AAEvD;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;CAaxB,CAAC;AAEF,eAAO,MAAM,yBAAyB;;;CAGrC,CAAC;AAEF,eAAO,MAAM,oCAAoC,EAAE,MAAa,CAAC;AAEjE,MAAM,MAAM,aAAa,GAAG,iCAAiC,GAAG,eAAe,CAAC"}
package/package.json CHANGED
@@ -1,91 +1,91 @@
1
1
  {
2
- "$schema": "https://json.schemastore.org/package.json",
3
- "name": "@azure/msal-node",
4
- "version": "5.0.0-alpha.0",
5
- "author": {
6
- "name": "Microsoft",
7
- "email": "nugetaad@microsoft.com",
8
- "url": "https://www.microsoft.com"
2
+ "$schema": "https://json.schemastore.org/package.json",
3
+ "name": "@azure/msal-node",
4
+ "version": "5.0.0-beta.0",
5
+ "author": {
6
+ "name": "Microsoft",
7
+ "email": "nugetaad@microsoft.com",
8
+ "url": "https://www.microsoft.com"
9
+ },
10
+ "license": "MIT",
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "https://github.com/AzureAD/microsoft-authentication-library-for-js.git"
14
+ },
15
+ "description": "Microsoft Authentication Library for Node",
16
+ "keywords": [
17
+ "js",
18
+ "ts",
19
+ "node",
20
+ "AAD",
21
+ "msal",
22
+ "oauth"
23
+ ],
24
+ "type": "module",
25
+ "main": "lib/msal-node.cjs",
26
+ "module": "dist/index.mjs",
27
+ "types": "dist/index.d.ts",
28
+ "exports": {
29
+ ".": {
30
+ "import": {
31
+ "types": "./dist/index.d.ts",
32
+ "default": "./dist/index.mjs"
33
+ },
34
+ "require": {
35
+ "types": "./lib/types/index.d.ts",
36
+ "default": "./lib/msal-node.cjs"
37
+ }
9
38
  },
10
- "license": "MIT",
11
- "repository": {
12
- "type": "git",
13
- "url": "https://github.com/AzureAD/microsoft-authentication-library-for-js.git"
14
- },
15
- "description": "Microsoft Authentication Library for Node",
16
- "keywords": [
17
- "js",
18
- "ts",
19
- "node",
20
- "AAD",
21
- "msal",
22
- "oauth"
23
- ],
24
- "type": "module",
25
- "main": "lib/msal-node.cjs",
26
- "module": "dist/index.mjs",
27
- "types": "dist/index.d.ts",
28
- "exports": {
29
- ".": {
30
- "import": {
31
- "types": "./dist/index.d.ts",
32
- "default": "./dist/index.mjs"
33
- },
34
- "require": {
35
- "types": "./lib/types/index.d.ts",
36
- "default": "./lib/msal-node.cjs"
37
- }
38
- },
39
- "./package.json": "./package.json"
40
- },
41
- "files": [
42
- "dist",
43
- "lib",
44
- "src"
45
- ],
46
- "scripts": {
47
- "build": "npm run clean && rollup -c --strictDeprecations --bundleConfigAsCjs",
48
- "build:watch": "rollup -c --watch --strictDeprecations --bundleConfigAsCjs",
49
- "clean": "shx rm -rf dist lib",
50
- "test": "jest",
51
- "test:watch": "jest --watch",
52
- "test:coverage": "jest --coverage",
53
- "lint": "eslint src --ext .ts",
54
- "lint:fix": "npm run lint -- --fix",
55
- "build:all": "cd ../.. && npm run build --workspace=@azure/msal-common --workspace=@azure/msal-node",
56
- "prepack": "npm run build:all",
57
- "format:check": "prettier --ignore-path .gitignore --check src test",
58
- "format:fix": "prettier --ignore-path .gitignore --write src test",
59
- "apiExtractor": "api-extractor run"
60
- },
61
- "beachball": {
62
- "disallowedChangeTypes": []
63
- },
64
- "devDependencies": {
65
- "@microsoft/api-extractor": "^7.43.4",
66
- "@rollup/plugin-node-resolve": "^15.0.1",
67
- "@rollup/plugin-typescript": "^11.0.0",
68
- "@types/jest": "^29.5.0",
69
- "@types/jsonwebtoken": "^9.0.1",
70
- "@types/node": "^20.3.1",
71
- "@types/uuid": "^7.0.0",
72
- "eslint-config-msal": "file:../../shared-configs/eslint-config-msal",
73
- "jest": "^29.5.0",
74
- "jest-junit": "^16.0.0",
75
- "prettier": "2.8.7",
76
- "rollup": "^4.22.4",
77
- "rollup-msal": "file:../../shared-configs/rollup-msal",
78
- "ts-jest": "^29.1.0",
79
- "tslib": "^1.10.0",
80
- "typescript": "^4.9.5",
81
- "yargs": "^17.3.1"
82
- },
83
- "dependencies": {
84
- "@azure/msal-common": "16.0.0-alpha.0",
85
- "jsonwebtoken": "^9.0.0",
86
- "uuid": "^8.3.0"
87
- },
88
- "engines": {
89
- "node": ">=20"
90
- }
39
+ "./package.json": "./package.json"
40
+ },
41
+ "files": [
42
+ "dist",
43
+ "lib",
44
+ "src"
45
+ ],
46
+ "scripts": {
47
+ "build": "npm run clean && rollup -c --strictDeprecations --bundleConfigAsCjs",
48
+ "build:watch": "rollup -c --watch --strictDeprecations --bundleConfigAsCjs",
49
+ "clean": "shx rm -rf dist lib",
50
+ "test": "jest",
51
+ "test:watch": "jest --watch",
52
+ "test:coverage": "jest --coverage",
53
+ "lint": "eslint src --ext .ts",
54
+ "lint:fix": "npm run lint -- --fix",
55
+ "build:all": "cd ../.. && npm run build --workspace=@azure/msal-common --workspace=@azure/msal-node",
56
+ "prepack": "npm run build:all",
57
+ "format:check": "prettier --ignore-path .gitignore --check src test",
58
+ "format:fix": "prettier --ignore-path .gitignore --write src test",
59
+ "apiExtractor": "api-extractor run"
60
+ },
61
+ "beachball": {
62
+ "disallowedChangeTypes": []
63
+ },
64
+ "devDependencies": {
65
+ "@microsoft/api-extractor": "^7.43.4",
66
+ "@rollup/plugin-node-resolve": "^15.0.1",
67
+ "@rollup/plugin-typescript": "^11.0.0",
68
+ "@types/jest": "^29.5.0",
69
+ "@types/jsonwebtoken": "^9.0.1",
70
+ "@types/node": "^20.3.1",
71
+ "@types/uuid": "^7.0.0",
72
+ "eslint-config-msal": "file:../../shared-configs/eslint-config-msal",
73
+ "jest": "^29.5.0",
74
+ "jest-junit": "^16.0.0",
75
+ "prettier": "2.8.7",
76
+ "rollup": "^4.22.4",
77
+ "rollup-msal": "file:../../shared-configs/rollup-msal",
78
+ "ts-jest": "^29.1.0",
79
+ "tslib": "^1.10.0",
80
+ "typescript": "^4.9.5",
81
+ "yargs": "^17.3.1"
82
+ },
83
+ "dependencies": {
84
+ "@azure/msal-common": "16.0.0-beta.0",
85
+ "jsonwebtoken": "^9.0.0",
86
+ "uuid": "^8.3.0"
87
+ },
88
+ "engines": {
89
+ "node": ">=20"
90
+ }
91
91
  }
@@ -0,0 +1,158 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ import {
7
+ ClientConfiguration,
8
+ buildClientConfiguration,
9
+ CommonClientConfiguration,
10
+ INetworkModule,
11
+ NetworkRequestOptions,
12
+ Logger,
13
+ ICrypto,
14
+ CacheManager,
15
+ ServerTelemetryManager,
16
+ Authority,
17
+ CcsCredential,
18
+ TokenProtocol,
19
+ RequestThumbprint,
20
+ ServerAuthorizationTokenResponse,
21
+ NetworkResponse,
22
+ BaseAuthRequest,
23
+ StubPerformanceClient,
24
+ } from "@azure/msal-common/node";
25
+ import { version, name } from "../packageMetadata.js";
26
+
27
+ /**
28
+ * Base application class which will construct requests to send to and handle responses from the Microsoft STS using the authorization code flow.
29
+ * @internal
30
+ */
31
+ export abstract class BaseClient {
32
+ // Logger object
33
+ public logger: Logger;
34
+
35
+ // Application config
36
+ protected config: CommonClientConfiguration;
37
+
38
+ // Crypto Interface
39
+ protected cryptoUtils: ICrypto;
40
+
41
+ // Storage Interface
42
+ protected cacheManager: CacheManager;
43
+
44
+ // Network Interface
45
+ protected networkClient: INetworkModule;
46
+
47
+ // Server Telemetry Manager
48
+ protected serverTelemetryManager: ServerTelemetryManager | null;
49
+
50
+ // Default authority object
51
+ public authority: Authority;
52
+
53
+ protected performanceClient: StubPerformanceClient;
54
+
55
+ protected constructor(configuration: ClientConfiguration) {
56
+ // Set the configuration
57
+ this.config = buildClientConfiguration(configuration);
58
+
59
+ // Initialize the logger
60
+ this.logger = new Logger(this.config.loggerOptions, name, version);
61
+
62
+ // Initialize crypto
63
+ this.cryptoUtils = this.config.cryptoInterface;
64
+
65
+ // Initialize storage interface
66
+ this.cacheManager = this.config.storageInterface;
67
+
68
+ // Set the network interface
69
+ this.networkClient = this.config.networkInterface;
70
+
71
+ // Set TelemetryManager
72
+ this.serverTelemetryManager = this.config.serverTelemetryManager;
73
+
74
+ // set Authority
75
+ this.authority = this.config.authOptions.authority;
76
+
77
+ this.performanceClient = new StubPerformanceClient();
78
+ }
79
+
80
+ /**
81
+ * Creates default headers for requests to token endpoint
82
+ */
83
+ protected createTokenRequestHeaders(
84
+ ccsCred?: CcsCredential
85
+ ): Record<string, string> {
86
+ return TokenProtocol.createTokenRequestHeaders(
87
+ this.logger,
88
+ false,
89
+ ccsCred
90
+ );
91
+ }
92
+
93
+ /**
94
+ * Http post to token endpoint
95
+ * @param tokenEndpoint
96
+ * @param queryString
97
+ * @param headers
98
+ * @param thumbprint
99
+ */
100
+ protected async executePostToTokenEndpoint(
101
+ tokenEndpoint: string,
102
+ queryString: string,
103
+ headers: Record<string, string>,
104
+ thumbprint: RequestThumbprint,
105
+ correlationId: string
106
+ ): Promise<NetworkResponse<ServerAuthorizationTokenResponse>> {
107
+ return TokenProtocol.executePostToTokenEndpoint(
108
+ tokenEndpoint,
109
+ queryString,
110
+ headers,
111
+ thumbprint,
112
+ correlationId,
113
+ this.cacheManager,
114
+ this.networkClient,
115
+ this.logger,
116
+ this.performanceClient,
117
+ this.serverTelemetryManager
118
+ );
119
+ }
120
+
121
+ /**
122
+ * Wraps sendPostRequestAsync with necessary preflight and postflight logic
123
+ * @param thumbprint - Request thumbprint for throttling
124
+ * @param tokenEndpoint - Endpoint to make the POST to
125
+ * @param options - Body and Headers to include on the POST request
126
+ * @param correlationId - CorrelationId for telemetry
127
+ */
128
+ async sendPostRequest<T extends ServerAuthorizationTokenResponse>(
129
+ thumbprint: RequestThumbprint,
130
+ tokenEndpoint: string,
131
+ options: NetworkRequestOptions,
132
+ correlationId: string
133
+ ): Promise<NetworkResponse<T>> {
134
+ return TokenProtocol.sendPostRequest<T>(
135
+ thumbprint,
136
+ tokenEndpoint,
137
+ options,
138
+ correlationId,
139
+ this.cacheManager,
140
+ this.networkClient,
141
+ this.logger,
142
+ this.performanceClient
143
+ );
144
+ }
145
+
146
+ /**
147
+ * Creates query string for the /token request
148
+ * @param request
149
+ */
150
+ createTokenQueryParameters(request: BaseAuthRequest): string {
151
+ return TokenProtocol.createTokenQueryParameters(
152
+ request,
153
+ this.config.authOptions.clientId,
154
+ this.config.authOptions.redirectUri,
155
+ this.performanceClient
156
+ );
157
+ }
158
+ }
@@ -7,7 +7,6 @@ import {
7
7
  AccessTokenEntity,
8
8
  AuthenticationResult,
9
9
  Authority,
10
- BaseClient,
11
10
  CacheManager,
12
11
  ClientAuthErrorCodes,
13
12
  ClientConfiguration,
@@ -29,13 +28,13 @@ import {
29
28
  ClientAssertion,
30
29
  getClientAssertion,
31
30
  UrlUtils,
32
- StubPerformanceClient,
33
31
  } from "@azure/msal-common/node";
34
32
  import {
35
33
  ManagedIdentityConfiguration,
36
34
  ManagedIdentityNodeConfiguration,
37
35
  } from "../config/Configuration.js";
38
36
  import { CommonClientCredentialRequest } from "../request/CommonClientCredentialRequest.js";
37
+ import { BaseClient } from "./BaseClient.js";
39
38
 
40
39
  /**
41
40
  * OAuth2.0 client credential grant
@@ -48,7 +47,7 @@ export class ClientCredentialClient extends BaseClient {
48
47
  configuration: ClientConfiguration,
49
48
  appTokenProvider?: IAppTokenProvider
50
49
  ) {
51
- super(configuration, new StubPerformanceClient());
50
+ super(configuration);
52
51
  this.appTokenProvider = appTokenProvider;
53
52
  }
54
53
 
@@ -6,7 +6,6 @@
6
6
  import {
7
7
  AuthErrorCodes,
8
8
  AuthenticationResult,
9
- BaseClient,
10
9
  ClientConfiguration,
11
10
  DeviceCodeResponse,
12
11
  RequestParameterBuilder,
@@ -21,10 +20,10 @@ import {
21
20
  createAuthError,
22
21
  createClientAuthError,
23
22
  Constants,
24
- StubPerformanceClient,
25
23
  } from "@azure/msal-common/node";
26
24
  import { CommonDeviceCodeRequest } from "../request/CommonDeviceCodeRequest.js";
27
25
  import * as NodeClientAuthErrorCodes from "../error/ClientAuthErrorCodes.js";
26
+ import { BaseClient } from "./BaseClient.js";
28
27
 
29
28
  /**
30
29
  * OAuth2.0 Device code client
@@ -32,7 +31,7 @@ import * as NodeClientAuthErrorCodes from "../error/ClientAuthErrorCodes.js";
32
31
  */
33
32
  export class DeviceCodeClient extends BaseClient {
34
33
  constructor(configuration: ClientConfiguration) {
35
- super(configuration, new StubPerformanceClient());
34
+ super(configuration);
36
35
  }
37
36
 
38
37
  /**
@@ -116,7 +115,7 @@ export class DeviceCodeClient extends BaseClient {
116
115
  const parameters = new Map<string, string>();
117
116
 
118
117
  if (request.extraQueryParameters) {
119
- RequestParameterBuilder.addExtraQueryParameters(
118
+ RequestParameterBuilder.addExtraParameters(
120
119
  parameters,
121
120
  request.extraQueryParameters
122
121
  );
@@ -183,7 +182,7 @@ export class DeviceCodeClient extends BaseClient {
183
182
  );
184
183
 
185
184
  if (request.extraQueryParameters) {
186
- RequestParameterBuilder.addExtraQueryParameters(
185
+ RequestParameterBuilder.addExtraParameters(
187
186
  parameters,
188
187
  request.extraQueryParameters
189
188
  );
@@ -22,12 +22,29 @@ import { NodeStorage } from "../../cache/NodeStorage.js";
22
22
  const APP_SERVICE_MSI_API_VERSION: string = "2019-08-01";
23
23
 
24
24
  /**
25
+ * Azure App Service Managed Identity Source implementation.
26
+ *
27
+ * This class provides managed identity authentication for applications running in Azure App Service.
28
+ * It uses the local metadata service endpoint available within App Service environments to obtain
29
+ * access tokens without requiring explicit credentials.
30
+ *
25
31
  * Original source of code: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/src/AppServiceManagedIdentitySource.cs
26
32
  */
27
33
  export class AppService extends BaseManagedIdentitySource {
28
34
  private identityEndpoint: string;
29
35
  private identityHeader: string;
30
36
 
37
+ /**
38
+ * Creates a new instance of the AppService managed identity source.
39
+ *
40
+ * @param logger - Logger instance for diagnostic output
41
+ * @param nodeStorage - Node.js storage implementation for caching
42
+ * @param networkClient - Network client for making HTTP requests
43
+ * @param cryptoProvider - Cryptographic operations provider
44
+ * @param disableInternalRetries - Whether to disable internal retry logic
45
+ * @param identityEndpoint - The App Service identity endpoint URL
46
+ * @param identityHeader - The secret header value required for authentication
47
+ */
31
48
  constructor(
32
49
  logger: Logger,
33
50
  nodeStorage: NodeStorage,
@@ -49,6 +66,16 @@ export class AppService extends BaseManagedIdentitySource {
49
66
  this.identityHeader = identityHeader;
50
67
  }
51
68
 
69
+ /**
70
+ * Retrieves the required environment variables for App Service managed identity.
71
+ *
72
+ * App Service managed identity requires two environment variables:
73
+ * - IDENTITY_ENDPOINT: The URL of the local metadata service
74
+ * - IDENTITY_HEADER: A secret header value for authentication
75
+ *
76
+ * @returns An array containing [identityEndpoint, identityHeader] values from environment variables.
77
+ * Either value may be undefined if the environment variable is not set.
78
+ */
52
79
  public static getEnvironmentVariables(): Array<string | undefined> {
53
80
  const identityEndpoint: string | undefined =
54
81
  process.env[
@@ -62,6 +89,21 @@ export class AppService extends BaseManagedIdentitySource {
62
89
  return [identityEndpoint, identityHeader];
63
90
  }
64
91
 
92
+ /**
93
+ * Attempts to create an AppService managed identity source if the environment supports it.
94
+ *
95
+ * This method checks for the presence of required environment variables and validates
96
+ * the identity endpoint URL. If the environment is not suitable for App Service managed
97
+ * identity (missing environment variables or invalid endpoint), it returns null.
98
+ *
99
+ * @param logger - Logger instance for diagnostic output
100
+ * @param nodeStorage - Node.js storage implementation for caching
101
+ * @param networkClient - Network client for making HTTP requests
102
+ * @param cryptoProvider - Cryptographic operations provider
103
+ * @param disableInternalRetries - Whether to disable internal retry logic
104
+ *
105
+ * @returns A new AppService instance if the environment is suitable, null otherwise
106
+ */
65
107
  public static tryCreate(
66
108
  logger: Logger,
67
109
  nodeStorage: NodeStorage,
@@ -105,6 +147,18 @@ export class AppService extends BaseManagedIdentitySource {
105
147
  );
106
148
  }
107
149
 
150
+ /**
151
+ * Creates a managed identity token request for the App Service environment.
152
+ *
153
+ * This method constructs an HTTP GET request to the App Service identity endpoint
154
+ * with the required headers, query parameters, and managed identity configuration.
155
+ * The request includes the secret header for authentication and appropriate API version.
156
+ *
157
+ * @param resource - The target resource/scope for which to request an access token (e.g., "https://graph.microsoft.com/.default")
158
+ * @param managedIdentityId - The managed identity configuration specifying whether to use system-assigned or user-assigned identity
159
+ *
160
+ * @returns A configured ManagedIdentityRequestParameters object ready for network execution
161
+ */
108
162
  public createRequest(
109
163
  resource: string,
110
164
  managedIdentityId: ManagedIdentityId