@azure/identity 4.5.1-alpha.20250115.7 → 4.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (1054) hide show
  1. package/README.md +1 -5
  2. package/dist/index.js +4211 -0
  3. package/dist/index.js.map +1 -0
  4. package/{dist/esm → dist-esm/src}/client/identityClient.js +7 -7
  5. package/dist-esm/src/client/identityClient.js.map +1 -0
  6. package/{dist/esm → dist-esm/src}/constants.js +2 -10
  7. package/dist-esm/src/constants.js.map +1 -0
  8. package/{dist/browser/credentials/authorizationCodeCredential.js → dist-esm/src/credentials/authorizationCodeCredential.browser.js} +2 -2
  9. package/dist-esm/src/credentials/authorizationCodeCredential.browser.js.map +1 -0
  10. package/{dist/esm → dist-esm/src}/credentials/authorizationCodeCredential.js +6 -6
  11. package/dist-esm/src/credentials/authorizationCodeCredential.js.map +1 -0
  12. package/dist-esm/src/credentials/authorizationCodeCredentialOptions.js.map +1 -0
  13. package/{dist/browser/credentials/azureApplicationCredential.js → dist-esm/src/credentials/azureApplicationCredential.browser.js} +3 -3
  14. package/dist-esm/src/credentials/azureApplicationCredential.browser.js.map +1 -0
  15. package/{dist/esm → dist-esm/src}/credentials/azureApplicationCredential.js +2 -2
  16. package/dist-esm/src/credentials/azureApplicationCredential.js.map +1 -0
  17. package/dist-esm/src/credentials/azureApplicationCredentialOptions.js.map +1 -0
  18. package/{dist/browser/credentials/azureCliCredential.js → dist-esm/src/credentials/azureCliCredential.browser.js} +2 -2
  19. package/dist-esm/src/credentials/azureCliCredential.browser.js.map +1 -0
  20. package/{dist/esm → dist-esm/src}/credentials/azureCliCredential.js +10 -24
  21. package/dist-esm/src/credentials/azureCliCredential.js.map +1 -0
  22. package/dist-esm/src/credentials/azureCliCredentialOptions.js.map +1 -0
  23. package/{dist/browser/credentials/azureDeveloperCliCredential.js → dist-esm/src/credentials/azureDeveloperCliCredential.browser.js} +2 -2
  24. package/dist-esm/src/credentials/azureDeveloperCliCredential.browser.js.map +1 -0
  25. package/{dist/esm → dist-esm/src}/credentials/azureDeveloperCliCredential.js +8 -8
  26. package/dist-esm/src/credentials/azureDeveloperCliCredential.js.map +1 -0
  27. package/dist-esm/src/credentials/azureDeveloperCliCredentialOptions.js.map +1 -0
  28. package/{dist/browser/credentials/azurePipelinesCredential.js → dist-esm/src/credentials/azurePipelinesCredential.browser.js} +2 -2
  29. package/dist-esm/src/credentials/azurePipelinesCredential.browser.js.map +1 -0
  30. package/{dist/esm → dist-esm/src}/credentials/azurePipelinesCredential.js +5 -5
  31. package/dist-esm/src/credentials/azurePipelinesCredential.js.map +1 -0
  32. package/dist-esm/src/credentials/azurePipelinesCredentialOptions.js.map +1 -0
  33. package/{dist/browser/credentials/azurePowerShellCredential.js → dist-esm/src/credentials/azurePowerShellCredential.browser.js} +2 -2
  34. package/dist-esm/src/credentials/azurePowerShellCredential.browser.js.map +1 -0
  35. package/{dist/esm → dist-esm/src}/credentials/azurePowerShellCredential.js +6 -6
  36. package/dist-esm/src/credentials/azurePowerShellCredential.js.map +1 -0
  37. package/dist-esm/src/credentials/azurePowerShellCredentialOptions.js.map +1 -0
  38. package/dist-esm/src/credentials/brokerAuthOptions.js.map +1 -0
  39. package/{dist/esm → dist-esm/src}/credentials/chainedTokenCredential.js +5 -8
  40. package/dist-esm/src/credentials/chainedTokenCredential.js.map +1 -0
  41. package/{dist/browser/credentials/clientAssertionCredential.js → dist-esm/src/credentials/clientAssertionCredential.browser.js} +2 -2
  42. package/dist-esm/src/credentials/clientAssertionCredential.browser.js.map +1 -0
  43. package/{dist/esm → dist-esm/src}/credentials/clientAssertionCredential.js +5 -5
  44. package/dist-esm/src/credentials/clientAssertionCredential.js.map +1 -0
  45. package/dist-esm/src/credentials/clientAssertionCredentialOptions.js.map +1 -0
  46. package/{dist/browser/credentials/clientCertificateCredential.js → dist-esm/src/credentials/clientCertificateCredential.browser.js} +2 -2
  47. package/dist-esm/src/credentials/clientCertificateCredential.browser.js.map +1 -0
  48. package/{dist/esm → dist-esm/src}/credentials/clientCertificateCredential.js +9 -12
  49. package/dist-esm/src/credentials/clientCertificateCredential.js.map +1 -0
  50. package/dist-esm/src/credentials/clientCertificateCredentialOptions.js.map +1 -0
  51. package/{dist/browser/credentials/clientSecretCredential.js → dist-esm/src/credentials/clientSecretCredential.browser.js} +6 -6
  52. package/dist-esm/src/credentials/clientSecretCredential.browser.js.map +1 -0
  53. package/{dist/esm → dist-esm/src}/credentials/clientSecretCredential.js +6 -6
  54. package/dist-esm/src/credentials/clientSecretCredential.js.map +1 -0
  55. package/dist-esm/src/credentials/clientSecretCredentialOptions.js.map +1 -0
  56. package/dist-esm/src/credentials/credentialPersistenceOptions.js.map +1 -0
  57. package/{dist/browser/credentials/defaultAzureCredential.js → dist-esm/src/credentials/defaultAzureCredential.browser.js} +3 -3
  58. package/dist-esm/src/credentials/defaultAzureCredential.browser.js.map +1 -0
  59. package/{dist/esm → dist-esm/src}/credentials/defaultAzureCredential.js +10 -23
  60. package/dist-esm/src/credentials/defaultAzureCredential.js.map +1 -0
  61. package/dist-esm/src/credentials/defaultAzureCredentialOptions.js.map +1 -0
  62. package/{dist/browser/credentials/deviceCodeCredential.js → dist-esm/src/credentials/deviceCodeCredential.browser.js} +2 -2
  63. package/dist-esm/src/credentials/deviceCodeCredential.browser.js.map +1 -0
  64. package/{dist/esm → dist-esm/src}/credentials/deviceCodeCredential.js +6 -6
  65. package/dist-esm/src/credentials/deviceCodeCredential.js.map +1 -0
  66. package/dist-esm/src/credentials/deviceCodeCredentialOptions.js.map +1 -0
  67. package/{dist/browser/credentials/environmentCredential.js → dist-esm/src/credentials/environmentCredential.browser.js} +2 -2
  68. package/dist-esm/src/credentials/environmentCredential.browser.js.map +1 -0
  69. package/{dist/esm → dist-esm/src}/credentials/environmentCredential.js +7 -7
  70. package/dist-esm/src/credentials/environmentCredential.js.map +1 -0
  71. package/dist-esm/src/credentials/environmentCredentialOptions.js.map +1 -0
  72. package/{dist/browser/credentials/interactiveBrowserCredential.js → dist-esm/src/credentials/interactiveBrowserCredential.browser.js} +6 -6
  73. package/dist-esm/src/credentials/interactiveBrowserCredential.browser.js.map +1 -0
  74. package/{dist/esm → dist-esm/src}/credentials/interactiveBrowserCredential.js +6 -6
  75. package/{dist/commonjs → dist-esm/src}/credentials/interactiveBrowserCredential.js.map +1 -1
  76. package/dist-esm/src/credentials/interactiveBrowserCredentialOptions.js.map +1 -0
  77. package/dist-esm/src/credentials/interactiveCredentialOptions.js.map +1 -0
  78. package/dist-esm/src/credentials/managedIdentityCredential/appServiceMsi2017.js +71 -0
  79. package/dist-esm/src/credentials/managedIdentityCredential/appServiceMsi2017.js.map +1 -0
  80. package/dist-esm/src/credentials/managedIdentityCredential/appServiceMsi2019.js +71 -0
  81. package/dist-esm/src/credentials/managedIdentityCredential/appServiceMsi2019.js.map +1 -0
  82. package/dist-esm/src/credentials/managedIdentityCredential/arcMsi.js +140 -0
  83. package/dist-esm/src/credentials/managedIdentityCredential/arcMsi.js.map +1 -0
  84. package/dist-esm/src/credentials/managedIdentityCredential/cloudShellMsi.js +75 -0
  85. package/dist-esm/src/credentials/managedIdentityCredential/cloudShellMsi.js.map +1 -0
  86. package/dist-esm/src/credentials/managedIdentityCredential/constants.js +9 -0
  87. package/dist-esm/src/credentials/managedIdentityCredential/constants.js.map +1 -0
  88. package/dist-esm/src/credentials/managedIdentityCredential/fabricMsi.js +95 -0
  89. package/dist-esm/src/credentials/managedIdentityCredential/fabricMsi.js.map +1 -0
  90. package/{dist/esm → dist-esm/src}/credentials/managedIdentityCredential/imdsMsi.js +38 -16
  91. package/dist-esm/src/credentials/managedIdentityCredential/imdsMsi.js.map +1 -0
  92. package/dist-esm/src/credentials/managedIdentityCredential/imdsRetryPolicy.js.map +1 -0
  93. package/{dist/browser/credentials/managedIdentityCredential/index.js → dist-esm/src/credentials/managedIdentityCredential/index.browser.js} +2 -2
  94. package/dist-esm/src/credentials/managedIdentityCredential/index.browser.js.map +1 -0
  95. package/dist-esm/src/credentials/managedIdentityCredential/index.js +37 -0
  96. package/dist-esm/src/credentials/managedIdentityCredential/index.js.map +1 -0
  97. package/dist-esm/src/credentials/managedIdentityCredential/legacyMsiProvider.js +309 -0
  98. package/dist-esm/src/credentials/managedIdentityCredential/legacyMsiProvider.js.map +1 -0
  99. package/dist-esm/src/credentials/managedIdentityCredential/models.js.map +1 -0
  100. package/{dist/esm/credentials/managedIdentityCredential/index.js → dist-esm/src/credentials/managedIdentityCredential/msalMsiProvider.js} +26 -31
  101. package/dist-esm/src/credentials/managedIdentityCredential/msalMsiProvider.js.map +1 -0
  102. package/{dist/browser → dist-esm/src}/credentials/managedIdentityCredential/tokenExchangeMsi.js +3 -6
  103. package/dist-esm/src/credentials/managedIdentityCredential/tokenExchangeMsi.js.map +1 -0
  104. package/{dist/browser → dist-esm/src}/credentials/managedIdentityCredential/utils.js +1 -1
  105. package/dist-esm/src/credentials/managedIdentityCredential/utils.js.map +1 -0
  106. package/dist-esm/src/credentials/multiTenantTokenCredentialOptions.js.map +1 -0
  107. package/{dist/browser/credentials/onBehalfOfCredential.js → dist-esm/src/credentials/onBehalfOfCredential.browser.js} +2 -2
  108. package/dist-esm/src/credentials/onBehalfOfCredential.browser.js.map +1 -0
  109. package/{dist/esm → dist-esm/src}/credentials/onBehalfOfCredential.js +6 -6
  110. package/dist-esm/src/credentials/onBehalfOfCredential.js.map +1 -0
  111. package/dist-esm/src/credentials/onBehalfOfCredentialOptions.js.map +1 -0
  112. package/{dist/browser/credentials/usernamePasswordCredential.js → dist-esm/src/credentials/usernamePasswordCredential.browser.js} +6 -6
  113. package/dist-esm/src/credentials/usernamePasswordCredential.browser.js.map +1 -0
  114. package/{dist/esm → dist-esm/src}/credentials/usernamePasswordCredential.js +6 -6
  115. package/dist-esm/src/credentials/usernamePasswordCredential.js.map +1 -0
  116. package/dist-esm/src/credentials/usernamePasswordCredentialOptions.js.map +1 -0
  117. package/{dist/browser/credentials/visualStudioCodeCredential.js → dist-esm/src/credentials/visualStudioCodeCredential.browser.js} +2 -2
  118. package/dist-esm/src/credentials/visualStudioCodeCredential.browser.js.map +1 -0
  119. package/{dist/esm → dist-esm/src}/credentials/visualStudioCodeCredential.js +9 -9
  120. package/dist-esm/src/credentials/visualStudioCodeCredential.js.map +1 -0
  121. package/dist-esm/src/credentials/visualStudioCodeCredentialOptions.js.map +1 -0
  122. package/{dist/browser/credentials/workloadIdentityCredential.js → dist-esm/src/credentials/workloadIdentityCredential.browser.js} +2 -2
  123. package/dist-esm/src/credentials/workloadIdentityCredential.browser.js.map +1 -0
  124. package/{dist/esm → dist-esm/src}/credentials/workloadIdentityCredential.js +5 -5
  125. package/dist-esm/src/credentials/workloadIdentityCredential.js.map +1 -0
  126. package/dist-esm/src/credentials/workloadIdentityCredentialOptions.js.map +1 -0
  127. package/dist-esm/src/errors.js.map +1 -0
  128. package/{dist/browser → dist-esm/src}/index.js +25 -25
  129. package/dist-esm/src/index.js.map +1 -0
  130. package/dist-esm/src/msal/browserFlows/flows.js.map +1 -0
  131. package/{dist/esm → dist-esm/src}/msal/browserFlows/msalAuthCode.js +3 -3
  132. package/dist-esm/src/msal/browserFlows/msalAuthCode.js.map +1 -0
  133. package/{dist/browser → dist-esm/src}/msal/browserFlows/msalBrowserCommon.js +5 -5
  134. package/dist-esm/src/msal/browserFlows/msalBrowserCommon.js.map +1 -0
  135. package/dist-esm/src/msal/credentials.js.map +1 -0
  136. package/{dist/browser/msal/msal.js → dist-esm/src/msal/msal.browser.js} +1 -1
  137. package/dist-esm/src/msal/msal.browser.js.map +1 -0
  138. package/{dist/browser → dist-esm/src}/msal/nodeFlows/msalClient.js +16 -9
  139. package/dist-esm/src/msal/nodeFlows/msalClient.js.map +1 -0
  140. package/{dist/browser → dist-esm/src}/msal/nodeFlows/msalPlugins.js +1 -1
  141. package/dist-esm/src/msal/nodeFlows/msalPlugins.js.map +1 -0
  142. package/{dist/browser → dist-esm/src}/msal/types.js.map +1 -1
  143. package/{dist/browser → dist-esm/src}/msal/utils.js +8 -14
  144. package/dist-esm/src/msal/utils.js.map +1 -0
  145. package/{dist/browser/plugins/consumer.js → dist-esm/src/plugins/consumer.browser.js} +1 -1
  146. package/dist-esm/src/plugins/consumer.browser.js.map +1 -0
  147. package/{dist/esm → dist-esm/src}/plugins/consumer.js +2 -2
  148. package/dist-esm/src/plugins/consumer.js.map +1 -0
  149. package/dist-esm/src/plugins/provider.js.map +1 -0
  150. package/dist-esm/src/tokenCredentialOptions.js.map +1 -0
  151. package/{dist/browser → dist-esm/src}/tokenProvider.js +0 -1
  152. package/dist-esm/src/tokenProvider.js.map +1 -0
  153. package/{dist/esm/util/authHostEnv-browser.mjs → dist-esm/src/util/authHostEnv.browser.js} +1 -1
  154. package/dist-esm/src/util/authHostEnv.browser.js.map +1 -0
  155. package/dist-esm/src/util/logging.js.map +1 -0
  156. package/{dist/browser/util/processMultiTenantRequest.js → dist-esm/src/util/processMultiTenantRequest.browser.js} +1 -1
  157. package/dist-esm/src/util/processMultiTenantRequest.browser.js.map +1 -0
  158. package/{dist/esm → dist-esm/src}/util/processMultiTenantRequest.js +2 -2
  159. package/{dist/commonjs → dist-esm/src}/util/processMultiTenantRequest.js.map +1 -1
  160. package/{dist/browser → dist-esm/src}/util/scopeUtils.js +1 -1
  161. package/dist-esm/src/util/scopeUtils.js.map +1 -0
  162. package/{dist/esm → dist-esm/src}/util/tenantIdUtils.js +3 -3
  163. package/dist-esm/src/util/tenantIdUtils.js.map +1 -0
  164. package/{dist/browser → dist-esm/src}/util/tracing.js +1 -1
  165. package/dist-esm/src/util/tracing.js.map +1 -0
  166. package/package.json +79 -65
  167. package/types/identity.d.ts +1853 -0
  168. package/dist/browser/client/identityClient.d.ts +0 -65
  169. package/dist/browser/client/identityClient.d.ts.map +0 -1
  170. package/dist/browser/client/identityClient.js +0 -248
  171. package/dist/browser/client/identityClient.js.map +0 -1
  172. package/dist/browser/constants.d.ts +0 -69
  173. package/dist/browser/constants.d.ts.map +0 -1
  174. package/dist/browser/constants.js +0 -75
  175. package/dist/browser/constants.js.map +0 -1
  176. package/dist/browser/credentials/authorityValidationOptions.d.ts +0 -16
  177. package/dist/browser/credentials/authorityValidationOptions.d.ts.map +0 -1
  178. package/dist/browser/credentials/authorizationCodeCredential-browser.d.mts.map +0 -1
  179. package/dist/browser/credentials/authorizationCodeCredential-browser.mjs.map +0 -1
  180. package/dist/browser/credentials/authorizationCodeCredential.d.ts +0 -11
  181. package/dist/browser/credentials/authorizationCodeCredentialOptions.d.ts +0 -8
  182. package/dist/browser/credentials/authorizationCodeCredentialOptions.d.ts.map +0 -1
  183. package/dist/browser/credentials/authorizationCodeCredentialOptions.js.map +0 -1
  184. package/dist/browser/credentials/azureApplicationCredential-browser.d.mts.map +0 -1
  185. package/dist/browser/credentials/azureApplicationCredential-browser.mjs.map +0 -1
  186. package/dist/browser/credentials/azureApplicationCredential.d.ts +0 -24
  187. package/dist/browser/credentials/azureApplicationCredentialOptions.d.ts +0 -13
  188. package/dist/browser/credentials/azureApplicationCredentialOptions.d.ts.map +0 -1
  189. package/dist/browser/credentials/azureApplicationCredentialOptions.js.map +0 -1
  190. package/dist/browser/credentials/azureCliCredential-browser.d.mts.map +0 -1
  191. package/dist/browser/credentials/azureCliCredential-browser.mjs.map +0 -1
  192. package/dist/browser/credentials/azureCliCredential.d.ts +0 -13
  193. package/dist/browser/credentials/azureCliCredentialOptions.d.ts +0 -20
  194. package/dist/browser/credentials/azureCliCredentialOptions.d.ts.map +0 -1
  195. package/dist/browser/credentials/azureCliCredentialOptions.js.map +0 -1
  196. package/dist/browser/credentials/azureDeveloperCliCredential-browser.d.mts.map +0 -1
  197. package/dist/browser/credentials/azureDeveloperCliCredential-browser.mjs.map +0 -1
  198. package/dist/browser/credentials/azureDeveloperCliCredential.d.ts +0 -13
  199. package/dist/browser/credentials/azureDeveloperCliCredentialOptions.d.ts +0 -15
  200. package/dist/browser/credentials/azureDeveloperCliCredentialOptions.d.ts.map +0 -1
  201. package/dist/browser/credentials/azureDeveloperCliCredentialOptions.js.map +0 -1
  202. package/dist/browser/credentials/azurePipelinesCredential-browser.d.mts.map +0 -1
  203. package/dist/browser/credentials/azurePipelinesCredential-browser.mjs.map +0 -1
  204. package/dist/browser/credentials/azurePipelinesCredential.d.ts +0 -13
  205. package/dist/browser/credentials/azurePipelinesCredentialOptions.d.ts +0 -9
  206. package/dist/browser/credentials/azurePipelinesCredentialOptions.d.ts.map +0 -1
  207. package/dist/browser/credentials/azurePipelinesCredentialOptions.js.map +0 -1
  208. package/dist/browser/credentials/azurePowerShellCredential-browser.d.mts.map +0 -1
  209. package/dist/browser/credentials/azurePowerShellCredential-browser.mjs.map +0 -1
  210. package/dist/browser/credentials/azurePowerShellCredential.d.ts +0 -12
  211. package/dist/browser/credentials/azurePowerShellCredentialOptions.d.ts +0 -15
  212. package/dist/browser/credentials/azurePowerShellCredentialOptions.d.ts.map +0 -1
  213. package/dist/browser/credentials/azurePowerShellCredentialOptions.js.map +0 -1
  214. package/dist/browser/credentials/brokerAuthOptions.d.ts +0 -13
  215. package/dist/browser/credentials/brokerAuthOptions.d.ts.map +0 -1
  216. package/dist/browser/credentials/brokerAuthOptions.js.map +0 -1
  217. package/dist/browser/credentials/browserCustomizationOptions.d.ts +0 -19
  218. package/dist/browser/credentials/browserCustomizationOptions.d.ts.map +0 -1
  219. package/dist/browser/credentials/chainedTokenCredential.d.ts +0 -51
  220. package/dist/browser/credentials/chainedTokenCredential.d.ts.map +0 -1
  221. package/dist/browser/credentials/chainedTokenCredential.js +0 -92
  222. package/dist/browser/credentials/chainedTokenCredential.js.map +0 -1
  223. package/dist/browser/credentials/clientAssertionCredential-browser.d.mts.map +0 -1
  224. package/dist/browser/credentials/clientAssertionCredential-browser.mjs.map +0 -1
  225. package/dist/browser/credentials/clientAssertionCredential.d.ts +0 -12
  226. package/dist/browser/credentials/clientAssertionCredentialOptions.d.ts +0 -9
  227. package/dist/browser/credentials/clientAssertionCredentialOptions.d.ts.map +0 -1
  228. package/dist/browser/credentials/clientAssertionCredentialOptions.js.map +0 -1
  229. package/dist/browser/credentials/clientCertificateCredential-browser.d.mts.map +0 -1
  230. package/dist/browser/credentials/clientCertificateCredential-browser.mjs.map +0 -1
  231. package/dist/browser/credentials/clientCertificateCredential.d.ts +0 -13
  232. package/dist/browser/credentials/clientCertificateCredentialModels.d.ts +0 -31
  233. package/dist/browser/credentials/clientCertificateCredentialModels.d.ts.map +0 -1
  234. package/dist/browser/credentials/clientCertificateCredentialModels.js +0 -4
  235. package/dist/browser/credentials/clientCertificateCredentialModels.js.map +0 -1
  236. package/dist/browser/credentials/clientCertificateCredentialOptions.d.ts +0 -14
  237. package/dist/browser/credentials/clientCertificateCredentialOptions.d.ts.map +0 -1
  238. package/dist/browser/credentials/clientCertificateCredentialOptions.js.map +0 -1
  239. package/dist/browser/credentials/clientSecretCredential-browser.d.mts.map +0 -1
  240. package/dist/browser/credentials/clientSecretCredential-browser.mjs.map +0 -1
  241. package/dist/browser/credentials/clientSecretCredential.d.ts +0 -40
  242. package/dist/browser/credentials/clientSecretCredentialOptions.d.ts +0 -9
  243. package/dist/browser/credentials/clientSecretCredentialOptions.d.ts.map +0 -1
  244. package/dist/browser/credentials/clientSecretCredentialOptions.js.map +0 -1
  245. package/dist/browser/credentials/credentialPersistenceOptions.d.ts +0 -30
  246. package/dist/browser/credentials/credentialPersistenceOptions.d.ts.map +0 -1
  247. package/dist/browser/credentials/credentialPersistenceOptions.js.map +0 -1
  248. package/dist/browser/credentials/defaultAzureCredential-browser.d.mts.map +0 -1
  249. package/dist/browser/credentials/defaultAzureCredential-browser.mjs.map +0 -1
  250. package/dist/browser/credentials/defaultAzureCredential.d.ts +0 -19
  251. package/dist/browser/credentials/defaultAzureCredentialOptions.d.ts +0 -49
  252. package/dist/browser/credentials/defaultAzureCredentialOptions.d.ts.map +0 -1
  253. package/dist/browser/credentials/defaultAzureCredentialOptions.js.map +0 -1
  254. package/dist/browser/credentials/deviceCodeCredential-browser.d.mts.map +0 -1
  255. package/dist/browser/credentials/deviceCodeCredential-browser.mjs.map +0 -1
  256. package/dist/browser/credentials/deviceCodeCredential.d.ts +0 -13
  257. package/dist/browser/credentials/deviceCodeCredentialOptions.d.ts +0 -53
  258. package/dist/browser/credentials/deviceCodeCredentialOptions.d.ts.map +0 -1
  259. package/dist/browser/credentials/deviceCodeCredentialOptions.js.map +0 -1
  260. package/dist/browser/credentials/environmentCredential-browser.d.mts.map +0 -1
  261. package/dist/browser/credentials/environmentCredential-browser.mjs.map +0 -1
  262. package/dist/browser/credentials/environmentCredential.d.ts +0 -13
  263. package/dist/browser/credentials/environmentCredentialOptions.d.ts +0 -9
  264. package/dist/browser/credentials/environmentCredentialOptions.d.ts.map +0 -1
  265. package/dist/browser/credentials/environmentCredentialOptions.js.map +0 -1
  266. package/dist/browser/credentials/interactiveBrowserCredential-browser.d.mts.map +0 -1
  267. package/dist/browser/credentials/interactiveBrowserCredential-browser.mjs.map +0 -1
  268. package/dist/browser/credentials/interactiveBrowserCredential.d.ts +0 -53
  269. package/dist/browser/credentials/interactiveBrowserCredentialOptions.d.ts +0 -77
  270. package/dist/browser/credentials/interactiveBrowserCredentialOptions.d.ts.map +0 -1
  271. package/dist/browser/credentials/interactiveBrowserCredentialOptions.js.map +0 -1
  272. package/dist/browser/credentials/interactiveCredentialOptions.d.ts +0 -25
  273. package/dist/browser/credentials/interactiveCredentialOptions.d.ts.map +0 -1
  274. package/dist/browser/credentials/interactiveCredentialOptions.js.map +0 -1
  275. package/dist/browser/credentials/managedIdentityCredential/imdsMsi.d.ts +0 -18
  276. package/dist/browser/credentials/managedIdentityCredential/imdsMsi.d.ts.map +0 -1
  277. package/dist/browser/credentials/managedIdentityCredential/imdsMsi.js +0 -122
  278. package/dist/browser/credentials/managedIdentityCredential/imdsMsi.js.map +0 -1
  279. package/dist/browser/credentials/managedIdentityCredential/imdsRetryPolicy.d.ts +0 -12
  280. package/dist/browser/credentials/managedIdentityCredential/imdsRetryPolicy.d.ts.map +0 -1
  281. package/dist/browser/credentials/managedIdentityCredential/imdsRetryPolicy.js.map +0 -1
  282. package/dist/browser/credentials/managedIdentityCredential/index-browser.d.mts.map +0 -1
  283. package/dist/browser/credentials/managedIdentityCredential/index-browser.mjs.map +0 -1
  284. package/dist/browser/credentials/managedIdentityCredential/index.d.ts +0 -6
  285. package/dist/browser/credentials/managedIdentityCredential/models.d.ts +0 -24
  286. package/dist/browser/credentials/managedIdentityCredential/models.d.ts.map +0 -1
  287. package/dist/browser/credentials/managedIdentityCredential/models.js.map +0 -1
  288. package/dist/browser/credentials/managedIdentityCredential/options.d.ts +0 -37
  289. package/dist/browser/credentials/managedIdentityCredential/options.d.ts.map +0 -1
  290. package/dist/browser/credentials/managedIdentityCredential/options.js +0 -4
  291. package/dist/browser/credentials/managedIdentityCredential/options.js.map +0 -1
  292. package/dist/browser/credentials/managedIdentityCredential/tokenExchangeMsi.d.ts +0 -14
  293. package/dist/browser/credentials/managedIdentityCredential/tokenExchangeMsi.d.ts.map +0 -1
  294. package/dist/browser/credentials/managedIdentityCredential/tokenExchangeMsi.js.map +0 -1
  295. package/dist/browser/credentials/managedIdentityCredential/utils.d.ts +0 -33
  296. package/dist/browser/credentials/managedIdentityCredential/utils.d.ts.map +0 -1
  297. package/dist/browser/credentials/managedIdentityCredential/utils.js.map +0 -1
  298. package/dist/browser/credentials/multiTenantTokenCredentialOptions.d.ts +0 -12
  299. package/dist/browser/credentials/multiTenantTokenCredentialOptions.d.ts.map +0 -1
  300. package/dist/browser/credentials/multiTenantTokenCredentialOptions.js.map +0 -1
  301. package/dist/browser/credentials/onBehalfOfCredential-browser.d.mts.map +0 -1
  302. package/dist/browser/credentials/onBehalfOfCredential-browser.mjs.map +0 -1
  303. package/dist/browser/credentials/onBehalfOfCredential.d.ts +0 -12
  304. package/dist/browser/credentials/onBehalfOfCredentialOptions.d.ts +0 -76
  305. package/dist/browser/credentials/onBehalfOfCredentialOptions.d.ts.map +0 -1
  306. package/dist/browser/credentials/onBehalfOfCredentialOptions.js.map +0 -1
  307. package/dist/browser/credentials/usernamePasswordCredential-browser.d.mts.map +0 -1
  308. package/dist/browser/credentials/usernamePasswordCredential-browser.mjs.map +0 -1
  309. package/dist/browser/credentials/usernamePasswordCredential.d.ts +0 -40
  310. package/dist/browser/credentials/usernamePasswordCredentialOptions.d.ts +0 -9
  311. package/dist/browser/credentials/usernamePasswordCredentialOptions.d.ts.map +0 -1
  312. package/dist/browser/credentials/usernamePasswordCredentialOptions.js.map +0 -1
  313. package/dist/browser/credentials/visualStudioCodeCredential-browser.d.mts.map +0 -1
  314. package/dist/browser/credentials/visualStudioCodeCredential-browser.mjs.map +0 -1
  315. package/dist/browser/credentials/visualStudioCodeCredential.d.ts +0 -15
  316. package/dist/browser/credentials/visualStudioCodeCredentialOptions.d.ts +0 -11
  317. package/dist/browser/credentials/visualStudioCodeCredentialOptions.d.ts.map +0 -1
  318. package/dist/browser/credentials/visualStudioCodeCredentialOptions.js.map +0 -1
  319. package/dist/browser/credentials/visualStudioCodeCredentialPlugin.d.ts +0 -11
  320. package/dist/browser/credentials/visualStudioCodeCredentialPlugin.d.ts.map +0 -1
  321. package/dist/browser/credentials/workloadIdentityCredential-browser.d.mts.map +0 -1
  322. package/dist/browser/credentials/workloadIdentityCredential-browser.mjs.map +0 -1
  323. package/dist/browser/credentials/workloadIdentityCredential.d.ts +0 -17
  324. package/dist/browser/credentials/workloadIdentityCredentialOptions.d.ts +0 -20
  325. package/dist/browser/credentials/workloadIdentityCredentialOptions.d.ts.map +0 -1
  326. package/dist/browser/credentials/workloadIdentityCredentialOptions.js.map +0 -1
  327. package/dist/browser/errors.d.ts +0 -139
  328. package/dist/browser/errors.d.ts.map +0 -1
  329. package/dist/browser/errors.js.map +0 -1
  330. package/dist/browser/index.d.ts +0 -61
  331. package/dist/browser/index.d.ts.map +0 -1
  332. package/dist/browser/index.js.map +0 -1
  333. package/dist/browser/msal/browserFlows/flows.d.ts +0 -42
  334. package/dist/browser/msal/browserFlows/flows.d.ts.map +0 -1
  335. package/dist/browser/msal/browserFlows/flows.js.map +0 -1
  336. package/dist/browser/msal/browserFlows/msalAuthCode.d.ts +0 -48
  337. package/dist/browser/msal/browserFlows/msalAuthCode.d.ts.map +0 -1
  338. package/dist/browser/msal/browserFlows/msalAuthCode.js +0 -203
  339. package/dist/browser/msal/browserFlows/msalAuthCode.js.map +0 -1
  340. package/dist/browser/msal/browserFlows/msalBrowserCommon.d.ts +0 -106
  341. package/dist/browser/msal/browserFlows/msalBrowserCommon.d.ts.map +0 -1
  342. package/dist/browser/msal/browserFlows/msalBrowserCommon.js.map +0 -1
  343. package/dist/browser/msal/credentials.d.ts +0 -52
  344. package/dist/browser/msal/credentials.d.ts.map +0 -1
  345. package/dist/browser/msal/credentials.js.map +0 -1
  346. package/dist/browser/msal/msal-browser.d.mts.map +0 -1
  347. package/dist/browser/msal/msal-browser.mjs.map +0 -1
  348. package/dist/browser/msal/msal.d.ts +0 -3
  349. package/dist/browser/msal/nodeFlows/brokerOptions.d.ts +0 -44
  350. package/dist/browser/msal/nodeFlows/brokerOptions.d.ts.map +0 -1
  351. package/dist/browser/msal/nodeFlows/msalClient.d.ts +0 -186
  352. package/dist/browser/msal/nodeFlows/msalClient.d.ts.map +0 -1
  353. package/dist/browser/msal/nodeFlows/msalClient.js.map +0 -1
  354. package/dist/browser/msal/nodeFlows/msalPlugins.d.ts +0 -91
  355. package/dist/browser/msal/nodeFlows/msalPlugins.d.ts.map +0 -1
  356. package/dist/browser/msal/nodeFlows/msalPlugins.js.map +0 -1
  357. package/dist/browser/msal/nodeFlows/tokenCachePersistenceOptions.d.ts +0 -24
  358. package/dist/browser/msal/nodeFlows/tokenCachePersistenceOptions.d.ts.map +0 -1
  359. package/dist/browser/msal/types.d.ts +0 -87
  360. package/dist/browser/msal/types.d.ts.map +0 -1
  361. package/dist/browser/msal/utils.d.ts +0 -95
  362. package/dist/browser/msal/utils.d.ts.map +0 -1
  363. package/dist/browser/msal/utils.js.map +0 -1
  364. package/dist/browser/package.json +0 -3
  365. package/dist/browser/plugins/consumer-browser.d.mts.map +0 -1
  366. package/dist/browser/plugins/consumer-browser.mjs.map +0 -1
  367. package/dist/browser/plugins/consumer.d.ts +0 -2
  368. package/dist/browser/plugins/provider.d.ts +0 -36
  369. package/dist/browser/plugins/provider.d.ts.map +0 -1
  370. package/dist/browser/plugins/provider.js.map +0 -1
  371. package/dist/browser/regionalAuthority.d.ts +0 -122
  372. package/dist/browser/regionalAuthority.d.ts.map +0 -1
  373. package/dist/browser/tokenCredentialOptions.d.ts +0 -28
  374. package/dist/browser/tokenCredentialOptions.d.ts.map +0 -1
  375. package/dist/browser/tokenCredentialOptions.js.map +0 -1
  376. package/dist/browser/tokenProvider.d.ts +0 -39
  377. package/dist/browser/tokenProvider.d.ts.map +0 -1
  378. package/dist/browser/tokenProvider.js.map +0 -1
  379. package/dist/browser/util/authHostEnv-browser.d.mts +0 -4
  380. package/dist/browser/util/authHostEnv-browser.d.mts.map +0 -1
  381. package/dist/browser/util/authHostEnv-browser.mjs +0 -7
  382. package/dist/browser/util/authHostEnv-browser.mjs.map +0 -1
  383. package/dist/browser/util/identityTokenEndpoint.d.ts +0 -2
  384. package/dist/browser/util/identityTokenEndpoint.d.ts.map +0 -1
  385. package/dist/browser/util/logging.d.ts +0 -70
  386. package/dist/browser/util/logging.d.ts.map +0 -1
  387. package/dist/browser/util/logging.js.map +0 -1
  388. package/dist/browser/util/processMultiTenantRequest-browser.d.mts.map +0 -1
  389. package/dist/browser/util/processMultiTenantRequest-browser.mjs.map +0 -1
  390. package/dist/browser/util/processMultiTenantRequest.d.ts +0 -9
  391. package/dist/browser/util/processUtils.d.ts +0 -13
  392. package/dist/browser/util/processUtils.d.ts.map +0 -1
  393. package/dist/browser/util/scopeUtils.d.ts +0 -17
  394. package/dist/browser/util/scopeUtils.d.ts.map +0 -1
  395. package/dist/browser/util/scopeUtils.js.map +0 -1
  396. package/dist/browser/util/subscriptionUtils.d.ts +0 -6
  397. package/dist/browser/util/subscriptionUtils.d.ts.map +0 -1
  398. package/dist/browser/util/subscriptionUtils.js +0 -14
  399. package/dist/browser/util/subscriptionUtils.js.map +0 -1
  400. package/dist/browser/util/tenantIdUtils.d.ts +0 -15
  401. package/dist/browser/util/tenantIdUtils.d.ts.map +0 -1
  402. package/dist/browser/util/tenantIdUtils.js +0 -44
  403. package/dist/browser/util/tenantIdUtils.js.map +0 -1
  404. package/dist/browser/util/tracing.d.ts +0 -6
  405. package/dist/browser/util/tracing.d.ts.map +0 -1
  406. package/dist/browser/util/tracing.js.map +0 -1
  407. package/dist/commonjs/client/identityClient.d.ts +0 -65
  408. package/dist/commonjs/client/identityClient.d.ts.map +0 -1
  409. package/dist/commonjs/client/identityClient.js +0 -253
  410. package/dist/commonjs/client/identityClient.js.map +0 -1
  411. package/dist/commonjs/constants.d.ts +0 -69
  412. package/dist/commonjs/constants.d.ts.map +0 -1
  413. package/dist/commonjs/constants.js +0 -78
  414. package/dist/commonjs/constants.js.map +0 -1
  415. package/dist/commonjs/credentials/authorityValidationOptions.d.ts +0 -16
  416. package/dist/commonjs/credentials/authorityValidationOptions.d.ts.map +0 -1
  417. package/dist/commonjs/credentials/authorityValidationOptions.js +0 -5
  418. package/dist/commonjs/credentials/authorityValidationOptions.js.map +0 -1
  419. package/dist/commonjs/credentials/authorizationCodeCredential.d.ts +0 -73
  420. package/dist/commonjs/credentials/authorizationCodeCredential.d.ts.map +0 -1
  421. package/dist/commonjs/credentials/authorizationCodeCredential.js +0 -64
  422. package/dist/commonjs/credentials/authorizationCodeCredential.js.map +0 -1
  423. package/dist/commonjs/credentials/authorizationCodeCredentialOptions.d.ts +0 -8
  424. package/dist/commonjs/credentials/authorizationCodeCredentialOptions.d.ts.map +0 -1
  425. package/dist/commonjs/credentials/authorizationCodeCredentialOptions.js +0 -5
  426. package/dist/commonjs/credentials/authorizationCodeCredentialOptions.js.map +0 -1
  427. package/dist/commonjs/credentials/azureApplicationCredential.d.ts +0 -24
  428. package/dist/commonjs/credentials/azureApplicationCredential.d.ts.map +0 -1
  429. package/dist/commonjs/credentials/azureApplicationCredential.js +0 -36
  430. package/dist/commonjs/credentials/azureApplicationCredential.js.map +0 -1
  431. package/dist/commonjs/credentials/azureApplicationCredentialOptions.d.ts +0 -13
  432. package/dist/commonjs/credentials/azureApplicationCredentialOptions.d.ts.map +0 -1
  433. package/dist/commonjs/credentials/azureApplicationCredentialOptions.js +0 -5
  434. package/dist/commonjs/credentials/azureApplicationCredentialOptions.js.map +0 -1
  435. package/dist/commonjs/credentials/azureCliCredential.d.ts +0 -64
  436. package/dist/commonjs/credentials/azureCliCredential.d.ts.map +0 -1
  437. package/dist/commonjs/credentials/azureCliCredential.js +0 -194
  438. package/dist/commonjs/credentials/azureCliCredential.js.map +0 -1
  439. package/dist/commonjs/credentials/azureCliCredentialOptions.d.ts +0 -20
  440. package/dist/commonjs/credentials/azureCliCredentialOptions.d.ts.map +0 -1
  441. package/dist/commonjs/credentials/azureCliCredentialOptions.js +0 -5
  442. package/dist/commonjs/credentials/azureCliCredentialOptions.js.map +0 -1
  443. package/dist/commonjs/credentials/azureDeveloperCliCredential.d.ts +0 -71
  444. package/dist/commonjs/credentials/azureDeveloperCliCredential.d.ts.map +0 -1
  445. package/dist/commonjs/credentials/azureDeveloperCliCredential.js +0 -176
  446. package/dist/commonjs/credentials/azureDeveloperCliCredential.js.map +0 -1
  447. package/dist/commonjs/credentials/azureDeveloperCliCredentialOptions.d.ts +0 -15
  448. package/dist/commonjs/credentials/azureDeveloperCliCredentialOptions.d.ts.map +0 -1
  449. package/dist/commonjs/credentials/azureDeveloperCliCredentialOptions.js +0 -5
  450. package/dist/commonjs/credentials/azureDeveloperCliCredentialOptions.js.map +0 -1
  451. package/dist/commonjs/credentials/azurePipelinesCredential.d.ts +0 -38
  452. package/dist/commonjs/credentials/azurePipelinesCredential.d.ts.map +0 -1
  453. package/dist/commonjs/credentials/azurePipelinesCredential.js +0 -146
  454. package/dist/commonjs/credentials/azurePipelinesCredential.js.map +0 -1
  455. package/dist/commonjs/credentials/azurePipelinesCredentialOptions.d.ts +0 -9
  456. package/dist/commonjs/credentials/azurePipelinesCredentialOptions.d.ts.map +0 -1
  457. package/dist/commonjs/credentials/azurePipelinesCredentialOptions.js +0 -5
  458. package/dist/commonjs/credentials/azurePipelinesCredentialOptions.js.map +0 -1
  459. package/dist/commonjs/credentials/azurePowerShellCredential.d.ts +0 -75
  460. package/dist/commonjs/credentials/azurePowerShellCredential.d.ts.map +0 -1
  461. package/dist/commonjs/credentials/azurePowerShellCredential.js +0 -235
  462. package/dist/commonjs/credentials/azurePowerShellCredential.js.map +0 -1
  463. package/dist/commonjs/credentials/azurePowerShellCredentialOptions.d.ts +0 -15
  464. package/dist/commonjs/credentials/azurePowerShellCredentialOptions.d.ts.map +0 -1
  465. package/dist/commonjs/credentials/azurePowerShellCredentialOptions.js +0 -5
  466. package/dist/commonjs/credentials/azurePowerShellCredentialOptions.js.map +0 -1
  467. package/dist/commonjs/credentials/brokerAuthOptions.d.ts +0 -13
  468. package/dist/commonjs/credentials/brokerAuthOptions.d.ts.map +0 -1
  469. package/dist/commonjs/credentials/brokerAuthOptions.js +0 -3
  470. package/dist/commonjs/credentials/brokerAuthOptions.js.map +0 -1
  471. package/dist/commonjs/credentials/browserCustomizationOptions.d.ts +0 -19
  472. package/dist/commonjs/credentials/browserCustomizationOptions.d.ts.map +0 -1
  473. package/dist/commonjs/credentials/browserCustomizationOptions.js +0 -5
  474. package/dist/commonjs/credentials/browserCustomizationOptions.js.map +0 -1
  475. package/dist/commonjs/credentials/chainedTokenCredential.d.ts +0 -51
  476. package/dist/commonjs/credentials/chainedTokenCredential.d.ts.map +0 -1
  477. package/dist/commonjs/credentials/chainedTokenCredential.js +0 -96
  478. package/dist/commonjs/credentials/chainedTokenCredential.js.map +0 -1
  479. package/dist/commonjs/credentials/clientAssertionCredential.d.ts +0 -33
  480. package/dist/commonjs/credentials/clientAssertionCredential.d.ts.map +0 -1
  481. package/dist/commonjs/credentials/clientAssertionCredential.js +0 -59
  482. package/dist/commonjs/credentials/clientAssertionCredential.js.map +0 -1
  483. package/dist/commonjs/credentials/clientAssertionCredentialOptions.d.ts +0 -9
  484. package/dist/commonjs/credentials/clientAssertionCredentialOptions.d.ts.map +0 -1
  485. package/dist/commonjs/credentials/clientAssertionCredentialOptions.js +0 -5
  486. package/dist/commonjs/credentials/clientAssertionCredentialOptions.js.map +0 -1
  487. package/dist/commonjs/credentials/clientCertificateCredential.d.ts +0 -72
  488. package/dist/commonjs/credentials/clientCertificateCredential.d.ts.map +0 -1
  489. package/dist/commonjs/credentials/clientCertificateCredential.js +0 -127
  490. package/dist/commonjs/credentials/clientCertificateCredential.js.map +0 -1
  491. package/dist/commonjs/credentials/clientCertificateCredentialModels.d.ts +0 -31
  492. package/dist/commonjs/credentials/clientCertificateCredentialModels.d.ts.map +0 -1
  493. package/dist/commonjs/credentials/clientCertificateCredentialModels.js +0 -5
  494. package/dist/commonjs/credentials/clientCertificateCredentialModels.js.map +0 -1
  495. package/dist/commonjs/credentials/clientCertificateCredentialOptions.d.ts +0 -14
  496. package/dist/commonjs/credentials/clientCertificateCredentialOptions.d.ts.map +0 -1
  497. package/dist/commonjs/credentials/clientCertificateCredentialOptions.js +0 -5
  498. package/dist/commonjs/credentials/clientCertificateCredentialOptions.js.map +0 -1
  499. package/dist/commonjs/credentials/clientSecretCredential.d.ts +0 -37
  500. package/dist/commonjs/credentials/clientSecretCredential.d.ts.map +0 -1
  501. package/dist/commonjs/credentials/clientSecretCredential.js +0 -64
  502. package/dist/commonjs/credentials/clientSecretCredential.js.map +0 -1
  503. package/dist/commonjs/credentials/clientSecretCredentialOptions.d.ts +0 -9
  504. package/dist/commonjs/credentials/clientSecretCredentialOptions.d.ts.map +0 -1
  505. package/dist/commonjs/credentials/clientSecretCredentialOptions.js +0 -5
  506. package/dist/commonjs/credentials/clientSecretCredentialOptions.js.map +0 -1
  507. package/dist/commonjs/credentials/credentialPersistenceOptions.d.ts +0 -30
  508. package/dist/commonjs/credentials/credentialPersistenceOptions.d.ts.map +0 -1
  509. package/dist/commonjs/credentials/credentialPersistenceOptions.js +0 -5
  510. package/dist/commonjs/credentials/credentialPersistenceOptions.js.map +0 -1
  511. package/dist/commonjs/credentials/defaultAzureCredential.d.ts +0 -65
  512. package/dist/commonjs/credentials/defaultAzureCredential.d.ts.map +0 -1
  513. package/dist/commonjs/credentials/defaultAzureCredential.js +0 -171
  514. package/dist/commonjs/credentials/defaultAzureCredential.js.map +0 -1
  515. package/dist/commonjs/credentials/defaultAzureCredentialOptions.d.ts +0 -49
  516. package/dist/commonjs/credentials/defaultAzureCredentialOptions.d.ts.map +0 -1
  517. package/dist/commonjs/credentials/defaultAzureCredentialOptions.js +0 -5
  518. package/dist/commonjs/credentials/defaultAzureCredentialOptions.js.map +0 -1
  519. package/dist/commonjs/credentials/deviceCodeCredential.d.ts +0 -67
  520. package/dist/commonjs/credentials/deviceCodeCredential.d.ts.map +0 -1
  521. package/dist/commonjs/credentials/deviceCodeCredential.js +0 -96
  522. package/dist/commonjs/credentials/deviceCodeCredential.js.map +0 -1
  523. package/dist/commonjs/credentials/deviceCodeCredentialOptions.d.ts +0 -53
  524. package/dist/commonjs/credentials/deviceCodeCredentialOptions.d.ts.map +0 -1
  525. package/dist/commonjs/credentials/deviceCodeCredentialOptions.js +0 -5
  526. package/dist/commonjs/credentials/deviceCodeCredentialOptions.js.map +0 -1
  527. package/dist/commonjs/credentials/environmentCredential.d.ts +0 -52
  528. package/dist/commonjs/credentials/environmentCredential.d.ts.map +0 -1
  529. package/dist/commonjs/credentials/environmentCredential.js +0 -135
  530. package/dist/commonjs/credentials/environmentCredential.js.map +0 -1
  531. package/dist/commonjs/credentials/environmentCredentialOptions.d.ts +0 -9
  532. package/dist/commonjs/credentials/environmentCredentialOptions.d.ts.map +0 -1
  533. package/dist/commonjs/credentials/environmentCredentialOptions.js +0 -5
  534. package/dist/commonjs/credentials/environmentCredentialOptions.js.map +0 -1
  535. package/dist/commonjs/credentials/interactiveBrowserCredential.d.ts +0 -56
  536. package/dist/commonjs/credentials/interactiveBrowserCredential.d.ts.map +0 -1
  537. package/dist/commonjs/credentials/interactiveBrowserCredential.js +0 -95
  538. package/dist/commonjs/credentials/interactiveBrowserCredentialOptions.d.ts +0 -77
  539. package/dist/commonjs/credentials/interactiveBrowserCredentialOptions.d.ts.map +0 -1
  540. package/dist/commonjs/credentials/interactiveBrowserCredentialOptions.js +0 -5
  541. package/dist/commonjs/credentials/interactiveBrowserCredentialOptions.js.map +0 -1
  542. package/dist/commonjs/credentials/interactiveCredentialOptions.d.ts +0 -25
  543. package/dist/commonjs/credentials/interactiveCredentialOptions.d.ts.map +0 -1
  544. package/dist/commonjs/credentials/interactiveCredentialOptions.js +0 -5
  545. package/dist/commonjs/credentials/interactiveCredentialOptions.js.map +0 -1
  546. package/dist/commonjs/credentials/managedIdentityCredential/imdsMsi.d.ts +0 -18
  547. package/dist/commonjs/credentials/managedIdentityCredential/imdsMsi.d.ts.map +0 -1
  548. package/dist/commonjs/credentials/managedIdentityCredential/imdsMsi.js +0 -125
  549. package/dist/commonjs/credentials/managedIdentityCredential/imdsMsi.js.map +0 -1
  550. package/dist/commonjs/credentials/managedIdentityCredential/imdsRetryPolicy.d.ts +0 -12
  551. package/dist/commonjs/credentials/managedIdentityCredential/imdsRetryPolicy.d.ts.map +0 -1
  552. package/dist/commonjs/credentials/managedIdentityCredential/imdsRetryPolicy.js +0 -36
  553. package/dist/commonjs/credentials/managedIdentityCredential/imdsRetryPolicy.js.map +0 -1
  554. package/dist/commonjs/credentials/managedIdentityCredential/index.d.ts +0 -61
  555. package/dist/commonjs/credentials/managedIdentityCredential/index.d.ts.map +0 -1
  556. package/dist/commonjs/credentials/managedIdentityCredential/index.js +0 -221
  557. package/dist/commonjs/credentials/managedIdentityCredential/index.js.map +0 -1
  558. package/dist/commonjs/credentials/managedIdentityCredential/models.d.ts +0 -24
  559. package/dist/commonjs/credentials/managedIdentityCredential/models.d.ts.map +0 -1
  560. package/dist/commonjs/credentials/managedIdentityCredential/models.js +0 -5
  561. package/dist/commonjs/credentials/managedIdentityCredential/models.js.map +0 -1
  562. package/dist/commonjs/credentials/managedIdentityCredential/options.d.ts +0 -37
  563. package/dist/commonjs/credentials/managedIdentityCredential/options.d.ts.map +0 -1
  564. package/dist/commonjs/credentials/managedIdentityCredential/options.js +0 -5
  565. package/dist/commonjs/credentials/managedIdentityCredential/options.js.map +0 -1
  566. package/dist/commonjs/credentials/managedIdentityCredential/tokenExchangeMsi.d.ts +0 -14
  567. package/dist/commonjs/credentials/managedIdentityCredential/tokenExchangeMsi.d.ts.map +0 -1
  568. package/dist/commonjs/credentials/managedIdentityCredential/tokenExchangeMsi.js +0 -35
  569. package/dist/commonjs/credentials/managedIdentityCredential/tokenExchangeMsi.js.map +0 -1
  570. package/dist/commonjs/credentials/managedIdentityCredential/utils.d.ts +0 -33
  571. package/dist/commonjs/credentials/managedIdentityCredential/utils.d.ts.map +0 -1
  572. package/dist/commonjs/credentials/managedIdentityCredential/utils.js +0 -82
  573. package/dist/commonjs/credentials/managedIdentityCredential/utils.js.map +0 -1
  574. package/dist/commonjs/credentials/multiTenantTokenCredentialOptions.d.ts +0 -12
  575. package/dist/commonjs/credentials/multiTenantTokenCredentialOptions.d.ts.map +0 -1
  576. package/dist/commonjs/credentials/multiTenantTokenCredentialOptions.js +0 -5
  577. package/dist/commonjs/credentials/multiTenantTokenCredentialOptions.js.map +0 -1
  578. package/dist/commonjs/credentials/onBehalfOfCredential.d.ts +0 -105
  579. package/dist/commonjs/credentials/onBehalfOfCredential.d.ts.map +0 -1
  580. package/dist/commonjs/credentials/onBehalfOfCredential.js +0 -116
  581. package/dist/commonjs/credentials/onBehalfOfCredential.js.map +0 -1
  582. package/dist/commonjs/credentials/onBehalfOfCredentialOptions.d.ts +0 -76
  583. package/dist/commonjs/credentials/onBehalfOfCredentialOptions.d.ts.map +0 -1
  584. package/dist/commonjs/credentials/onBehalfOfCredentialOptions.js +0 -5
  585. package/dist/commonjs/credentials/onBehalfOfCredentialOptions.js.map +0 -1
  586. package/dist/commonjs/credentials/usernamePasswordCredential.d.ts +0 -41
  587. package/dist/commonjs/credentials/usernamePasswordCredential.d.ts.map +0 -1
  588. package/dist/commonjs/credentials/usernamePasswordCredential.js +0 -71
  589. package/dist/commonjs/credentials/usernamePasswordCredential.js.map +0 -1
  590. package/dist/commonjs/credentials/usernamePasswordCredentialOptions.d.ts +0 -9
  591. package/dist/commonjs/credentials/usernamePasswordCredentialOptions.d.ts.map +0 -1
  592. package/dist/commonjs/credentials/usernamePasswordCredentialOptions.js +0 -5
  593. package/dist/commonjs/credentials/usernamePasswordCredentialOptions.js.map +0 -1
  594. package/dist/commonjs/credentials/visualStudioCodeCredential.d.ts +0 -60
  595. package/dist/commonjs/credentials/visualStudioCodeCredential.d.ts.map +0 -1
  596. package/dist/commonjs/credentials/visualStudioCodeCredential.js +0 -196
  597. package/dist/commonjs/credentials/visualStudioCodeCredential.js.map +0 -1
  598. package/dist/commonjs/credentials/visualStudioCodeCredentialOptions.d.ts +0 -11
  599. package/dist/commonjs/credentials/visualStudioCodeCredentialOptions.d.ts.map +0 -1
  600. package/dist/commonjs/credentials/visualStudioCodeCredentialOptions.js +0 -5
  601. package/dist/commonjs/credentials/visualStudioCodeCredentialOptions.js.map +0 -1
  602. package/dist/commonjs/credentials/visualStudioCodeCredentialPlugin.d.ts +0 -11
  603. package/dist/commonjs/credentials/visualStudioCodeCredentialPlugin.d.ts.map +0 -1
  604. package/dist/commonjs/credentials/visualStudioCodeCredentialPlugin.js +0 -5
  605. package/dist/commonjs/credentials/visualStudioCodeCredentialPlugin.js.map +0 -1
  606. package/dist/commonjs/credentials/workloadIdentityCredential.d.ts +0 -47
  607. package/dist/commonjs/credentials/workloadIdentityCredential.d.ts.map +0 -1
  608. package/dist/commonjs/credentials/workloadIdentityCredential.js +0 -118
  609. package/dist/commonjs/credentials/workloadIdentityCredential.js.map +0 -1
  610. package/dist/commonjs/credentials/workloadIdentityCredentialOptions.d.ts +0 -20
  611. package/dist/commonjs/credentials/workloadIdentityCredentialOptions.d.ts.map +0 -1
  612. package/dist/commonjs/credentials/workloadIdentityCredentialOptions.js +0 -5
  613. package/dist/commonjs/credentials/workloadIdentityCredentialOptions.js.map +0 -1
  614. package/dist/commonjs/errors.d.ts +0 -139
  615. package/dist/commonjs/errors.d.ts.map +0 -1
  616. package/dist/commonjs/errors.js +0 -130
  617. package/dist/commonjs/errors.js.map +0 -1
  618. package/dist/commonjs/index.d.ts +0 -61
  619. package/dist/commonjs/index.d.ts.map +0 -1
  620. package/dist/commonjs/index.js +0 -69
  621. package/dist/commonjs/index.js.map +0 -1
  622. package/dist/commonjs/msal/browserFlows/flows.d.ts +0 -42
  623. package/dist/commonjs/msal/browserFlows/flows.d.ts.map +0 -1
  624. package/dist/commonjs/msal/browserFlows/flows.js +0 -5
  625. package/dist/commonjs/msal/browserFlows/flows.js.map +0 -1
  626. package/dist/commonjs/msal/browserFlows/msalAuthCode.d.ts +0 -48
  627. package/dist/commonjs/msal/browserFlows/msalAuthCode.d.ts.map +0 -1
  628. package/dist/commonjs/msal/browserFlows/msalAuthCode.js +0 -208
  629. package/dist/commonjs/msal/browserFlows/msalAuthCode.js.map +0 -1
  630. package/dist/commonjs/msal/browserFlows/msalBrowserCommon.d.ts +0 -106
  631. package/dist/commonjs/msal/browserFlows/msalBrowserCommon.d.ts.map +0 -1
  632. package/dist/commonjs/msal/browserFlows/msalBrowserCommon.js +0 -121
  633. package/dist/commonjs/msal/browserFlows/msalBrowserCommon.js.map +0 -1
  634. package/dist/commonjs/msal/credentials.d.ts +0 -52
  635. package/dist/commonjs/msal/credentials.d.ts.map +0 -1
  636. package/dist/commonjs/msal/credentials.js +0 -5
  637. package/dist/commonjs/msal/credentials.js.map +0 -1
  638. package/dist/commonjs/msal/msal.d.ts +0 -3
  639. package/dist/commonjs/msal/msal.d.ts.map +0 -1
  640. package/dist/commonjs/msal/msal.js +0 -9
  641. package/dist/commonjs/msal/msal.js.map +0 -1
  642. package/dist/commonjs/msal/nodeFlows/brokerOptions.d.ts +0 -44
  643. package/dist/commonjs/msal/nodeFlows/brokerOptions.d.ts.map +0 -1
  644. package/dist/commonjs/msal/nodeFlows/brokerOptions.js +0 -3
  645. package/dist/commonjs/msal/nodeFlows/brokerOptions.js.map +0 -1
  646. package/dist/commonjs/msal/nodeFlows/msalClient.d.ts +0 -186
  647. package/dist/commonjs/msal/nodeFlows/msalClient.d.ts.map +0 -1
  648. package/dist/commonjs/msal/nodeFlows/msalClient.js +0 -482
  649. package/dist/commonjs/msal/nodeFlows/msalClient.js.map +0 -1
  650. package/dist/commonjs/msal/nodeFlows/msalPlugins.d.ts +0 -91
  651. package/dist/commonjs/msal/nodeFlows/msalPlugins.d.ts.map +0 -1
  652. package/dist/commonjs/msal/nodeFlows/msalPlugins.js +0 -91
  653. package/dist/commonjs/msal/nodeFlows/msalPlugins.js.map +0 -1
  654. package/dist/commonjs/msal/nodeFlows/tokenCachePersistenceOptions.d.ts +0 -24
  655. package/dist/commonjs/msal/nodeFlows/tokenCachePersistenceOptions.d.ts.map +0 -1
  656. package/dist/commonjs/msal/nodeFlows/tokenCachePersistenceOptions.js +0 -5
  657. package/dist/commonjs/msal/nodeFlows/tokenCachePersistenceOptions.js.map +0 -1
  658. package/dist/commonjs/msal/types.d.ts +0 -87
  659. package/dist/commonjs/msal/types.d.ts.map +0 -1
  660. package/dist/commonjs/msal/types.js +0 -5
  661. package/dist/commonjs/msal/types.js.map +0 -1
  662. package/dist/commonjs/msal/utils.d.ts +0 -95
  663. package/dist/commonjs/msal/utils.d.ts.map +0 -1
  664. package/dist/commonjs/msal/utils.js +0 -253
  665. package/dist/commonjs/msal/utils.js.map +0 -1
  666. package/dist/commonjs/package.json +0 -3
  667. package/dist/commonjs/plugins/consumer.d.ts +0 -28
  668. package/dist/commonjs/plugins/consumer.d.ts.map +0 -1
  669. package/dist/commonjs/plugins/consumer.js +0 -46
  670. package/dist/commonjs/plugins/consumer.js.map +0 -1
  671. package/dist/commonjs/plugins/provider.d.ts +0 -36
  672. package/dist/commonjs/plugins/provider.d.ts.map +0 -1
  673. package/dist/commonjs/plugins/provider.js +0 -5
  674. package/dist/commonjs/plugins/provider.js.map +0 -1
  675. package/dist/commonjs/regionalAuthority.d.ts +0 -122
  676. package/dist/commonjs/regionalAuthority.d.ts.map +0 -1
  677. package/dist/commonjs/regionalAuthority.js +0 -144
  678. package/dist/commonjs/regionalAuthority.js.map +0 -1
  679. package/dist/commonjs/tokenCredentialOptions.d.ts +0 -28
  680. package/dist/commonjs/tokenCredentialOptions.d.ts.map +0 -1
  681. package/dist/commonjs/tokenCredentialOptions.js +0 -5
  682. package/dist/commonjs/tokenCredentialOptions.js.map +0 -1
  683. package/dist/commonjs/tokenProvider.d.ts +0 -39
  684. package/dist/commonjs/tokenProvider.d.ts.map +0 -1
  685. package/dist/commonjs/tokenProvider.js +0 -56
  686. package/dist/commonjs/tokenProvider.js.map +0 -1
  687. package/dist/commonjs/tsdoc-metadata.json +0 -11
  688. package/dist/commonjs/util/identityTokenEndpoint.d.ts +0 -2
  689. package/dist/commonjs/util/identityTokenEndpoint.d.ts.map +0 -1
  690. package/dist/commonjs/util/identityTokenEndpoint.js +0 -14
  691. package/dist/commonjs/util/identityTokenEndpoint.js.map +0 -1
  692. package/dist/commonjs/util/logging.d.ts +0 -70
  693. package/dist/commonjs/util/logging.d.ts.map +0 -1
  694. package/dist/commonjs/util/logging.js +0 -103
  695. package/dist/commonjs/util/logging.js.map +0 -1
  696. package/dist/commonjs/util/processMultiTenantRequest.d.ts +0 -10
  697. package/dist/commonjs/util/processMultiTenantRequest.d.ts.map +0 -1
  698. package/dist/commonjs/util/processMultiTenantRequest.js +0 -38
  699. package/dist/commonjs/util/processUtils.d.ts +0 -13
  700. package/dist/commonjs/util/processUtils.d.ts.map +0 -1
  701. package/dist/commonjs/util/processUtils.js +0 -36
  702. package/dist/commonjs/util/processUtils.js.map +0 -1
  703. package/dist/commonjs/util/scopeUtils.d.ts +0 -17
  704. package/dist/commonjs/util/scopeUtils.d.ts.map +0 -1
  705. package/dist/commonjs/util/scopeUtils.js +0 -34
  706. package/dist/commonjs/util/scopeUtils.js.map +0 -1
  707. package/dist/commonjs/util/subscriptionUtils.d.ts +0 -6
  708. package/dist/commonjs/util/subscriptionUtils.d.ts.map +0 -1
  709. package/dist/commonjs/util/subscriptionUtils.js +0 -17
  710. package/dist/commonjs/util/subscriptionUtils.js.map +0 -1
  711. package/dist/commonjs/util/tenantIdUtils.d.ts +0 -15
  712. package/dist/commonjs/util/tenantIdUtils.d.ts.map +0 -1
  713. package/dist/commonjs/util/tenantIdUtils.js +0 -51
  714. package/dist/commonjs/util/tenantIdUtils.js.map +0 -1
  715. package/dist/commonjs/util/tracing.d.ts +0 -6
  716. package/dist/commonjs/util/tracing.d.ts.map +0 -1
  717. package/dist/commonjs/util/tracing.js +0 -17
  718. package/dist/commonjs/util/tracing.js.map +0 -1
  719. package/dist/esm/client/identityClient.d.ts +0 -65
  720. package/dist/esm/client/identityClient.d.ts.map +0 -1
  721. package/dist/esm/client/identityClient.js.map +0 -1
  722. package/dist/esm/constants.d.ts +0 -69
  723. package/dist/esm/constants.d.ts.map +0 -1
  724. package/dist/esm/constants.js.map +0 -1
  725. package/dist/esm/credentials/authorityValidationOptions.d.ts +0 -16
  726. package/dist/esm/credentials/authorityValidationOptions.d.ts.map +0 -1
  727. package/dist/esm/credentials/authorityValidationOptions.js +0 -4
  728. package/dist/esm/credentials/authorityValidationOptions.js.map +0 -1
  729. package/dist/esm/credentials/authorizationCodeCredential.d.ts +0 -73
  730. package/dist/esm/credentials/authorizationCodeCredential.d.ts.map +0 -1
  731. package/dist/esm/credentials/authorizationCodeCredential.js.map +0 -1
  732. package/dist/esm/credentials/authorizationCodeCredentialOptions.d.ts +0 -8
  733. package/dist/esm/credentials/authorizationCodeCredentialOptions.d.ts.map +0 -1
  734. package/dist/esm/credentials/authorizationCodeCredentialOptions.js +0 -4
  735. package/dist/esm/credentials/authorizationCodeCredentialOptions.js.map +0 -1
  736. package/dist/esm/credentials/azureApplicationCredential.d.ts +0 -24
  737. package/dist/esm/credentials/azureApplicationCredential.d.ts.map +0 -1
  738. package/dist/esm/credentials/azureApplicationCredential.js.map +0 -1
  739. package/dist/esm/credentials/azureApplicationCredentialOptions.d.ts +0 -13
  740. package/dist/esm/credentials/azureApplicationCredentialOptions.d.ts.map +0 -1
  741. package/dist/esm/credentials/azureApplicationCredentialOptions.js +0 -4
  742. package/dist/esm/credentials/azureApplicationCredentialOptions.js.map +0 -1
  743. package/dist/esm/credentials/azureCliCredential.d.ts +0 -64
  744. package/dist/esm/credentials/azureCliCredential.d.ts.map +0 -1
  745. package/dist/esm/credentials/azureCliCredential.js.map +0 -1
  746. package/dist/esm/credentials/azureCliCredentialOptions.d.ts +0 -20
  747. package/dist/esm/credentials/azureCliCredentialOptions.d.ts.map +0 -1
  748. package/dist/esm/credentials/azureCliCredentialOptions.js +0 -4
  749. package/dist/esm/credentials/azureCliCredentialOptions.js.map +0 -1
  750. package/dist/esm/credentials/azureDeveloperCliCredential.d.ts +0 -71
  751. package/dist/esm/credentials/azureDeveloperCliCredential.d.ts.map +0 -1
  752. package/dist/esm/credentials/azureDeveloperCliCredential.js.map +0 -1
  753. package/dist/esm/credentials/azureDeveloperCliCredentialOptions.d.ts +0 -15
  754. package/dist/esm/credentials/azureDeveloperCliCredentialOptions.d.ts.map +0 -1
  755. package/dist/esm/credentials/azureDeveloperCliCredentialOptions.js +0 -4
  756. package/dist/esm/credentials/azureDeveloperCliCredentialOptions.js.map +0 -1
  757. package/dist/esm/credentials/azurePipelinesCredential.d.ts +0 -38
  758. package/dist/esm/credentials/azurePipelinesCredential.d.ts.map +0 -1
  759. package/dist/esm/credentials/azurePipelinesCredential.js.map +0 -1
  760. package/dist/esm/credentials/azurePipelinesCredentialOptions.d.ts +0 -9
  761. package/dist/esm/credentials/azurePipelinesCredentialOptions.d.ts.map +0 -1
  762. package/dist/esm/credentials/azurePipelinesCredentialOptions.js +0 -4
  763. package/dist/esm/credentials/azurePipelinesCredentialOptions.js.map +0 -1
  764. package/dist/esm/credentials/azurePowerShellCredential.d.ts +0 -75
  765. package/dist/esm/credentials/azurePowerShellCredential.d.ts.map +0 -1
  766. package/dist/esm/credentials/azurePowerShellCredential.js.map +0 -1
  767. package/dist/esm/credentials/azurePowerShellCredentialOptions.d.ts +0 -15
  768. package/dist/esm/credentials/azurePowerShellCredentialOptions.d.ts.map +0 -1
  769. package/dist/esm/credentials/azurePowerShellCredentialOptions.js +0 -4
  770. package/dist/esm/credentials/azurePowerShellCredentialOptions.js.map +0 -1
  771. package/dist/esm/credentials/brokerAuthOptions.d.ts +0 -13
  772. package/dist/esm/credentials/brokerAuthOptions.d.ts.map +0 -1
  773. package/dist/esm/credentials/brokerAuthOptions.js +0 -2
  774. package/dist/esm/credentials/brokerAuthOptions.js.map +0 -1
  775. package/dist/esm/credentials/browserCustomizationOptions.d.ts +0 -19
  776. package/dist/esm/credentials/browserCustomizationOptions.d.ts.map +0 -1
  777. package/dist/esm/credentials/browserCustomizationOptions.js +0 -4
  778. package/dist/esm/credentials/browserCustomizationOptions.js.map +0 -1
  779. package/dist/esm/credentials/chainedTokenCredential.d.ts +0 -51
  780. package/dist/esm/credentials/chainedTokenCredential.d.ts.map +0 -1
  781. package/dist/esm/credentials/chainedTokenCredential.js.map +0 -1
  782. package/dist/esm/credentials/clientAssertionCredential.d.ts +0 -33
  783. package/dist/esm/credentials/clientAssertionCredential.d.ts.map +0 -1
  784. package/dist/esm/credentials/clientAssertionCredential.js.map +0 -1
  785. package/dist/esm/credentials/clientAssertionCredentialOptions.d.ts +0 -9
  786. package/dist/esm/credentials/clientAssertionCredentialOptions.d.ts.map +0 -1
  787. package/dist/esm/credentials/clientAssertionCredentialOptions.js +0 -4
  788. package/dist/esm/credentials/clientAssertionCredentialOptions.js.map +0 -1
  789. package/dist/esm/credentials/clientCertificateCredential.d.ts +0 -72
  790. package/dist/esm/credentials/clientCertificateCredential.d.ts.map +0 -1
  791. package/dist/esm/credentials/clientCertificateCredential.js.map +0 -1
  792. package/dist/esm/credentials/clientCertificateCredentialModels.d.ts +0 -31
  793. package/dist/esm/credentials/clientCertificateCredentialModels.d.ts.map +0 -1
  794. package/dist/esm/credentials/clientCertificateCredentialModels.js +0 -4
  795. package/dist/esm/credentials/clientCertificateCredentialModels.js.map +0 -1
  796. package/dist/esm/credentials/clientCertificateCredentialOptions.d.ts +0 -14
  797. package/dist/esm/credentials/clientCertificateCredentialOptions.d.ts.map +0 -1
  798. package/dist/esm/credentials/clientCertificateCredentialOptions.js +0 -4
  799. package/dist/esm/credentials/clientCertificateCredentialOptions.js.map +0 -1
  800. package/dist/esm/credentials/clientSecretCredential.d.ts +0 -37
  801. package/dist/esm/credentials/clientSecretCredential.d.ts.map +0 -1
  802. package/dist/esm/credentials/clientSecretCredential.js.map +0 -1
  803. package/dist/esm/credentials/clientSecretCredentialOptions.d.ts +0 -9
  804. package/dist/esm/credentials/clientSecretCredentialOptions.d.ts.map +0 -1
  805. package/dist/esm/credentials/clientSecretCredentialOptions.js +0 -4
  806. package/dist/esm/credentials/clientSecretCredentialOptions.js.map +0 -1
  807. package/dist/esm/credentials/credentialPersistenceOptions.d.ts +0 -30
  808. package/dist/esm/credentials/credentialPersistenceOptions.d.ts.map +0 -1
  809. package/dist/esm/credentials/credentialPersistenceOptions.js +0 -4
  810. package/dist/esm/credentials/credentialPersistenceOptions.js.map +0 -1
  811. package/dist/esm/credentials/defaultAzureCredential.d.ts +0 -65
  812. package/dist/esm/credentials/defaultAzureCredential.d.ts.map +0 -1
  813. package/dist/esm/credentials/defaultAzureCredential.js.map +0 -1
  814. package/dist/esm/credentials/defaultAzureCredentialOptions.d.ts +0 -49
  815. package/dist/esm/credentials/defaultAzureCredentialOptions.d.ts.map +0 -1
  816. package/dist/esm/credentials/defaultAzureCredentialOptions.js +0 -4
  817. package/dist/esm/credentials/defaultAzureCredentialOptions.js.map +0 -1
  818. package/dist/esm/credentials/deviceCodeCredential.d.ts +0 -67
  819. package/dist/esm/credentials/deviceCodeCredential.d.ts.map +0 -1
  820. package/dist/esm/credentials/deviceCodeCredential.js.map +0 -1
  821. package/dist/esm/credentials/deviceCodeCredentialOptions.d.ts +0 -53
  822. package/dist/esm/credentials/deviceCodeCredentialOptions.d.ts.map +0 -1
  823. package/dist/esm/credentials/deviceCodeCredentialOptions.js +0 -4
  824. package/dist/esm/credentials/deviceCodeCredentialOptions.js.map +0 -1
  825. package/dist/esm/credentials/environmentCredential.d.ts +0 -52
  826. package/dist/esm/credentials/environmentCredential.d.ts.map +0 -1
  827. package/dist/esm/credentials/environmentCredential.js.map +0 -1
  828. package/dist/esm/credentials/environmentCredentialOptions.d.ts +0 -9
  829. package/dist/esm/credentials/environmentCredentialOptions.d.ts.map +0 -1
  830. package/dist/esm/credentials/environmentCredentialOptions.js +0 -4
  831. package/dist/esm/credentials/environmentCredentialOptions.js.map +0 -1
  832. package/dist/esm/credentials/interactiveBrowserCredential.d.ts +0 -56
  833. package/dist/esm/credentials/interactiveBrowserCredential.d.ts.map +0 -1
  834. package/dist/esm/credentials/interactiveBrowserCredential.js.map +0 -1
  835. package/dist/esm/credentials/interactiveBrowserCredentialOptions.d.ts +0 -77
  836. package/dist/esm/credentials/interactiveBrowserCredentialOptions.d.ts.map +0 -1
  837. package/dist/esm/credentials/interactiveBrowserCredentialOptions.js +0 -4
  838. package/dist/esm/credentials/interactiveBrowserCredentialOptions.js.map +0 -1
  839. package/dist/esm/credentials/interactiveCredentialOptions.d.ts +0 -25
  840. package/dist/esm/credentials/interactiveCredentialOptions.d.ts.map +0 -1
  841. package/dist/esm/credentials/interactiveCredentialOptions.js +0 -4
  842. package/dist/esm/credentials/interactiveCredentialOptions.js.map +0 -1
  843. package/dist/esm/credentials/managedIdentityCredential/imdsMsi.d.ts +0 -18
  844. package/dist/esm/credentials/managedIdentityCredential/imdsMsi.d.ts.map +0 -1
  845. package/dist/esm/credentials/managedIdentityCredential/imdsMsi.js.map +0 -1
  846. package/dist/esm/credentials/managedIdentityCredential/imdsRetryPolicy.d.ts +0 -12
  847. package/dist/esm/credentials/managedIdentityCredential/imdsRetryPolicy.d.ts.map +0 -1
  848. package/dist/esm/credentials/managedIdentityCredential/imdsRetryPolicy.js +0 -33
  849. package/dist/esm/credentials/managedIdentityCredential/imdsRetryPolicy.js.map +0 -1
  850. package/dist/esm/credentials/managedIdentityCredential/index.d.ts +0 -61
  851. package/dist/esm/credentials/managedIdentityCredential/index.d.ts.map +0 -1
  852. package/dist/esm/credentials/managedIdentityCredential/index.js.map +0 -1
  853. package/dist/esm/credentials/managedIdentityCredential/models.d.ts +0 -24
  854. package/dist/esm/credentials/managedIdentityCredential/models.d.ts.map +0 -1
  855. package/dist/esm/credentials/managedIdentityCredential/models.js +0 -4
  856. package/dist/esm/credentials/managedIdentityCredential/models.js.map +0 -1
  857. package/dist/esm/credentials/managedIdentityCredential/options.d.ts +0 -37
  858. package/dist/esm/credentials/managedIdentityCredential/options.d.ts.map +0 -1
  859. package/dist/esm/credentials/managedIdentityCredential/options.js +0 -4
  860. package/dist/esm/credentials/managedIdentityCredential/options.js.map +0 -1
  861. package/dist/esm/credentials/managedIdentityCredential/tokenExchangeMsi.d.ts +0 -14
  862. package/dist/esm/credentials/managedIdentityCredential/tokenExchangeMsi.d.ts.map +0 -1
  863. package/dist/esm/credentials/managedIdentityCredential/tokenExchangeMsi.js +0 -32
  864. package/dist/esm/credentials/managedIdentityCredential/tokenExchangeMsi.js.map +0 -1
  865. package/dist/esm/credentials/managedIdentityCredential/utils.d.ts +0 -33
  866. package/dist/esm/credentials/managedIdentityCredential/utils.d.ts.map +0 -1
  867. package/dist/esm/credentials/managedIdentityCredential/utils.js +0 -77
  868. package/dist/esm/credentials/managedIdentityCredential/utils.js.map +0 -1
  869. package/dist/esm/credentials/multiTenantTokenCredentialOptions.d.ts +0 -12
  870. package/dist/esm/credentials/multiTenantTokenCredentialOptions.d.ts.map +0 -1
  871. package/dist/esm/credentials/multiTenantTokenCredentialOptions.js +0 -4
  872. package/dist/esm/credentials/multiTenantTokenCredentialOptions.js.map +0 -1
  873. package/dist/esm/credentials/onBehalfOfCredential.d.ts +0 -105
  874. package/dist/esm/credentials/onBehalfOfCredential.d.ts.map +0 -1
  875. package/dist/esm/credentials/onBehalfOfCredential.js.map +0 -1
  876. package/dist/esm/credentials/onBehalfOfCredentialOptions.d.ts +0 -76
  877. package/dist/esm/credentials/onBehalfOfCredentialOptions.d.ts.map +0 -1
  878. package/dist/esm/credentials/onBehalfOfCredentialOptions.js +0 -4
  879. package/dist/esm/credentials/onBehalfOfCredentialOptions.js.map +0 -1
  880. package/dist/esm/credentials/usernamePasswordCredential.d.ts +0 -41
  881. package/dist/esm/credentials/usernamePasswordCredential.d.ts.map +0 -1
  882. package/dist/esm/credentials/usernamePasswordCredential.js.map +0 -1
  883. package/dist/esm/credentials/usernamePasswordCredentialOptions.d.ts +0 -9
  884. package/dist/esm/credentials/usernamePasswordCredentialOptions.d.ts.map +0 -1
  885. package/dist/esm/credentials/usernamePasswordCredentialOptions.js +0 -4
  886. package/dist/esm/credentials/usernamePasswordCredentialOptions.js.map +0 -1
  887. package/dist/esm/credentials/visualStudioCodeCredential.d.ts +0 -60
  888. package/dist/esm/credentials/visualStudioCodeCredential.d.ts.map +0 -1
  889. package/dist/esm/credentials/visualStudioCodeCredential.js.map +0 -1
  890. package/dist/esm/credentials/visualStudioCodeCredentialOptions.d.ts +0 -11
  891. package/dist/esm/credentials/visualStudioCodeCredentialOptions.d.ts.map +0 -1
  892. package/dist/esm/credentials/visualStudioCodeCredentialOptions.js +0 -4
  893. package/dist/esm/credentials/visualStudioCodeCredentialOptions.js.map +0 -1
  894. package/dist/esm/credentials/visualStudioCodeCredentialPlugin.d.ts +0 -11
  895. package/dist/esm/credentials/visualStudioCodeCredentialPlugin.d.ts.map +0 -1
  896. package/dist/esm/credentials/visualStudioCodeCredentialPlugin.js +0 -4
  897. package/dist/esm/credentials/visualStudioCodeCredentialPlugin.js.map +0 -1
  898. package/dist/esm/credentials/workloadIdentityCredential.d.ts +0 -47
  899. package/dist/esm/credentials/workloadIdentityCredential.d.ts.map +0 -1
  900. package/dist/esm/credentials/workloadIdentityCredential.js.map +0 -1
  901. package/dist/esm/credentials/workloadIdentityCredentialOptions.d.ts +0 -20
  902. package/dist/esm/credentials/workloadIdentityCredentialOptions.d.ts.map +0 -1
  903. package/dist/esm/credentials/workloadIdentityCredentialOptions.js +0 -4
  904. package/dist/esm/credentials/workloadIdentityCredentialOptions.js.map +0 -1
  905. package/dist/esm/errors.d.ts +0 -139
  906. package/dist/esm/errors.d.ts.map +0 -1
  907. package/dist/esm/errors.js +0 -123
  908. package/dist/esm/errors.js.map +0 -1
  909. package/dist/esm/index.d.ts +0 -61
  910. package/dist/esm/index.d.ts.map +0 -1
  911. package/dist/esm/index.js +0 -34
  912. package/dist/esm/index.js.map +0 -1
  913. package/dist/esm/msal/browserFlows/flows.d.ts +0 -42
  914. package/dist/esm/msal/browserFlows/flows.d.ts.map +0 -1
  915. package/dist/esm/msal/browserFlows/flows.js +0 -4
  916. package/dist/esm/msal/browserFlows/flows.js.map +0 -1
  917. package/dist/esm/msal/browserFlows/msalAuthCode.d.ts +0 -48
  918. package/dist/esm/msal/browserFlows/msalAuthCode.d.ts.map +0 -1
  919. package/dist/esm/msal/browserFlows/msalAuthCode.js.map +0 -1
  920. package/dist/esm/msal/browserFlows/msalBrowserCommon.d.ts +0 -106
  921. package/dist/esm/msal/browserFlows/msalBrowserCommon.d.ts.map +0 -1
  922. package/dist/esm/msal/browserFlows/msalBrowserCommon.js +0 -116
  923. package/dist/esm/msal/browserFlows/msalBrowserCommon.js.map +0 -1
  924. package/dist/esm/msal/credentials.d.ts +0 -52
  925. package/dist/esm/msal/credentials.d.ts.map +0 -1
  926. package/dist/esm/msal/credentials.js +0 -4
  927. package/dist/esm/msal/credentials.js.map +0 -1
  928. package/dist/esm/msal/msal.d.ts +0 -3
  929. package/dist/esm/msal/msal.d.ts.map +0 -1
  930. package/dist/esm/msal/nodeFlows/brokerOptions.d.ts +0 -44
  931. package/dist/esm/msal/nodeFlows/brokerOptions.d.ts.map +0 -1
  932. package/dist/esm/msal/nodeFlows/brokerOptions.js +0 -2
  933. package/dist/esm/msal/nodeFlows/brokerOptions.js.map +0 -1
  934. package/dist/esm/msal/nodeFlows/msalClient.d.ts +0 -186
  935. package/dist/esm/msal/nodeFlows/msalClient.d.ts.map +0 -1
  936. package/dist/esm/msal/nodeFlows/msalClient.js +0 -477
  937. package/dist/esm/msal/nodeFlows/msalClient.js.map +0 -1
  938. package/dist/esm/msal/nodeFlows/msalPlugins.d.ts +0 -91
  939. package/dist/esm/msal/nodeFlows/msalPlugins.d.ts.map +0 -1
  940. package/dist/esm/msal/nodeFlows/msalPlugins.js +0 -87
  941. package/dist/esm/msal/nodeFlows/msalPlugins.js.map +0 -1
  942. package/dist/esm/msal/nodeFlows/tokenCachePersistenceOptions.d.ts +0 -24
  943. package/dist/esm/msal/nodeFlows/tokenCachePersistenceOptions.d.ts.map +0 -1
  944. package/dist/esm/msal/nodeFlows/tokenCachePersistenceOptions.js +0 -4
  945. package/dist/esm/msal/nodeFlows/tokenCachePersistenceOptions.js.map +0 -1
  946. package/dist/esm/msal/types.d.ts +0 -87
  947. package/dist/esm/msal/types.d.ts.map +0 -1
  948. package/dist/esm/msal/types.js +0 -4
  949. package/dist/esm/msal/types.js.map +0 -1
  950. package/dist/esm/msal/utils.d.ts +0 -95
  951. package/dist/esm/msal/utils.d.ts.map +0 -1
  952. package/dist/esm/msal/utils.js +0 -238
  953. package/dist/esm/msal/utils.js.map +0 -1
  954. package/dist/esm/package.json +0 -3
  955. package/dist/esm/plugins/consumer.d.ts +0 -28
  956. package/dist/esm/plugins/consumer.d.ts.map +0 -1
  957. package/dist/esm/plugins/consumer.js.map +0 -1
  958. package/dist/esm/plugins/provider.d.ts +0 -36
  959. package/dist/esm/plugins/provider.d.ts.map +0 -1
  960. package/dist/esm/plugins/provider.js +0 -4
  961. package/dist/esm/plugins/provider.js.map +0 -1
  962. package/dist/esm/regionalAuthority.d.ts +0 -122
  963. package/dist/esm/regionalAuthority.d.ts.map +0 -1
  964. package/dist/esm/regionalAuthority.js +0 -140
  965. package/dist/esm/regionalAuthority.js.map +0 -1
  966. package/dist/esm/tokenCredentialOptions.d.ts +0 -28
  967. package/dist/esm/tokenCredentialOptions.d.ts.map +0 -1
  968. package/dist/esm/tokenCredentialOptions.js +0 -4
  969. package/dist/esm/tokenCredentialOptions.js.map +0 -1
  970. package/dist/esm/tokenProvider.d.ts +0 -39
  971. package/dist/esm/tokenProvider.d.ts.map +0 -1
  972. package/dist/esm/tokenProvider.js +0 -53
  973. package/dist/esm/tokenProvider.js.map +0 -1
  974. package/dist/esm/util/authHostEnv-browser.d.mts +0 -4
  975. package/dist/esm/util/authHostEnv-browser.d.mts.map +0 -1
  976. package/dist/esm/util/authHostEnv-browser.mjs.map +0 -1
  977. package/dist/esm/util/identityTokenEndpoint.d.ts +0 -2
  978. package/dist/esm/util/identityTokenEndpoint.d.ts.map +0 -1
  979. package/dist/esm/util/identityTokenEndpoint.js +0 -11
  980. package/dist/esm/util/identityTokenEndpoint.js.map +0 -1
  981. package/dist/esm/util/logging.d.ts +0 -70
  982. package/dist/esm/util/logging.d.ts.map +0 -1
  983. package/dist/esm/util/logging.js +0 -94
  984. package/dist/esm/util/logging.js.map +0 -1
  985. package/dist/esm/util/processMultiTenantRequest.d.ts +0 -10
  986. package/dist/esm/util/processMultiTenantRequest.d.ts.map +0 -1
  987. package/dist/esm/util/processMultiTenantRequest.js.map +0 -1
  988. package/dist/esm/util/processUtils.d.ts +0 -13
  989. package/dist/esm/util/processUtils.d.ts.map +0 -1
  990. package/dist/esm/util/processUtils.js +0 -32
  991. package/dist/esm/util/processUtils.js.map +0 -1
  992. package/dist/esm/util/scopeUtils.d.ts +0 -17
  993. package/dist/esm/util/scopeUtils.d.ts.map +0 -1
  994. package/dist/esm/util/scopeUtils.js +0 -29
  995. package/dist/esm/util/scopeUtils.js.map +0 -1
  996. package/dist/esm/util/subscriptionUtils.d.ts +0 -6
  997. package/dist/esm/util/subscriptionUtils.d.ts.map +0 -1
  998. package/dist/esm/util/subscriptionUtils.js +0 -14
  999. package/dist/esm/util/subscriptionUtils.js.map +0 -1
  1000. package/dist/esm/util/tenantIdUtils.d.ts +0 -15
  1001. package/dist/esm/util/tenantIdUtils.d.ts.map +0 -1
  1002. package/dist/esm/util/tenantIdUtils.js.map +0 -1
  1003. package/dist/esm/util/tracing.d.ts +0 -6
  1004. package/dist/esm/util/tracing.d.ts.map +0 -1
  1005. package/dist/esm/util/tracing.js +0 -14
  1006. package/dist/esm/util/tracing.js.map +0 -1
  1007. /package/{dist/browser → dist-esm/src}/credentials/authorityValidationOptions.js +0 -0
  1008. /package/{dist/browser → dist-esm/src}/credentials/authorityValidationOptions.js.map +0 -0
  1009. /package/{dist/browser → dist-esm/src}/credentials/authorizationCodeCredentialOptions.js +0 -0
  1010. /package/{dist/browser → dist-esm/src}/credentials/azureApplicationCredentialOptions.js +0 -0
  1011. /package/{dist/browser → dist-esm/src}/credentials/azureCliCredentialOptions.js +0 -0
  1012. /package/{dist/browser → dist-esm/src}/credentials/azureDeveloperCliCredentialOptions.js +0 -0
  1013. /package/{dist/browser → dist-esm/src}/credentials/azurePipelinesCredentialOptions.js +0 -0
  1014. /package/{dist/browser → dist-esm/src}/credentials/azurePowerShellCredentialOptions.js +0 -0
  1015. /package/{dist/browser → dist-esm/src}/credentials/brokerAuthOptions.js +0 -0
  1016. /package/{dist/browser → dist-esm/src}/credentials/browserCustomizationOptions.js +0 -0
  1017. /package/{dist/browser → dist-esm/src}/credentials/browserCustomizationOptions.js.map +0 -0
  1018. /package/{dist/browser → dist-esm/src}/credentials/clientAssertionCredentialOptions.js +0 -0
  1019. /package/{dist/browser → dist-esm/src}/credentials/clientCertificateCredentialOptions.js +0 -0
  1020. /package/{dist/browser → dist-esm/src}/credentials/clientSecretCredentialOptions.js +0 -0
  1021. /package/{dist/browser → dist-esm/src}/credentials/credentialPersistenceOptions.js +0 -0
  1022. /package/{dist/browser → dist-esm/src}/credentials/defaultAzureCredentialOptions.js +0 -0
  1023. /package/{dist/browser → dist-esm/src}/credentials/deviceCodeCredentialOptions.js +0 -0
  1024. /package/{dist/browser → dist-esm/src}/credentials/environmentCredentialOptions.js +0 -0
  1025. /package/{dist/browser → dist-esm/src}/credentials/interactiveBrowserCredentialOptions.js +0 -0
  1026. /package/{dist/browser → dist-esm/src}/credentials/interactiveCredentialOptions.js +0 -0
  1027. /package/{dist/browser → dist-esm/src}/credentials/managedIdentityCredential/imdsRetryPolicy.js +0 -0
  1028. /package/{dist/browser → dist-esm/src}/credentials/managedIdentityCredential/models.js +0 -0
  1029. /package/{dist/browser → dist-esm/src}/credentials/multiTenantTokenCredentialOptions.js +0 -0
  1030. /package/{dist/browser → dist-esm/src}/credentials/onBehalfOfCredentialOptions.js +0 -0
  1031. /package/{dist/browser → dist-esm/src}/credentials/usernamePasswordCredentialOptions.js +0 -0
  1032. /package/{dist/browser → dist-esm/src}/credentials/visualStudioCodeCredentialOptions.js +0 -0
  1033. /package/{dist/browser → dist-esm/src}/credentials/visualStudioCodeCredentialPlugin.js +0 -0
  1034. /package/{dist/browser → dist-esm/src}/credentials/visualStudioCodeCredentialPlugin.js.map +0 -0
  1035. /package/{dist/browser → dist-esm/src}/credentials/workloadIdentityCredentialOptions.js +0 -0
  1036. /package/{dist/browser → dist-esm/src}/errors.js +0 -0
  1037. /package/{dist/browser → dist-esm/src}/msal/browserFlows/flows.js +0 -0
  1038. /package/{dist/browser → dist-esm/src}/msal/credentials.js +0 -0
  1039. /package/{dist/esm → dist-esm/src}/msal/msal.js +0 -0
  1040. /package/{dist/esm → dist-esm/src}/msal/msal.js.map +0 -0
  1041. /package/{dist/browser → dist-esm/src}/msal/nodeFlows/brokerOptions.js +0 -0
  1042. /package/{dist/browser → dist-esm/src}/msal/nodeFlows/brokerOptions.js.map +0 -0
  1043. /package/{dist/browser → dist-esm/src}/msal/nodeFlows/tokenCachePersistenceOptions.js +0 -0
  1044. /package/{dist/browser → dist-esm/src}/msal/nodeFlows/tokenCachePersistenceOptions.js.map +0 -0
  1045. /package/{dist/browser → dist-esm/src}/msal/types.js +0 -0
  1046. /package/{dist/browser → dist-esm/src}/plugins/provider.js +0 -0
  1047. /package/{dist/browser → dist-esm/src}/regionalAuthority.js +0 -0
  1048. /package/{dist/browser → dist-esm/src}/regionalAuthority.js.map +0 -0
  1049. /package/{dist/browser → dist-esm/src}/tokenCredentialOptions.js +0 -0
  1050. /package/{dist/browser → dist-esm/src}/util/identityTokenEndpoint.js +0 -0
  1051. /package/{dist/browser → dist-esm/src}/util/identityTokenEndpoint.js.map +0 -0
  1052. /package/{dist/browser → dist-esm/src}/util/logging.js +0 -0
  1053. /package/{dist/browser → dist-esm/src}/util/processUtils.js +0 -0
  1054. /package/{dist/browser → dist-esm/src}/util/processUtils.js.map +0 -0
