@azure/identity 4.14.0-beta.2 → 4.14.0-beta.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 (470) hide show
  1. package/dist/browser/client/identityClient.d.ts.map +1 -1
  2. package/dist/browser/client/identityClient.js +2 -1
  3. package/dist/browser/client/identityClient.js.map +1 -1
  4. package/dist/browser/constants.d.ts +1 -1
  5. package/dist/browser/constants.js +1 -1
  6. package/dist/browser/constants.js.map +1 -1
  7. package/dist/browser/credentials/{authorizationCodeCredential.d.ts → authorizationCodeCredential-browser.d.mts} +2 -2
  8. package/dist/browser/credentials/authorizationCodeCredential-browser.d.mts.map +1 -1
  9. package/dist/browser/credentials/{authorizationCodeCredential.js → authorizationCodeCredential-browser.mjs} +1 -1
  10. package/dist/browser/credentials/authorizationCodeCredential-browser.mjs.map +1 -1
  11. package/dist/browser/credentials/azureCliCredential-browser.d.mts +14 -0
  12. package/dist/browser/credentials/azureCliCredential-browser.d.mts.map +1 -1
  13. package/dist/browser/credentials/{azureCliCredential.js → azureCliCredential-browser.mjs} +2 -2
  14. package/dist/browser/credentials/azureCliCredential-browser.mjs.map +1 -1
  15. package/dist/browser/credentials/azureDeveloperCliCredential-browser.d.mts +14 -0
  16. package/dist/browser/credentials/azureDeveloperCliCredential-browser.d.mts.map +1 -1
  17. package/dist/browser/credentials/{azureDeveloperCliCredential.js → azureDeveloperCliCredential-browser.mjs} +2 -2
  18. package/dist/browser/credentials/azureDeveloperCliCredential-browser.mjs.map +1 -1
  19. package/dist/browser/credentials/azurePipelinesCredential-browser.d.mts +14 -0
  20. package/dist/browser/credentials/azurePipelinesCredential-browser.d.mts.map +1 -1
  21. package/dist/browser/credentials/{azurePipelinesCredential.js → azurePipelinesCredential-browser.mjs} +2 -2
  22. package/dist/browser/credentials/azurePipelinesCredential-browser.mjs.map +1 -1
  23. package/dist/browser/credentials/azurePowerShellCredential-browser.d.mts +13 -0
  24. package/dist/browser/credentials/azurePowerShellCredential-browser.d.mts.map +1 -1
  25. package/dist/browser/credentials/{azurePowerShellCredential.js → azurePowerShellCredential-browser.mjs} +2 -2
  26. package/dist/browser/credentials/azurePowerShellCredential-browser.mjs.map +1 -1
  27. package/dist/browser/credentials/clientAssertionCredential-browser.d.mts +13 -0
  28. package/dist/browser/credentials/clientAssertionCredential-browser.d.mts.map +1 -1
  29. package/dist/browser/credentials/{clientAssertionCredential.js → clientAssertionCredential-browser.mjs} +2 -2
  30. package/dist/browser/credentials/clientAssertionCredential-browser.mjs.map +1 -1
  31. package/dist/browser/credentials/clientCertificateCredential-browser.d.mts +15 -0
  32. package/dist/browser/credentials/clientCertificateCredential-browser.d.mts.map +1 -1
  33. package/dist/browser/credentials/{clientCertificateCredential.js → clientCertificateCredential-browser.mjs} +2 -2
  34. package/dist/browser/credentials/clientCertificateCredential-browser.mjs.map +1 -1
  35. package/dist/browser/credentials/{defaultAzureCredential.d.ts → defaultAzureCredential-browser.d.mts} +2 -2
  36. package/dist/browser/credentials/defaultAzureCredential-browser.d.mts.map +1 -1
  37. package/dist/browser/credentials/{defaultAzureCredential.js → defaultAzureCredential-browser.mjs} +1 -1
  38. package/dist/browser/credentials/defaultAzureCredential-browser.mjs.map +1 -1
  39. package/dist/browser/credentials/defaultAzureCredentialOptions.d.ts +2 -2
  40. package/dist/browser/credentials/defaultAzureCredentialOptions.js.map +1 -1
  41. package/dist/browser/credentials/deviceCodeCredential-browser.d.mts +14 -0
  42. package/dist/browser/credentials/deviceCodeCredential-browser.d.mts.map +1 -1
  43. package/dist/browser/credentials/{deviceCodeCredential.js → deviceCodeCredential-browser.mjs} +2 -2
  44. package/dist/browser/credentials/deviceCodeCredential-browser.mjs.map +1 -1
  45. package/dist/browser/credentials/environmentCredential-browser.d.mts +14 -0
  46. package/dist/browser/credentials/environmentCredential-browser.d.mts.map +1 -1
  47. package/dist/browser/credentials/{environmentCredential.js → environmentCredential-browser.mjs} +2 -2
  48. package/dist/browser/credentials/environmentCredential-browser.mjs.map +1 -1
  49. package/dist/browser/credentials/managedIdentityCredential/index-browser.d.mts +11 -0
  50. package/dist/browser/credentials/managedIdentityCredential/index-browser.d.mts.map +1 -1
  51. package/dist/browser/credentials/managedIdentityCredential/{index.js → index-browser.mjs} +2 -2
  52. package/dist/browser/credentials/managedIdentityCredential/index-browser.mjs.map +1 -1
  53. package/dist/browser/credentials/onBehalfOfCredential-browser.d.mts +13 -0
  54. package/dist/browser/credentials/onBehalfOfCredential-browser.d.mts.map +1 -1
  55. package/dist/browser/credentials/{onBehalfOfCredential.js → onBehalfOfCredential-browser.mjs} +2 -2
  56. package/dist/browser/credentials/onBehalfOfCredential-browser.mjs.map +1 -1
  57. package/dist/browser/credentials/usernamePasswordCredential-browser.mjs.map +1 -1
  58. package/dist/browser/credentials/{visualStudioCodeCredential.d.ts → visualStudioCodeCredential-browser.d.mts} +4 -3
  59. package/dist/browser/credentials/visualStudioCodeCredential-browser.d.mts.map +1 -1
  60. package/dist/browser/credentials/{visualStudioCodeCredential.js → visualStudioCodeCredential-browser.mjs} +2 -2
  61. package/dist/browser/credentials/visualStudioCodeCredential-browser.mjs.map +1 -1
  62. package/dist/browser/credentials/{workloadIdentityCredential.d.ts → workloadIdentityCredential-browser.d.mts} +4 -3
  63. package/dist/browser/credentials/workloadIdentityCredential-browser.d.mts.map +1 -1
  64. package/dist/browser/credentials/{workloadIdentityCredential.js → workloadIdentityCredential-browser.mjs} +2 -2
  65. package/dist/browser/credentials/workloadIdentityCredential-browser.mjs.map +1 -1
  66. package/dist/browser/index.d.ts +51 -51
  67. package/dist/browser/index.d.ts.map +1 -1
  68. package/dist/browser/index.js +19 -19
  69. package/dist/browser/index.js.map +1 -1
  70. package/dist/browser/msal/browserFlows/msalBrowserCommon.d.ts.map +1 -1
  71. package/dist/browser/msal/browserFlows/msalBrowserCommon.js +2 -3
  72. package/dist/browser/msal/browserFlows/msalBrowserCommon.js.map +1 -1
  73. package/dist/browser/msal/msal-browser.d.mts +2 -0
  74. package/dist/browser/msal/msal-browser.d.mts.map +1 -1
  75. package/dist/browser/msal/msal-browser.mjs +4 -0
  76. package/dist/browser/msal/msal-browser.mjs.map +1 -1
  77. package/dist/browser/msal/utils.d.ts +5 -4
  78. package/dist/browser/msal/utils.d.ts.map +1 -1
  79. package/dist/browser/msal/utils.js +16 -11
  80. package/dist/browser/msal/utils.js.map +1 -1
  81. package/dist/browser/util/{processMultiTenantRequest.d.ts → processMultiTenantRequest-browser.d.mts} +2 -1
  82. package/dist/browser/util/processMultiTenantRequest-browser.d.mts.map +1 -1
  83. package/dist/browser/util/{processMultiTenantRequest.js → processMultiTenantRequest-browser.mjs} +1 -1
  84. package/dist/browser/util/processMultiTenantRequest-browser.mjs.map +1 -1
  85. package/dist/browser/util/tenantIdUtils.d.ts +1 -1
  86. package/dist/browser/util/tenantIdUtils.d.ts.map +1 -1
  87. package/dist/browser/util/tenantIdUtils.js +1 -1
  88. package/dist/browser/util/tenantIdUtils.js.map +1 -1
  89. package/dist/commonjs/client/identityClient.d.ts.map +1 -1
  90. package/dist/commonjs/client/identityClient.js +295 -288
  91. package/dist/commonjs/client/identityClient.js.map +7 -1
  92. package/dist/commonjs/constants.d.ts +1 -1
  93. package/dist/commonjs/constants.js +61 -78
  94. package/dist/commonjs/constants.js.map +7 -1
  95. package/dist/commonjs/credentials/authorityValidationOptions.js +16 -5
  96. package/dist/commonjs/credentials/authorityValidationOptions.js.map +7 -1
  97. package/dist/commonjs/credentials/authorizationCodeCredential.js +98 -74
  98. package/dist/commonjs/credentials/authorizationCodeCredential.js.map +7 -1
  99. package/dist/commonjs/credentials/authorizationCodeCredentialOptions.js +16 -5
  100. package/dist/commonjs/credentials/authorizationCodeCredentialOptions.js.map +7 -1
  101. package/dist/commonjs/credentials/azureCliCredential.d.ts.map +1 -1
  102. package/dist/commonjs/credentials/azureCliCredential.js +246 -214
  103. package/dist/commonjs/credentials/azureCliCredential.js.map +7 -1
  104. package/dist/commonjs/credentials/azureCliCredentialOptions.js +16 -5
  105. package/dist/commonjs/credentials/azureCliCredentialOptions.js.map +7 -1
  106. package/dist/commonjs/credentials/azureDeveloperCliCredential.d.ts +12 -4
  107. package/dist/commonjs/credentials/azureDeveloperCliCredential.d.ts.map +1 -1
  108. package/dist/commonjs/credentials/azureDeveloperCliCredential.js +262 -224
  109. package/dist/commonjs/credentials/azureDeveloperCliCredential.js.map +7 -1
  110. package/dist/commonjs/credentials/azureDeveloperCliCredentialOptions.js +16 -5
  111. package/dist/commonjs/credentials/azureDeveloperCliCredentialOptions.js.map +7 -1
  112. package/dist/commonjs/credentials/azurePipelinesCredential.js +173 -135
  113. package/dist/commonjs/credentials/azurePipelinesCredential.js.map +7 -1
  114. package/dist/commonjs/credentials/azurePipelinesCredentialOptions.js +16 -5
  115. package/dist/commonjs/credentials/azurePipelinesCredentialOptions.js.map +7 -1
  116. package/dist/commonjs/credentials/azurePowerShellCredential.d.ts.map +1 -1
  117. package/dist/commonjs/credentials/azurePowerShellCredential.js +205 -205
  118. package/dist/commonjs/credentials/azurePowerShellCredential.js.map +7 -1
  119. package/dist/commonjs/credentials/azurePowerShellCredentialOptions.js +16 -5
  120. package/dist/commonjs/credentials/azurePowerShellCredentialOptions.js.map +7 -1
  121. package/dist/commonjs/credentials/brokerAuthOptions.js +16 -3
  122. package/dist/commonjs/credentials/brokerAuthOptions.js.map +7 -1
  123. package/dist/commonjs/credentials/brokerCredential.js +103 -70
  124. package/dist/commonjs/credentials/brokerCredential.js.map +7 -1
  125. package/dist/commonjs/credentials/browserCustomizationOptions.js +16 -5
  126. package/dist/commonjs/credentials/browserCustomizationOptions.js.map +7 -1
  127. package/dist/commonjs/credentials/chainedTokenCredential.js +113 -93
  128. package/dist/commonjs/credentials/chainedTokenCredential.js.map +7 -1
  129. package/dist/commonjs/credentials/clientAssertionCredential.js +101 -63
  130. package/dist/commonjs/credentials/clientAssertionCredential.js.map +7 -1
  131. package/dist/commonjs/credentials/clientAssertionCredentialOptions.js +16 -5
  132. package/dist/commonjs/credentials/clientAssertionCredentialOptions.js.map +7 -1
  133. package/dist/commonjs/credentials/clientCertificateCredential.js +129 -123
  134. package/dist/commonjs/credentials/clientCertificateCredential.js.map +7 -1
  135. package/dist/commonjs/credentials/clientCertificateCredentialModels.js +16 -5
  136. package/dist/commonjs/credentials/clientCertificateCredentialModels.js.map +7 -1
  137. package/dist/commonjs/credentials/clientCertificateCredentialOptions.js +16 -5
  138. package/dist/commonjs/credentials/clientCertificateCredentialOptions.js.map +7 -1
  139. package/dist/commonjs/credentials/clientSecretCredential.js +96 -67
  140. package/dist/commonjs/credentials/clientSecretCredential.js.map +7 -1
  141. package/dist/commonjs/credentials/clientSecretCredentialOptions.js +16 -5
  142. package/dist/commonjs/credentials/clientSecretCredentialOptions.js.map +7 -1
  143. package/dist/commonjs/credentials/credentialPersistenceOptions.js +16 -5
  144. package/dist/commonjs/credentials/credentialPersistenceOptions.js.map +7 -1
  145. package/dist/commonjs/credentials/defaultAzureCredential.js +121 -159
  146. package/dist/commonjs/credentials/defaultAzureCredential.js.map +7 -1
  147. package/dist/commonjs/credentials/defaultAzureCredentialFunctions.js +110 -140
  148. package/dist/commonjs/credentials/defaultAzureCredentialFunctions.js.map +7 -1
  149. package/dist/commonjs/credentials/defaultAzureCredentialOptions.d.ts +2 -2
  150. package/dist/commonjs/credentials/defaultAzureCredentialOptions.js +16 -5
  151. package/dist/commonjs/credentials/defaultAzureCredentialOptions.js.map +7 -1
  152. package/dist/commonjs/credentials/deviceCodeCredential.js +132 -103
  153. package/dist/commonjs/credentials/deviceCodeCredential.js.map +7 -1
  154. package/dist/commonjs/credentials/deviceCodeCredentialOptions.js +16 -5
  155. package/dist/commonjs/credentials/deviceCodeCredentialOptions.js.map +7 -1
  156. package/dist/commonjs/credentials/environmentCredential.js +157 -123
  157. package/dist/commonjs/credentials/environmentCredential.js.map +7 -1
  158. package/dist/commonjs/credentials/environmentCredentialOptions.js +16 -5
  159. package/dist/commonjs/credentials/environmentCredentialOptions.js.map +7 -1
  160. package/dist/commonjs/credentials/interactiveBrowserCredential.js +144 -107
  161. package/dist/commonjs/credentials/interactiveBrowserCredential.js.map +7 -1
  162. package/dist/commonjs/credentials/interactiveBrowserCredentialOptions.js +16 -5
  163. package/dist/commonjs/credentials/interactiveBrowserCredentialOptions.js.map +7 -1
  164. package/dist/commonjs/credentials/interactiveCredentialOptions.js +16 -5
  165. package/dist/commonjs/credentials/interactiveCredentialOptions.js.map +7 -1
  166. package/dist/commonjs/credentials/managedIdentityCredential/imdsMsi.js +92 -91
  167. package/dist/commonjs/credentials/managedIdentityCredential/imdsMsi.js.map +7 -1
  168. package/dist/commonjs/credentials/managedIdentityCredential/imdsRetryPolicy.js +51 -44
  169. package/dist/commonjs/credentials/managedIdentityCredential/imdsRetryPolicy.js.map +7 -1
  170. package/dist/commonjs/credentials/managedIdentityCredential/index.js +256 -242
  171. package/dist/commonjs/credentials/managedIdentityCredential/index.js.map +7 -1
  172. package/dist/commonjs/credentials/managedIdentityCredential/models.js +16 -5
  173. package/dist/commonjs/credentials/managedIdentityCredential/models.js.map +7 -1
  174. package/dist/commonjs/credentials/managedIdentityCredential/options.js +16 -5
  175. package/dist/commonjs/credentials/managedIdentityCredential/options.js.map +7 -1
  176. package/dist/commonjs/credentials/managedIdentityCredential/tokenExchangeMsi.js +56 -39
  177. package/dist/commonjs/credentials/managedIdentityCredential/tokenExchangeMsi.js.map +7 -1
  178. package/dist/commonjs/credentials/managedIdentityCredential/utils.js +79 -75
  179. package/dist/commonjs/credentials/managedIdentityCredential/utils.js.map +7 -1
  180. package/dist/commonjs/credentials/multiTenantTokenCredentialOptions.js +16 -5
  181. package/dist/commonjs/credentials/multiTenantTokenCredentialOptions.js.map +7 -1
  182. package/dist/commonjs/credentials/onBehalfOfCredential.js +168 -126
  183. package/dist/commonjs/credentials/onBehalfOfCredential.js.map +7 -1
  184. package/dist/commonjs/credentials/onBehalfOfCredentialOptions.js +16 -5
  185. package/dist/commonjs/credentials/onBehalfOfCredentialOptions.js.map +7 -1
  186. package/dist/commonjs/credentials/usernamePasswordCredential.js +112 -75
  187. package/dist/commonjs/credentials/usernamePasswordCredential.js.map +7 -1
  188. package/dist/commonjs/credentials/usernamePasswordCredentialOptions.js +16 -5
  189. package/dist/commonjs/credentials/usernamePasswordCredentialOptions.js.map +7 -1
  190. package/dist/commonjs/credentials/visualStudioCodeCredential.js +144 -132
  191. package/dist/commonjs/credentials/visualStudioCodeCredential.js.map +7 -1
  192. package/dist/commonjs/credentials/visualStudioCodeCredentialOptions.js +16 -5
  193. package/dist/commonjs/credentials/visualStudioCodeCredentialOptions.js.map +7 -1
  194. package/dist/commonjs/credentials/workloadIdentityCredential.js +284 -274
  195. package/dist/commonjs/credentials/workloadIdentityCredential.js.map +7 -1
  196. package/dist/commonjs/credentials/workloadIdentityCredentialOptions.js +16 -5
  197. package/dist/commonjs/credentials/workloadIdentityCredentialOptions.js.map +7 -1
  198. package/dist/commonjs/errors.js +131 -132
  199. package/dist/commonjs/errors.js.map +7 -1
  200. package/dist/commonjs/index.d.ts +33 -33
  201. package/dist/commonjs/index.d.ts.map +1 -1
  202. package/dist/commonjs/index.js +115 -67
  203. package/dist/commonjs/index.js.map +7 -1
  204. package/dist/commonjs/msal/msal.d.ts +1 -2
  205. package/dist/commonjs/msal/msal.d.ts.map +1 -1
  206. package/dist/commonjs/msal/msal.js +30 -9
  207. package/dist/commonjs/msal/msal.js.map +7 -1
  208. package/dist/commonjs/msal/nodeFlows/brokerOptions.js +16 -3
  209. package/dist/commonjs/msal/nodeFlows/brokerOptions.js.map +7 -1
  210. package/dist/commonjs/msal/nodeFlows/msalClient.d.ts +2 -2
  211. package/dist/commonjs/msal/nodeFlows/msalClient.d.ts.map +1 -1
  212. package/dist/commonjs/msal/nodeFlows/msalClient.js +450 -478
  213. package/dist/commonjs/msal/nodeFlows/msalClient.js.map +7 -1
  214. package/dist/commonjs/msal/nodeFlows/msalPlugins.js +140 -147
  215. package/dist/commonjs/msal/nodeFlows/msalPlugins.js.map +7 -1
  216. package/dist/commonjs/msal/nodeFlows/tokenCachePersistenceOptions.js +16 -5
  217. package/dist/commonjs/msal/nodeFlows/tokenCachePersistenceOptions.js.map +7 -1
  218. package/dist/commonjs/msal/types.js +16 -5
  219. package/dist/commonjs/msal/types.js.map +7 -1
  220. package/dist/commonjs/msal/utils.d.ts +5 -4
  221. package/dist/commonjs/msal/utils.d.ts.map +1 -1
  222. package/dist/commonjs/msal/utils.js +176 -211
  223. package/dist/commonjs/msal/utils.js.map +7 -1
  224. package/dist/commonjs/plugins/consumer.js +32 -40
  225. package/dist/commonjs/plugins/consumer.js.map +7 -1
  226. package/dist/commonjs/plugins/provider.js +16 -5
  227. package/dist/commonjs/plugins/provider.js.map +7 -1
  228. package/dist/commonjs/regionalAuthority.js +93 -141
  229. package/dist/commonjs/regionalAuthority.js.map +7 -1
  230. package/dist/commonjs/tokenCredentialOptions.js +16 -5
  231. package/dist/commonjs/tokenCredentialOptions.js.map +7 -1
  232. package/dist/commonjs/tokenProvider.js +52 -52
  233. package/dist/commonjs/tokenProvider.js.map +7 -1
  234. package/dist/commonjs/tsdoc-metadata.json +1 -1
  235. package/dist/commonjs/util/authorityHost.js +34 -19
  236. package/dist/commonjs/util/authorityHost.js.map +7 -1
  237. package/dist/commonjs/util/certificatesUtils.js +54 -45
  238. package/dist/commonjs/util/certificatesUtils.js.map +7 -1
  239. package/dist/commonjs/util/identityTokenEndpoint.js +32 -12
  240. package/dist/commonjs/util/identityTokenEndpoint.js.map +7 -1
  241. package/dist/commonjs/util/logging.js +91 -97
  242. package/dist/commonjs/util/logging.js.map +7 -1
  243. package/dist/commonjs/util/processMultiTenantRequest.js +43 -33
  244. package/dist/commonjs/util/processMultiTenantRequest.js.map +7 -1
  245. package/dist/commonjs/util/processUtils.js +60 -35
  246. package/dist/commonjs/util/processUtils.js.map +7 -1
  247. package/dist/commonjs/util/scopeUtils.js +39 -28
  248. package/dist/commonjs/util/scopeUtils.js.map +7 -1
  249. package/dist/commonjs/util/subscriptionUtils.js +35 -17
  250. package/dist/commonjs/util/subscriptionUtils.js.map +7 -1
  251. package/dist/commonjs/util/tenantIdUtils.d.ts.map +1 -1
  252. package/dist/commonjs/util/tenantIdUtils.js +61 -45
  253. package/dist/commonjs/util/tenantIdUtils.js.map +7 -1
  254. package/dist/commonjs/util/tracing.js +33 -16
  255. package/dist/commonjs/util/tracing.js.map +7 -1
  256. package/dist/esm/client/identityClient.d.ts.map +1 -1
  257. package/dist/esm/client/identityClient.js +2 -1
  258. package/dist/esm/client/identityClient.js.map +1 -1
  259. package/dist/esm/constants.d.ts +1 -1
  260. package/dist/esm/constants.js +1 -1
  261. package/dist/esm/constants.js.map +1 -1
  262. package/dist/esm/credentials/azureCliCredential.d.ts.map +1 -1
  263. package/dist/esm/credentials/azureCliCredential.js +2 -1
  264. package/dist/esm/credentials/azureCliCredential.js.map +1 -1
  265. package/dist/esm/credentials/azureDeveloperCliCredential.d.ts +12 -4
  266. package/dist/esm/credentials/azureDeveloperCliCredential.d.ts.map +1 -1
  267. package/dist/esm/credentials/azureDeveloperCliCredential.js +40 -14
  268. package/dist/esm/credentials/azureDeveloperCliCredential.js.map +1 -1
  269. package/dist/esm/credentials/azurePipelinesCredential.js.map +1 -1
  270. package/dist/esm/credentials/azurePowerShellCredential.d.ts.map +1 -1
  271. package/dist/esm/credentials/azurePowerShellCredential.js +2 -1
  272. package/dist/esm/credentials/azurePowerShellCredential.js.map +1 -1
  273. package/dist/esm/credentials/defaultAzureCredential.js.map +1 -1
  274. package/dist/esm/credentials/defaultAzureCredentialFunctions.js.map +1 -1
  275. package/dist/esm/credentials/defaultAzureCredentialOptions.d.ts +2 -2
  276. package/dist/esm/credentials/defaultAzureCredentialOptions.js.map +1 -1
  277. package/dist/esm/credentials/environmentCredential.js.map +1 -1
  278. package/dist/esm/credentials/managedIdentityCredential/tokenExchangeMsi.js.map +1 -1
  279. package/dist/esm/credentials/workloadIdentityCredential.js.map +1 -1
  280. package/dist/esm/index.d.ts +33 -33
  281. package/dist/esm/index.d.ts.map +1 -1
  282. package/dist/esm/index.js.map +1 -1
  283. package/dist/esm/msal/msal.d.ts +1 -2
  284. package/dist/esm/msal/msal.d.ts.map +1 -1
  285. package/dist/esm/msal/msal.js +1 -2
  286. package/dist/esm/msal/msal.js.map +1 -1
  287. package/dist/esm/msal/nodeFlows/msalClient.d.ts +2 -2
  288. package/dist/esm/msal/nodeFlows/msalClient.d.ts.map +1 -1
  289. package/dist/esm/msal/nodeFlows/msalClient.js +3 -3
  290. package/dist/esm/msal/nodeFlows/msalClient.js.map +1 -1
  291. package/dist/esm/msal/utils.d.ts +5 -4
  292. package/dist/esm/msal/utils.d.ts.map +1 -1
  293. package/dist/esm/msal/utils.js +16 -11
  294. package/dist/esm/msal/utils.js.map +1 -1
  295. package/dist/esm/util/tenantIdUtils.d.ts.map +1 -1
  296. package/dist/esm/util/tenantIdUtils.js.map +1 -1
  297. package/dist/workerd/client/identityClient.d.ts.map +1 -1
  298. package/dist/workerd/client/identityClient.js +2 -1
  299. package/dist/workerd/client/identityClient.js.map +1 -1
  300. package/dist/workerd/constants.d.ts +1 -1
  301. package/dist/workerd/constants.js +1 -1
  302. package/dist/workerd/constants.js.map +1 -1
  303. package/dist/workerd/credentials/azureCliCredential.d.ts.map +1 -1
  304. package/dist/workerd/credentials/azureCliCredential.js +2 -1
  305. package/dist/workerd/credentials/azureCliCredential.js.map +1 -1
  306. package/dist/workerd/credentials/azureDeveloperCliCredential.d.ts +12 -4
  307. package/dist/workerd/credentials/azureDeveloperCliCredential.d.ts.map +1 -1
  308. package/dist/workerd/credentials/azureDeveloperCliCredential.js +40 -14
  309. package/dist/workerd/credentials/azureDeveloperCliCredential.js.map +1 -1
  310. package/dist/workerd/credentials/azurePipelinesCredential.js.map +1 -1
  311. package/dist/workerd/credentials/azurePowerShellCredential.d.ts.map +1 -1
  312. package/dist/workerd/credentials/azurePowerShellCredential.js +2 -1
  313. package/dist/workerd/credentials/azurePowerShellCredential.js.map +1 -1
  314. package/dist/workerd/credentials/defaultAzureCredential.js.map +1 -1
  315. package/dist/workerd/credentials/defaultAzureCredentialFunctions.js.map +1 -1
  316. package/dist/workerd/credentials/defaultAzureCredentialOptions.d.ts +2 -2
  317. package/dist/workerd/credentials/defaultAzureCredentialOptions.js.map +1 -1
  318. package/dist/workerd/credentials/environmentCredential.js.map +1 -1
  319. package/dist/workerd/credentials/managedIdentityCredential/tokenExchangeMsi.js.map +1 -1
  320. package/dist/workerd/credentials/workloadIdentityCredential.js.map +1 -1
  321. package/dist/workerd/index.d.ts +33 -33
  322. package/dist/workerd/index.d.ts.map +1 -1
  323. package/dist/workerd/index.js.map +1 -1
  324. package/dist/workerd/msal/msal.d.ts +1 -2
  325. package/dist/workerd/msal/msal.d.ts.map +1 -1
  326. package/dist/workerd/msal/msal.js +1 -2
  327. package/dist/workerd/msal/msal.js.map +1 -1
  328. package/dist/workerd/msal/nodeFlows/msalClient.d.ts +2 -2
  329. package/dist/workerd/msal/nodeFlows/msalClient.d.ts.map +1 -1
  330. package/dist/workerd/msal/nodeFlows/msalClient.js +3 -3
  331. package/dist/workerd/msal/nodeFlows/msalClient.js.map +1 -1
  332. package/dist/workerd/msal/utils.d.ts +5 -4
  333. package/dist/workerd/msal/utils.d.ts.map +1 -1
  334. package/dist/workerd/msal/utils.js +16 -11
  335. package/dist/workerd/msal/utils.js.map +1 -1
  336. package/dist/workerd/util/tenantIdUtils.d.ts.map +1 -1
  337. package/dist/workerd/util/tenantIdUtils.js.map +1 -1
  338. package/package.json +29 -36
  339. package/dist/browser/credentials/azureCliCredential.d.ts +0 -13
  340. package/dist/browser/credentials/azureDeveloperCliCredential.d.ts +0 -13
  341. package/dist/browser/credentials/azurePipelinesCredential.d.ts +0 -13
  342. package/dist/browser/credentials/azurePowerShellCredential.d.ts +0 -12
  343. package/dist/browser/credentials/brokerCredential.d.ts +0 -35
  344. package/dist/browser/credentials/brokerCredential.d.ts.map +0 -1
  345. package/dist/browser/credentials/brokerCredential.js +0 -68
  346. package/dist/browser/credentials/brokerCredential.js.map +0 -1
  347. package/dist/browser/credentials/clientAssertionCredential.d.ts +0 -12
  348. package/dist/browser/credentials/clientCertificateCredential.d.ts +0 -13
  349. package/dist/browser/credentials/defaultAzureCredentialFunctions.d.ts +0 -64
  350. package/dist/browser/credentials/defaultAzureCredentialFunctions.d.ts.map +0 -1
  351. package/dist/browser/credentials/defaultAzureCredentialFunctions.js +0 -147
  352. package/dist/browser/credentials/defaultAzureCredentialFunctions.js.map +0 -1
  353. package/dist/browser/credentials/deviceCodeCredential.d.ts +0 -13
  354. package/dist/browser/credentials/environmentCredential.d.ts +0 -13
  355. package/dist/browser/credentials/managedIdentityCredential/imdsMsi.d.ts +0 -18
  356. package/dist/browser/credentials/managedIdentityCredential/imdsMsi.d.ts.map +0 -1
  357. package/dist/browser/credentials/managedIdentityCredential/imdsMsi.js +0 -97
  358. package/dist/browser/credentials/managedIdentityCredential/imdsMsi.js.map +0 -1
  359. package/dist/browser/credentials/managedIdentityCredential/imdsRetryPolicy.d.ts +0 -13
  360. package/dist/browser/credentials/managedIdentityCredential/imdsRetryPolicy.d.ts.map +0 -1
  361. package/dist/browser/credentials/managedIdentityCredential/imdsRetryPolicy.js +0 -43
  362. package/dist/browser/credentials/managedIdentityCredential/imdsRetryPolicy.js.map +0 -1
  363. package/dist/browser/credentials/managedIdentityCredential/index.d.ts +0 -6
  364. package/dist/browser/credentials/managedIdentityCredential/models.d.ts +0 -24
  365. package/dist/browser/credentials/managedIdentityCredential/models.d.ts.map +0 -1
  366. package/dist/browser/credentials/managedIdentityCredential/models.js +0 -4
  367. package/dist/browser/credentials/managedIdentityCredential/models.js.map +0 -1
  368. package/dist/browser/credentials/managedIdentityCredential/tokenExchangeMsi.d.ts +0 -14
  369. package/dist/browser/credentials/managedIdentityCredential/tokenExchangeMsi.d.ts.map +0 -1
  370. package/dist/browser/credentials/managedIdentityCredential/tokenExchangeMsi.js +0 -38
  371. package/dist/browser/credentials/managedIdentityCredential/tokenExchangeMsi.js.map +0 -1
  372. package/dist/browser/credentials/onBehalfOfCredential.d.ts +0 -12
  373. package/dist/browser/credentials/visualStudioCodeCredentialPlugin.d.ts +0 -12
  374. package/dist/browser/credentials/visualStudioCodeCredentialPlugin.d.ts.map +0 -1
  375. package/dist/browser/credentials/visualStudioCodeCredentialPlugin.js +0 -4
  376. package/dist/browser/credentials/visualStudioCodeCredentialPlugin.js.map +0 -1
  377. package/dist/browser/msal/msal.d.ts +0 -3
  378. package/dist/browser/msal/msal.js +0 -5
  379. package/dist/browser/msal/nodeFlows/msalClient.d.ts +0 -205
  380. package/dist/browser/msal/nodeFlows/msalClient.d.ts.map +0 -1
  381. package/dist/browser/msal/nodeFlows/msalClient.js +0 -499
  382. package/dist/browser/msal/nodeFlows/msalClient.js.map +0 -1
  383. package/dist/browser/msal/nodeFlows/msalPlugins.d.ts +0 -109
  384. package/dist/browser/msal/nodeFlows/msalPlugins.d.ts.map +0 -1
  385. package/dist/browser/msal/nodeFlows/msalPlugins.js +0 -160
  386. package/dist/browser/msal/nodeFlows/msalPlugins.js.map +0 -1
  387. package/dist/browser/regionalAuthority.d.ts +0 -122
  388. package/dist/browser/regionalAuthority.d.ts.map +0 -1
  389. package/dist/browser/regionalAuthority.js +0 -139
  390. package/dist/browser/regionalAuthority.js.map +0 -1
  391. package/dist/browser/util/authHostEnv-browser.d.mts +0 -4
  392. package/dist/browser/util/authHostEnv-browser.d.mts.map +0 -1
  393. package/dist/browser/util/authHostEnv-browser.mjs +0 -7
  394. package/dist/browser/util/authHostEnv-browser.mjs.map +0 -1
  395. package/dist/browser/util/certificatesUtils.d.ts +0 -13
  396. package/dist/browser/util/certificatesUtils.d.ts.map +0 -1
  397. package/dist/browser/util/certificatesUtils.js +0 -47
  398. package/dist/browser/util/certificatesUtils.js.map +0 -1
  399. package/dist/browser/util/processUtils.d.ts +0 -13
  400. package/dist/browser/util/processUtils.d.ts.map +0 -1
  401. package/dist/browser/util/processUtils.js +0 -32
  402. package/dist/browser/util/processUtils.js.map +0 -1
  403. package/dist/browser/util/subscriptionUtils.d.ts +0 -6
  404. package/dist/browser/util/subscriptionUtils.d.ts.map +0 -1
  405. package/dist/browser/util/subscriptionUtils.js +0 -16
  406. package/dist/browser/util/subscriptionUtils.js.map +0 -1
  407. package/dist/commonjs/credentials/visualStudioCodeCredentialPlugin.d.ts +0 -12
  408. package/dist/commonjs/credentials/visualStudioCodeCredentialPlugin.d.ts.map +0 -1
  409. package/dist/commonjs/credentials/visualStudioCodeCredentialPlugin.js +0 -5
  410. package/dist/commonjs/credentials/visualStudioCodeCredentialPlugin.js.map +0 -1
  411. package/dist/commonjs/msal/browserFlows/msalBrowserCommon.d.ts +0 -19
  412. package/dist/commonjs/msal/browserFlows/msalBrowserCommon.d.ts.map +0 -1
  413. package/dist/commonjs/msal/browserFlows/msalBrowserCommon.js +0 -265
  414. package/dist/commonjs/msal/browserFlows/msalBrowserCommon.js.map +0 -1
  415. package/dist/commonjs/msal/browserFlows/msalBrowserOptions.d.ts +0 -87
  416. package/dist/commonjs/msal/browserFlows/msalBrowserOptions.d.ts.map +0 -1
  417. package/dist/commonjs/msal/browserFlows/msalBrowserOptions.js +0 -5
  418. package/dist/commonjs/msal/browserFlows/msalBrowserOptions.js.map +0 -1
  419. package/dist/commonjs/msal/credentials.d.ts +0 -52
  420. package/dist/commonjs/msal/credentials.d.ts.map +0 -1
  421. package/dist/commonjs/msal/credentials.js +0 -5
  422. package/dist/commonjs/msal/credentials.js.map +0 -1
  423. package/dist/esm/credentials/visualStudioCodeCredentialPlugin.d.ts +0 -12
  424. package/dist/esm/credentials/visualStudioCodeCredentialPlugin.d.ts.map +0 -1
  425. package/dist/esm/credentials/visualStudioCodeCredentialPlugin.js +0 -4
  426. package/dist/esm/credentials/visualStudioCodeCredentialPlugin.js.map +0 -1
  427. package/dist/esm/msal/browserFlows/msalBrowserCommon.d.ts +0 -19
  428. package/dist/esm/msal/browserFlows/msalBrowserCommon.d.ts.map +0 -1
  429. package/dist/esm/msal/browserFlows/msalBrowserCommon.js +0 -261
  430. package/dist/esm/msal/browserFlows/msalBrowserCommon.js.map +0 -1
  431. package/dist/esm/msal/browserFlows/msalBrowserOptions.d.ts +0 -87
  432. package/dist/esm/msal/browserFlows/msalBrowserOptions.d.ts.map +0 -1
  433. package/dist/esm/msal/browserFlows/msalBrowserOptions.js +0 -4
  434. package/dist/esm/msal/browserFlows/msalBrowserOptions.js.map +0 -1
  435. package/dist/esm/msal/credentials.d.ts +0 -52
  436. package/dist/esm/msal/credentials.d.ts.map +0 -1
  437. package/dist/esm/msal/credentials.js +0 -4
  438. package/dist/esm/msal/credentials.js.map +0 -1
  439. package/dist/esm/util/authHostEnv-browser.d.mts +0 -4
  440. package/dist/esm/util/authHostEnv-browser.d.mts.map +0 -1
  441. package/dist/esm/util/authHostEnv-browser.mjs +0 -7
  442. package/dist/esm/util/authHostEnv-browser.mjs.map +0 -1
  443. package/dist/workerd/credentials/visualStudioCodeCredentialPlugin.d.ts +0 -12
  444. package/dist/workerd/credentials/visualStudioCodeCredentialPlugin.d.ts.map +0 -1
  445. package/dist/workerd/credentials/visualStudioCodeCredentialPlugin.js +0 -4
  446. package/dist/workerd/credentials/visualStudioCodeCredentialPlugin.js.map +0 -1
  447. package/dist/workerd/msal/browserFlows/msalBrowserCommon.d.ts +0 -19
  448. package/dist/workerd/msal/browserFlows/msalBrowserCommon.d.ts.map +0 -1
  449. package/dist/workerd/msal/browserFlows/msalBrowserCommon.js +0 -261
  450. package/dist/workerd/msal/browserFlows/msalBrowserCommon.js.map +0 -1
  451. package/dist/workerd/msal/browserFlows/msalBrowserOptions.d.ts +0 -87
  452. package/dist/workerd/msal/browserFlows/msalBrowserOptions.d.ts.map +0 -1
  453. package/dist/workerd/msal/browserFlows/msalBrowserOptions.js +0 -4
  454. package/dist/workerd/msal/browserFlows/msalBrowserOptions.js.map +0 -1
  455. package/dist/workerd/msal/credentials.d.ts +0 -52
  456. package/dist/workerd/msal/credentials.d.ts.map +0 -1
  457. package/dist/workerd/msal/credentials.js +0 -4
  458. package/dist/workerd/msal/credentials.js.map +0 -1
  459. package/dist/workerd/util/authHostEnv-browser.d.mts +0 -4
  460. package/dist/workerd/util/authHostEnv-browser.d.mts.map +0 -1
  461. package/dist/workerd/util/authHostEnv-browser.mjs +0 -7
  462. package/dist/workerd/util/authHostEnv-browser.mjs.map +0 -1
  463. /package/dist/browser/credentials/{clientSecretCredential.d.ts → clientSecretCredential-browser.d.mts} +0 -0
  464. /package/dist/browser/credentials/{clientSecretCredential.js → clientSecretCredential-browser.mjs} +0 -0
  465. /package/dist/browser/credentials/{interactiveBrowserCredential.d.ts → interactiveBrowserCredential-browser.d.mts} +0 -0
  466. /package/dist/browser/credentials/{interactiveBrowserCredential.js → interactiveBrowserCredential-browser.mjs} +0 -0
  467. /package/dist/browser/credentials/{usernamePasswordCredential.d.ts → usernamePasswordCredential-browser.d.mts} +0 -0
  468. /package/dist/browser/credentials/{usernamePasswordCredential.js → usernamePasswordCredential-browser.mjs} +0 -0
  469. /package/dist/browser/plugins/{consumer.d.ts → consumer-browser.d.mts} +0 -0
  470. /package/dist/browser/plugins/{consumer.js → consumer-browser.mjs} +0 -0
