@azure/identity 4.8.1-alpha.20250410.1 → 4.9.1-alpha.20250416.4

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 (323) hide show
  1. package/dist/browser/constants.d.ts +1 -1
  2. package/dist/browser/constants.js +1 -1
  3. package/dist/browser/constants.js.map +1 -1
  4. package/dist/commonjs/constants.d.ts +1 -1
  5. package/dist/commonjs/constants.js +1 -1
  6. package/dist/commonjs/constants.js.map +1 -1
  7. package/dist/esm/constants.d.ts +1 -1
  8. package/dist/esm/constants.js +1 -1
  9. package/dist/esm/constants.js.map +1 -1
  10. package/dist/workerd/client/identityClient.d.ts +65 -0
  11. package/dist/workerd/client/identityClient.d.ts.map +1 -0
  12. package/dist/workerd/client/identityClient.js +248 -0
  13. package/dist/workerd/client/identityClient.js.map +1 -0
  14. package/dist/workerd/constants.d.ts +69 -0
  15. package/dist/workerd/constants.d.ts.map +1 -0
  16. package/dist/workerd/constants.js +75 -0
  17. package/dist/workerd/constants.js.map +1 -0
  18. package/dist/workerd/credentials/authorityValidationOptions.d.ts +16 -0
  19. package/dist/workerd/credentials/authorityValidationOptions.d.ts.map +1 -0
  20. package/dist/workerd/credentials/authorityValidationOptions.js +4 -0
  21. package/dist/workerd/credentials/authorityValidationOptions.js.map +1 -0
  22. package/dist/workerd/credentials/authorizationCodeCredential.d.ts +73 -0
  23. package/dist/workerd/credentials/authorizationCodeCredential.d.ts.map +1 -0
  24. package/dist/workerd/credentials/authorizationCodeCredential.js +60 -0
  25. package/dist/workerd/credentials/authorizationCodeCredential.js.map +1 -0
  26. package/dist/workerd/credentials/authorizationCodeCredentialOptions.d.ts +8 -0
  27. package/dist/workerd/credentials/authorizationCodeCredentialOptions.d.ts.map +1 -0
  28. package/dist/workerd/credentials/authorizationCodeCredentialOptions.js +4 -0
  29. package/dist/workerd/credentials/authorizationCodeCredentialOptions.js.map +1 -0
  30. package/dist/workerd/credentials/azureApplicationCredential.d.ts +24 -0
  31. package/dist/workerd/credentials/azureApplicationCredential.d.ts.map +1 -0
  32. package/dist/workerd/credentials/azureApplicationCredential.js +32 -0
  33. package/dist/workerd/credentials/azureApplicationCredential.js.map +1 -0
  34. package/dist/workerd/credentials/azureApplicationCredentialOptions.d.ts +13 -0
  35. package/dist/workerd/credentials/azureApplicationCredentialOptions.d.ts.map +1 -0
  36. package/dist/workerd/credentials/azureApplicationCredentialOptions.js +4 -0
  37. package/dist/workerd/credentials/azureApplicationCredentialOptions.js.map +1 -0
  38. package/dist/workerd/credentials/azureCliCredential.d.ts +64 -0
  39. package/dist/workerd/credentials/azureCliCredential.d.ts.map +1 -0
  40. package/dist/workerd/credentials/azureCliCredential.js +191 -0
  41. package/dist/workerd/credentials/azureCliCredential.js.map +1 -0
  42. package/dist/workerd/credentials/azureCliCredentialOptions.d.ts +20 -0
  43. package/dist/workerd/credentials/azureCliCredentialOptions.d.ts.map +1 -0
  44. package/dist/workerd/credentials/azureCliCredentialOptions.js +4 -0
  45. package/dist/workerd/credentials/azureCliCredentialOptions.js.map +1 -0
  46. package/dist/workerd/credentials/azureDeveloperCliCredential.d.ts +71 -0
  47. package/dist/workerd/credentials/azureDeveloperCliCredential.d.ts.map +1 -0
  48. package/dist/workerd/credentials/azureDeveloperCliCredential.js +173 -0
  49. package/dist/workerd/credentials/azureDeveloperCliCredential.js.map +1 -0
  50. package/dist/workerd/credentials/azureDeveloperCliCredentialOptions.d.ts +15 -0
  51. package/dist/workerd/credentials/azureDeveloperCliCredentialOptions.d.ts.map +1 -0
  52. package/dist/workerd/credentials/azureDeveloperCliCredentialOptions.js +4 -0
  53. package/dist/workerd/credentials/azureDeveloperCliCredentialOptions.js.map +1 -0
  54. package/dist/workerd/credentials/azurePipelinesCredential.d.ts +38 -0
  55. package/dist/workerd/credentials/azurePipelinesCredential.d.ts.map +1 -0
  56. package/dist/workerd/credentials/azurePipelinesCredential.js +141 -0
  57. package/dist/workerd/credentials/azurePipelinesCredential.js.map +1 -0
  58. package/dist/workerd/credentials/azurePipelinesCredentialOptions.d.ts +9 -0
  59. package/dist/workerd/credentials/azurePipelinesCredentialOptions.d.ts.map +1 -0
  60. package/dist/workerd/credentials/azurePipelinesCredentialOptions.js +4 -0
  61. package/dist/workerd/credentials/azurePipelinesCredentialOptions.js.map +1 -0
  62. package/dist/workerd/credentials/azurePowerShellCredential.d.ts +75 -0
  63. package/dist/workerd/credentials/azurePowerShellCredential.d.ts.map +1 -0
  64. package/dist/workerd/credentials/azurePowerShellCredential.js +229 -0
  65. package/dist/workerd/credentials/azurePowerShellCredential.js.map +1 -0
  66. package/dist/workerd/credentials/azurePowerShellCredentialOptions.d.ts +15 -0
  67. package/dist/workerd/credentials/azurePowerShellCredentialOptions.d.ts.map +1 -0
  68. package/dist/workerd/credentials/azurePowerShellCredentialOptions.js +4 -0
  69. package/dist/workerd/credentials/azurePowerShellCredentialOptions.js.map +1 -0
  70. package/dist/workerd/credentials/brokerAuthOptions.d.ts +13 -0
  71. package/dist/workerd/credentials/brokerAuthOptions.d.ts.map +1 -0
  72. package/dist/workerd/credentials/brokerAuthOptions.js +2 -0
  73. package/dist/workerd/credentials/brokerAuthOptions.js.map +1 -0
  74. package/dist/workerd/credentials/browserCustomizationOptions.d.ts +19 -0
  75. package/dist/workerd/credentials/browserCustomizationOptions.d.ts.map +1 -0
  76. package/dist/workerd/credentials/browserCustomizationOptions.js +4 -0
  77. package/dist/workerd/credentials/browserCustomizationOptions.js.map +1 -0
  78. package/dist/workerd/credentials/chainedTokenCredential.d.ts +51 -0
  79. package/dist/workerd/credentials/chainedTokenCredential.d.ts.map +1 -0
  80. package/dist/workerd/credentials/chainedTokenCredential.js +92 -0
  81. package/dist/workerd/credentials/chainedTokenCredential.js.map +1 -0
  82. package/dist/workerd/credentials/clientAssertionCredential.d.ts +33 -0
  83. package/dist/workerd/credentials/clientAssertionCredential.d.ts.map +1 -0
  84. package/dist/workerd/credentials/clientAssertionCredential.js +55 -0
  85. package/dist/workerd/credentials/clientAssertionCredential.js.map +1 -0
  86. package/dist/workerd/credentials/clientAssertionCredentialOptions.d.ts +9 -0
  87. package/dist/workerd/credentials/clientAssertionCredentialOptions.d.ts.map +1 -0
  88. package/dist/workerd/credentials/clientAssertionCredentialOptions.js +4 -0
  89. package/dist/workerd/credentials/clientAssertionCredentialOptions.js.map +1 -0
  90. package/dist/workerd/credentials/clientCertificateCredential.d.ts +72 -0
  91. package/dist/workerd/credentials/clientCertificateCredential.d.ts.map +1 -0
  92. package/dist/workerd/credentials/clientCertificateCredential.js +122 -0
  93. package/dist/workerd/credentials/clientCertificateCredential.js.map +1 -0
  94. package/dist/workerd/credentials/clientCertificateCredentialModels.d.ts +31 -0
  95. package/dist/workerd/credentials/clientCertificateCredentialModels.d.ts.map +1 -0
  96. package/dist/workerd/credentials/clientCertificateCredentialModels.js +4 -0
  97. package/dist/workerd/credentials/clientCertificateCredentialModels.js.map +1 -0
  98. package/dist/workerd/credentials/clientCertificateCredentialOptions.d.ts +14 -0
  99. package/dist/workerd/credentials/clientCertificateCredentialOptions.d.ts.map +1 -0
  100. package/dist/workerd/credentials/clientCertificateCredentialOptions.js +4 -0
  101. package/dist/workerd/credentials/clientCertificateCredentialOptions.js.map +1 -0
  102. package/dist/workerd/credentials/clientSecretCredential.d.ts +37 -0
  103. package/dist/workerd/credentials/clientSecretCredential.d.ts.map +1 -0
  104. package/dist/workerd/credentials/clientSecretCredential.js +60 -0
  105. package/dist/workerd/credentials/clientSecretCredential.js.map +1 -0
  106. package/dist/workerd/credentials/clientSecretCredentialOptions.d.ts +9 -0
  107. package/dist/workerd/credentials/clientSecretCredentialOptions.d.ts.map +1 -0
  108. package/dist/workerd/credentials/clientSecretCredentialOptions.js +4 -0
  109. package/dist/workerd/credentials/clientSecretCredentialOptions.js.map +1 -0
  110. package/dist/workerd/credentials/credentialPersistenceOptions.d.ts +30 -0
  111. package/dist/workerd/credentials/credentialPersistenceOptions.d.ts.map +1 -0
  112. package/dist/workerd/credentials/credentialPersistenceOptions.js +4 -0
  113. package/dist/workerd/credentials/credentialPersistenceOptions.js.map +1 -0
  114. package/dist/workerd/credentials/defaultAzureCredential.d.ts +65 -0
  115. package/dist/workerd/credentials/defaultAzureCredential.d.ts.map +1 -0
  116. package/dist/workerd/credentials/defaultAzureCredential.js +164 -0
  117. package/dist/workerd/credentials/defaultAzureCredential.js.map +1 -0
  118. package/dist/workerd/credentials/defaultAzureCredentialOptions.d.ts +49 -0
  119. package/dist/workerd/credentials/defaultAzureCredentialOptions.d.ts.map +1 -0
  120. package/dist/workerd/credentials/defaultAzureCredentialOptions.js +4 -0
  121. package/dist/workerd/credentials/defaultAzureCredentialOptions.js.map +1 -0
  122. package/dist/workerd/credentials/deviceCodeCredential.d.ts +67 -0
  123. package/dist/workerd/credentials/deviceCodeCredential.d.ts.map +1 -0
  124. package/dist/workerd/credentials/deviceCodeCredential.js +91 -0
  125. package/dist/workerd/credentials/deviceCodeCredential.js.map +1 -0
  126. package/dist/workerd/credentials/deviceCodeCredentialOptions.d.ts +53 -0
  127. package/dist/workerd/credentials/deviceCodeCredentialOptions.d.ts.map +1 -0
  128. package/dist/workerd/credentials/deviceCodeCredentialOptions.js +4 -0
  129. package/dist/workerd/credentials/deviceCodeCredentialOptions.js.map +1 -0
  130. package/dist/workerd/credentials/environmentCredential.d.ts +52 -0
  131. package/dist/workerd/credentials/environmentCredential.d.ts.map +1 -0
  132. package/dist/workerd/credentials/environmentCredential.js +130 -0
  133. package/dist/workerd/credentials/environmentCredential.js.map +1 -0
  134. package/dist/workerd/credentials/environmentCredentialOptions.d.ts +9 -0
  135. package/dist/workerd/credentials/environmentCredentialOptions.d.ts.map +1 -0
  136. package/dist/workerd/credentials/environmentCredentialOptions.js +4 -0
  137. package/dist/workerd/credentials/environmentCredentialOptions.js.map +1 -0
  138. package/dist/workerd/credentials/interactiveBrowserCredential.d.ts +56 -0
  139. package/dist/workerd/credentials/interactiveBrowserCredential.d.ts.map +1 -0
  140. package/dist/workerd/credentials/interactiveBrowserCredential.js +91 -0
  141. package/dist/workerd/credentials/interactiveBrowserCredential.js.map +1 -0
  142. package/dist/workerd/credentials/interactiveBrowserCredentialOptions.d.ts +77 -0
  143. package/dist/workerd/credentials/interactiveBrowserCredentialOptions.d.ts.map +1 -0
  144. package/dist/workerd/credentials/interactiveBrowserCredentialOptions.js +4 -0
  145. package/dist/workerd/credentials/interactiveBrowserCredentialOptions.js.map +1 -0
  146. package/dist/workerd/credentials/interactiveCredentialOptions.d.ts +25 -0
  147. package/dist/workerd/credentials/interactiveCredentialOptions.d.ts.map +1 -0
  148. package/dist/workerd/credentials/interactiveCredentialOptions.js +4 -0
  149. package/dist/workerd/credentials/interactiveCredentialOptions.js.map +1 -0
  150. package/dist/workerd/credentials/managedIdentityCredential/imdsMsi.d.ts +18 -0
  151. package/dist/workerd/credentials/managedIdentityCredential/imdsMsi.d.ts.map +1 -0
  152. package/dist/workerd/credentials/managedIdentityCredential/imdsMsi.js +99 -0
  153. package/dist/workerd/credentials/managedIdentityCredential/imdsMsi.js.map +1 -0
  154. package/dist/workerd/credentials/managedIdentityCredential/imdsRetryPolicy.d.ts +12 -0
  155. package/dist/workerd/credentials/managedIdentityCredential/imdsRetryPolicy.d.ts.map +1 -0
  156. package/dist/workerd/credentials/managedIdentityCredential/imdsRetryPolicy.js +33 -0
  157. package/dist/workerd/credentials/managedIdentityCredential/imdsRetryPolicy.js.map +1 -0
  158. package/dist/workerd/credentials/managedIdentityCredential/index.d.ts +61 -0
  159. package/dist/workerd/credentials/managedIdentityCredential/index.d.ts.map +1 -0
  160. package/dist/workerd/credentials/managedIdentityCredential/index.js +239 -0
  161. package/dist/workerd/credentials/managedIdentityCredential/index.js.map +1 -0
  162. package/dist/workerd/credentials/managedIdentityCredential/models.d.ts +24 -0
  163. package/dist/workerd/credentials/managedIdentityCredential/models.d.ts.map +1 -0
  164. package/dist/workerd/credentials/managedIdentityCredential/models.js +4 -0
  165. package/dist/workerd/credentials/managedIdentityCredential/models.js.map +1 -0
  166. package/dist/workerd/credentials/managedIdentityCredential/options.d.ts +37 -0
  167. package/dist/workerd/credentials/managedIdentityCredential/options.d.ts.map +1 -0
  168. package/dist/workerd/credentials/managedIdentityCredential/options.js +4 -0
  169. package/dist/workerd/credentials/managedIdentityCredential/options.js.map +1 -0
  170. package/dist/workerd/credentials/managedIdentityCredential/tokenExchangeMsi.d.ts +14 -0
  171. package/dist/workerd/credentials/managedIdentityCredential/tokenExchangeMsi.d.ts.map +1 -0
  172. package/dist/workerd/credentials/managedIdentityCredential/tokenExchangeMsi.js +32 -0
  173. package/dist/workerd/credentials/managedIdentityCredential/tokenExchangeMsi.js.map +1 -0
  174. package/dist/workerd/credentials/managedIdentityCredential/utils.d.ts +37 -0
  175. package/dist/workerd/credentials/managedIdentityCredential/utils.d.ts.map +1 -0
  176. package/dist/workerd/credentials/managedIdentityCredential/utils.js +81 -0
  177. package/dist/workerd/credentials/managedIdentityCredential/utils.js.map +1 -0
  178. package/dist/workerd/credentials/multiTenantTokenCredentialOptions.d.ts +12 -0
  179. package/dist/workerd/credentials/multiTenantTokenCredentialOptions.d.ts.map +1 -0
  180. package/dist/workerd/credentials/multiTenantTokenCredentialOptions.js +4 -0
  181. package/dist/workerd/credentials/multiTenantTokenCredentialOptions.js.map +1 -0
  182. package/dist/workerd/credentials/onBehalfOfCredential.d.ts +105 -0
  183. package/dist/workerd/credentials/onBehalfOfCredential.d.ts.map +1 -0
  184. package/dist/workerd/credentials/onBehalfOfCredential.js +112 -0
  185. package/dist/workerd/credentials/onBehalfOfCredential.js.map +1 -0
  186. package/dist/workerd/credentials/onBehalfOfCredentialOptions.d.ts +76 -0
  187. package/dist/workerd/credentials/onBehalfOfCredentialOptions.d.ts.map +1 -0
  188. package/dist/workerd/credentials/onBehalfOfCredentialOptions.js +4 -0
  189. package/dist/workerd/credentials/onBehalfOfCredentialOptions.js.map +1 -0
  190. package/dist/workerd/credentials/usernamePasswordCredential.d.ts +42 -0
  191. package/dist/workerd/credentials/usernamePasswordCredential.d.ts.map +1 -0
  192. package/dist/workerd/credentials/usernamePasswordCredential.js +68 -0
  193. package/dist/workerd/credentials/usernamePasswordCredential.js.map +1 -0
  194. package/dist/workerd/credentials/usernamePasswordCredentialOptions.d.ts +10 -0
  195. package/dist/workerd/credentials/usernamePasswordCredentialOptions.d.ts.map +1 -0
  196. package/dist/workerd/credentials/usernamePasswordCredentialOptions.js +4 -0
  197. package/dist/workerd/credentials/usernamePasswordCredentialOptions.js.map +1 -0
  198. package/dist/workerd/credentials/visualStudioCodeCredential.d.ts +66 -0
  199. package/dist/workerd/credentials/visualStudioCodeCredential.d.ts.map +1 -0
  200. package/dist/workerd/credentials/visualStudioCodeCredential.js +196 -0
  201. package/dist/workerd/credentials/visualStudioCodeCredential.js.map +1 -0
  202. package/dist/workerd/credentials/visualStudioCodeCredentialOptions.d.ts +16 -0
  203. package/dist/workerd/credentials/visualStudioCodeCredentialOptions.d.ts.map +1 -0
  204. package/dist/workerd/credentials/visualStudioCodeCredentialOptions.js +4 -0
  205. package/dist/workerd/credentials/visualStudioCodeCredentialOptions.js.map +1 -0
  206. package/dist/workerd/credentials/visualStudioCodeCredentialPlugin.d.ts +16 -0
  207. package/dist/workerd/credentials/visualStudioCodeCredentialPlugin.d.ts.map +1 -0
  208. package/dist/workerd/credentials/visualStudioCodeCredentialPlugin.js +4 -0
  209. package/dist/workerd/credentials/visualStudioCodeCredentialPlugin.js.map +1 -0
  210. package/dist/workerd/credentials/workloadIdentityCredential.d.ts +47 -0
  211. package/dist/workerd/credentials/workloadIdentityCredential.d.ts.map +1 -0
  212. package/dist/workerd/credentials/workloadIdentityCredential.js +114 -0
  213. package/dist/workerd/credentials/workloadIdentityCredential.js.map +1 -0
  214. package/dist/workerd/credentials/workloadIdentityCredentialOptions.d.ts +20 -0
  215. package/dist/workerd/credentials/workloadIdentityCredentialOptions.d.ts.map +1 -0
  216. package/dist/workerd/credentials/workloadIdentityCredentialOptions.js +4 -0
  217. package/dist/workerd/credentials/workloadIdentityCredentialOptions.js.map +1 -0
  218. package/dist/workerd/errors.d.ts +139 -0
  219. package/dist/workerd/errors.d.ts.map +1 -0
  220. package/dist/workerd/errors.js +123 -0
  221. package/dist/workerd/errors.js.map +1 -0
  222. package/dist/workerd/index.d.ts +61 -0
  223. package/dist/workerd/index.d.ts.map +1 -0
  224. package/dist/workerd/index.js +34 -0
  225. package/dist/workerd/index.js.map +1 -0
  226. package/dist/workerd/msal/browserFlows/msalBrowserCommon.d.ts +19 -0
  227. package/dist/workerd/msal/browserFlows/msalBrowserCommon.d.ts.map +1 -0
  228. package/dist/workerd/msal/browserFlows/msalBrowserCommon.js +291 -0
  229. package/dist/workerd/msal/browserFlows/msalBrowserCommon.js.map +1 -0
  230. package/dist/workerd/msal/browserFlows/msalBrowserOptions.d.ts +87 -0
  231. package/dist/workerd/msal/browserFlows/msalBrowserOptions.d.ts.map +1 -0
  232. package/dist/workerd/msal/browserFlows/msalBrowserOptions.js +4 -0
  233. package/dist/workerd/msal/browserFlows/msalBrowserOptions.js.map +1 -0
  234. package/dist/workerd/msal/credentials.d.ts +52 -0
  235. package/dist/workerd/msal/credentials.d.ts.map +1 -0
  236. package/dist/workerd/msal/credentials.js +4 -0
  237. package/dist/workerd/msal/credentials.js.map +1 -0
  238. package/dist/workerd/msal/msal.d.ts +3 -0
  239. package/dist/workerd/msal/msal.d.ts.map +1 -0
  240. package/dist/workerd/msal/msal.js +5 -0
  241. package/dist/workerd/msal/msal.js.map +1 -0
  242. package/dist/workerd/msal/nodeFlows/brokerOptions.d.ts +44 -0
  243. package/dist/workerd/msal/nodeFlows/brokerOptions.d.ts.map +1 -0
  244. package/dist/workerd/msal/nodeFlows/brokerOptions.js +2 -0
  245. package/dist/workerd/msal/nodeFlows/brokerOptions.js.map +1 -0
  246. package/dist/workerd/msal/nodeFlows/msalClient.d.ts +186 -0
  247. package/dist/workerd/msal/nodeFlows/msalClient.d.ts.map +1 -0
  248. package/dist/workerd/msal/nodeFlows/msalClient.js +469 -0
  249. package/dist/workerd/msal/nodeFlows/msalClient.js.map +1 -0
  250. package/dist/workerd/msal/nodeFlows/msalPlugins.d.ts +91 -0
  251. package/dist/workerd/msal/nodeFlows/msalPlugins.d.ts.map +1 -0
  252. package/dist/workerd/msal/nodeFlows/msalPlugins.js +87 -0
  253. package/dist/workerd/msal/nodeFlows/msalPlugins.js.map +1 -0
  254. package/dist/workerd/msal/nodeFlows/tokenCachePersistenceOptions.d.ts +24 -0
  255. package/dist/workerd/msal/nodeFlows/tokenCachePersistenceOptions.d.ts.map +1 -0
  256. package/dist/workerd/msal/nodeFlows/tokenCachePersistenceOptions.js +4 -0
  257. package/dist/workerd/msal/nodeFlows/tokenCachePersistenceOptions.js.map +1 -0
  258. package/dist/workerd/msal/types.d.ts +87 -0
  259. package/dist/workerd/msal/types.d.ts.map +1 -0
  260. package/dist/workerd/msal/types.js +4 -0
  261. package/dist/workerd/msal/types.js.map +1 -0
  262. package/dist/workerd/msal/utils.d.ts +95 -0
  263. package/dist/workerd/msal/utils.d.ts.map +1 -0
  264. package/dist/workerd/msal/utils.js +238 -0
  265. package/dist/workerd/msal/utils.js.map +1 -0
  266. package/dist/workerd/package.json +3 -0
  267. package/dist/workerd/plugins/consumer.d.ts +28 -0
  268. package/dist/workerd/plugins/consumer.d.ts.map +1 -0
  269. package/dist/workerd/plugins/consumer.js +43 -0
  270. package/dist/workerd/plugins/consumer.js.map +1 -0
  271. package/dist/workerd/plugins/provider.d.ts +36 -0
  272. package/dist/workerd/plugins/provider.d.ts.map +1 -0
  273. package/dist/workerd/plugins/provider.js +4 -0
  274. package/dist/workerd/plugins/provider.js.map +1 -0
  275. package/dist/workerd/regionalAuthority.d.ts +122 -0
  276. package/dist/workerd/regionalAuthority.d.ts.map +1 -0
  277. package/dist/workerd/regionalAuthority.js +140 -0
  278. package/dist/workerd/regionalAuthority.js.map +1 -0
  279. package/dist/workerd/tokenCredentialOptions.d.ts +28 -0
  280. package/dist/workerd/tokenCredentialOptions.d.ts.map +1 -0
  281. package/dist/workerd/tokenCredentialOptions.js +4 -0
  282. package/dist/workerd/tokenCredentialOptions.js.map +1 -0
  283. package/dist/workerd/tokenProvider.d.ts +39 -0
  284. package/dist/workerd/tokenProvider.d.ts.map +1 -0
  285. package/dist/workerd/tokenProvider.js +53 -0
  286. package/dist/workerd/tokenProvider.js.map +1 -0
  287. package/dist/workerd/util/authHostEnv-browser.d.mts +4 -0
  288. package/dist/workerd/util/authHostEnv-browser.d.mts.map +1 -0
  289. package/dist/workerd/util/authHostEnv-browser.mjs +7 -0
  290. package/dist/workerd/util/authHostEnv-browser.mjs.map +1 -0
  291. package/dist/workerd/util/identityTokenEndpoint.d.ts +2 -0
  292. package/dist/workerd/util/identityTokenEndpoint.d.ts.map +1 -0
  293. package/dist/workerd/util/identityTokenEndpoint.js +11 -0
  294. package/dist/workerd/util/identityTokenEndpoint.js.map +1 -0
  295. package/dist/workerd/util/logging.d.ts +70 -0
  296. package/dist/workerd/util/logging.d.ts.map +1 -0
  297. package/dist/workerd/util/logging.js +94 -0
  298. package/dist/workerd/util/logging.js.map +1 -0
  299. package/dist/workerd/util/processMultiTenantRequest.d.ts +10 -0
  300. package/dist/workerd/util/processMultiTenantRequest.d.ts.map +1 -0
  301. package/dist/workerd/util/processMultiTenantRequest.js +35 -0
  302. package/dist/workerd/util/processMultiTenantRequest.js.map +1 -0
  303. package/dist/workerd/util/processUtils.d.ts +13 -0
  304. package/dist/workerd/util/processUtils.d.ts.map +1 -0
  305. package/dist/workerd/util/processUtils.js +32 -0
  306. package/dist/workerd/util/processUtils.js.map +1 -0
  307. package/dist/workerd/util/scopeUtils.d.ts +17 -0
  308. package/dist/workerd/util/scopeUtils.d.ts.map +1 -0
  309. package/dist/workerd/util/scopeUtils.js +29 -0
  310. package/dist/workerd/util/scopeUtils.js.map +1 -0
  311. package/dist/workerd/util/subscriptionUtils.d.ts +6 -0
  312. package/dist/workerd/util/subscriptionUtils.d.ts.map +1 -0
  313. package/dist/workerd/util/subscriptionUtils.js +14 -0
  314. package/dist/workerd/util/subscriptionUtils.js.map +1 -0
  315. package/dist/workerd/util/tenantIdUtils.d.ts +15 -0
  316. package/dist/workerd/util/tenantIdUtils.d.ts.map +1 -0
  317. package/dist/workerd/util/tenantIdUtils.js +44 -0
  318. package/dist/workerd/util/tenantIdUtils.js.map +1 -0
  319. package/dist/workerd/util/tracing.d.ts +6 -0
  320. package/dist/workerd/util/tracing.d.ts.map +1 -0
  321. package/dist/workerd/util/tracing.js +14 -0
  322. package/dist/workerd/util/tracing.js.map +1 -0
  323. package/package.json +9 -3