@@ -0,0 +1,309 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ import { ConfidentialClientApplication } from "@azure/msal-node";
4
+ import { AuthenticationError, AuthenticationRequiredError, CredentialUnavailableError, } from "../../errors";
5
+ import { cloudShellMsi } from "./cloudShellMsi";
6
+ import { credentialLogger, formatError, formatSuccess } from "../../util/logging";
7
+ import { DeveloperSignOnClientId } from "../../constants";
8
+ import { IdentityClient } from "../../client/identityClient";
9
+ import { appServiceMsi2017 } from "./appServiceMsi2017";
10
+ import { appServiceMsi2019 } from "./appServiceMsi2019";
11
+ import { arcMsi } from "./arcMsi";
12
+ import { fabricMsi } from "./fabricMsi";
13
+ import { getLogLevel } from "@azure/logger";
14
+ import { getMSALLogLevel } from "../../msal/utils";
15
+ import { imdsMsi } from "./imdsMsi";
16
+ import { tokenExchangeMsi } from "./tokenExchangeMsi";
17
+ import { tracingClient } from "../../util/tracing";
18
+ const logger = credentialLogger("ManagedIdentityCredential");
19
+ export class LegacyMsiProvider {
20
+ constructor(clientIdOrOptions, options) {
21
+ var _a, _b;
22
+ this.isEndpointUnavailable = null;
23
+ this.isAppTokenProviderInitialized = false;
24
+ this.msiRetryConfig = {
25
+ maxRetries: 5,
26
+ startDelayInMs: 800,
27
+ intervalIncrement: 2,
28
+ };
29
+ let _options;
30
+ if (typeof clientIdOrOptions === "string") {
31
+ this.clientId = clientIdOrOptions;
32
+ _options = options;
33
+ }
34
+ else {
35
+ this.clientId = clientIdOrOptions === null || clientIdOrOptions === void 0 ? void 0 : clientIdOrOptions.clientId;
36
+ _options = clientIdOrOptions;
37
+ }
38
+ this.resourceId = _options === null || _options === void 0 ? void 0 : _options.resourceId;
39
+ // For JavaScript users.
40
+ if (this.clientId && this.resourceId) {
41
+ throw new Error(`ManagedIdentityCredential - Client Id and Resource Id can't be provided at the same time.`);
42
+ }
43
+ if (((_a = _options === null || _options === void 0 ? void 0 : _options.retryOptions) === null || _a === void 0 ? void 0 : _a.maxRetries) !== undefined) {
44
+ this.msiRetryConfig.maxRetries = _options.retryOptions.maxRetries;
45
+ }
46
+ this.identityClient = new IdentityClient(_options);
47
+ this.isAvailableIdentityClient = new IdentityClient(Object.assign(Object.assign({}, _options), { retryOptions: {
48
+ maxRetries: 0,
49
+ } }));
50
+ /** authority host validation and metadata discovery to be skipped in managed identity
51
+ * since this wasn't done previously before adding token cache support
52
+ */
53
+ this.confidentialApp = new ConfidentialClientApplication({
54
+ auth: {
55
+ authority: "https://login.microsoftonline.com/managed_identity",
56
+ clientId: (_b = this.clientId) !== null && _b !== void 0 ? _b : DeveloperSignOnClientId,
57
+ clientSecret: "dummy-secret",
58
+ cloudDiscoveryMetadata: '{"tenant_discovery_endpoint":"https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration","api-version":"1.1","metadata":[{"preferred_network":"login.microsoftonline.com","preferred_cache":"login.windows.net","aliases":["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{"preferred_network":"login.partner.microsoftonline.cn","preferred_cache":"login.partner.microsoftonline.cn","aliases":["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{"preferred_network":"login.microsoftonline.de","preferred_cache":"login.microsoftonline.de","aliases":["login.microsoftonline.de"]},{"preferred_network":"login.microsoftonline.us","preferred_cache":"login.microsoftonline.us","aliases":["login.microsoftonline.us","login.usgovcloudapi.net"]},{"preferred_network":"login-us.microsoftonline.com","preferred_cache":"login-us.microsoftonline.com","aliases":["login-us.microsoftonline.com"]}]}',
59
+ authorityMetadata: '{"token_endpoint":"https://login.microsoftonline.com/common/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/common/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/{tenantid}/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/common/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/common/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/common/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"kerberos_endpoint":"https://login.microsoftonline.com/common/kerberos","tenant_region_scope":null,"cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}',
60
+ clientCapabilities: [],
61
+ },
62
+ system: {
63
+ loggerOptions: {
64
+ logLevel: getMSALLogLevel(getLogLevel()),
65
+ },
66
+ },
67
+ });
68
+ }
69
+ async cachedAvailableMSI(scopes, getTokenOptions) {
70
+ if (this.cachedMSI) {
71
+ return this.cachedMSI;
72
+ }
73
+ const MSIs = [
74
+ arcMsi,
75
+ fabricMsi,
76
+ appServiceMsi2019,
77
+ appServiceMsi2017,
78
+ cloudShellMsi,
79
+ tokenExchangeMsi,
80
+ imdsMsi,
81
+ ];
82
+ for (const msi of MSIs) {
83
+ if (await msi.isAvailable({
84
+ scopes,
85
+ identityClient: this.isAvailableIdentityClient,
86
+ clientId: this.clientId,
87
+ resourceId: this.resourceId,
88
+ getTokenOptions,
89
+ })) {
90
+ this.cachedMSI = msi;
91
+ return msi;
92
+ }
93
+ }
94
+ throw new CredentialUnavailableError(`ManagedIdentityCredential - No MSI credential available`);
95
+ }
96
+ async authenticateManagedIdentity(scopes, getTokenOptions) {
97
+ const { span, updatedOptions } = tracingClient.startSpan(`ManagedIdentityCredential.authenticateManagedIdentity`, getTokenOptions);
98
+ try {
99
+ // Determining the available MSI, and avoiding checking for other MSIs while the program is running.
100
+ const availableMSI = await this.cachedAvailableMSI(scopes, updatedOptions);
101
+ return availableMSI.getToken({
102
+ identityClient: this.identityClient,
103
+ scopes,
104
+ clientId: this.clientId,
105
+ resourceId: this.resourceId,
106
+ retryConfig: this.msiRetryConfig,
107
+ }, updatedOptions);
108
+ }
109
+ catch (err) {
110
+ span.setStatus({
111
+ status: "error",
112
+ error: err,
113
+ });
114
+ throw err;
115
+ }
116
+ finally {
117
+ span.end();
118
+ }
119
+ }
120
+ /**
121
+ * Authenticates with Microsoft Entra ID and returns an access token if successful.
122
+ * If authentication fails, a {@link CredentialUnavailableError} will be thrown with the details of the failure.
123
+ * If an unexpected error occurs, an {@link AuthenticationError} will be thrown with the details of the failure.
124
+ *
125
+ * @param scopes - The list of scopes for which the token will have access.
126
+ * @param options - The options used to configure any requests this
127
+ * TokenCredential implementation might make.
128
+ */
129
+ async getToken(scopes, options) {
130
+ let result = null;
131
+ const { span, updatedOptions } = tracingClient.startSpan(`ManagedIdentityCredential.getToken`, options);
132
+ try {
133
+ // isEndpointAvailable can be true, false, or null,
134
+ // If it's null, it means we don't yet know whether
135
+ // the endpoint is available and need to check for it.
136
+ if (this.isEndpointUnavailable !== true) {
137
+ const availableMSI = await this.cachedAvailableMSI(scopes, updatedOptions);
138
+ if (availableMSI.name === "tokenExchangeMsi") {
139
+ result = await this.authenticateManagedIdentity(scopes, updatedOptions);
140
+ }
141
+ else {
142
+ const appTokenParameters = {
143
+ correlationId: this.identityClient.getCorrelationId(),
144
+ tenantId: (options === null || options === void 0 ? void 0 : options.tenantId) || "managed_identity",
145
+ scopes: Array.isArray(scopes) ? scopes : [scopes],
146
+ claims: options === null || options === void 0 ? void 0 : options.claims,
147
+ };
148
+ // Added a check to see if SetAppTokenProvider was already defined.
149
+ this.initializeSetAppTokenProvider();
150
+ const authenticationResult = await this.confidentialApp.acquireTokenByClientCredential(Object.assign({}, appTokenParameters));
151
+ result = this.handleResult(scopes, authenticationResult || undefined);
152
+ }
153
+ if (result === null) {
154
+ // If authenticateManagedIdentity returns null,
155
+ // it means no MSI endpoints are available.
156
+ // If so, we avoid trying to reach to them in future requests.
157
+ this.isEndpointUnavailable = true;
158
+ // It also means that the endpoint answered with either 200 or 201 (see the sendTokenRequest method),
159
+ // yet we had no access token. For this reason, we'll throw once with a specific message:
160
+ const error = new CredentialUnavailableError("The managed identity endpoint was reached, yet no tokens were received.");
161
+ logger.getToken.info(formatError(scopes, error));
162
+ throw error;
163
+ }
164
+ // Since `authenticateManagedIdentity` didn't throw, and the result was not null,
165
+ // We will assume that this endpoint is reachable from this point forward,
166
+ // and avoid pinging again to it.
167
+ this.isEndpointUnavailable = false;
168
+ }
169
+ else {
170
+ // We've previously determined that the endpoint was unavailable,
171
+ // either because it was unreachable or permanently unable to authenticate.
172
+ const error = new CredentialUnavailableError("The managed identity endpoint is not currently available");
173
+ logger.getToken.info(formatError(scopes, error));
174
+ throw error;
175
+ }
176
+ logger.getToken.info(formatSuccess(scopes));
177
+ return result;
178
+ }
179
+ catch (err) {
180
+ // CredentialUnavailable errors are expected to reach here.
181
+ // We intend them to bubble up, so that DefaultAzureCredential can catch them.
182
+ if (err.name === "AuthenticationRequiredError") {
183
+ throw err;
184
+ }
185
+ // Expected errors to reach this point:
186
+ // - Errors coming from a method unexpectedly breaking.
187
+ // - When identityClient.sendTokenRequest throws, in which case
188
+ // if the status code was 400, it means that the endpoint is working,
189
+ // but no identity is available.
190
+ span.setStatus({
191
+ status: "error",
192
+ error: err,
193
+ });
194
+ // If either the network is unreachable,
195
+ // we can safely assume the credential is unavailable.
196
+ if (err.code === "ENETUNREACH") {
197
+ const error = new CredentialUnavailableError(`ManagedIdentityCredential: Unavailable. Network unreachable. Message: ${err.message}`);
198
+ logger.getToken.info(formatError(scopes, error));
199
+ throw error;
200
+ }
201
+ // If either the host was unreachable,
202
+ // we can safely assume the credential is unavailable.
203
+ if (err.code === "EHOSTUNREACH") {
204
+ const error = new CredentialUnavailableError(`ManagedIdentityCredential: Unavailable. No managed identity endpoint found. Message: ${err.message}`);
205
+ logger.getToken.info(formatError(scopes, error));
206
+ throw error;
207
+ }
208
+ // If err.statusCode has a value of 400, it comes from sendTokenRequest,
209
+ // and it means that the endpoint is working, but that no identity is available.
210
+ if (err.statusCode === 400) {
211
+ throw new CredentialUnavailableError(`ManagedIdentityCredential: The managed identity endpoint is indicating there's no available identity. Message: ${err.message}`);
212
+ }
213
+ // 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"
214
+ // rather than just timing out, as expected.
215
+ if (err.statusCode === 403 || err.code === 403) {
216
+ if (err.message.includes("unreachable")) {
217
+ const error = new CredentialUnavailableError(`ManagedIdentityCredential: Unavailable. Network unreachable. Message: ${err.message}`);
218
+ logger.getToken.info(formatError(scopes, error));
219
+ throw error;
220
+ }
221
+ }
222
+ // If the error has no status code, we can assume there was no available identity.
223
+ // This will throw silently during any ChainedTokenCredential.
224
+ if (err.statusCode === undefined) {
225
+ throw new CredentialUnavailableError(`ManagedIdentityCredential: Authentication failed. Message ${err.message}`);
226
+ }
227
+ // Any other error should break the chain.
228
+ throw new AuthenticationError(err.statusCode, {
229
+ error: `ManagedIdentityCredential authentication failed.`,
230
+ error_description: err.message,
231
+ });
232
+ }
233
+ finally {
234
+ // Finally is always called, both if we return and if we throw in the above try/catch.
235
+ span.end();
236
+ }
237
+ }
238
+ /**
239
+ * Handles the MSAL authentication result.
240
+ * If the result has an account, we update the local account reference.
241
+ * If the token received is invalid, an error will be thrown depending on what's missing.
242
+ */
243
+ handleResult(scopes, result, getTokenOptions) {
244
+ var _a;
245
+ this.ensureValidMsalToken(scopes, result, getTokenOptions);
246
+ logger.getToken.info(formatSuccess(scopes));
247
+ return {
248
+ token: result.accessToken,
249
+ expiresOnTimestamp: result.expiresOn.getTime(),
250
+ refreshAfterTimestamp: (_a = result.refreshOn) === null || _a === void 0 ? void 0 : _a.getTime(),
251
+ tokenType: "Bearer",
252
+ };
253
+ }
254
+ /**
255
+ * Ensures the validity of the MSAL token
256
+ */
257
+ ensureValidMsalToken(scopes, msalToken, getTokenOptions) {
258
+ const error = (message) => {
259
+ logger.getToken.info(message);
260
+ return new AuthenticationRequiredError({
261
+ scopes: Array.isArray(scopes) ? scopes : [scopes],
262
+ getTokenOptions,
263
+ message,
264
+ });
265
+ };
266
+ if (!msalToken) {
267
+ throw error("No response");
268
+ }
269
+ if (!msalToken.expiresOn) {
270
+ throw error(`Response had no "expiresOn" property.`);
271
+ }
272
+ if (!msalToken.accessToken) {
273
+ throw error(`Response had no "accessToken" property.`);
274
+ }
275
+ }
276
+ initializeSetAppTokenProvider() {
277
+ if (!this.isAppTokenProviderInitialized) {
278
+ this.confidentialApp.SetAppTokenProvider(async (appTokenProviderParameters) => {
279
+ logger.info(`SetAppTokenProvider invoked with parameters- ${JSON.stringify(appTokenProviderParameters)}`);
280
+ const getTokenOptions = Object.assign({}, appTokenProviderParameters);
281
+ logger.info(`authenticateManagedIdentity invoked with scopes- ${JSON.stringify(appTokenProviderParameters.scopes)} and getTokenOptions - ${JSON.stringify(getTokenOptions)}`);
282
+ const resultToken = await this.authenticateManagedIdentity(appTokenProviderParameters.scopes, getTokenOptions);
283
+ if (resultToken) {
284
+ logger.info(`SetAppTokenProvider will save the token in cache`);
285
+ const expiresInSeconds = (resultToken === null || resultToken === void 0 ? void 0 : resultToken.expiresOnTimestamp)
286
+ ? Math.floor((resultToken.expiresOnTimestamp - Date.now()) / 1000)
287
+ : 0;
288
+ const refreshInSeconds = (resultToken === null || resultToken === void 0 ? void 0 : resultToken.refreshAfterTimestamp)
289
+ ? Math.floor((resultToken.refreshAfterTimestamp - Date.now()) / 1000)
290
+ : 0;
291
+ return {
292
+ accessToken: resultToken === null || resultToken === void 0 ? void 0 : resultToken.token,
293
+ expiresInSeconds,
294
+ refreshInSeconds,
295
+ };
296
+ }
297
+ else {
298
+ logger.info(`SetAppTokenProvider token has "no_access_token_returned" as the saved token`);
299
+ return {
300
+ accessToken: "no_access_token_returned",
301
+ expiresInSeconds: 0,
302
+ };
303
+ }
304
+ });
305
+ this.isAppTokenProviderInitialized = true;
306
+ }
307
+ }
308
+ }
309
+ //# sourceMappingURL=legacyMsiProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"legacyMsiProvider.js","sourceRoot":"","sources":["../../../../src/credentials/managedIdentityCredential/legacyMsiProvider.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAA8B,6BAA6B,EAAE,MAAM,kBAAkB,CAAC;AAC7F,OAAO,EACL,mBAAmB,EACnB,2BAA2B,EAC3B,0BAA0B,GAC3B,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAElF,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,OAAO,EAAE,iBAAiB,EAAE,M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oBACN,MAAM,CAAC,IAAI,CACT,6EAA6E,CAC9E,CAAC;oBACF,OAAO;wBACL,WAAW,EAAE,0BAA0B;wBACvC,gBAAgB,EAAE,CAAC;qBACpB,CAAC;gBACJ,CAAC;YACH,CAAC,CAAC,CAAC;YACH,IAAI,CAAC,6BAA6B,GAAG,IAAI,CAAC;QAC5C,CAAC;IACH,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { AccessToken, GetTokenOptions } from \"@azure/core-auth\";\nimport { AppTokenProviderParameters, ConfidentialClientApplication } from \"@azure/msal-node\";\nimport {\n AuthenticationError,\n AuthenticationRequiredError,\n CredentialUnavailableError,\n} from \"../../errors\";\nimport { MSI, MSIConfiguration, MSIToken } from \"./models\";\nimport { MsalResult, MsalToken, ValidMsalToken } from \"../../msal/types\";\nimport { cloudShellMsi } from \"./cloudShellMsi\";\nimport { credentialLogger, formatError, formatSuccess } from \"../../util/logging\";\n\nimport { DeveloperSignOnClientId } from \"../../constants\";\nimport { IdentityClient } from \"../../client/identityClient\";\nimport { TokenCredentialOptions } from \"../../tokenCredentialOptions\";\nimport { appServiceMsi2017 } from \"./appServiceMsi2017\";\nimport { appServiceMsi2019 } from \"./appServiceMsi2019\";\nimport { arcMsi } from \"./arcMsi\";\nimport { fabricMsi } from \"./fabricMsi\";\nimport { getLogLevel } from \"@azure/logger\";\nimport { getMSALLogLevel } from \"../../msal/utils\";\nimport { imdsMsi } from \"./imdsMsi\";\nimport { tokenExchangeMsi } from \"./tokenExchangeMsi\";\nimport { tracingClient } from \"../../util/tracing\";\n\nconst logger = credentialLogger(\"ManagedIdentityCredential\");\n\n// As part of the migration of Managed Identity to MSAL, this legacy provider captures the existing behavior\n// ported over from the ManagedIdentityCredential verbatim. This is to ensure that the existing behavior\n// is maintained while the new implementation is being tested and validated.\n// https://github.com/Azure/azure-sdk-for-js/issues/30189 tracks deleting this provider once it is no longer needed.\n\n/**\n * Options to send on the {@link ManagedIdentityCredential} constructor.\n * Since this is an internal implementation, uses a looser interface than the public one.\n */\ninterface ManagedIdentityCredentialOptions extends TokenCredentialOptions {\n /**\n * The client ID of the user - assigned identity, or app registration(when working with AKS pod - identity).\n */\n clientId?: string;\n\n /**\n * Allows specifying a custom resource Id.\n * In scenarios such as when user assigned identities are created using an ARM template,\n * where the resource Id of the identity is known but the client Id can't be known ahead of time,\n * this parameter allows programs to use these user assigned identities\n * without having to first determine the client Id of the created identity.\n */\n resourceId?: string;\n}\n\nexport class LegacyMsiProvider {\n private identityClient: IdentityClient;\n private clientId: string | undefined;\n private resourceId: string | undefined;\n private isEndpointUnavailable: boolean | null = null;\n private isAvailableIdentityClient: IdentityClient;\n private confidentialApp: ConfidentialClientApplication;\n private isAppTokenProviderInitialized: boolean = false;\n private msiRetryConfig: MSIConfiguration[\"retryConfig\"] = {\n maxRetries: 5,\n startDelayInMs: 800,\n intervalIncrement: 2,\n };\n\n constructor(\n clientIdOrOptions?: string | ManagedIdentityCredentialOptions,\n options?: TokenCredentialOptions,\n ) {\n let _options: TokenCredentialOptions | undefined;\n if (typeof clientIdOrOptions === \"string\") {\n this.clientId = clientIdOrOptions;\n _options = options;\n } else {\n this.clientId = (clientIdOrOptions as ManagedIdentityCredentialOptions)?.clientId;\n _options = clientIdOrOptions;\n }\n this.resourceId = (_options as ManagedIdentityCredentialOptions)?.resourceId;\n // For JavaScript users.\n if (this.clientId && this.resourceId) {\n throw new Error(\n `ManagedIdentityCredential - Client Id and Resource Id can't be provided at the same time.`,\n );\n }\n if (_options?.retryOptions?.maxRetries !== undefined) {\n this.msiRetryConfig.maxRetries = _options.retryOptions.maxRetries;\n }\n this.identityClient = new IdentityClient(_options);\n this.isAvailableIdentityClient = new IdentityClient({\n ..._options,\n retryOptions: {\n maxRetries: 0,\n },\n });\n\n /** authority host validation and metadata discovery to be skipped in managed identity\n * since this wasn't done previously before adding token cache support\n */\n this.confidentialApp = new ConfidentialClientApplication({\n auth: {\n authority: \"https://login.microsoftonline.com/managed_identity\",\n clientId: this.clientId ?? DeveloperSignOnClientId,\n clientSecret: \"dummy-secret\",\n cloudDiscoveryMetadata:\n '{\"tenant_discovery_endpoint\":\"https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration\",\"api-version\":\"1.1\",\"metadata\":[{\"preferred_network\":\"login.microsoftonline.com\",\"preferred_cache\":\"login.windows.net\",\"aliases\":[\"login.microsoftonline.com\",\"login.windows.net\",\"login.microsoft.com\",\"sts.windows.net\"]},{\"preferred_network\":\"login.partner.microsoftonline.cn\",\"preferred_cache\":\"login.partner.microsoftonline.cn\",\"aliases\":[\"login.partner.microsoftonline.cn\",\"login.chinacloudapi.cn\"]},{\"preferred_network\":\"login.microsoftonline.de\",\"preferred_cache\":\"login.microsoftonline.de\",\"aliases\":[\"login.microsoftonline.de\"]},{\"preferred_network\":\"login.microsoftonline.us\",\"preferred_cache\":\"login.microsoftonline.us\",\"aliases\":[\"login.microsoftonline.us\",\"login.usgovcloudapi.net\"]},{\"preferred_network\":\"login-us.microsoftonline.com\",\"preferred_cache\":\"login-us.microsoftonline.com\",\"aliases\":[\"login-us.microsoftonline.com\"]}]}',\n authorityMetadata:\n '{\"token_endpoint\":\"https://login.microsoftonline.com/common/oauth2/v2.0/token\",\"token_endpoint_auth_methods_supported\":[\"client_secret_post\",\"private_key_jwt\",\"client_secret_basic\"],\"jwks_uri\":\"https://login.microsoftonline.com/common/discovery/v2.0/keys\",\"response_modes_supported\":[\"query\",\"fragment\",\"form_post\"],\"subject_types_supported\":[\"pairwise\"],\"id_token_signing_alg_values_supported\":[\"RS256\"],\"response_types_supported\":[\"code\",\"id_token\",\"code id_token\",\"id_token token\"],\"scopes_supported\":[\"openid\",\"profile\",\"email\",\"offline_access\"],\"issuer\":\"https://login.microsoftonline.com/{tenantid}/v2.0\",\"request_uri_parameter_supported\":false,\"userinfo_endpoint\":\"https://graph.microsoft.com/oidc/userinfo\",\"authorization_endpoint\":\"https://login.microsoftonline.com/common/oauth2/v2.0/authorize\",\"device_authorization_endpoint\":\"https://login.microsoftonline.com/common/oauth2/v2.0/devicecode\",\"http_logout_supported\":true,\"frontchannel_logout_supported\":true,\"end_session_endpoint\":\"https://login.microsoftonline.com/common/oauth2/v2.0/logout\",\"claims_supported\":[\"sub\",\"iss\",\"cloud_instance_name\",\"cloud_instance_host_name\",\"cloud_graph_host_name\",\"msgraph_host\",\"aud\",\"exp\",\"iat\",\"auth_time\",\"acr\",\"nonce\",\"preferred_username\",\"name\",\"tid\",\"ver\",\"at_hash\",\"c_hash\",\"email\"],\"kerberos_endpoint\":\"https://login.microsoftonline.com/common/kerberos\",\"tenant_region_scope\":null,\"cloud_instance_name\":\"microsoftonline.com\",\"cloud_graph_host_name\":\"graph.windows.net\",\"msgraph_host\":\"graph.microsoft.com\",\"rbac_url\":\"https://pas.windows.net\"}',\n clientCapabilities: [],\n },\n system: {\n loggerOptions: {\n logLevel: getMSALLogLevel(getLogLevel()),\n },\n },\n });\n }\n\n private cachedMSI: MSI | undefined;\n\n private async cachedAvailableMSI(\n scopes: string | string[],\n getTokenOptions?: GetTokenOptions,\n ): Promise<MSI> {\n if (this.cachedMSI) {\n return this.cachedMSI;\n }\n\n const MSIs = [\n arcMsi,\n fabricMsi,\n appServiceMsi2019,\n appServiceMsi2017,\n cloudShellMsi,\n tokenExchangeMsi,\n imdsMsi,\n ];\n\n for (const msi of MSIs) {\n if (\n await msi.isAvailable({\n scopes,\n identityClient: this.isAvailableIdentityClient,\n clientId: this.clientId,\n resourceId: this.resourceId,\n getTokenOptions,\n })\n ) {\n this.cachedMSI = msi;\n return msi;\n }\n }\n\n throw new CredentialUnavailableError(`ManagedIdentityCredential - No MSI credential available`);\n }\n\n private async authenticateManagedIdentity(\n scopes: string | string[],\n getTokenOptions?: GetTokenOptions,\n ): Promise<MSIToken | null> {\n const { span, updatedOptions } = tracingClient.startSpan(\n `ManagedIdentityCredential.authenticateManagedIdentity`,\n getTokenOptions,\n );\n\n try {\n // Determining the available MSI, and avoiding checking for other MSIs while the program is running.\n const availableMSI = await this.cachedAvailableMSI(scopes, updatedOptions);\n return availableMSI.getToken(\n {\n identityClient: this.identityClient,\n scopes,\n clientId: this.clientId,\n resourceId: this.resourceId,\n retryConfig: this.msiRetryConfig,\n },\n updatedOptions,\n );\n } catch (err: any) {\n span.setStatus({\n status: \"error\",\n error: err,\n });\n throw err;\n } finally {\n span.end();\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 * If an unexpected error occurs, an {@link AuthenticationError} 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 public async getToken(\n scopes: string | string[],\n options?: GetTokenOptions,\n ): Promise<AccessToken> {\n let result: AccessToken | null = null;\n const { span, updatedOptions } = tracingClient.startSpan(\n `ManagedIdentityCredential.getToken`,\n options,\n );\n try {\n // isEndpointAvailable can be true, false, or null,\n // If it's null, it means we don't yet know whether\n // the endpoint is available and need to check for it.\n if (this.isEndpointUnavailable !== true) {\n const availableMSI = await this.cachedAvailableMSI(scopes, updatedOptions);\n if (availableMSI.name === \"tokenExchangeMsi\") {\n result = await this.authenticateManagedIdentity(scopes, updatedOptions);\n } else {\n const appTokenParameters: AppTokenProviderParameters = {\n correlationId: this.identityClient.getCorrelationId(),\n tenantId: options?.tenantId || \"managed_identity\",\n scopes: Array.isArray(scopes) ? scopes : [scopes],\n claims: options?.claims,\n };\n\n // Added a check to see if SetAppTokenProvider was already defined.\n this.initializeSetAppTokenProvider();\n const authenticationResult = await this.confidentialApp.acquireTokenByClientCredential({\n ...appTokenParameters,\n });\n result = this.handleResult(scopes, authenticationResult || undefined);\n }\n if (result === null) {\n // If authenticateManagedIdentity returns null,\n // it means no MSI endpoints are available.\n // If so, we avoid trying to reach to them in future requests.\n this.isEndpointUnavailable = true;\n\n // It also means that the endpoint answered with either 200 or 201 (see the sendTokenRequest method),\n // yet we had no access token. For this reason, we'll throw once with a specific message:\n const error = new CredentialUnavailableError(\n \"The managed identity endpoint was reached, yet no tokens were received.\",\n );\n logger.getToken.info(formatError(scopes, error));\n throw error;\n }\n\n // Since `authenticateManagedIdentity` didn't throw, and the result was not null,\n // We will assume that this endpoint is reachable from this point forward,\n // and avoid pinging again to it.\n this.isEndpointUnavailable = false;\n } else {\n // We've previously determined that the endpoint was unavailable,\n // either because it was unreachable or permanently unable to authenticate.\n const error = new CredentialUnavailableError(\n \"The managed identity endpoint is not currently available\",\n );\n logger.getToken.info(formatError(scopes, error));\n throw error;\n }\n\n logger.getToken.info(formatSuccess(scopes));\n return result;\n } catch (err: any) {\n // CredentialUnavailable errors are expected to reach here.\n // We intend them to bubble up, so that DefaultAzureCredential can catch them.\n if (err.name === \"AuthenticationRequiredError\") {\n throw err;\n }\n\n // Expected errors to reach this point:\n // - Errors coming from a method unexpectedly breaking.\n // - When identityClient.sendTokenRequest throws, in which case\n // if the status code was 400, it means that the endpoint is working,\n // but no identity is available.\n\n span.setStatus({\n status: \"error\",\n error: err,\n });\n\n // If either the network is unreachable,\n // we can safely assume the credential is unavailable.\n if (err.code === \"ENETUNREACH\") {\n const error = new CredentialUnavailableError(\n `ManagedIdentityCredential: Unavailable. Network unreachable. Message: ${err.message}`,\n );\n\n logger.getToken.info(formatError(scopes, error));\n throw error;\n }\n\n // If either the host was unreachable,\n // we can safely assume the credential is unavailable.\n if (err.code === \"EHOSTUNREACH\") {\n const error = new CredentialUnavailableError(\n `ManagedIdentityCredential: Unavailable. No managed identity endpoint found. Message: ${err.message}`,\n );\n\n logger.getToken.info(formatError(scopes, error));\n throw error;\n }\n // If err.statusCode has a value of 400, it comes from sendTokenRequest,\n // and it means that the endpoint is working, but that no identity is available.\n if (err.statusCode === 400) {\n throw new CredentialUnavailableError(\n `ManagedIdentityCredential: The managed identity endpoint is indicating there's no available identity. Message: ${err.message}`,\n );\n }\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 if (err.statusCode === 403 || err.code === 403) {\n if (err.message.includes(\"unreachable\")) {\n const error = new CredentialUnavailableError(\n `ManagedIdentityCredential: Unavailable. Network unreachable. Message: ${err.message}`,\n );\n\n logger.getToken.info(formatError(scopes, error));\n throw error;\n }\n }\n\n // If the error has no status code, we can assume there was no available identity.\n // This will throw silently during any ChainedTokenCredential.\n if (err.statusCode === undefined) {\n throw new CredentialUnavailableError(\n `ManagedIdentityCredential: Authentication failed. Message ${err.message}`,\n );\n }\n\n // Any other error should break the chain.\n throw new AuthenticationError(err.statusCode, {\n error: `ManagedIdentityCredential authentication failed.`,\n error_description: err.message,\n });\n } finally {\n // Finally is always called, both if we return and if we throw in the above try/catch.\n span.end();\n }\n }\n\n /**\n * Handles the MSAL authentication result.\n * If the result has an account, we update the local account reference.\n * If the token received is invalid, an error will be thrown depending on what's missing.\n */\n private handleResult(\n scopes: string | string[],\n result?: MsalResult,\n getTokenOptions?: GetTokenOptions,\n ): AccessToken {\n this.ensureValidMsalToken(scopes, result, getTokenOptions);\n logger.getToken.info(formatSuccess(scopes));\n return {\n token: result.accessToken,\n expiresOnTimestamp: result.expiresOn.getTime(),\n refreshAfterTimestamp: result.refreshOn?.getTime(),\n tokenType: \"Bearer\",\n } as AccessToken;\n }\n\n /**\n * Ensures the validity of the MSAL token\n */\n private ensureValidMsalToken(\n scopes: string | string[],\n msalToken?: MsalToken,\n getTokenOptions?: GetTokenOptions,\n ): asserts msalToken is ValidMsalToken {\n const error = (message: string): Error => {\n logger.getToken.info(message);\n return new AuthenticationRequiredError({\n scopes: Array.isArray(scopes) ? scopes : [scopes],\n getTokenOptions,\n message,\n });\n };\n if (!msalToken) {\n throw error(\"No response\");\n }\n if (!msalToken.expiresOn) {\n throw error(`Response had no \"expiresOn\" property.`);\n }\n if (!msalToken.accessToken) {\n throw error(`Response had no \"accessToken\" property.`);\n }\n }\n\n private initializeSetAppTokenProvider(): void {\n if (!this.isAppTokenProviderInitialized) {\n this.confidentialApp.SetAppTokenProvider(async (appTokenProviderParameters) => {\n logger.info(\n `SetAppTokenProvider invoked with parameters- ${JSON.stringify(\n appTokenProviderParameters,\n )}`,\n );\n const getTokenOptions: GetTokenOptions = {\n ...appTokenProviderParameters,\n };\n logger.info(\n `authenticateManagedIdentity invoked with scopes- ${JSON.stringify(\n appTokenProviderParameters.scopes,\n )} and getTokenOptions - ${JSON.stringify(getTokenOptions)}`,\n );\n const resultToken = await this.authenticateManagedIdentity(\n appTokenProviderParameters.scopes,\n getTokenOptions,\n );\n\n if (resultToken) {\n logger.info(`SetAppTokenProvider will save the token in cache`);\n\n const expiresInSeconds = resultToken?.expiresOnTimestamp\n ? Math.floor((resultToken.expiresOnTimestamp - Date.now()) / 1000)\n : 0;\n const refreshInSeconds = resultToken?.refreshAfterTimestamp\n ? Math.floor((resultToken.refreshAfterTimestamp - Date.now()) / 1000)\n : 0;\n return {\n accessToken: resultToken?.token,\n expiresInSeconds,\n refreshInSeconds,\n };\n } else {\n logger.info(\n `SetAppTokenProvider token has \"no_access_token_returned\" as the saved token`,\n );\n return {\n accessToken: \"no_access_token_returned\",\n expiresInSeconds: 0,\n };\n }\n });\n this.isAppTokenProviderInitialized = true;\n }\n }\n}\n"]}
@@ -0,0 +1 @@
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 { AccessToken, GetTokenOptions } from \"@azure/core-auth\";\n\nimport { IdentityClient } from \"../../client/identityClient\";\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\n/**\n * @internal\n */\nexport interface MSI {\n name: string;\n isAvailable(options: {\n scopes: string | string[];\n identityClient?: IdentityClient;\n clientId?: string;\n resourceId?: string;\n getTokenOptions?: GetTokenOptions;\n }): Promise<boolean>;\n getToken(\n configuration: MSIConfiguration,\n getTokenOptions?: GetTokenOptions,\n ): Promise<MSIToken | null>;\n}\n"]}
@@ -1,41 +1,29 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
- import { getLogLevel } from "@azure/logger";
3
+ import { AuthenticationRequiredError, CredentialUnavailableError } from "../../errors";
4
+ import { credentialLogger, formatError, formatSuccess } from "../../util/logging";
5
+ import { defaultLoggerCallback, getMSALLogLevel } from "../../msal/utils";
6
+ import { IdentityClient } from "../../client/identityClient";
4
7
  import { ManagedIdentityApplication } from "@azure/msal-node";