@@ -1,97 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT License.
3
- import { createHttpHeaders, createPipelineRequest } from "@azure/core-rest-pipeline";
4
- import { isError } from "@azure/core-util";
5
- import { credentialLogger } from "../../util/logging.js";
6
- import { mapScopesToResource } from "./utils.js";
7
- import { tracingClient } from "../../util/tracing.js";
8
- const msiName = "ManagedIdentityCredential - IMDS";
9
- const logger = credentialLogger(msiName);
10
- const imdsHost = "http://169.254.169.254";
11
- const imdsEndpointPath = "/metadata/identity/oauth2/token";
12
- /**
13
- * Generates an invalid request options to get a response quickly from IMDS endpoint.
14
- * The response indicates the availability of IMSD service; otherwise the request would time out.
15
- */
16
- function prepareInvalidRequestOptions(scopes) {
17
- const resource = mapScopesToResource(scopes);
18
- if (!resource) {
19
- throw new Error(`${msiName}: Multiple scopes are not supported.`);
20
- }
21
- // Pod Identity will try to process this request even if the Metadata header is missing.
22
- // We can exclude the request query to ensure no IMDS endpoint tries to process the ping request.
23
- const url = new URL(imdsEndpointPath, process.env.AZURE_POD_IDENTITY_AUTHORITY_HOST ?? imdsHost);
24
- const rawHeaders = {
25
- Accept: "application/json",
26
- // intentionally leave out the Metadata header to invoke an error from IMDS endpoint.
27
- };
28
- return {
29
- // intentionally not including any query
30
- url: `${url}`,
31
- method: "GET",
32
- headers: createHttpHeaders(rawHeaders),
33
- };
34
- }
35
- /**
36
- * Defines how to determine whether the Azure IMDS MSI is available.
37
- *
38
- * Actually getting the token once we determine IMDS is available is handled by MSAL.
39
- */
40
- export const imdsMsi = {
41
- name: "imdsMsi",
42
- async isAvailable(options) {
43
- const { scopes, identityClient, getTokenOptions } = options;
44
- const resource = mapScopesToResource(scopes);
45
- if (!resource) {
46
- logger.info(`${msiName}: Unavailable. Multiple scopes are not supported.`);
47
- return false;
48
- }
49
- // if the PodIdentityEndpoint environment variable was set no need to probe the endpoint, it can be assumed to exist
50
- if (process.env.AZURE_POD_IDENTITY_AUTHORITY_HOST) {
51
- return true;
52
- }
53
- if (!identityClient) {
54
- throw new Error("Missing IdentityClient");
55
- }
56
- const requestOptions = prepareInvalidRequestOptions(resource);
57
- return tracingClient.withSpan("ManagedIdentityCredential-pingImdsEndpoint", getTokenOptions ?? {}, async (updatedOptions) => {
58
- requestOptions.tracingOptions = updatedOptions.tracingOptions;
59
- // Create a request with a timeout since we expect that
60
- // not having a "Metadata" header should cause an error to be
61
- // returned quickly from the endpoint, proving its availability.
62
- const request = createPipelineRequest(requestOptions);
63
- // Default to 1000 if the default of 0 is used.
64
- // Negative values can still be used to disable the timeout.
65
- request.timeout = updatedOptions.requestOptions?.timeout || 1000;
66
- // This MSI uses the imdsEndpoint to get the token, which only uses http://
67
- request.allowInsecureConnection = true;
68
- let response;
69
- try {
70
- logger.info(`${msiName}: Pinging the Azure IMDS endpoint`);
71
- response = await identityClient.sendRequest(request);
72
- }
73
- catch (err) {
74
- // If the request failed, or Node.js was unable to establish a connection,
75
- // or the host was down, we'll assume the IMDS endpoint isn't available.
76
- if (isError(err)) {
77
- logger.verbose(`${msiName}: Caught error ${err.name}: ${err.message}`);
78
- }
79
- // This is a special case for Docker Desktop which responds with a 403 with a message that contains "A socket operation was attempted to an unreachable network" or "A socket operation was attempted to an unreachable host"
80
- // rather than just timing out, as expected.
81
- logger.info(`${msiName}: The Azure IMDS endpoint is unavailable`);
82
- return false;
83
- }
84
- if (response.status === 403) {
85
- if (response.bodyAsText?.includes("unreachable")) {
86
- logger.info(`${msiName}: The Azure IMDS endpoint is unavailable`);
87
- logger.info(`${msiName}: ${response.bodyAsText}`);
88
- return false;
89
- }
90
- }
91
- // If we received any response, the endpoint is available
92
- logger.info(`${msiName}: The Azure IMDS endpoint is available`);
93
- return true;
94
- });
95
- },
96
- };
97
- //# sourceMappingURL=imdsMsi.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"imdsMsi.js","sourceRoot":"","sources":["../../../../src/credentials/managedIdentityCredential/imdsMsi.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AACrF,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAG3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAGtD,MAAM,OAAO,GAAG,kCAAkC,CAAC;AACnD,MAAM,MAAM,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;AAEzC,MAAM,QAAQ,GAAG,wBAAwB,CAAC;AAC1C,MAAM,gBAAgB,GAAG,iCAAiC,CAAC;AAE3D;;;GAGG;AACH,SAAS,4BAA4B,CAAC,MAAyB;IA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AAO,KAAK,CAAC;gBACf,CAAC;YACH,CAAC;YACD,yDAAyD;YACzD,MAAM,CAAC,IAAI,CAAC,GAAG,OAAO,wCAAwC,CAAC,CAAC;YAChE,OAAO,IAAI,CAAC;QACd,CAAC,CACF,CAAC;IACJ,CAAC;CACF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { PipelineRequestOptions, PipelineResponse } from \"@azure/core-rest-pipeline\";\nimport { createHttpHeaders, createPipelineRequest } from \"@azure/core-rest-pipeline\";\nimport { isError } from \"@azure/core-util\";\n\nimport type { GetTokenOptions } from \"@azure/core-auth\";\nimport { credentialLogger } from \"../../util/logging.js\";\nimport { mapScopesToResource } from \"./utils.js\";\nimport { tracingClient } from \"../../util/tracing.js\";\nimport type { IdentityClient } from \"../../client/identityClient.js\";\n\nconst msiName = \"ManagedIdentityCredential - IMDS\";\nconst logger = credentialLogger(msiName);\n\nconst imdsHost = \"http://169.254.169.254\";\nconst imdsEndpointPath = \"/metadata/identity/oauth2/token\";\n\n/**\n * Generates an invalid request options to get a response quickly from IMDS endpoint.\n * The response indicates the availability of IMSD service; otherwise the request would time out.\n */\nfunction prepareInvalidRequestOptions(scopes: string | string[]): PipelineRequestOptions {\n const resource = mapScopesToResource(scopes);\n if (!resource) {\n throw new Error(`${msiName}: Multiple scopes are not supported.`);\n }\n\n // Pod Identity will try to process this request even if the Metadata header is missing.\n // We can exclude the request query to ensure no IMDS endpoint tries to process the ping request.\n const url = new URL(imdsEndpointPath, process.env.AZURE_POD_IDENTITY_AUTHORITY_HOST ?? imdsHost);\n\n const rawHeaders: Record<string, string> = {\n Accept: \"application/json\",\n // intentionally leave out the Metadata header to invoke an error from IMDS endpoint.\n };\n\n return {\n // intentionally not including any query\n url: `${url}`,\n method: \"GET\",\n headers: createHttpHeaders(rawHeaders),\n };\n}\n\n/**\n * Defines how to determine whether the Azure IMDS MSI is available.\n *\n * Actually getting the token once we determine IMDS is available is handled by MSAL.\n */\nexport const imdsMsi = {\n name: \"imdsMsi\",\n async isAvailable(options: {\n scopes: string | string[];\n identityClient?: IdentityClient;\n clientId?: string;\n resourceId?: string;\n getTokenOptions?: GetTokenOptions;\n }): Promise<boolean> {\n const { scopes, identityClient, getTokenOptions } = options;\n const resource = mapScopesToResource(scopes);\n if (!resource) {\n logger.info(`${msiName}: Unavailable. Multiple scopes are not supported.`);\n return false;\n }\n\n // if the PodIdentityEndpoint environment variable was set no need to probe the endpoint, it can be assumed to exist\n if (process.env.AZURE_POD_IDENTITY_AUTHORITY_HOST) {\n return true;\n }\n\n if (!identityClient) {\n throw new Error(\"Missing IdentityClient\");\n }\n\n const requestOptions = prepareInvalidRequestOptions(resource);\n\n return tracingClient.withSpan(\n \"ManagedIdentityCredential-pingImdsEndpoint\",\n getTokenOptions ?? {},\n async (updatedOptions) => {\n requestOptions.tracingOptions = updatedOptions.tracingOptions;\n\n // Create a request with a timeout since we expect that\n // not having a \"Metadata\" header should cause an error to be\n // returned quickly from the endpoint, proving its availability.\n const request = createPipelineRequest(requestOptions);\n\n // Default to 1000 if the default of 0 is used.\n // Negative values can still be used to disable the timeout.\n request.timeout = updatedOptions.requestOptions?.timeout || 1000;\n\n // This MSI uses the imdsEndpoint to get the token, which only uses http://\n request.allowInsecureConnection = true;\n let response: PipelineResponse;\n try {\n logger.info(`${msiName}: Pinging the Azure IMDS endpoint`);\n response = await identityClient.sendRequest(request);\n } catch (err: unknown) {\n // If the request failed, or Node.js was unable to establish a connection,\n // or the host was down, we'll assume the IMDS endpoint isn't available.\n if (isError(err)) {\n logger.verbose(`${msiName}: Caught error ${err.name}: ${err.message}`);\n }\n // This is a special case for Docker Desktop which responds with a 403 with a message that contains \"A socket operation was attempted to an unreachable network\" or \"A socket operation was attempted to an unreachable host\"\n // rather than just timing out, as expected.\n logger.info(`${msiName}: The Azure IMDS endpoint is unavailable`);\n return false;\n }\n if (response.status === 403) {\n if (response.bodyAsText?.includes(\"unreachable\")) {\n logger.info(`${msiName}: The Azure IMDS endpoint is unavailable`);\n logger.info(`${msiName}: ${response.bodyAsText}`);\n return false;\n }\n }\n // If we received any response, the endpoint is available\n logger.info(`${msiName}: The Azure IMDS endpoint is available`);\n return true;\n },\n );\n },\n};\n"]}
@@ -1,13 +0,0 @@
1
- import type { PipelinePolicy } from "@azure/core-rest-pipeline";
2
- import type { MSIConfiguration } from "./models.js";
3
- /**
4
- * An additional policy that retries on 404 and 410 errors. The default retry policy does not retry on
5
- * 404s or 410s, but the IMDS endpoint can return these when the token is not yet available or when
6
- * the identity is still being set up. This policy will retry on 404s and 410s with an exponential backoff.
7
- * For 410 responses, it uses a minimum 3-second initial delay to ensure at least 70 seconds total duration.
8
- *
9
- * @param msiRetryConfig - The retry configuration for the MSI credential.
10
- * @returns - The policy that will retry on 404s and 410s.
11
- */
12
- export declare function imdsRetryPolicy(msiRetryConfig: MSIConfiguration["retryConfig"]): PipelinePolicy;
13
- //# sourceMappingURL=imdsRetryPolicy.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"imdsRetryPolicy.d.ts","sourceRoot":"","sources":["../../../../src/credentials/managedIdentityCredential/imdsRetryPolicy.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAGhE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAYpD;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,cAAc,EAAE,gBAAgB,CAAC,aAAa,CAAC,GAAG,cAAc,CA2B/F"}
@@ -1,43 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT License.
3
- import { retryPolicy } from "@azure/core-rest-pipeline";
4
- import { calculateRetryDelay } from "@azure/core-util";
5
- // Matches the default retry configuration in expontentialRetryStrategy.ts
6
- const DEFAULT_CLIENT_MAX_RETRY_INTERVAL = 1000 * 64;
7
- // For 410 responses, we need at least 70 seconds total retry duration
8
- // With 5 retries using exponential backoff: delays of d, 2d, 4d, 8d, 16d sum to 31d
9
- // Accounting for jitter (which can reduce delays by 20%), we need 31d * 0.8 >= 70
10
- // So we need d >= 70/24.8 = 2.82 seconds. Using 3 seconds to be safe.
11
- const MIN_DELAY_FOR_410_MS = 3000;
12
- /**
13
- * An additional policy that retries on 404 and 410 errors. The default retry policy does not retry on
14
- * 404s or 410s, but the IMDS endpoint can return these when the token is not yet available or when
15
- * the identity is still being set up. This policy will retry on 404s and 410s with an exponential backoff.
16
- * For 410 responses, it uses a minimum 3-second initial delay to ensure at least 70 seconds total duration.
17
- *
18
- * @param msiRetryConfig - The retry configuration for the MSI credential.
19
- * @returns - The policy that will retry on 404s and 410s.
20
- */
21
- export function imdsRetryPolicy(msiRetryConfig) {
22
- return retryPolicy([
23
- {
24
- name: "imdsRetryPolicy",
25
- retry: ({ retryCount, response }) => {
26
- if (response?.status !== 404 && response?.status !== 410) {
27
- return { skipStrategy: true };
28
- }
29
- // For 410 responses, use a minimum 3-second delay to ensure at least 70 seconds total retry duration
30
- const initialDelayMs = response?.status === 410
31
- ? Math.max(MIN_DELAY_FOR_410_MS, msiRetryConfig.startDelayInMs)
32
- : msiRetryConfig.startDelayInMs;
33
- return calculateRetryDelay(retryCount, {
34
- retryDelayInMs: initialDelayMs,
35
- maxRetryDelayInMs: DEFAULT_CLIENT_MAX_RETRY_INTERVAL,
36
- });
37
- },
38
- },
39
- ], {
40
- maxRetries: msiRetryConfig.maxRetries,
41
- });
42
- }
43
- //# sourceMappingURL=imdsRetryPolicy.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"imdsRetryPolicy.js","sourceRoot":"","sources":["../../../../src/credentials/managedIdentityCredential/imdsRetryPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAGxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEvD,0EAA0E;AAC1E,MAAM,iCAAiC,GAAG,IAAI,GAAG,EAAE,CAAC;AAEpD,sEAAsE;AACtE,oFAAoF;AACpF,kFAAkF;AAClF,sEAAsE;AACtE,MAAM,oBAAoB,GAAG,IAAI,CAAC;AAElC;;;;;;;;GAQG;AACH,MAAM,UAAU,eAAe,CAAC,cAA+C;IAC7E,OAAO,WAAW,CAChB;QACE;YACE,IAAI,EAAE,iBAAiB;YACvB,KAAK,EAAE,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,EAAE;gBAClC,IAAI,QAAQ,EAAE,MAAM,KAAK,GAAG,IAAI,QAAQ,EAAE,MAAM,KAAK,GAAG,EAAE,CAAC;oBACzD,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;gBAChC,CAAC;gBAED,qGAAqG;gBACrG,MAAM,cAAc,GAClB,QAAQ,EAAE,MAAM,KAAK,GAAG;oBACtB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,oBAAoB,EAAE,cAAc,CAAC,cAAc,CAAC;oBAC/D,CAAC,CAAC,cAAc,CAAC,cAAc,CAAC;gBAEpC,OAAO,mBAAmB,CAAC,UAAU,EAAE;oBACrC,cAAc,EAAE,cAAc;oBAC9B,iBAAiB,EAAE,iCAAiC;iBACrD,CAAC,CAAC;YACL,CAAC;SACF;KACF,EACD;QACE,UAAU,EAAE,cAAc,CAAC,UAAU;KACtC,CACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { PipelinePolicy } from \"@azure/core-rest-pipeline\";\nimport { retryPolicy } from \"@azure/core-rest-pipeline\";\n\nimport type { MSIConfiguration } from \"./models.js\";\nimport { calculateRetryDelay } from \"@azure/core-util\";\n\n// Matches the default retry configuration in expontentialRetryStrategy.ts\nconst DEFAULT_CLIENT_MAX_RETRY_INTERVAL = 1000 * 64;\n\n// For 410 responses, we need at least 70 seconds total retry duration\n// With 5 retries using exponential backoff: delays of d, 2d, 4d, 8d, 16d sum to 31d\n// Accounting for jitter (which can reduce delays by 20%), we need 31d * 0.8 >= 70\n// So we need d >= 70/24.8 = 2.82 seconds. Using 3 seconds to be safe.\nconst MIN_DELAY_FOR_410_MS = 3000;\n\n/**\n * An additional policy that retries on 404 and 410 errors. The default retry policy does not retry on\n * 404s or 410s, but the IMDS endpoint can return these when the token is not yet available or when\n * the identity is still being set up. This policy will retry on 404s and 410s with an exponential backoff.\n * For 410 responses, it uses a minimum 3-second initial delay to ensure at least 70 seconds total duration.\n *\n * @param msiRetryConfig - The retry configuration for the MSI credential.\n * @returns - The policy that will retry on 404s and 410s.\n */\nexport function imdsRetryPolicy(msiRetryConfig: MSIConfiguration[\"retryConfig\"]): PipelinePolicy {\n return retryPolicy(\n [\n {\n name: \"imdsRetryPolicy\",\n retry: ({ retryCount, response }) => {\n if (response?.status !== 404 && response?.status !== 410) {\n return { skipStrategy: true };\n }\n\n // For 410 responses, use a minimum 3-second delay to ensure at least 70 seconds total retry duration\n const initialDelayMs =\n response?.status === 410\n ? Math.max(MIN_DELAY_FOR_410_MS, msiRetryConfig.startDelayInMs)\n : msiRetryConfig.startDelayInMs;\n\n return calculateRetryDelay(retryCount, {\n retryDelayInMs: initialDelayMs,\n maxRetryDelayInMs: DEFAULT_CLIENT_MAX_RETRY_INTERVAL,\n });\n },\n },\n ],\n {\n maxRetries: msiRetryConfig.maxRetries,\n },\n );\n}\n"]}
@@ -1,6 +0,0 @@
1
- import type { AccessToken, TokenCredential } from "@azure/core-auth";
2
- export declare class ManagedIdentityCredential implements TokenCredential {
3
- constructor();
4
- getToken(): Promise<AccessToken | null>;
5
- }
6
- //# sourceMappingURL=index-browser.d.mts.map
@@ -1,24 +0,0 @@
1
- import type { AccessToken } from "@azure/core-auth";
2
- import type { IdentityClient } from "../../client/identityClient.js";
3
- /**
4
- * @internal
5
- */
6
- export interface MSIConfiguration {
7
- retryConfig: {
8
- maxRetries: number;
9
- startDelayInMs: number;
10
- intervalIncrement: number;
11
- };
12
- identityClient: IdentityClient;
13
- scopes: string | string[];
14
- clientId?: string;
15
- resourceId?: string;
16
- }
17
- /**
18
- * @internal
19
- * Represents an access token for {@link ManagedIdentity} for internal usage,
20
- * with an expiration time and the time in which token should refresh.
21
- */
22
- export declare interface MSIToken extends AccessToken {
23
- }
24
- //# sourceMappingURL=models.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../../src/credentials/managedIdentityCredential/models.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAErE;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE;QACX,UAAU,EAAE,MAAM,CAAC;QACnB,cAAc,EAAE,MAAM,CAAC;QACvB,iBAAiB,EAAE,MAAM,CAAC;KAC3B,CAAC;IACF,cAAc,EAAE,cAAc,CAAC;IAC/B,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,MAAM,CAAC,OAAO,WAAW,QAAS,SAAQ,WAAW;CAAG"}
@@ -1,4 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT License.
3
- export {};
4
- //# sourceMappingURL=models.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"models.js","sourceRoot":"","sources":["../../../../src/credentials/managedIdentityCredential/models.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AccessToken } from \"@azure/core-auth\";\n\nimport type { IdentityClient } from \"../../client/identityClient.js\";\n\n/**\n * @internal\n */\nexport interface MSIConfiguration {\n retryConfig: {\n maxRetries: number;\n startDelayInMs: number;\n intervalIncrement: number;\n };\n identityClient: IdentityClient;\n scopes: string | string[];\n clientId?: string;\n resourceId?: string;\n}\n\n/**\n * @internal\n * Represents an access token for {@link ManagedIdentity} for internal usage,\n * with an expiration time and the time in which token should refresh.\n */\nexport declare interface MSIToken extends AccessToken {}\n"]}
@@ -1,14 +0,0 @@
1
- import type { AccessToken, GetTokenOptions } from "@azure/core-auth";
2
- import type { MSIConfiguration } from "./models.js";
3
- /**
4
- * Defines how to determine whether the token exchange MSI is available, and also how to retrieve a token from the token exchange MSI.
5
- *
6
- * Token exchange MSI (used by AKS) is the only MSI implementation handled entirely by Azure Identity.
7
- * The rest have been migrated to MSAL.
8
- */
9
- export declare const tokenExchangeMsi: {
10
- name: string;
11
- isAvailable(clientId?: string): Promise<boolean>;
12
- getToken(configuration: MSIConfiguration, getTokenOptions?: GetTokenOptions): Promise<AccessToken | null>;
13
- };
14
- //# sourceMappingURL=tokenExchangeMsi.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tokenExchangeMsi.d.ts","sourceRoot":"","sources":["../../../../src/credentials/managedIdentityCredential/tokenExchangeMsi.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAQpD;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB;;2BAEE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;4BAerC,gBAAgB,oBACd,eAAe,GAC/B,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC;CAY/B,CAAC"}
@@ -1,38 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT License.
3
- import { WorkloadIdentityCredential } from "../workloadIdentityCredential.js";
4
- import { credentialLogger } from "../../util/logging.js";
5
- const msiName = "ManagedIdentityCredential - Token Exchange";
6
- const logger = credentialLogger(msiName);
7
- /**
8
- * Defines how to determine whether the token exchange MSI is available, and also how to retrieve a token from the token exchange MSI.
9
- *
10
- * Token exchange MSI (used by AKS) is the only MSI implementation handled entirely by Azure Identity.
11
- * The rest have been migrated to MSAL.
12
- */
13
- export const tokenExchangeMsi = {
14
- name: "tokenExchangeMsi",
15
- async isAvailable(clientId) {
16
- const env = process.env;
17
- const result = Boolean((clientId || env.AZURE_CLIENT_ID) &&
18
- env.AZURE_TENANT_ID &&
19
- process.env.AZURE_FEDERATED_TOKEN_FILE);
20
- if (!result) {
21
- logger.info(`${msiName}: Unavailable. The environment variables needed are: AZURE_CLIENT_ID (or the client ID sent through the parameters), AZURE_TENANT_ID and AZURE_FEDERATED_TOKEN_FILE`);
22
- }
23
- return result;
24
- },
25
- async getToken(configuration, getTokenOptions = {}) {
26
- const { scopes, clientId } = configuration;
27
- const identityClientTokenCredentialOptions = {};
28
- const workloadIdentityCredential = new WorkloadIdentityCredential({
29
- clientId,
30
- tenantId: process.env.AZURE_TENANT_ID,
31
- tokenFilePath: process.env.AZURE_FEDERATED_TOKEN_FILE,
32
- ...identityClientTokenCredentialOptions,
33
- disableInstanceDiscovery: true,
34
- });
35
- return workloadIdentityCredential.getToken(scopes, getTokenOptions);
36
- },
37
- };
38
- //# sourceMappingURL=tokenExchangeMsi.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tokenExchangeMsi.js","sourceRoot":"","sources":["../../../../src/credentials/managedIdentityCredential/tokenExchangeMsi.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAGzD,MAAM,OAAO,GAAG,4CAA4C,CAAC;AAC7D,MAAM,MAAM,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;AAEzC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,IAAI,EAAE,kBAAkB;IACxB,KAAK,CAAC,WAAW,CAAC,QAAiB;QACjC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;QACxB,MAAM,MAAM,GAAG,OAAO,CACpB,CAAC,QAAQ,IAAI,GAAG,CAAC,eAAe,CAAC;YACjC,GAAG,CAAC,eAAe;YACnB,OAAO,CAAC,GAAG,CAAC,0BAA0B,CACvC,CAAC;QACF,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,CAAC,IAAI,CACT,GAAG,OAAO,qKAAqK,CAChL,CAAC;QACJ,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,KAAK,CAAC,QAAQ,CACZ,aAA+B,EAC/B,kBAAmC,EAAE;QAErC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,aAAa,CAAC;QAC3C,MAAM,oCAAoC,GAAG,EAAE,CAAC;QAChD,MAAM,0BAA0B,GAAG,IAAI,0BAA0B,CAAC;YAChE,QAAQ;YACR,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,eAAe;YACrC,aAAa,EAAE,OAAO,CAAC,GAAG,CAAC,0BAA0B;YACrD,GAAG,oCAAoC;YACvC,wBAAwB,EAAE,IAAI;SACM,CAAC,CAAC;QACxC,OAAO,0BAA0B,CAAC,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IACtE,CAAC;CACF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AccessToken, GetTokenOptions } from \"@azure/core-auth\";\nimport type { MSIConfiguration } from \"./models.js\";\nimport { WorkloadIdentityCredential } from \"../workloadIdentityCredential.js\";\nimport { credentialLogger } from \"../../util/logging.js\";\nimport type { WorkloadIdentityCredentialOptions } from \"../workloadIdentityCredentialOptions.js\";\n\nconst msiName = \"ManagedIdentityCredential - Token Exchange\";\nconst logger = credentialLogger(msiName);\n\n/**\n * Defines how to determine whether the token exchange MSI is available, and also how to retrieve a token from the token exchange MSI.\n *\n * Token exchange MSI (used by AKS) is the only MSI implementation handled entirely by Azure Identity.\n * The rest have been migrated to MSAL.\n */\nexport const tokenExchangeMsi = {\n name: \"tokenExchangeMsi\",\n async isAvailable(clientId?: string): Promise<boolean> {\n const env = process.env;\n const result = Boolean(\n (clientId || env.AZURE_CLIENT_ID) &&\n env.AZURE_TENANT_ID &&\n process.env.AZURE_FEDERATED_TOKEN_FILE,\n );\n if (!result) {\n logger.info(\n `${msiName}: Unavailable. The environment variables needed are: AZURE_CLIENT_ID (or the client ID sent through the parameters), AZURE_TENANT_ID and AZURE_FEDERATED_TOKEN_FILE`,\n );\n }\n return result;\n },\n async getToken(\n configuration: MSIConfiguration,\n getTokenOptions: GetTokenOptions = {},\n ): Promise<AccessToken | null> {\n const { scopes, clientId } = configuration;\n const identityClientTokenCredentialOptions = {};\n const workloadIdentityCredential = new WorkloadIdentityCredential({\n clientId,\n tenantId: process.env.AZURE_TENANT_ID,\n tokenFilePath: process.env.AZURE_FEDERATED_TOKEN_FILE,\n ...identityClientTokenCredentialOptions,\n disableInstanceDiscovery: true,\n } as WorkloadIdentityCredentialOptions);\n return workloadIdentityCredential.getToken(scopes, getTokenOptions);\n },\n};\n"]}
@@ -1,12 +0,0 @@
1
- import type { AccessToken, TokenCredential } from "@azure/core-auth";
2
- /**
3
- * Enables authentication to Microsoft Entra ID using the [On Behalf Of flow](https://learn.microsoft.com/entra/identity-platform/v2-oauth2-on-behalf-of-flow).
4
- */
5
- export declare class OnBehalfOfCredential implements TokenCredential {
6
- /**
7
- * Only available in Node.js
8
- */
9
- constructor();
10
- getToken(): Promise<AccessToken | null>;
11
- }
12
- //# sourceMappingURL=onBehalfOfCredential-browser.d.mts.map
@@ -1,12 +0,0 @@
1
- /**
2
- * A function that searches for credentials in the Visual Studio Code credential store.
3
- *
4
- * @returns an array of credentials (username and password)
5
- * @internal
6
- *
7
- */
8
- export type VSCodeCredentialFinder = () => Promise<Array<{
9
- account: string;
10
- password: string;
11
- }>>;
12
- //# sourceMappingURL=visualStudioCodeCredentialPlugin.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"visualStudioCodeCredentialPlugin.d.ts","sourceRoot":"","sources":["../../../src/credentials/visualStudioCodeCredentialPlugin.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,MAAM,MAAM,sBAAsB,GAAG,MAAM,OAAO,CAAC,KAAK,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,CAAC"}
@@ -1,4 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT License.
3
- export {};
4
- //# sourceMappingURL=visualStudioCodeCredentialPlugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"visualStudioCodeCredentialPlugin.js","sourceRoot":"","sources":["../../../src/credentials/visualStudioCodeCredentialPlugin.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * A function that searches for credentials in the Visual Studio Code credential store.\n *\n * @returns an array of credentials (username and password)\n * @internal\n *\n */\nexport type VSCodeCredentialFinder = () => Promise<Array<{ account: string; password: string }>>;\n"]}
@@ -1,3 +0,0 @@
1
- import * as msalCommon from "@azure/msal-browser";
2
- export { msalCommon };
3
- //# sourceMappingURL=msal-browser.d.mts.map
@@ -1,5 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT License.
3
- import * as msalCommon from "@azure/msal-browser";
4
- export { msalCommon };
5
- //# sourceMappingURL=msal-browser.mjs.map
@@ -1,205 +0,0 @@
1
- import * as msal from "@azure/msal-node";
2
- import type { AccessToken, GetTokenOptions } from "@azure/core-auth";
3
- import type { AuthenticationRecord, CertificateParts } from "../types.js";
4
- import type { CredentialLogger } from "../../util/logging.js";
5
- import type { BrokerOptions } from "./brokerOptions.js";
6
- import type { DeviceCodePromptCallback } from "../../credentials/deviceCodeCredentialOptions.js";
7
- import type { InteractiveBrowserCredentialNodeOptions } from "../../credentials/interactiveBrowserCredentialOptions.js";
8
- import type { TokenCachePersistenceOptions } from "./tokenCachePersistenceOptions.js";
9
- import { CommonClientOptions } from "@azure/core-client";
10
- import { LogPolicyOptions } from "@azure/core-rest-pipeline";
11
- /**
12
- * Represents the options for acquiring a token using flows that support silent authentication.
13
- */
14
- export interface GetTokenWithSilentAuthOptions extends GetTokenOptions {
15
- /**
16
- * Disables automatic authentication. If set to true, the method will throw an error if the user needs to authenticate.
17
- *
18
- * @remarks
19
- *
20
- * This option will be set to `false` when the user calls `authenticate` directly on a credential that supports it.
21
- */
22
- disableAutomaticAuthentication?: boolean;
23
- }
24
- /**
25
- * Represents the options for acquiring a token interactively.
26
- */
27
- export interface GetTokenInteractiveOptions extends GetTokenWithSilentAuthOptions {
28
- /**
29
- * Window handle for parent window, required for WAM authentication.
30
- */
31
- parentWindowHandle?: Buffer;
32
- /**
33
- * Shared configuration options for browser customization
34
- */
35
- browserCustomizationOptions?: InteractiveBrowserCredentialNodeOptions["browserCustomizationOptions"];
36
- /**
37
- * loginHint allows a user name to be pre-selected for interactive logins.
38
- * Setting this option skips the account selection prompt and immediately attempts to login with the specified account.
39
- */
40
- loginHint?: string;
41
- }
42
- /**
43
- * Represents a client for interacting with the Microsoft Authentication Library (MSAL).
44
- */
45
- export interface MsalClient {
46
- /**
47
- *
48
- * Retrieves an access token by using the on-behalf-of flow and a client assertion callback of the calling service.
49
- *
50
- * @param scopes - The scopes for which the access token is requested. These represent the resources that the application wants to access.
51
- * @param userAssertionToken - The access token that was sent to the middle-tier API. This token must have an audience of the app making this OBO request.
52
- * @param clientCredentials - The client secret OR client certificate OR client `getAssertion` callback.
53
- * @param options - Additional options that may be provided to the method.
54
- * @returns An access token.
55
- */
56
- getTokenOnBehalfOf(scopes: string[], userAssertionToken: string, clientCredentials: string | CertificateParts | (() => Promise<string>), options?: GetTokenOptions): Promise<AccessToken>;
57
- /**
58
- * Retrieves an access token by using an interactive prompt (InteractiveBrowserCredential).
59
- * @param scopes - The scopes for which the access token is requested. These represent the resources that the application wants to access.
60
- * @param options - Additional options that may be provided to the method.
61
- * @returns An access token.
62
- */
63
- getTokenByInteractiveRequest(scopes: string[], options: GetTokenInteractiveOptions): Promise<AccessToken>;
64
- /**
65
- * Retrieves an access token by using a user's username and password.
66
- *
67
- * @param scopes - The scopes for which the access token is requested. These represent the resources that the application wants to access.
68
- * @param username - The username provided by the developer.
69
- * @param password - The user's password provided by the developer.
70
- * @param options - Additional options that may be provided to the method.
71
- * @returns An access token.
72
- */
73
- getTokenByUsernamePassword(scopes: string[], username: string, password: string, options?: GetTokenOptions): Promise<AccessToken>;
74
- /**
75
- * Retrieves an access token by prompting the user to authenticate using a device code.
76
- *
77
- * @param scopes - The scopes for which the access token is requested. These represent the resources that the application wants to access.
78
- * @param userPromptCallback - The callback function that allows developers to customize the prompt message.
79
- * @param options - Additional options that may be provided to the method.
80
- * @returns An access token.
81
- */
82
- getTokenByDeviceCode(scopes: string[], userPromptCallback: DeviceCodePromptCallback, options?: GetTokenWithSilentAuthOptions): Promise<AccessToken>;
83
- /**
84
- * Retrieves an access token by using a client certificate.
85
- *
86
- * @param scopes - The scopes for which the access token is requested. These represent the resources that the application wants to access.
87
- * @param certificate - The client certificate used for authentication.
88
- * @param options - Additional options that may be provided to the method.
89
- * @returns An access token.
90
- */
91
- getTokenByClientCertificate(scopes: string[], certificate: CertificateParts, options?: GetTokenOptions): Promise<AccessToken>;
92
- /**
93
- * Retrieves an access token by using a client assertion.
94
- *
95
- * @param scopes - The scopes for which the access token is requested. These represent the resources that the application wants to access.
96
- * @param clientAssertion - The client `getAssertion` callback used for authentication.
97
- * @param options - Additional options that may be provided to the method.
98
- * @returns An access token.
99
- */
100
- getTokenByClientAssertion(scopes: string[], clientAssertion: () => Promise<string>, options?: GetTokenOptions): Promise<AccessToken>;
101
- /**
102
- * Retrieves an access token by using a client secret.
103
- *
104
- * @param scopes - The scopes for which the access token is requested. These represent the resources that the application wants to access.
105
- * @param clientSecret - The client secret of the application. This is a credential that the application can use to authenticate itself.
106
- * @param options - Additional options that may be provided to the method.
107
- * @returns An access token.
108
- */
109
- getTokenByClientSecret(scopes: string[], clientSecret: string, options?: GetTokenOptions): Promise<AccessToken>;
110
- /**
111
- * Retrieves an access token by using an authorization code flow.
112
- *
113
- * @param scopes - The scopes for which the access token is requested. These represent the resources that the application wants to access.
114
- * @param authorizationCode - An authorization code that was received from following the
115
- authorization code flow. This authorization code must not
116
- have already been used to obtain an access token.
117
- * @param redirectUri - The redirect URI that was used to request the authorization code.
118
- Must be the same URI that is configured for the App Registration.
119
- * @param clientSecret - An optional client secret that was generated for the App Registration.
120
- * @param options - Additional options that may be provided to the method.
121
- */
122
- getTokenByAuthorizationCode(scopes: string[], redirectUri: string, authorizationCode: string, clientSecret?: string, options?: GetTokenWithSilentAuthOptions): Promise<AccessToken>;
123
- /**
124
- * Retrieves the last authenticated account. This method expects an authentication record to have been previously loaded.
125
- *
126
- * An authentication record could be loaded by calling the `getToken` method, or by providing an `authenticationRecord` when creating a credential.
127
- */
128
- getActiveAccount(): AuthenticationRecord | undefined;
129
- /**
130
- * Retrieves an access token using brokered authentication.
131
- *
132
- * @param scopes - The scopes for which the access token is requested. These represent the resources that the application wants to access.
133
- * @param useDefaultBrokerAccount - Whether to use the default broker account for authentication.
134
- * @param options - Additional options that may be provided to the method.
135
- * @returns An access token.
136
- */
137
- getBrokeredToken(scopes: string[], useDefaultBrokerAccount: boolean, options?: GetTokenInteractiveOptions): Promise<AccessToken>;
138
- }
139
- /**
140
- * Represents the options for configuring the MsalClient.
141
- */
142
- export interface MsalClientOptions extends CommonClientOptions {
143
- /**
144
- * Parameters that enable WAM broker authentication in the InteractiveBrowserCredential.
145
- */
146
- brokerOptions?: BrokerOptions;
147
- /**
148
- * Parameters that enable token cache persistence in the Identity credentials.
149
- */
150
- tokenCachePersistenceOptions?: TokenCachePersistenceOptions;
151
- /**
152
- * Indicates if this is being used by VSCode credential.
153
- */
154
- isVSCodeCredential?: boolean;
155
- /**
156
- * A custom authority host.
157
- */
158
- authorityHost?: string;
159
- /**
160
- * Allows users to configure settings for logging policy options, allow logging account information and personally identifiable information for customer support.
161
- */
162
- loggingOptions?: LogPolicyOptions & {
163
- /**
164
- * Allows logging account information once the authentication flow succeeds.
165
- */
166
- allowLoggingAccountIdentifiers?: boolean;
167
- /**
168
- * Allows logging personally identifiable information for customer support.
169
- */
170
- enableUnsafeSupportLogging?: boolean;
171
- };
172
- /**
173
- * Determines whether instance discovery is disabled.
174
- */
175
- disableInstanceDiscovery?: boolean;
176
- /**
177
- * The logger for the MsalClient.
178
- */
179
- logger?: CredentialLogger;
180
- /**
181
- * The authentication record for the MsalClient.
182
- */
183
- authenticationRecord?: AuthenticationRecord;
184
- }
185
- /**
186
- * Generates the configuration for MSAL (Microsoft Authentication Library).
187
- *
188
- * @param clientId - The client ID of the application.
189
- * @param tenantId - The tenant ID of the Azure Active Directory.
190
- * @param msalClientOptions - Optional. Additional options for creating the MSAL client.
191
- * @returns The MSAL configuration object.
192
- */
193
- export declare function generateMsalConfiguration(clientId: string, tenantId: string, msalClientOptions?: MsalClientOptions): msal.Configuration;
194
- /**
195
- * Creates an instance of the MSAL (Microsoft Authentication Library) client.
196
- *
197
- * @param clientId - The client ID of the application.
198
- * @param tenantId - The tenant ID of the Azure Active Directory.
199
- * @param createMsalClientOptions - Optional. Additional options for creating the MSAL client.
200
- * @returns An instance of the MSAL client.
201
- *
202
- * @public
203
- */
204
- export declare function createMsalClient(clientId: string, tenantId: string, createMsalClientOptions?: MsalClientOptions): MsalClient;
205
- //# sourceMappingURL=msalClient.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"msalClient.d.ts","sourceRoot":"","sources":["../../../../src/msal/nodeFlows/msalClient.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAC;AAEzC,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACrE,O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