@@ -0,0 +1,55 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ import { createMsalClient } from "../msal/nodeFlows/msalClient.js";
4
+ import { processMultiTenantRequest, resolveAdditionallyAllowedTenantIds, } from "../util/tenantIdUtils.js";
5
+ import { CredentialUnavailableError } from "../errors.js";
6
+ import { credentialLogger } from "../util/logging.js";
7
+ import { tracingClient } from "../util/tracing.js";
8
+ const logger = credentialLogger("ClientAssertionCredential");
9
+ /**
10
+ * Authenticates a service principal with a JWT assertion.
11
+ */
12
+ export class ClientAssertionCredential {
13
+ /**
14
+ * Creates an instance of the ClientAssertionCredential with the details
15
+ * needed to authenticate against Microsoft Entra ID with a client
16
+ * assertion provided by the developer through the `getAssertion` function parameter.
17
+ *
18
+ * @param tenantId - The Microsoft Entra tenant (directory) ID.
19
+ * @param clientId - The client (application) ID of an App Registration in the tenant.
20
+ * @param getAssertion - A function that retrieves the assertion for the credential to use.
21
+ * @param options - Options for configuring the client which makes the authentication request.
22
+ */
23
+ constructor(tenantId, clientId, getAssertion, options = {}) {
24
+ if (!tenantId) {
25
+ throw new CredentialUnavailableError("ClientAssertionCredential: tenantId is a required parameter.");
26
+ }
27
+ if (!clientId) {
28
+ throw new CredentialUnavailableError("ClientAssertionCredential: clientId is a required parameter.");
29
+ }
30
+ if (!getAssertion) {
31
+ throw new CredentialUnavailableError("ClientAssertionCredential: clientAssertion is a required parameter.");
32
+ }
33
+ this.tenantId = tenantId;
34
+ this.additionallyAllowedTenantIds = resolveAdditionallyAllowedTenantIds(options === null || options === void 0 ? void 0 : options.additionallyAllowedTenants);
35
+ this.options = options;
36
+ this.getAssertion = getAssertion;
37
+ this.msalClient = createMsalClient(clientId, tenantId, Object.assign(Object.assign({}, options), { logger, tokenCredentialOptions: this.options }));
38
+ }
39
+ /**
40
+ * Authenticates with Microsoft Entra ID and returns an access token if successful.
41
+ * If authentication fails, a {@link CredentialUnavailableError} will be thrown with the details of the failure.
42
+ *
43
+ * @param scopes - The list of scopes for which the token will have access.
44
+ * @param options - The options used to configure any requests this
45
+ * TokenCredential implementation might make.
46
+ */
47
+ async getToken(scopes, options = {}) {
48
+ return tracingClient.withSpan(`${this.constructor.name}.getToken`, options, async (newOptions) => {
49
+ newOptions.tenantId = processMultiTenantRequest(this.tenantId, newOptions, this.additionallyAllowedTenantIds, logger);
50
+ const arrayScopes = Array.isArray(scopes) ? scopes : [scopes];
51
+ return this.msalClient.getTokenByClientAssertion(arrayScopes, this.getAssertion, newOptions);
52
+ });
53
+ }
54
+ }
55
+ //# sourceMappingURL=clientAssertionCredential.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clientAssertionCredential.js","sourceRoot":"","sources":["../../../src/credentials/clientAssertionCredential.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EACL,yBAAyB,EACzB,mCAAmC,GACpC,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,MAAM,MAAM,GAAG,gBAAgB,CAAC,2BAA2B,CAAC,CAAC;AAE7D;;GAEG;AACH,MAAM,OAAO,yBAAyB;IAOpC;;;;;;;;;OASG;IACH,YACE,QAAgB,EAChB,QAAgB,EAChB,YAAmC,EACnC,UAA4C,EAAE;QAE9C,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,0BAA0B,CAClC,8DAA8D,CAC/D,CAAC;QACJ,CAAC;QAED,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,0BAA0B,CAClC,8DAA8D,CAC/D,CAAC;QACJ,CAAC;QAED,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,MAAM,IAAI,0BAA0B,CAClC,qEAAqE,CACtE,CAAC;QACJ,CAAC;QACD,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,4BAA4B,GAAG,mCAAmC,CACrE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,0BAA0B,CACpC,CAAC;QAEF,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,UAAU,GAAG,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,kCAChD,OAAO,KACV,MAAM,EACN,sBAAsB,EAAE,IAAI,CAAC,OAAO,IACpC,CAAC;IACL,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,QAAQ,CAAC,MAAyB,EAAE,UAA2B,EAAE;QACrE,OAAO,aAAa,CAAC,QAAQ,CAC3B,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,WAAW,EACnC,OAAO,EACP,KAAK,EAAE,UAAU,EAAE,EAAE;YACnB,UAAU,CAAC,QAAQ,GAAG,yBAAyB,CAC7C,IAAI,CAAC,QAAQ,EACb,UAAU,EACV,IAAI,CAAC,4BAA4B,EACjC,MAAM,CACP,CAAC;YAEF,MAAM,WAAW,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;YAC9D,OAAO,IAAI,CAAC,UAAU,CAAC,yBAAyB,CAC9C,WAAW,EACX,IAAI,CAAC,YAAY,EACjB,UAAU,CACX,CAAC;QACJ,CAAC,CACF,CAAC;IACJ,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AccessToken, GetTokenOptions, TokenCredential } from \"@azure/core-auth\";\nimport type { MsalClient } from \"../msal/nodeFlows/msalClient.js\";\nimport { createMsalClient } from \"../msal/nodeFlows/msalClient.js\";\nimport {\n processMultiTenantRequest,\n resolveAdditionallyAllowedTenantIds,\n} from \"../util/tenantIdUtils.js\";\n\nimport type { ClientAssertionCredentialOptions } from \"./clientAssertionCredentialOptions.js\";\nimport { CredentialUnavailableError } from \"../errors.js\";\nimport { credentialLogger } from \"../util/logging.js\";\nimport { tracingClient } from \"../util/tracing.js\";\n\nconst logger = credentialLogger(\"ClientAssertionCredential\");\n\n/**\n * Authenticates a service principal with a JWT assertion.\n */\nexport class ClientAssertionCredential implements TokenCredential {\n private msalClient: MsalClient;\n private tenantId: string;\n private additionallyAllowedTenantIds: string[];\n private getAssertion: () => Promise<string>;\n private options: ClientAssertionCredentialOptions;\n\n /**\n * Creates an instance of the ClientAssertionCredential with the details\n * needed to authenticate against Microsoft Entra ID with a client\n * assertion provided by the developer through the `getAssertion` function parameter.\n *\n * @param tenantId - The Microsoft Entra tenant (directory) ID.\n * @param clientId - The client (application) ID of an App Registration in the tenant.\n * @param getAssertion - A function that retrieves the assertion for the credential to use.\n * @param options - Options for configuring the client which makes the authentication request.\n */\n constructor(\n tenantId: string,\n clientId: string,\n getAssertion: () => Promise<string>,\n options: ClientAssertionCredentialOptions = {},\n ) {\n if (!tenantId) {\n throw new CredentialUnavailableError(\n \"ClientAssertionCredential: tenantId is a required parameter.\",\n );\n }\n\n if (!clientId) {\n throw new CredentialUnavailableError(\n \"ClientAssertionCredential: clientId is a required parameter.\",\n );\n }\n\n if (!getAssertion) {\n throw new CredentialUnavailableError(\n \"ClientAssertionCredential: clientAssertion is a required parameter.\",\n );\n }\n this.tenantId = tenantId;\n this.additionallyAllowedTenantIds = resolveAdditionallyAllowedTenantIds(\n options?.additionallyAllowedTenants,\n );\n\n this.options = options;\n this.getAssertion = getAssertion;\n this.msalClient = createMsalClient(clientId, tenantId, {\n ...options,\n logger,\n tokenCredentialOptions: this.options,\n });\n }\n\n /**\n * Authenticates with Microsoft Entra ID and returns an access token if successful.\n * If authentication fails, a {@link CredentialUnavailableError} will be thrown with the details of the failure.\n *\n * @param scopes - The list of scopes for which the token will have access.\n * @param options - The options used to configure any requests this\n * TokenCredential implementation might make.\n */\n async getToken(scopes: string | string[], options: GetTokenOptions = {}): Promise<AccessToken> {\n return tracingClient.withSpan(\n `${this.constructor.name}.getToken`,\n options,\n async (newOptions) => {\n newOptions.tenantId = processMultiTenantRequest(\n this.tenantId,\n newOptions,\n this.additionallyAllowedTenantIds,\n logger,\n );\n\n const arrayScopes = Array.isArray(scopes) ? scopes : [scopes];\n return this.msalClient.getTokenByClientAssertion(\n arrayScopes,\n this.getAssertion,\n newOptions,\n );\n },\n );\n }\n}\n"]}
@@ -0,0 +1,9 @@
1
+ import type { AuthorityValidationOptions } from "./authorityValidationOptions.js";
2
+ import type { CredentialPersistenceOptions } from "./credentialPersistenceOptions.js";
3
+ import type { MultiTenantTokenCredentialOptions } from "./multiTenantTokenCredentialOptions.js";
4
+ /**
5
+ * Options for the {@link ClientAssertionCredential}
6
+ */
7
+ export interface ClientAssertionCredentialOptions extends MultiTenantTokenCredentialOptions, CredentialPersistenceOptions, AuthorityValidationOptions {
8
+ }
9
+ //# sourceMappingURL=clientAssertionCredentialOptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clientAssertionCredentialOptions.d.ts","sourceRoot":"","sources":["../../../src/credentials/clientAssertionCredentialOptions.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAClF,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AACtF,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,wCAAwC,CAAC;AAEhG;;GAEG;AACH,MAAM,WAAW,gCACf,SAAQ,iCAAiC,EACvC,4BAA4B,EAC5B,0BAA0B;CAAG"}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ export {};
4
+ //# sourceMappingURL=clientAssertionCredentialOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clientAssertionCredentialOptions.js","sourceRoot":"","sources":["../../../src/credentials/clientAssertionCredentialOptions.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AuthorityValidationOptions } from \"./authorityValidationOptions.js\";\nimport type { CredentialPersistenceOptions } from \"./credentialPersistenceOptions.js\";\nimport type { MultiTenantTokenCredentialOptions } from \"./multiTenantTokenCredentialOptions.js\";\n\n/**\n * Options for the {@link ClientAssertionCredential}\n */\nexport interface ClientAssertionCredentialOptions\n extends MultiTenantTokenCredentialOptions,\n CredentialPersistenceOptions,\n AuthorityValidationOptions {}\n"]}
@@ -0,0 +1,72 @@
1
+ import type { AccessToken, GetTokenOptions, TokenCredential } from "@azure/core-auth";
2
+ import type { CertificateParts } from "../msal/types.js";
3
+ import type { ClientCertificateCredentialOptions } from "./clientCertificateCredentialOptions.js";
4
+ import type { ClientCertificateCredentialPEMConfiguration, ClientCertificatePEMCertificate, ClientCertificatePEMCertificatePath } from "./clientCertificateCredentialModels.js";
5
+ /**
6
+ * Enables authentication to Microsoft Entra ID using a PEM-encoded
7
+ * certificate that is assigned to an App Registration. More information
8
+ * on how to configure certificate authentication can be found here:
9
+ *
10
+ * https://learn.microsoft.com/en-us/azure/active-directory/develop/active-directory-certificate-credentials#register-your-certificate-with-azure-ad
11
+ *
12
+ */
13
+ export declare class ClientCertificateCredential implements TokenCredential {
14
+ private tenantId;
15
+ private additionallyAllowedTenantIds;
16
+ private certificateConfiguration;
17
+ private sendCertificateChain?;
18
+ private msalClient;
19
+ /**
20
+ * Creates an instance of the ClientCertificateCredential with the details
21
+ * needed to authenticate against Microsoft Entra ID with a certificate.
22
+ *
23
+ * @param tenantId - The Microsoft Entra tenant (directory) ID.
24
+ * @param clientId - The client (application) ID of an App Registration in the tenant.
25
+ * @param certificatePath - The path to a PEM-encoded public/private key certificate on the filesystem.
26
+ * @param options - Options for configuring the client which makes the authentication request.
27
+ */
28
+ constructor(tenantId: string, clientId: string, certificatePath: string, options?: ClientCertificateCredentialOptions);
29
+ /**
30
+ * Creates an instance of the ClientCertificateCredential with the details
31
+ * needed to authenticate against Microsoft Entra ID with a certificate.
32
+ *
33
+ * @param tenantId - The Microsoft Entra tenant (directory) ID.
34
+ * @param clientId - The client (application) ID of an App Registration in the tenant.
35
+ * @param configuration - Other parameters required, including the path of the certificate on the filesystem.
36
+ * If the type is ignored, we will throw the value of the path to a PEM certificate.
37
+ * @param options - Options for configuring the client which makes the authentication request.
38
+ */
39
+ constructor(tenantId: string, clientId: string, configuration: ClientCertificatePEMCertificatePath, options?: ClientCertificateCredentialOptions);
40
+ /**
41
+ * Creates an instance of the ClientCertificateCredential with the details
42
+ * needed to authenticate against Microsoft Entra ID with a certificate.
43
+ *
44
+ * @param tenantId - The Microsoft Entra tenant (directory) ID.
45
+ * @param clientId - The client (application) ID of an App Registration in the tenant.
46
+ * @param configuration - Other parameters required, including the PEM-encoded certificate as a string.
47
+ * If the type is ignored, we will throw the value of the PEM-encoded certificate.
48
+ * @param options - Options for configuring the client which makes the authentication request.
49
+ */
50
+ constructor(tenantId: string, clientId: string, configuration: ClientCertificatePEMCertificate, options?: ClientCertificateCredentialOptions);
51
+ /**
52
+ * Authenticates with Microsoft Entra ID and returns an access token if successful.
53
+ * If authentication fails, a {@link CredentialUnavailableError} will be thrown with the details of the failure.
54
+ *
55
+ * @param scopes - The list of scopes for which the token will have access.
56
+ * @param options - The options used to configure any requests this
57
+ * TokenCredential implementation might make.
58
+ */
59
+ getToken(scopes: string | string[], options?: GetTokenOptions): Promise<AccessToken>;
60
+ private buildClientCertificate;
61
+ }
62
+ /**
63
+ * Parses a certificate into its relevant parts
64
+ *
65
+ * @param certificateConfiguration - The certificate contents or path to the certificate
66
+ * @param sendCertificateChain - true if the entire certificate chain should be sent for SNI, false otherwise
67
+ * @returns The parsed certificate parts and the certificate contents
68
+ */
69
+ export declare function parseCertificate(certificateConfiguration: ClientCertificateCredentialPEMConfiguration, sendCertificateChain: boolean): Promise<Omit<CertificateParts, "privateKey"> & {
70
+ certificateContents: string;
71
+ }>;
72
+ //# sourceMappingURL=clientCertificateCredential.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clientCertificateCredential.d.ts","sourceRoot":"","sources":["../../../src/credentials/clientCertificateCredential.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAStF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,yCAAyC,CAAC;AAIlG,OAAO,KAAK,EACV,2CAA2C,EAC3C,+BAA+B,EAC/B,mCAAmC,EACpC,MAAM,wCAAwC,CAAC;AAKhD;;;;;;;GAOG;AACH,qBAAa,2BAA4B,YAAW,eAAe;IACjE,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,4BAA4B,CAAW;IAC/C,OAAO,CAAC,wBAAwB,CAA8C;IAC9E,OAAO,CAAC,oBAAoB,CAAC,CAAU;IACvC,OAAO,CAAC,UAAU,CAAa;IAE/B;;;;;;;;OAQG;gBAED,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,eAAe,EAAE,MAAM,EACvB,OAAO,CAAC,EAAE,kCAAkC;IAE9C;;;;;;;;;OASG;gBAED,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,mCAAmC,EAClD,OAAO,CAAC,EAAE,kCAAkC;IAE9C;;;;;;;;;OASG;gBAED,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,+BAA+B,EAC9C,OAAO,CAAC,EAAE,kCAAkC;IA+C9C;;;;;;;OAOG;IACG,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,OAAO,GAAE,eAAoB,GAAG,OAAO,CAAC,WAAW,CAAC;YAehF,sBAAsB;CA4BrC;AAED;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CACpC,wBAAwB,EAAE,2CAA2C,EACrE,oBAAoB,EAAE,OAAO,GAC5B,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,YAAY,CAAC,GAAG;IAAE,mBAAmB,EAAE,MAAM,CAAA;CAAE,CAAC,CAkCjF"}
@@ -0,0 +1,122 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ import { createMsalClient } from "../msal/nodeFlows/msalClient.js";
4
+ import { createHash, createPrivateKey } from "node:crypto";
5
+ import { processMultiTenantRequest, resolveAdditionallyAllowedTenantIds, } from "../util/tenantIdUtils.js";
6
+ import { credentialLogger } from "../util/logging.js";
7
+ import { readFile } from "node:fs/promises";
8
+ import { tracingClient } from "../util/tracing.js";
9
+ const credentialName = "ClientCertificateCredential";
10
+ const logger = credentialLogger(credentialName);
11
+ /**
12
+ * Enables authentication to Microsoft Entra ID using a PEM-encoded
13
+ * certificate that is assigned to an App Registration. More information
14
+ * on how to configure certificate authentication can be found here:
15
+ *
16
+ * https://learn.microsoft.com/en-us/azure/active-directory/develop/active-directory-certificate-credentials#register-your-certificate-with-azure-ad
17
+ *
18
+ */
19
+ export class ClientCertificateCredential {
20
+ constructor(tenantId, clientId, certificatePathOrConfiguration, options = {}) {
21
+ if (!tenantId || !clientId) {
22
+ throw new Error(`${credentialName}: tenantId and clientId are required parameters.`);
23
+ }
24
+ this.tenantId = tenantId;
25
+ this.additionallyAllowedTenantIds = resolveAdditionallyAllowedTenantIds(options === null || options === void 0 ? void 0 : options.additionallyAllowedTenants);
26
+ this.sendCertificateChain = options.sendCertificateChain;
27
+ this.certificateConfiguration = Object.assign({}, (typeof certificatePathOrConfiguration === "string"
28
+ ? {
29
+ certificatePath: certificatePathOrConfiguration,
30
+ }
31
+ : certificatePathOrConfiguration));
32
+ const certificate = this.certificateConfiguration
33
+ .certificate;
34
+ const certificatePath = this.certificateConfiguration
35
+ .certificatePath;
36
+ if (!this.certificateConfiguration || !(certificate || certificatePath)) {
37
+ throw new Error(`${credentialName}: Provide either a PEM certificate in string form, or the path to that certificate in the filesystem. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.`);
38
+ }
39
+ if (certificate && certificatePath) {
40
+ throw new Error(`${credentialName}: To avoid unexpected behaviors, providing both the contents of a PEM certificate and the path to a PEM certificate is forbidden. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.`);
41
+ }
42
+ this.msalClient = createMsalClient(clientId, tenantId, Object.assign(Object.assign({}, options), { logger, tokenCredentialOptions: options }));
43
+ }
44
+ /**
45
+ * Authenticates with Microsoft Entra ID and returns an access token if successful.
46
+ * If authentication fails, a {@link CredentialUnavailableError} will be thrown with the details of the failure.
47
+ *
48
+ * @param scopes - The list of scopes for which the token will have access.
49
+ * @param options - The options used to configure any requests this
50
+ * TokenCredential implementation might make.
51
+ */
52
+ async getToken(scopes, options = {}) {
53
+ return tracingClient.withSpan(`${credentialName}.getToken`, options, async (newOptions) => {
54
+ newOptions.tenantId = processMultiTenantRequest(this.tenantId, newOptions, this.additionallyAllowedTenantIds, logger);
55
+ const arrayScopes = Array.isArray(scopes) ? scopes : [scopes];
56
+ const certificate = await this.buildClientCertificate();
57
+ return this.msalClient.getTokenByClientCertificate(arrayScopes, certificate, newOptions);
58
+ });
59
+ }
60
+ async buildClientCertificate() {
61
+ var _a;
62
+ const parts = await parseCertificate(this.certificateConfiguration, (_a = this.sendCertificateChain) !== null && _a !== void 0 ? _a : false);
63
+ let privateKey;
64
+ if (this.certificateConfiguration.certificatePassword !== undefined) {
65
+ privateKey = createPrivateKey({
66
+ key: parts.certificateContents,
67
+ passphrase: this.certificateConfiguration.certificatePassword,
68
+ format: "pem",
69
+ })
70
+ .export({
71
+ format: "pem",
72
+ type: "pkcs8",
73
+ })
74
+ .toString();
75
+ }
76
+ else {
77
+ privateKey = parts.certificateContents;
78
+ }
79
+ return {
80
+ thumbprint: parts.thumbprint,
81
+ privateKey,
82
+ x5c: parts.x5c,
83
+ };
84
+ }
85
+ }
86
+ /**
87
+ * Parses a certificate into its relevant parts
88
+ *
89
+ * @param certificateConfiguration - The certificate contents or path to the certificate
90
+ * @param sendCertificateChain - true if the entire certificate chain should be sent for SNI, false otherwise
91
+ * @returns The parsed certificate parts and the certificate contents
92
+ */
93
+ export async function parseCertificate(certificateConfiguration, sendCertificateChain) {
94
+ const certificate = certificateConfiguration.certificate;
95
+ const certificatePath = certificateConfiguration
96
+ .certificatePath;
97
+ const certificateContents = certificate || (await readFile(certificatePath, "utf8"));
98
+ const x5c = sendCertificateChain ? certificateContents : undefined;
99
+ const certificatePattern = /(-+BEGIN CERTIFICATE-+)(\n\r?|\r\n?)([A-Za-z0-9+/\n\r]+=*)(\n\r?|\r\n?)(-+END CERTIFICATE-+)/g;
100
+ const publicKeys = [];
101
+ // Match all possible certificates, in the order they are in the file. These will form the chain that is used for x5c
102
+ let match;
103
+ do {
104
+ match = certificatePattern.exec(certificateContents);
105
+ if (match) {
106
+ publicKeys.push(match[3]);
107
+ }
108
+ } while (match);
109
+ if (publicKeys.length === 0) {
110
+ throw new Error("The file at the specified path does not contain a PEM-encoded certificate.");
111
+ }
112
+ const thumbprint = createHash("sha1")
113
+ .update(Buffer.from(publicKeys[0], "base64"))
114
+ .digest("hex")
115
+ .toUpperCase();
116
+ return {
117
+ certificateContents,
118
+ thumbprint,
119
+ x5c,
120
+ };
121
+ }
122
+ //# sourceMappingURL=clientCertificateCredential.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clientCertificateCredential.js","sourceRoot":"","sources":["../../../src/credentials/clientCertificateCredential.ts"],"names":[],"mappings":"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","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AccessToken, GetTokenOptions, TokenCredential } from \"@azure/core-auth\";\nimport type { MsalClient } from \"../msal/nodeFlows/msalClient.js\";\nimport { createMsalClient } from \"../msal/nodeFlows/msalClient.js\";\nimport { createHash, createPrivateKey } from \"node:crypto\";\nimport {\n processMultiTenantRequest,\n resolveAdditionallyAllowedTenantIds,\n} from \"../util/tenantIdUtils.js\";\n\nimport type { CertificateParts } from \"../msal/types.js\";\nimport type { ClientCertificateCredentialOptions } from \"./clientCertificateCredentialOptions.js\";\nimport { credentialLogger } from \"../util/logging.js\";\nimport { readFile } from \"node:fs/promises\";\nimport { tracingClient } from \"../util/tracing.js\";\nimport type {\n ClientCertificateCredentialPEMConfiguration,\n ClientCertificatePEMCertificate,\n ClientCertificatePEMCertificatePath,\n} from \"./clientCertificateCredentialModels.js\";\n\nconst credentialName = \"ClientCertificateCredential\";\nconst logger = credentialLogger(credentialName);\n\n/**\n * Enables authentication to Microsoft Entra ID using a PEM-encoded\n * certificate that is assigned to an App Registration. More information\n * on how to configure certificate authentication can be found here:\n *\n * https://learn.microsoft.com/en-us/azure/active-directory/develop/active-directory-certificate-credentials#register-your-certificate-with-azure-ad\n *\n */\nexport class ClientCertificateCredential implements TokenCredential {\n private tenantId: string;\n private additionallyAllowedTenantIds: string[];\n private certificateConfiguration: ClientCertificateCredentialPEMConfiguration;\n private sendCertificateChain?: boolean;\n private msalClient: MsalClient;\n\n /**\n * Creates an instance of the ClientCertificateCredential with the details\n * needed to authenticate against Microsoft Entra ID with a certificate.\n *\n * @param tenantId - The Microsoft Entra tenant (directory) ID.\n * @param clientId - The client (application) ID of an App Registration in the tenant.\n * @param certificatePath - The path to a PEM-encoded public/private key certificate on the filesystem.\n * @param options - Options for configuring the client which makes the authentication request.\n */\n constructor(\n tenantId: string,\n clientId: string,\n certificatePath: string,\n options?: ClientCertificateCredentialOptions,\n );\n /**\n * Creates an instance of the ClientCertificateCredential with the details\n * needed to authenticate against Microsoft Entra ID with a certificate.\n *\n * @param tenantId - The Microsoft Entra tenant (directory) ID.\n * @param clientId - The client (application) ID of an App Registration in the tenant.\n * @param configuration - Other parameters required, including the path of the certificate on the filesystem.\n * If the type is ignored, we will throw the value of the path to a PEM certificate.\n * @param options - Options for configuring the client which makes the authentication request.\n */\n constructor(\n tenantId: string,\n clientId: string,\n configuration: ClientCertificatePEMCertificatePath,\n options?: ClientCertificateCredentialOptions,\n );\n /**\n * Creates an instance of the ClientCertificateCredential with the details\n * needed to authenticate against Microsoft Entra ID with a certificate.\n *\n * @param tenantId - The Microsoft Entra tenant (directory) ID.\n * @param clientId - The client (application) ID of an App Registration in the tenant.\n * @param configuration - Other parameters required, including the PEM-encoded certificate as a string.\n * If the type is ignored, we will throw the value of the PEM-encoded certificate.\n * @param options - Options for configuring the client which makes the authentication request.\n */\n constructor(\n tenantId: string,\n clientId: string,\n configuration: ClientCertificatePEMCertificate,\n options?: ClientCertificateCredentialOptions,\n );\n constructor(\n tenantId: string,\n clientId: string,\n certificatePathOrConfiguration: string | ClientCertificateCredentialPEMConfiguration,\n options: ClientCertificateCredentialOptions = {},\n ) {\n if (!tenantId || !clientId) {\n throw new Error(`${credentialName}: tenantId and clientId are required parameters.`);\n }\n\n this.tenantId = tenantId;\n this.additionallyAllowedTenantIds = resolveAdditionallyAllowedTenantIds(\n options?.additionallyAllowedTenants,\n );\n\n this.sendCertificateChain = options.sendCertificateChain;\n\n this.certificateConfiguration = {\n ...(typeof certificatePathOrConfiguration === \"string\"\n ? {\n certificatePath: certificatePathOrConfiguration,\n }\n : certificatePathOrConfiguration),\n };\n const certificate = (this.certificateConfiguration as ClientCertificatePEMCertificate)\n .certificate;\n const certificatePath = (this.certificateConfiguration as ClientCertificatePEMCertificatePath)\n .certificatePath;\n if (!this.certificateConfiguration || !(certificate || certificatePath)) {\n throw new Error(\n `${credentialName}: Provide either a PEM certificate in string form, or the path to that certificate in the filesystem. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.`,\n );\n }\n if (certificate && certificatePath) {\n throw new Error(\n `${credentialName}: To avoid unexpected behaviors, providing both the contents of a PEM certificate and the path to a PEM certificate is forbidden. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.`,\n );\n }\n this.msalClient = createMsalClient(clientId, tenantId, {\n ...options,\n logger,\n tokenCredentialOptions: options,\n });\n }\n\n /**\n * Authenticates with Microsoft Entra ID and returns an access token if successful.\n * If authentication fails, a {@link CredentialUnavailableError} will be thrown with the details of the failure.\n *\n * @param scopes - The list of scopes for which the token will have access.\n * @param options - The options used to configure any requests this\n * TokenCredential implementation might make.\n */\n async getToken(scopes: string | string[], options: GetTokenOptions = {}): Promise<AccessToken> {\n return tracingClient.withSpan(`${credentialName}.getToken`, options, async (newOptions) => {\n newOptions.tenantId = processMultiTenantRequest(\n this.tenantId,\n newOptions,\n this.additionallyAllowedTenantIds,\n logger,\n );\n\n const arrayScopes = Array.isArray(scopes) ? scopes : [scopes];\n const certificate = await this.buildClientCertificate();\n return this.msalClient.getTokenByClientCertificate(arrayScopes, certificate, newOptions);\n });\n }\n\n private async buildClientCertificate(): Promise<CertificateParts> {\n const parts = await parseCertificate(\n this.certificateConfiguration,\n this.sendCertificateChain ?? false,\n );\n\n let privateKey: string;\n if (this.certificateConfiguration.certificatePassword !== undefined) {\n privateKey = createPrivateKey({\n key: parts.certificateContents,\n passphrase: this.certificateConfiguration.certificatePassword,\n format: \"pem\",\n })\n .export({\n format: \"pem\",\n type: \"pkcs8\",\n })\n .toString();\n } else {\n privateKey = parts.certificateContents;\n }\n\n return {\n thumbprint: parts.thumbprint,\n privateKey,\n x5c: parts.x5c,\n };\n }\n}\n\n/**\n * Parses a certificate into its relevant parts\n *\n * @param certificateConfiguration - The certificate contents or path to the certificate\n * @param sendCertificateChain - true if the entire certificate chain should be sent for SNI, false otherwise\n * @returns The parsed certificate parts and the certificate contents\n */\nexport async function parseCertificate(\n certificateConfiguration: ClientCertificateCredentialPEMConfiguration,\n sendCertificateChain: boolean,\n): Promise<Omit<CertificateParts, \"privateKey\"> & { certificateContents: string }> {\n const certificate = (certificateConfiguration as ClientCertificatePEMCertificate).certificate;\n const certificatePath = (certificateConfiguration as ClientCertificatePEMCertificatePath)\n .certificatePath;\n const certificateContents = certificate || (await readFile(certificatePath!, \"utf8\"));\n const x5c = sendCertificateChain ? certificateContents : undefined;\n\n const certificatePattern =\n /(-+BEGIN CERTIFICATE-+)(\\n\\r?|\\r\\n?)([A-Za-z0-9+/\\n\\r]+=*)(\\n\\r?|\\r\\n?)(-+END CERTIFICATE-+)/g;\n const publicKeys: string[] = [];\n\n // Match all possible certificates, in the order they are in the file. These will form the chain that is used for x5c\n let match;\n do {\n match = certificatePattern.exec(certificateContents);\n if (match) {\n publicKeys.push(match[3]);\n }\n } while (match);\n\n if (publicKeys.length === 0) {\n throw new Error(\"The file at the specified path does not contain a PEM-encoded certificate.\");\n }\n\n const thumbprint = createHash(\"sha1\")\n .update(Buffer.from(publicKeys[0], \"base64\"))\n .digest(\"hex\")\n .toUpperCase();\n\n return {\n certificateContents,\n thumbprint,\n x5c,\n };\n}\n"]}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Required configuration options for the {@link ClientCertificateCredential}, with the string contents of a PEM certificate
3
+ */
4
+ export interface ClientCertificatePEMCertificate {
5
+ /**
6
+ * The PEM-encoded public/private key certificate on the filesystem.
7
+ */
8
+ certificate: string;
9
+ /**
10
+ * The password for the certificate file.
11
+ */
12
+ certificatePassword?: string;
13
+ }
14
+ /**
15
+ * Required configuration options for the {@link ClientCertificateCredential}, with the path to a PEM certificate.
16
+ */
17
+ export interface ClientCertificatePEMCertificatePath {
18
+ /**
19
+ * The path to the PEM-encoded public/private key certificate on the filesystem.
20
+ */
21
+ certificatePath: string;
22
+ /**
23
+ * The password for the certificate file.
24
+ */
25
+ certificatePassword?: string;
26
+ }
27
+ /**
28
+ * Required configuration options for the {@link ClientCertificateCredential}, with either the string contents of a PEM certificate, or the path to a PEM certificate.
29
+ */
30
+ export type ClientCertificateCredentialPEMConfiguration = ClientCertificatePEMCertificate | ClientCertificatePEMCertificatePath;
31
+ //# sourceMappingURL=clientCertificateCredentialModels.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clientCertificateCredentialModels.d.ts","sourceRoot":"","sources":["../../../src/credentials/clientCertificateCredentialModels.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,WAAW,+BAA+B;IAC9C;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AACD;;GAEG;AACH,MAAM,WAAW,mCAAmC;IAClD;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AACD;;GAEG;AACH,MAAM,MAAM,2CAA2C,GACnD,+BAA+B,GAC/B,mCAAmC,CAAC"}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ export {};
4
+ //# sourceMappingURL=clientCertificateCredentialModels.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clientCertificateCredentialModels.js","sourceRoot":"","sources":["../../../src/credentials/clientCertificateCredentialModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Required configuration options for the {@link ClientCertificateCredential}, with the string contents of a PEM certificate\n */\nexport interface ClientCertificatePEMCertificate {\n /**\n * The PEM-encoded public/private key certificate on the filesystem.\n */\n certificate: string;\n\n /**\n * The password for the certificate file.\n */\n certificatePassword?: string;\n}\n/**\n * Required configuration options for the {@link ClientCertificateCredential}, with the path to a PEM certificate.\n */\nexport interface ClientCertificatePEMCertificatePath {\n /**\n * The path to the PEM-encoded public/private key certificate on the filesystem.\n */\n certificatePath: string;\n\n /**\n * The password for the certificate file.\n */\n certificatePassword?: string;\n}\n/**\n * Required configuration options for the {@link ClientCertificateCredential}, with either the string contents of a PEM certificate, or the path to a PEM certificate.\n */\nexport type ClientCertificateCredentialPEMConfiguration =\n | ClientCertificatePEMCertificate\n | ClientCertificatePEMCertificatePath;\n"]}
@@ -0,0 +1,14 @@
1
+ import type { AuthorityValidationOptions } from "./authorityValidationOptions.js";
2
+ import type { CredentialPersistenceOptions } from "./credentialPersistenceOptions.js";
3
+ import type { MultiTenantTokenCredentialOptions } from "./multiTenantTokenCredentialOptions.js";
4
+ /**
5
+ * Optional parameters for the {@link ClientCertificateCredential} class.
6
+ */
7
+ export interface ClientCertificateCredentialOptions extends MultiTenantTokenCredentialOptions, CredentialPersistenceOptions, AuthorityValidationOptions {
8
+ /**
9
+ * Option to include x5c header for SubjectName and Issuer name authorization.
10
+ * Set this option to send base64 encoded public certificate in the client assertion header as an x5c claim
11
+ */
12
+ sendCertificateChain?: boolean;
13
+ }
14
+ //# sourceMappingURL=clientCertificateCredentialOptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clientCertificateCredentialOptions.d.ts","sourceRoot":"","sources":["../../../src/credentials/clientCertificateCredentialOptions.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAClF,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AACtF,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,wCAAwC,CAAC;AAEhG;;GAEG;AACH,MAAM,WAAW,kCACf,SAAQ,iCAAiC,EACvC,4BAA4B,EAC5B,0BAA0B;IAC5B;;;OAGG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAQhC"}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ export {};
4
+ //# sourceMappingURL=clientCertificateCredentialOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clientCertificateCredentialOptions.js","sourceRoot":"","sources":["../../../src/credentials/clientCertificateCredentialOptions.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AuthorityValidationOptions } from \"./authorityValidationOptions.js\";\nimport type { CredentialPersistenceOptions } from \"./credentialPersistenceOptions.js\";\nimport type { MultiTenantTokenCredentialOptions } from \"./multiTenantTokenCredentialOptions.js\";\n\n/**\n * Optional parameters for the {@link ClientCertificateCredential} class.\n */\nexport interface ClientCertificateCredentialOptions\n extends MultiTenantTokenCredentialOptions,\n CredentialPersistenceOptions,\n AuthorityValidationOptions {\n /**\n * Option to include x5c header for SubjectName and Issuer name authorization.\n * Set this option to send base64 encoded public certificate in the client assertion header as an x5c claim\n */\n sendCertificateChain?: boolean;\n // TODO: Export again once we're ready to release this feature.\n // /**\n // * Specifies a regional authority. Please refer to the {@link RegionalAuthority} type for the accepted values.\n // * If {@link RegionalAuthority.AutoDiscoverRegion} is specified, we will try to discover the regional authority endpoint.\n // * If the property is not specified, the credential uses the global authority endpoint.\n // */\n // regionalAuthority?: string;\n}\n"]}
@@ -0,0 +1,37 @@
1
+ import type { AccessToken, GetTokenOptions, TokenCredential } from "@azure/core-auth";
2
+ import type { ClientSecretCredentialOptions } from "./clientSecretCredentialOptions.js";
3
+ /**
4
+ * Enables authentication to Microsoft Entra ID using a client secret
5
+ * that was generated for an App Registration. More information on how
6
+ * to configure a client secret can be found here:
7
+ *
8
+ * https://learn.microsoft.com/entra/identity-platform/quickstart-configure-app-access-web-apis#add-credentials-to-your-web-application
9
+ *
10
+ */
11
+ export declare class ClientSecretCredential implements TokenCredential {
12
+ private tenantId;
13
+ private additionallyAllowedTenantIds;
14
+ private msalClient;
15
+ private clientSecret;
16
+ /**
17
+ * Creates an instance of the ClientSecretCredential with the details
18
+ * needed to authenticate against Microsoft Entra ID with a client
19
+ * secret.
20
+ *
21
+ * @param tenantId - The Microsoft Entra tenant (directory) ID.
22
+ * @param clientId - The client (application) ID of an App Registration in the tenant.
23
+ * @param clientSecret - A client secret that was generated for the App Registration.
24
+ * @param options - Options for configuring the client which makes the authentication request.
25
+ */
26
+ constructor(tenantId: string, clientId: string, clientSecret: string, options?: ClientSecretCredentialOptions);
27
+ /**
28
+ * Authenticates with Microsoft Entra ID and returns an access token if successful.
29
+ * If authentication fails, a {@link CredentialUnavailableError} will be thrown with the details of the failure.
30
+ *
31
+ * @param scopes - The list of scopes for which the token will have access.
32
+ * @param options - The options used to configure any requests this
33
+ * TokenCredential implementation might make.
34
+ */
35
+ getToken(scopes: string | string[], options?: GetTokenOptions): Promise<AccessToken>;
36
+ }
37
+ //# sourceMappingURL=clientSecretCredential.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clientSecretCredential.d.ts","sourceRoot":"","sources":["../../../src/credentials/clientSecretCredential.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAQtF,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AAQxF;;;;;;;GAOG;AACH,qBAAa,sBAAuB,YAAW,eAAe;IAC5D,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,4BAA4B,CAAW;IAC/C,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,YAAY,CAAS;IAE7B;;;;;;;;;OASG;gBAED,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,EACpB,OAAO,GAAE,6BAAkC;IAiC7C;;;;;;;OAOG;IACG,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,OAAO,GAAE,eAAoB,GAAG,OAAO,CAAC,WAAW,CAAC;CAiB/F"}
@@ -0,0 +1,60 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ import { createMsalClient } from "../msal/nodeFlows/msalClient.js";
4
+ import { processMultiTenantRequest, resolveAdditionallyAllowedTenantIds, } from "../util/tenantIdUtils.js";
5
+ import { CredentialUnavailableError } from "../errors.js";
6
+ import { credentialLogger } from "../util/logging.js";
7
+ import { ensureScopes } from "../util/scopeUtils.js";
8
+ import { tracingClient } from "../util/tracing.js";
9
+ const logger = credentialLogger("ClientSecretCredential");
10
+ /**
11
+ * Enables authentication to Microsoft Entra ID using a client secret
12
+ * that was generated for an App Registration. More information on how
13
+ * to configure a client secret can be found here:
14
+ *
15
+ * https://learn.microsoft.com/entra/identity-platform/quickstart-configure-app-access-web-apis#add-credentials-to-your-web-application
16
+ *
17
+ */
18
+ export class ClientSecretCredential {
19
+ /**
20
+ * Creates an instance of the ClientSecretCredential with the details
21
+ * needed to authenticate against Microsoft Entra ID with a client
22
+ * secret.
23
+ *
24
+ * @param tenantId - The Microsoft Entra tenant (directory) ID.
25
+ * @param clientId - The client (application) ID of an App Registration in the tenant.
26
+ * @param clientSecret - A client secret that was generated for the App Registration.
27
+ * @param options - Options for configuring the client which makes the authentication request.
28
+ */
29
+ constructor(tenantId, clientId, clientSecret, options = {}) {
30
+ if (!tenantId) {
31
+ throw new CredentialUnavailableError("ClientSecretCredential: tenantId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.");
32
+ }
33
+ if (!clientId) {
34
+ throw new CredentialUnavailableError("ClientSecretCredential: clientId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.");
35
+ }
36
+ if (!clientSecret) {
37
+ throw new CredentialUnavailableError("ClientSecretCredential: clientSecret is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.");
38
+ }
39
+ this.clientSecret = clientSecret;
40
+ this.tenantId = tenantId;
41
+ this.additionallyAllowedTenantIds = resolveAdditionallyAllowedTenantIds(options === null || options === void 0 ? void 0 : options.additionallyAllowedTenants);
42
+ this.msalClient = createMsalClient(clientId, tenantId, Object.assign(Object.assign({}, options), { logger, tokenCredentialOptions: options }));
43
+ }
44
+ /**
45
+ * Authenticates with Microsoft Entra ID and returns an access token if successful.
46
+ * If authentication fails, a {@link CredentialUnavailableError} will be thrown with the details of the failure.
47
+ *
48
+ * @param scopes - The list of scopes for which the token will have access.
49
+ * @param options - The options used to configure any requests this
50
+ * TokenCredential implementation might make.
51
+ */
52
+ async getToken(scopes, options = {}) {
53
+ return tracingClient.withSpan(`${this.constructor.name}.getToken`, options, async (newOptions) => {
54
+ newOptions.tenantId = processMultiTenantRequest(this.tenantId, newOptions, this.additionallyAllowedTenantIds, logger);
55
+ const arrayScopes = ensureScopes(scopes);
56
+ return this.msalClient.getTokenByClientSecret(arrayScopes, this.clientSecret, newOptions);
57
+ });
58
+ }
59
+ }
60
+ //# sourceMappingURL=clientSecretCredential.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clientSecretCredential.js","sourceRoot":"","sources":["../../../src/credentials/clientSecretCredential.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EACL,yBAAyB,EACzB,mCAAmC,GACpC,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,MAAM,MAAM,GAAG,gBAAgB,CAAC,wBAAwB,CAAC,CAAC;AAE1D;;;;;;;GAOG;AACH,MAAM,OAAO,sBAAsB;IAMjC;;;;;;;;;OASG;IACH,YACE,QAAgB,EAChB,QAAgB,EAChB,YAAoB,EACpB,UAAyC,EAAE;QAE3C,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,0BAA0B,CAClC,gKAAgK,CACjK,CAAC;QACJ,CAAC;QAED,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,0BAA0B,CAClC,gKAAgK,CACjK,CAAC;QACJ,CAAC;QAED,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,MAAM,IAAI,0BAA0B,CAClC,oKAAoK,CACrK,CAAC;QACJ,CAAC;QAED,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,4BAA4B,GAAG,mCAAmC,CACrE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,0BAA0B,CACpC,CAAC;QAEF,IAAI,CAAC,UAAU,GAAG,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,kCAChD,OAAO,KACV,MAAM,EACN,sBAAsB,EAAE,OAAO,IAC/B,CAAC;IACL,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,QAAQ,CAAC,MAAyB,EAAE,UAA2B,EAAE;QACrE,OAAO,aAAa,CAAC,QAAQ,CAC3B,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,WAAW,EACnC,OAAO,EACP,KAAK,EAAE,UAAU,EAAE,EAAE;YACnB,UAAU,CAAC,QAAQ,GAAG,yBAAyB,CAC7C,IAAI,CAAC,QAAQ,EACb,UAAU,EACV,IAAI,CAAC,4BAA4B,EACjC,MAAM,CACP,CAAC;YAEF,MAAM,WAAW,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;YACzC,OAAO,IAAI,CAAC,UAAU,CAAC,sBAAsB,CAAC,WAAW,EAAE,IAAI,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;QAC5F,CAAC,CACF,CAAC;IACJ,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AccessToken, GetTokenOptions, TokenCredential } from \"@azure/core-auth\";\nimport type { MsalClient } from \"../msal/nodeFlows/msalClient.js\";\nimport { createMsalClient } from \"../msal/nodeFlows/msalClient.js\";\nimport {\n processMultiTenantRequest,\n resolveAdditionallyAllowedTenantIds,\n} from \"../util/tenantIdUtils.js\";\n\nimport type { ClientSecretCredentialOptions } from \"./clientSecretCredentialOptions.js\";\nimport { CredentialUnavailableError } from \"../errors.js\";\nimport { credentialLogger } from \"../util/logging.js\";\nimport { ensureScopes } from \"../util/scopeUtils.js\";\nimport { tracingClient } from \"../util/tracing.js\";\n\nconst logger = credentialLogger(\"ClientSecretCredential\");\n\n/**\n * Enables authentication to Microsoft Entra ID using a client secret\n * that was generated for an App Registration. More information on how\n * to configure a client secret can be found here:\n *\n * https://learn.microsoft.com/entra/identity-platform/quickstart-configure-app-access-web-apis#add-credentials-to-your-web-application\n *\n */\nexport class ClientSecretCredential implements TokenCredential {\n private tenantId: string;\n private additionallyAllowedTenantIds: string[];\n private msalClient: MsalClient;\n private clientSecret: string;\n\n /**\n * Creates an instance of the ClientSecretCredential with the details\n * needed to authenticate against Microsoft Entra ID with a client\n * secret.\n *\n * @param tenantId - The Microsoft Entra tenant (directory) ID.\n * @param clientId - The client (application) ID of an App Registration in the tenant.\n * @param clientSecret - A client secret that was generated for the App Registration.\n * @param options - Options for configuring the client which makes the authentication request.\n */\n constructor(\n tenantId: string,\n clientId: string,\n clientSecret: string,\n options: ClientSecretCredentialOptions = {},\n ) {\n if (!tenantId) {\n throw new CredentialUnavailableError(\n \"ClientSecretCredential: tenantId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.\",\n );\n }\n\n if (!clientId) {\n throw new CredentialUnavailableError(\n \"ClientSecretCredential: clientId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.\",\n );\n }\n\n if (!clientSecret) {\n throw new CredentialUnavailableError(\n \"ClientSecretCredential: clientSecret is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.\",\n );\n }\n\n this.clientSecret = clientSecret;\n this.tenantId = tenantId;\n this.additionallyAllowedTenantIds = resolveAdditionallyAllowedTenantIds(\n options?.additionallyAllowedTenants,\n );\n\n this.msalClient = createMsalClient(clientId, tenantId, {\n ...options,\n logger,\n tokenCredentialOptions: options,\n });\n }\n\n /**\n * Authenticates with Microsoft Entra ID and returns an access token if successful.\n * If authentication fails, a {@link CredentialUnavailableError} will be thrown with the details of the failure.\n *\n * @param scopes - The list of scopes for which the token will have access.\n * @param options - The options used to configure any requests this\n * TokenCredential implementation might make.\n */\n async getToken(scopes: string | string[], options: GetTokenOptions = {}): Promise<AccessToken> {\n return tracingClient.withSpan(\n `${this.constructor.name}.getToken`,\n options,\n async (newOptions) => {\n newOptions.tenantId = processMultiTenantRequest(\n this.tenantId,\n newOptions,\n this.additionallyAllowedTenantIds,\n logger,\n );\n\n const arrayScopes = ensureScopes(scopes);\n return this.msalClient.getTokenByClientSecret(arrayScopes, this.clientSecret, newOptions);\n },\n );\n }\n}\n"]}
@@ -0,0 +1,9 @@
1
+ import type { AuthorityValidationOptions } from "./authorityValidationOptions.js";
2
+ import type { CredentialPersistenceOptions } from "./credentialPersistenceOptions.js";
3
+ import type { MultiTenantTokenCredentialOptions } from "./multiTenantTokenCredentialOptions.js";
4
+ /**
5
+ * Optional parameters for the {@link ClientSecretCredential} class.
6
+ */
7
+ export interface ClientSecretCredentialOptions extends MultiTenantTokenCredentialOptions, CredentialPersistenceOptions, AuthorityValidationOptions {
8
+ }
9
+ //# sourceMappingURL=clientSecretCredentialOptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clientSecretCredentialOptions.d.ts","sourceRoot":"","sources":["../../../src/credentials/clientSecretCredentialOptions.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAClF,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AACtF,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,wCAAwC,CAAC;AAEhG;;GAEG;AACH,MAAM,WAAW,6BACf,SAAQ,iCAAiC,EACvC,4BAA4B,EAC5B,0BAA0B;CAQ7B"}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ export {};
4
+ //# sourceMappingURL=clientSecretCredentialOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clientSecretCredentialOptions.js","sourceRoot":"","sources":["../../../src/credentials/clientSecretCredentialOptions.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AuthorityValidationOptions } from \"./authorityValidationOptions.js\";\nimport type { CredentialPersistenceOptions } from \"./credentialPersistenceOptions.js\";\nimport type { MultiTenantTokenCredentialOptions } from \"./multiTenantTokenCredentialOptions.js\";\n\n/**\n * Optional parameters for the {@link ClientSecretCredential} class.\n */\nexport interface ClientSecretCredentialOptions\n extends MultiTenantTokenCredentialOptions,\n CredentialPersistenceOptions,\n AuthorityValidationOptions {\n // TODO: Export again once we're ready to release this feature.\n // /**\n // * Specifies a regional authority. Please refer to the {@link RegionalAuthority} type for the accepted values.\n // * If {@link RegionalAuthority.AutoDiscoverRegion} is specified, we will try to discover the regional authority endpoint.\n // * If the property is not specified, the credential uses the global authority endpoint.\n // */\n // regionalAuthority?: string;\n}\n"]}
@@ -0,0 +1,30 @@
1
+ import type { TokenCachePersistenceOptions } from "../msal/nodeFlows/tokenCachePersistenceOptions.js";
2
+ /**
3
+ * Shared configuration options for credentials that support persistent token
4
+ * caching.
5
+ */
6
+ export interface CredentialPersistenceOptions {
7
+ /**
8
+ * Options to provide to the persistence layer (if one is available) when
9
+ * storing credentials.
10
+ *
11
+ * You must first register a persistence provider plugin. See the
12
+ * `@azure/identity-cache-persistence` package on NPM.
13
+ *
14
+ * Example:
15
+ *
16
+ * ```ts snippet:credential_persistence_options_example
17
+ * import { useIdentityPlugin, DeviceCodeCredential } from "@azure/identity";
18
+ *
19
+ * useIdentityPlugin(cachePersistencePlugin);
20
+ *
21
+ * const credential = new DeviceCodeCredential({
22
+ * tokenCachePersistenceOptions: {
23
+ * enabled: true,
24
+ * },
25
+ * });
26
+ * ```
27
+ */
28
+ tokenCachePersistenceOptions?: TokenCachePersistenceOptions;
29
+ }
30
+ //# sourceMappingURL=credentialPersistenceOptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credentialPersistenceOptions.d.ts","sourceRoot":"","sources":["../../../src/credentials/credentialPersistenceOptions.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,mDAAmD,CAAC;AAEtG;;;GAGG;AACH,MAAM,WAAW,4BAA4B;IAC3C;;;;;;;;;;;;;;;;;;;;OAoBG;IAEH,4BAA4B,CAAC,EAAE,4BAA4B,CAAC;CAC7D"}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ export {};
4
+ //# sourceMappingURL=credentialPersistenceOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credentialPersistenceOptions.js","sourceRoot":"","sources":["../../../src/credentials/credentialPersistenceOptions.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { TokenCachePersistenceOptions } from \"../msal/nodeFlows/tokenCachePersistenceOptions.js\";\n\n/**\n * Shared configuration options for credentials that support persistent token\n * caching.\n */\nexport interface CredentialPersistenceOptions {\n /**\n * Options to provide to the persistence layer (if one is available) when\n * storing credentials.\n *\n * You must first register a persistence provider plugin. See the\n * `@azure/identity-cache-persistence` package on NPM.\n *\n * Example:\n *\n * ```ts snippet:credential_persistence_options_example\n * import { useIdentityPlugin, DeviceCodeCredential } from \"@azure/identity\";\n *\n * useIdentityPlugin(cachePersistencePlugin);\n *\n * const credential = new DeviceCodeCredential({\n * tokenCachePersistenceOptions: {\n * enabled: true,\n * },\n * });\n * ```\n */\n\n tokenCachePersistenceOptions?: TokenCachePersistenceOptions;\n}\n"]}