5
- import { IdentityClient } from "../../client/identityClient.js";
6
- import { AuthenticationRequiredError, CredentialUnavailableError } from "../../errors.js";
7
- import { getMSALLogLevel, defaultLoggerCallback } from "../../msal/utils.js";
8
- import { imdsRetryPolicy } from "./imdsRetryPolicy.js";
9
- import { formatSuccess, formatError, credentialLogger } from "../../util/logging.js";
10
- import { tracingClient } from "../../util/tracing.js";
11
- import { imdsMsi } from "./imdsMsi.js";
12
- import { tokenExchangeMsi } from "./tokenExchangeMsi.js";
13
- import { mapScopesToResource } from "./utils.js";
14
- const logger = credentialLogger("ManagedIdentityCredential");
15
- /**
16
- * Attempts authentication using a managed identity available at the deployment environment.
17
- * This authentication type works in Azure VMs, App Service instances, Azure Functions applications,
18
- * Azure Kubernetes Services, Azure Service Fabric instances and inside of the Azure Cloud Shell.
19
- *
20
- * More information about configuring managed identities can be found here:
21
- * https://learn.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/overview
22
- */
23
- export class ManagedIdentityCredential {
24
- /**
25
- * @internal
26
- * @hidden
27
- */
28
- constructor(clientIdOrOptions, options) {
8
+ import { getLogLevel } from "@azure/logger";
9
+ import { imdsMsi } from "./imdsMsi";
10
+ import { imdsRetryPolicy } from "./imdsRetryPolicy";
11
+ import { mapScopesToResource } from "./utils";
12
+ import { tokenExchangeMsi } from "./tokenExchangeMsi";
13
+ import { tracingClient } from "../../util/tracing";
14
+ const logger = credentialLogger("ManagedIdentityCredential(MSAL)");
15
+ export class MsalMsiProvider {
16
+ constructor(clientIdOrOptions, options = {}) {
29
17
  var _a, _b;
30
18
  this.msiRetryConfig = {
31
19
  maxRetries: 5,
32
20
  startDelayInMs: 800,
33
21
  intervalIncrement: 2,
34
22
  };
35
- let _options;
23
+ let _options = {};
36
24
  if (typeof clientIdOrOptions === "string") {
37
25
  this.clientId = clientIdOrOptions;
38
- _options = options !== null && options !== void 0 ? options : {};
26
+ _options = options;
39
27
  }
40
28
  else {
41
29
  this.clientId = clientIdOrOptions === null || clientIdOrOptions === void 0 ? void 0 : clientIdOrOptions.clientId;
@@ -50,7 +38,7 @@ export class ManagedIdentityCredential {
50
38
  }
51
39
  // ManagedIdentity uses http for local requests
52
40
  _options.allowInsecureConnection = true;
53
- if (((_a = _options.retryOptions) === null || _a === void 0 ? void 0 : _a.maxRetries) !== undefined) {
41
+ if (((_a = _options === null || _options === void 0 ? void 0 : _options.retryOptions) === null || _a === void 0 ? void 0 : _a.maxRetries) !== undefined) {
54
42
  this.msiRetryConfig.maxRetries = _options.retryOptions.maxRetries;
55
43
  }
56
44
  this.identityClient = new IdentityClient(Object.assign(Object.assign({}, _options), { additionalPolicies: [{ policy: imdsRetryPolicy(this.msiRetryConfig), position: "perCall" }] }));
@@ -61,11 +49,12 @@ export class ManagedIdentityCredential {
61
49
  userAssignedObjectId: this.objectId,
62
50
  },
63
51
  system: {
52
+ // todo: proxyUrl?
64
53
  disableInternalRetries: true,
65
54
  networkClient: this.identityClient,
66
55
  loggerOptions: {
67
56
  logLevel: getMSALLogLevel(getLogLevel()),
68
- piiLoggingEnabled: (_b = _options.loggingOptions) === null || _b === void 0 ? void 0 : _b.enableUnsafeSupportLogging,
57
+ piiLoggingEnabled: (_b = options.loggingOptions) === null || _b === void 0 ? void 0 : _b.enableUnsafeSupportLogging,
69
58
  loggerCallback: defaultLoggerCallback(logger),
70
59
  },
71
60
  },
@@ -103,7 +92,13 @@ export class ManagedIdentityCredential {
103
92
  return tracingClient.withSpan("ManagedIdentityCredential.getToken", options, async () => {
104
93
  var _a;
105
94
  try {
106
- const isTokenExchangeMsi = await tokenExchangeMsi.isAvailable(this.clientId);
95
+ const isTokenExchangeMsi = await tokenExchangeMsi.isAvailable({
96
+ scopes,
97
+ clientId: this.clientId,
98
+ getTokenOptions: options,
99
+ identityClient: this.identityClient,
100
+ resourceId: this.resourceId,
101
+ });
107
102
  // Most scenarios are handled by MSAL except for two:
108
103
  // AKS pod identity - MSAL does not implement the token exchange flow.
109
104
  // IMDS Endpoint probing - MSAL does not do any probing before trying to get a token.
@@ -214,4 +209,4 @@ function isNetworkError(err) {
214
209
  }
215
210
  return false;
216
211
  }
217
- //# sourceMappingURL=index.js.map
212
+ //# sourceMappingURL=msalMsiProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"msalMsiProvider.js","sourceRoot":"","sources":["../../../../src/credentials/managedIdentityCredential/msalMsiProvider.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,2BAA2B,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAEvF,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAClF,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAE1E,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,OAAO,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAE9D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,C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ACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { AccessToken, GetTokenOptions } from \"@azure/core-auth\";\nimport { AuthenticationRequiredError, CredentialUnavailableError } from \"../../errors\";\nimport { MsalToken, ValidMsalToken } from \"../../msal/types\";\nimport { credentialLogger, formatError, formatSuccess } from \"../../util/logging\";\nimport { defaultLoggerCallback, getMSALLogLevel } from \"../../msal/utils\";\n\nimport { IdentityClient } from \"../../client/identityClient\";\nimport { MSIConfiguration } from \"./models\";\nimport { ManagedIdentityApplication } from \"@azure/msal-node\";\nimport { TokenCredentialOptions } from \"../../tokenCredentialOptions\";\nimport { getLogLevel } from \"@azure/logger\";\nimport { imdsMsi } from \"./imdsMsi\";\nimport { imdsRetryPolicy } from \"./imdsRetryPolicy\";\nimport { mapScopesToResource } from \"./utils\";\nimport { tokenExchangeMsi } from \"./tokenExchangeMsi\";\nimport { tracingClient } from \"../../util/tracing\";\n\nconst logger = credentialLogger(\"ManagedIdentityCredential(MSAL)\");\n\n/**\n * Options to send on the {@link ManagedIdentityCredential} constructor.\n * Since this is an internal implementation, uses a looser interface than the public one.\n */\ninterface ManagedIdentityCredentialOptions extends TokenCredentialOptions {\n /**\n * The client ID of the user - assigned identity, or app registration(when working with AKS pod - identity).\n */\n clientId?: string;\n\n /**\n * Allows specifying a custom resource Id.\n * In scenarios such as when user assigned identities are created using an ARM template,\n * where the resource Id of the identity is known but the client Id can't be known ahead of time,\n * this parameter allows programs to use these user assigned identities\n * without having to first determine the client Id of the created identity.\n */\n resourceId?: string;\n\n /**\n * Allows specifying the object ID of the underlying service principal used to authenticate a user-assigned managed identity.\n * This is an alternative to providing a client ID and is not required for system-assigned managed identities.\n */\n objectId?: string;\n}\n\nexport class MsalMsiProvider {\n private managedIdentityApp: ManagedIdentityApplication;\n private identityClient: IdentityClient;\n private clientId?: string;\n private resourceId?: string;\n private objectId?: string;\n private msiRetryConfig: MSIConfiguration[\"retryConfig\"] = {\n maxRetries: 5,\n startDelayInMs: 800,\n intervalIncrement: 2,\n };\n private isAvailableIdentityClient: IdentityClient;\n\n constructor(\n clientIdOrOptions?: string | ManagedIdentityCredentialOptions,\n options: ManagedIdentityCredentialOptions = {},\n ) {\n let _options: ManagedIdentityCredentialOptions = {};\n if (typeof clientIdOrOptions === \"string\") {\n this.clientId = clientIdOrOptions;\n _options = options;\n } else {\n this.clientId = clientIdOrOptions?.clientId;\n _options = clientIdOrOptions ?? {};\n }\n this.resourceId = _options?.resourceId;\n this.objectId = _options?.objectId;\n\n // For JavaScript users.\n const providedIds = [this.clientId, this.resourceId, this.objectId].filter(Boolean);\n if (providedIds.length > 1) {\n throw new Error(\n `ManagedIdentityCredential: only one of 'clientId', 'resourceId', or 'objectId' can be provided. Received values: ${JSON.stringify(\n { clientId: this.clientId, resourceId: this.resourceId, objectId: this.objectId },\n )}`,\n );\n }\n\n // ManagedIdentity uses http for local requests\n _options.allowInsecureConnection = true;\n\n if (_options?.retryOptions?.maxRetries !== undefined) {\n this.msiRetryConfig.maxRetries = _options.retryOptions.maxRetries;\n }\n\n this.identityClient = new IdentityClient({\n ..._options,\n additionalPolicies: [{ policy: imdsRetryPolicy(this.msiRetryConfig), position: \"perCall\" }],\n });\n\n this.managedIdentityApp = new ManagedIdentityApplication({\n managedIdentityIdParams: {\n userAssignedClientId: this.clientId,\n userAssignedResourceId: this.resourceId,\n userAssignedObjectId: this.objectId,\n },\n system: {\n // todo: proxyUrl?\n disableInternalRetries: true,\n networkClient: this.identityClient,\n loggerOptions: {\n logLevel: getMSALLogLevel(getLogLevel()),\n piiLoggingEnabled: options.loggingOptions?.enableUnsafeSupportLogging,\n loggerCallback: defaultLoggerCallback(logger),\n },\n },\n });\n\n this.isAvailableIdentityClient = new IdentityClient({\n ..._options,\n retryOptions: {\n maxRetries: 0,\n },\n });\n\n // CloudShell MSI will ignore any user-assigned identity passed as parameters. To avoid confusion, we prevent this from happening as early as possible.\n if (this.managedIdentityApp.getManagedIdentitySource() === \"CloudShell\") {\n if (this.clientId || this.resourceId || this.objectId) {\n logger.warning(\n `CloudShell MSI detected with user-provided IDs - throwing. Received values: ${JSON.stringify(\n {\n clientId: this.clientId,\n resourceId: this.resourceId,\n objectId: this.objectId,\n },\n )}.`,\n );\n throw new CredentialUnavailableError(\n \"ManagedIdentityCredential: Specifying a user-assigned managed identity is not supported for CloudShell at runtime. When using Managed Identity in CloudShell, omit the clientId, resourceId, and objectId parameters.\",\n );\n }\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 * If an unexpected error occurs, an {@link AuthenticationError} 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 public async getToken(\n scopes: string | string[],\n options: GetTokenOptions = {},\n ): Promise<AccessToken> {\n logger.getToken.info(\"Using the MSAL provider for Managed Identity.\");\n const resource = mapScopesToResource(scopes);\n if (!resource) {\n throw new CredentialUnavailableError(\n `ManagedIdentityCredential: Multiple scopes are not supported. Scopes: ${JSON.stringify(\n scopes,\n )}`,\n );\n }\n\n return tracingClient.withSpan(\"ManagedIdentityCredential.getToken\", options, async () => {\n try {\n const isTokenExchangeMsi = await tokenExchangeMsi.isAvailable({\n scopes,\n clientId: this.clientId,\n getTokenOptions: options,\n identityClient: this.identityClient,\n resourceId: this.resourceId,\n });\n\n // Most scenarios are handled by MSAL except for two:\n // AKS pod identity - MSAL does not implement the token exchange flow.\n // IMDS Endpoint probing - MSAL does not do any probing before trying to get a token.\n // As a DefaultAzureCredential optimization we probe the IMDS endpoint with a short timeout and no retries before actually trying to get a token\n // We will continue to implement these features in the Identity library.\n\n const identitySource = this.managedIdentityApp.getManagedIdentitySource();\n const isImdsMsi = identitySource === \"DefaultToImds\" || identitySource === \"Imds\"; // Neither actually checks that IMDS endpoint is available, just that it's the source the MSAL _would_ try to use.\n\n logger.getToken.info(`MSAL Identity source: ${identitySource}`);\n\n if (isTokenExchangeMsi) {\n // In the AKS scenario we will use the existing tokenExchangeMsi indefinitely.\n logger.getToken.info(\"Using the token exchange managed identity.\");\n const result = await tokenExchangeMsi.getToken({\n scopes,\n clientId: this.clientId,\n identityClient: this.identityClient,\n retryConfig: this.msiRetryConfig,\n resourceId: this.resourceId,\n });\n\n if (result === null) {\n throw new CredentialUnavailableError(\n \"Attempted to use the token exchange managed identity, but received a null response.\",\n );\n }\n\n return result;\n } else if (isImdsMsi) {\n // In the IMDS scenario we will probe the IMDS endpoint to ensure it's available before trying to get a token.\n // If the IMDS endpoint is not available and this is the source that MSAL will use, we will fail-fast with an error that tells DAC to move to the next credential.\n logger.getToken.info(\"Using the IMDS endpoint to probe for availability.\");\n const isAvailable = await imdsMsi.isAvailable({\n scopes,\n clientId: this.clientId,\n getTokenOptions: options,\n identityClient: this.isAvailableIdentityClient,\n resourceId: this.resourceId,\n });\n\n if (!isAvailable) {\n throw new CredentialUnavailableError(\n `Attempted to use the IMDS endpoint, but it is not available.`,\n );\n }\n }\n\n // If we got this far, it means:\n // - This is not a tokenExchangeMsi,\n // - We already probed for IMDS endpoint availability and failed-fast if it's unreachable.\n // We can proceed normally by calling MSAL for a token.\n logger.getToken.info(\"Calling into MSAL for managed identity token.\");\n const token = await this.managedIdentityApp.acquireToken({\n resource,\n });\n\n this.ensureValidMsalToken(scopes, token, options);\n logger.getToken.info(formatSuccess(scopes));\n\n return {\n expiresOnTimestamp: token.expiresOn.getTime(),\n token: token.accessToken,\n refreshAfterTimestamp: token.refreshOn?.getTime(),\n tokenType: \"Bearer\",\n } as AccessToken;\n } catch (err: any) {\n logger.getToken.error(formatError(scopes, err));\n\n // AuthenticationRequiredError described as Error to enforce authentication after trying to retrieve a token silently.\n // TODO: why would this _ever_ happen considering we're not trying the silent request in this flow?\n if (err.name === \"AuthenticationRequiredError\") {\n throw err;\n }\n\n if (isNetworkError(err)) {\n throw new CredentialUnavailableError(\n `ManagedIdentityCredential: Network unreachable. Message: ${err.message}`,\n { cause: err },\n );\n }\n\n throw new CredentialUnavailableError(\n `ManagedIdentityCredential: Authentication failed. Message ${err.message}`,\n { cause: err },\n );\n }\n });\n }\n\n /**\n * Ensures the validity of the MSAL token\n */\n private ensureValidMsalToken(\n scopes: string | string[],\n msalToken?: MsalToken,\n getTokenOptions?: GetTokenOptions,\n ): asserts msalToken is ValidMsalToken {\n const createError = (message: string): Error => {\n logger.getToken.info(message);\n return new AuthenticationRequiredError({\n scopes: Array.isArray(scopes) ? scopes : [scopes],\n getTokenOptions,\n message,\n });\n };\n if (!msalToken) {\n throw createError(\"No response.\");\n }\n if (!msalToken.expiresOn) {\n throw createError(`Response had no \"expiresOn\" property.`);\n }\n if (!msalToken.accessToken) {\n throw createError(`Response had no \"accessToken\" property.`);\n }\n }\n}\n\nfunction isNetworkError(err: any): boolean {\n // MSAL error\n if (err.errorCode === \"network_error\") {\n return true;\n }\n\n // Probe errors\n if (err.code === \"ENETUNREACH\" || err.code === \"EHOSTUNREACH\") {\n return true;\n }\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 if (err.statusCode === 403 || err.code === 403) {\n if (err.message.includes(\"unreachable\")) {\n return true;\n }\n }\n\n return false;\n}\n"]}
@@ -1,18 +1,15 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
- import { WorkloadIdentityCredential } from "../workloadIdentityCredential.js";
4
- import { credentialLogger } from "../../util/logging.js";
3
+ import { WorkloadIdentityCredential } from "../workloadIdentityCredential";
4
+ import { credentialLogger } from "../../util/logging";
5
5
  const msiName = "ManagedIdentityCredential - Token Exchange";
6
6
  const logger = credentialLogger(msiName);
7
7
  /**
8
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
9
  */
13
10
  export const tokenExchangeMsi = {
14
11
  name: "tokenExchangeMsi",
15
- async isAvailable(clientId) {
12
+ async isAvailable({ clientId }) {
16
13
  const env = process.env;
17
14
  const result = Boolean((clientId || env.AZURE_CLIENT_ID) &&
18
15
  env.AZURE_TENANT_ID &&
@@ -0,0 +1 @@
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,+BAA+B,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGtD,MAAM,OAAO,GAAG,4CAA4C,CAAC;AAC7D,MAAM,MAAM,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;AAEzC;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAQ;IACnC,IAAI,EAAE,kBAAkB;IACxB,KAAK,CAAC,WAAW,CAAC,EAAE,QAAQ,EAAE;QAC5B,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;QACxB,MAAM,MAAM,GAAG,OAAO,CACpB,CAAC,QAAQ,IAAI,GAAG,CAAC,eAAe,CAAC;YAC/B,GAAG,CAAC,eAAe;YACnB,OAAO,CAAC,GAAG,CAAC,0BAA0B,CACzC,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,8BAChE,QAAQ,EACR,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,eAAe,EACrC,aAAa,EAAE,OAAO,CAAC,GAAG,CAAC,0BAA0B,IAClD,oCAAoC,KACvC,wBAAwB,EAAE,IAAI,GACM,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 { AccessToken, GetTokenOptions } from \"@azure/core-auth\";\nimport { MSI, MSIConfiguration } from \"./models\";\nimport { WorkloadIdentityCredential } from \"../workloadIdentityCredential\";\nimport { credentialLogger } from \"../../util/logging\";\nimport { WorkloadIdentityCredentialOptions } from \"../workloadIdentityCredentialOptions\";\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 */\nexport const tokenExchangeMsi: MSI = {\n name: \"tokenExchangeMsi\",\n async isAvailable({ clientId }): 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,6 +1,6 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
- const DefaultScopeSuffix = "/.default";
3
+ import { DefaultScopeSuffix } from "./constants";
4
4
  /**
5
5
  * Most MSIs send requests to the IMDS endpoint, or a similar endpoint.
6
6
  * These are GET requests that require sending a `resource` parameter on the query.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/credentials/managedIdentityCredential/utils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD;;;;;;;;GAQG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAAyB;IAC3D,IAAI,KAAK,GAAG,EAAE,CAAC;IACf,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC1B,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACxB,OAAO;QACT,CAAC;QAED,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;SAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QACtC,KAAK,GAAG,MAAM,CAAC;IACjB,CAAC;IAED,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,CAAC;QACxC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC,CAAC;AAChE,CAAC;AAeD;;;GAGG;AACH,MAAM,UAAU,wBAAwB,CAAC,IAA6B;IACpE,IAAI,OAAO,IAAI,CAAC,UAAU,KAAK,QAAQ,EAAE,CAAC;QACxC,OAAO,IA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AI,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;gBACnB,OAAO,MAAM,CAAC;YAChB,CAAC;QACH,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,qDAAqD,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;IAC3F,CAAC;SAAM,CAAC;QACN,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { DefaultScopeSuffix } from \"./constants\";\n\n/**\n * Most MSIs send requests to the IMDS endpoint, or a similar endpoint.\n * These are GET requests that require sending a `resource` parameter on the query.\n * This resource can be derived from the scopes received through the getToken call, as long as only one scope is received.\n * Multiple scopes assume that the resulting token will have access to multiple resources, which won't be the case.\n *\n * For that reason, when we encounter multiple scopes, we return undefined.\n * It's up to the individual MSI implementations to throw the errors (which helps us provide less generic errors).\n */\nexport function mapScopesToResource(scopes: string | string[]): string | undefined {\n let scope = \"\";\n if (Array.isArray(scopes)) {\n if (scopes.length !== 1) {\n return;\n }\n\n scope = scopes[0];\n } else if (typeof scopes === \"string\") {\n scope = scopes;\n }\n\n if (!scope.endsWith(DefaultScopeSuffix)) {\n return scope;\n }\n\n return scope.substr(0, scope.lastIndexOf(DefaultScopeSuffix));\n}\n\n/**\n * Internal type roughly matching the raw responses of the authentication endpoints.\n *\n * @internal\n */\nexport interface TokenResponseParsedBody {\n access_token?: string;\n refresh_token?: string;\n expires_in: number;\n expires_on?: number | string;\n refresh_on?: number | string;\n}\n\n/**\n * Given a token response, return the expiration timestamp as the number of milliseconds from the Unix epoch.\n * @param body - A parsed response body from the authentication endpoint.\n */\nexport function parseExpirationTimestamp(body: TokenResponseParsedBody): number {\n if (typeof body.expires_on === \"number\") {\n return body.expires_on * 1000;\n }\n\n if (typeof body.expires_on === \"string\") {\n const asNumber = +body.expires_on;\n if (!isNaN(asNumber)) {\n return asNumber * 1000;\n }\n\n const asDate = Date.parse(body.expires_on);\n if (!isNaN(asDate)) {\n return asDate;\n }\n }\n\n if (typeof body.expires_in === \"number\") {\n return Date.now() + body.expires_in * 1000;\n }\n\n throw new Error(\n `Failed to parse token expiration from body. expires_in=\"${body.expires_in}\", expires_on=\"${body.expires_on}\"`,\n );\n}\n\n/**\n * Given a token response, return the expiration timestamp as the number of milliseconds from the Unix epoch.\n * @param body - A parsed response body from the authentication endpoint.\n */\nexport function parseRefreshTimestamp(body: TokenResponseParsedBody): number | undefined {\n if (body.refresh_on) {\n if (typeof body.refresh_on === \"number\") {\n return body.refresh_on * 1000;\n }\n\n if (typeof body.refresh_on === \"string\") {\n const asNumber = +body.refresh_on;\n if (!isNaN(asNumber)) {\n return asNumber * 1000;\n }\n\n const asDate = Date.parse(body.refresh_on);\n if (!isNaN(asDate)) {\n return asDate;\n }\n }\n throw new Error(`Failed to parse refresh_on from body. refresh_on=\"${body.refresh_on}\"`);\n } else {\n return undefined;\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"multiTenantTokenCredentialOptions.js","sourceRoot":"","sources":["../../../src/credentials/multiTenantTokenCredentialOptions.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { TokenCredentialOptions } from \"../tokenCredentialOptions\";\n\n/**\n * Options for multi-tenant applications which allows for additionally allowed tenants.\n */\nexport interface MultiTenantTokenCredentialOptions extends TokenCredentialOptions {\n /**\n * For multi-tenant applications, specifies additional tenants for which the credential may acquire tokens.\n * Add the wildcard value \"*\" to allow the credential to acquire tokens for any tenant the application is installed.\n */\n additionallyAllowedTenants?: string[];\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
- import { credentialLogger, formatError } from "../util/logging.js";
3
+ import { credentialLogger, formatError } from "../util/logging";
4
4
  const credentialName = "OnBehalfOfCredential";
5
5
  const BrowserNotSupportedError = new Error(`${credentialName}: Not supported in the browser.`);
6
6
  const logger = credentialLogger(credentialName);
@@ -20,4 +20,4 @@ export class OnBehalfOfCredential {
20
20
  throw BrowserNotSupportedError;
21
21
  }
22
22
  }
23
- //# sourceMappingURL=onBehalfOfCredential-browser.mjs.map
23
+ //# sourceMappingURL=onBehalfOfCredential.browser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"onBehalfOfCredential.browser.js","sourceRoot":"","sources":["../../../src/credentials/onBehalfOfCredential.browser.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEhE,MAAM,cAAc,GAAG,sBAAsB,CAAC;AAC9C,MAAM,wBAAwB,GAAG,IAAI,KAAK,CAAC,GAAG,cAAc,iCAAiC,CAAC,CAAC;AAC/F,MAAM,MAAM,GAAG,gBAAgB,CAAC,cAAc,CAAC,CAAC;AAEhD;;GAEG;AACH,MAAM,OAAO,oBAAoB;IAC/B;;OAEG;IACH;QACE,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,EAAE,wBAAwB,CAAC,CAAC,CAAC;QACvD,MAAM,wBAAwB,CAAC;IACjC,CAAC;IAEM,QAAQ;QACb,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,EAAE,wBAAwB,CAAC,CAAC,CAAC;QAChE,MAAM,wBAAwB,CAAC;IACjC,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { AccessToken, TokenCredential } from \"@azure/core-auth\";\nimport { credentialLogger, formatError } from \"../util/logging\";\n\nconst credentialName = \"OnBehalfOfCredential\";\nconst BrowserNotSupportedError = new Error(`${credentialName}: Not supported in the browser.`);\nconst logger = credentialLogger(credentialName);\n\n/**\n * 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).\n */\nexport class OnBehalfOfCredential implements TokenCredential {\n /**\n * Only available in Node.js\n */\n constructor() {\n logger.info(formatError(\"\", BrowserNotSupportedError));\n throw BrowserNotSupportedError;\n }\n\n public getToken(): Promise<AccessToken | null> {\n logger.getToken.info(formatError(\"\", BrowserNotSupportedError));\n throw BrowserNotSupportedError;\n }\n}\n"]}