@azure/identity 4.5.0-beta.2 → 4.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (213) hide show
  1. package/README.md +65 -74
  2. package/dist/index.js +190 -81
  3. package/dist/index.js.map +1 -1
  4. package/dist-esm/src/client/identityClient.js +4 -2
  5. package/dist-esm/src/client/identityClient.js.map +1 -1
  6. package/dist-esm/src/constants.js +2 -2
  7. package/dist-esm/src/constants.js.map +1 -1
  8. package/dist-esm/src/credentials/authorityValidationOptions.js +1 -1
  9. package/dist-esm/src/credentials/authorityValidationOptions.js.map +1 -1
  10. package/dist-esm/src/credentials/authorizationCodeCredential.browser.js +1 -1
  11. package/dist-esm/src/credentials/authorizationCodeCredential.browser.js.map +1 -1
  12. package/dist-esm/src/credentials/authorizationCodeCredential.js +1 -1
  13. package/dist-esm/src/credentials/authorizationCodeCredential.js.map +1 -1
  14. package/dist-esm/src/credentials/authorizationCodeCredentialOptions.js +1 -1
  15. package/dist-esm/src/credentials/authorizationCodeCredentialOptions.js.map +1 -1
  16. package/dist-esm/src/credentials/azureApplicationCredential.browser.js +1 -1
  17. package/dist-esm/src/credentials/azureApplicationCredential.browser.js.map +1 -1
  18. package/dist-esm/src/credentials/azureApplicationCredential.js +1 -1
  19. package/dist-esm/src/credentials/azureApplicationCredential.js.map +1 -1
  20. package/dist-esm/src/credentials/azureApplicationCredentialOptions.js +1 -1
  21. package/dist-esm/src/credentials/azureApplicationCredentialOptions.js.map +1 -1
  22. package/dist-esm/src/credentials/azureCliCredential.browser.js +1 -1
  23. package/dist-esm/src/credentials/azureCliCredential.browser.js.map +1 -1
  24. package/dist-esm/src/credentials/azureCliCredential.js +3 -1
  25. package/dist-esm/src/credentials/azureCliCredential.js.map +1 -1
  26. package/dist-esm/src/credentials/azureCliCredentialOptions.js +1 -1
  27. package/dist-esm/src/credentials/azureCliCredentialOptions.js.map +1 -1
  28. package/dist-esm/src/credentials/azureDeveloperCliCredential.browser.js +1 -1
  29. package/dist-esm/src/credentials/azureDeveloperCliCredential.browser.js.map +1 -1
  30. package/dist-esm/src/credentials/azureDeveloperCliCredential.js +2 -1
  31. package/dist-esm/src/credentials/azureDeveloperCliCredential.js.map +1 -1
  32. package/dist-esm/src/credentials/azureDeveloperCliCredentialOptions.js +1 -1
  33. package/dist-esm/src/credentials/azureDeveloperCliCredentialOptions.js.map +1 -1
  34. package/dist-esm/src/credentials/azurePipelinesCredential.browser.js +1 -1
  35. package/dist-esm/src/credentials/azurePipelinesCredential.browser.js.map +1 -1
  36. package/dist-esm/src/credentials/azurePipelinesCredential.js +16 -5
  37. package/dist-esm/src/credentials/azurePipelinesCredential.js.map +1 -1
  38. package/dist-esm/src/credentials/azurePipelinesCredentialOptions.js +1 -1
  39. package/dist-esm/src/credentials/azurePipelinesCredentialOptions.js.map +1 -1
  40. package/dist-esm/src/credentials/azurePowerShellCredential.browser.js +1 -1
  41. package/dist-esm/src/credentials/azurePowerShellCredential.browser.js.map +1 -1
  42. package/dist-esm/src/credentials/azurePowerShellCredential.js +2 -1
  43. package/dist-esm/src/credentials/azurePowerShellCredential.js.map +1 -1
  44. package/dist-esm/src/credentials/azurePowerShellCredentialOptions.js +1 -1
  45. package/dist-esm/src/credentials/azurePowerShellCredentialOptions.js.map +1 -1
  46. package/dist-esm/src/credentials/brokerAuthOptions.js.map +1 -1
  47. package/dist-esm/src/credentials/browserCustomizationOptions.js +1 -1
  48. package/dist-esm/src/credentials/browserCustomizationOptions.js.map +1 -1
  49. package/dist-esm/src/credentials/chainedTokenCredential.js +9 -2
  50. package/dist-esm/src/credentials/chainedTokenCredential.js.map +1 -1
  51. package/dist-esm/src/credentials/clientAssertionCredential.browser.js +1 -1
  52. package/dist-esm/src/credentials/clientAssertionCredential.browser.js.map +1 -1
  53. package/dist-esm/src/credentials/clientAssertionCredential.js +1 -1
  54. package/dist-esm/src/credentials/clientAssertionCredential.js.map +1 -1
  55. package/dist-esm/src/credentials/clientAssertionCredentialOptions.js +1 -1
  56. package/dist-esm/src/credentials/clientAssertionCredentialOptions.js.map +1 -1
  57. package/dist-esm/src/credentials/clientCertificateCredential.browser.js +1 -1
  58. package/dist-esm/src/credentials/clientCertificateCredential.browser.js.map +1 -1
  59. package/dist-esm/src/credentials/clientCertificateCredential.js +1 -1
  60. package/dist-esm/src/credentials/clientCertificateCredential.js.map +1 -1
  61. package/dist-esm/src/credentials/clientCertificateCredentialOptions.js +1 -1
  62. package/dist-esm/src/credentials/clientCertificateCredentialOptions.js.map +1 -1
  63. package/dist-esm/src/credentials/clientSecretCredential.browser.js +1 -1
  64. package/dist-esm/src/credentials/clientSecretCredential.browser.js.map +1 -1
  65. package/dist-esm/src/credentials/clientSecretCredential.js +1 -1
  66. package/dist-esm/src/credentials/clientSecretCredential.js.map +1 -1
  67. package/dist-esm/src/credentials/clientSecretCredentialOptions.js +1 -1
  68. package/dist-esm/src/credentials/clientSecretCredentialOptions.js.map +1 -1
  69. package/dist-esm/src/credentials/credentialPersistenceOptions.js +1 -1
  70. package/dist-esm/src/credentials/credentialPersistenceOptions.js.map +1 -1
  71. package/dist-esm/src/credentials/defaultAzureCredential.browser.js +1 -1
  72. package/dist-esm/src/credentials/defaultAzureCredential.browser.js.map +1 -1
  73. package/dist-esm/src/credentials/defaultAzureCredential.js +1 -1
  74. package/dist-esm/src/credentials/defaultAzureCredential.js.map +1 -1
  75. package/dist-esm/src/credentials/defaultAzureCredentialOptions.js +1 -1
  76. package/dist-esm/src/credentials/defaultAzureCredentialOptions.js.map +1 -1
  77. package/dist-esm/src/credentials/deviceCodeCredential.browser.js +1 -1
  78. package/dist-esm/src/credentials/deviceCodeCredential.browser.js.map +1 -1
  79. package/dist-esm/src/credentials/deviceCodeCredential.js +7 -5
  80. package/dist-esm/src/credentials/deviceCodeCredential.js.map +1 -1
  81. package/dist-esm/src/credentials/deviceCodeCredentialOptions.js +1 -1
  82. package/dist-esm/src/credentials/deviceCodeCredentialOptions.js.map +1 -1
  83. package/dist-esm/src/credentials/environmentCredential.browser.js +1 -1
  84. package/dist-esm/src/credentials/environmentCredential.browser.js.map +1 -1
  85. package/dist-esm/src/credentials/environmentCredential.js +1 -1
  86. package/dist-esm/src/credentials/environmentCredential.js.map +1 -1
  87. package/dist-esm/src/credentials/environmentCredentialOptions.js +1 -1
  88. package/dist-esm/src/credentials/environmentCredentialOptions.js.map +1 -1
  89. package/dist-esm/src/credentials/interactiveBrowserCredential.browser.js +1 -1
  90. package/dist-esm/src/credentials/interactiveBrowserCredential.browser.js.map +1 -1
  91. package/dist-esm/src/credentials/interactiveBrowserCredential.js +1 -1
  92. package/dist-esm/src/credentials/interactiveBrowserCredential.js.map +1 -1
  93. package/dist-esm/src/credentials/interactiveBrowserCredentialOptions.js +1 -1
  94. package/dist-esm/src/credentials/interactiveBrowserCredentialOptions.js.map +1 -1
  95. package/dist-esm/src/credentials/interactiveCredentialOptions.js +1 -1
  96. package/dist-esm/src/credentials/interactiveCredentialOptions.js.map +1 -1
  97. package/dist-esm/src/credentials/managedIdentityCredential/appServiceMsi2017.js +1 -1
  98. package/dist-esm/src/credentials/managedIdentityCredential/appServiceMsi2017.js.map +1 -1
  99. package/dist-esm/src/credentials/managedIdentityCredential/appServiceMsi2019.js +1 -1
  100. package/dist-esm/src/credentials/managedIdentityCredential/appServiceMsi2019.js.map +1 -1
  101. package/dist-esm/src/credentials/managedIdentityCredential/arcMsi.js +1 -1
  102. package/dist-esm/src/credentials/managedIdentityCredential/arcMsi.js.map +1 -1
  103. package/dist-esm/src/credentials/managedIdentityCredential/cloudShellMsi.js +1 -1
  104. package/dist-esm/src/credentials/managedIdentityCredential/cloudShellMsi.js.map +1 -1
  105. package/dist-esm/src/credentials/managedIdentityCredential/constants.js +1 -1
  106. package/dist-esm/src/credentials/managedIdentityCredential/constants.js.map +1 -1
  107. package/dist-esm/src/credentials/managedIdentityCredential/fabricMsi.js +1 -1
  108. package/dist-esm/src/credentials/managedIdentityCredential/fabricMsi.js.map +1 -1
  109. package/dist-esm/src/credentials/managedIdentityCredential/imdsMsi.js +1 -1
  110. package/dist-esm/src/credentials/managedIdentityCredential/imdsMsi.js.map +1 -1
  111. package/dist-esm/src/credentials/managedIdentityCredential/imdsRetryPolicy.js +6 -10
  112. package/dist-esm/src/credentials/managedIdentityCredential/imdsRetryPolicy.js.map +1 -1
  113. package/dist-esm/src/credentials/managedIdentityCredential/index.browser.js +1 -1
  114. package/dist-esm/src/credentials/managedIdentityCredential/index.browser.js.map +1 -1
  115. package/dist-esm/src/credentials/managedIdentityCredential/index.js +1 -1
  116. package/dist-esm/src/credentials/managedIdentityCredential/index.js.map +1 -1
  117. package/dist-esm/src/credentials/managedIdentityCredential/legacyMsiProvider.js +8 -1
  118. package/dist-esm/src/credentials/managedIdentityCredential/legacyMsiProvider.js.map +1 -1
  119. package/dist-esm/src/credentials/managedIdentityCredential/models.js +1 -1
  120. package/dist-esm/src/credentials/managedIdentityCredential/models.js.map +1 -1
  121. package/dist-esm/src/credentials/managedIdentityCredential/msalMsiProvider.js +21 -4
  122. package/dist-esm/src/credentials/managedIdentityCredential/msalMsiProvider.js.map +1 -1
  123. package/dist-esm/src/credentials/managedIdentityCredential/tokenExchangeMsi.js +1 -1
  124. package/dist-esm/src/credentials/managedIdentityCredential/tokenExchangeMsi.js.map +1 -1
  125. package/dist-esm/src/credentials/managedIdentityCredential/utils.js +26 -1
  126. package/dist-esm/src/credentials/managedIdentityCredential/utils.js.map +1 -1
  127. package/dist-esm/src/credentials/multiTenantTokenCredentialOptions.js +1 -1
  128. package/dist-esm/src/credentials/multiTenantTokenCredentialOptions.js.map +1 -1
  129. package/dist-esm/src/credentials/onBehalfOfCredential.browser.js +1 -1
  130. package/dist-esm/src/credentials/onBehalfOfCredential.browser.js.map +1 -1
  131. package/dist-esm/src/credentials/onBehalfOfCredential.js +1 -1
  132. package/dist-esm/src/credentials/onBehalfOfCredential.js.map +1 -1
  133. package/dist-esm/src/credentials/onBehalfOfCredentialOptions.js +1 -1
  134. package/dist-esm/src/credentials/onBehalfOfCredentialOptions.js.map +1 -1
  135. package/dist-esm/src/credentials/usernamePasswordCredential.browser.js +1 -1
  136. package/dist-esm/src/credentials/usernamePasswordCredential.browser.js.map +1 -1
  137. package/dist-esm/src/credentials/usernamePasswordCredential.js +1 -1
  138. package/dist-esm/src/credentials/usernamePasswordCredential.js.map +1 -1
  139. package/dist-esm/src/credentials/usernamePasswordCredentialOptions.js +1 -1
  140. package/dist-esm/src/credentials/usernamePasswordCredentialOptions.js.map +1 -1
  141. package/dist-esm/src/credentials/visualStudioCodeCredential.browser.js +1 -1
  142. package/dist-esm/src/credentials/visualStudioCodeCredential.browser.js.map +1 -1
  143. package/dist-esm/src/credentials/visualStudioCodeCredential.js +1 -1
  144. package/dist-esm/src/credentials/visualStudioCodeCredential.js.map +1 -1
  145. package/dist-esm/src/credentials/visualStudioCodeCredentialOptions.js +1 -1
  146. package/dist-esm/src/credentials/visualStudioCodeCredentialOptions.js.map +1 -1
  147. package/dist-esm/src/credentials/visualStudioCodeCredentialPlugin.js +1 -1
  148. package/dist-esm/src/credentials/visualStudioCodeCredentialPlugin.js.map +1 -1
  149. package/dist-esm/src/credentials/workloadIdentityCredential.browser.js +1 -1
  150. package/dist-esm/src/credentials/workloadIdentityCredential.browser.js.map +1 -1
  151. package/dist-esm/src/credentials/workloadIdentityCredential.js +1 -1
  152. package/dist-esm/src/credentials/workloadIdentityCredential.js.map +1 -1
  153. package/dist-esm/src/credentials/workloadIdentityCredentialOptions.js +1 -1
  154. package/dist-esm/src/credentials/workloadIdentityCredentialOptions.js.map +1 -1
  155. package/dist-esm/src/errors.js +1 -2
  156. package/dist-esm/src/errors.js.map +1 -1
  157. package/dist-esm/src/index.js +1 -1
  158. package/dist-esm/src/index.js.map +1 -1
  159. package/dist-esm/src/msal/browserFlows/flows.js +1 -1
  160. package/dist-esm/src/msal/browserFlows/flows.js.map +1 -1
  161. package/dist-esm/src/msal/browserFlows/msalAuthCode.js +2 -2
  162. package/dist-esm/src/msal/browserFlows/msalAuthCode.js.map +1 -1
  163. package/dist-esm/src/msal/browserFlows/msalBrowserCommon.js +4 -1
  164. package/dist-esm/src/msal/browserFlows/msalBrowserCommon.js.map +1 -1
  165. package/dist-esm/src/msal/credentials.js +1 -1
  166. package/dist-esm/src/msal/credentials.js.map +1 -1
  167. package/dist-esm/src/msal/msal.browser.js +1 -1
  168. package/dist-esm/src/msal/msal.browser.js.map +1 -1
  169. package/dist-esm/src/msal/msal.js +1 -1
  170. package/dist-esm/src/msal/msal.js.map +1 -1
  171. package/dist-esm/src/msal/nodeFlows/brokerOptions.js.map +1 -1
  172. package/dist-esm/src/msal/nodeFlows/msalClient.js +42 -8
  173. package/dist-esm/src/msal/nodeFlows/msalClient.js.map +1 -1
  174. package/dist-esm/src/msal/nodeFlows/msalPlugins.js +1 -1
  175. package/dist-esm/src/msal/nodeFlows/msalPlugins.js.map +1 -1
  176. package/dist-esm/src/msal/nodeFlows/tokenCachePersistenceOptions.js +1 -1
  177. package/dist-esm/src/msal/nodeFlows/tokenCachePersistenceOptions.js.map +1 -1
  178. package/dist-esm/src/msal/types.js +1 -1
  179. package/dist-esm/src/msal/types.js.map +1 -1
  180. package/dist-esm/src/msal/utils.js +17 -3
  181. package/dist-esm/src/msal/utils.js.map +1 -1
  182. package/dist-esm/src/plugins/consumer.browser.js +1 -1
  183. package/dist-esm/src/plugins/consumer.browser.js.map +1 -1
  184. package/dist-esm/src/plugins/consumer.js +7 -9
  185. package/dist-esm/src/plugins/consumer.js.map +1 -1
  186. package/dist-esm/src/plugins/provider.js +1 -1
  187. package/dist-esm/src/plugins/provider.js.map +1 -1
  188. package/dist-esm/src/regionalAuthority.js +1 -1
  189. package/dist-esm/src/regionalAuthority.js.map +1 -1
  190. package/dist-esm/src/tokenCredentialOptions.js +1 -1
  191. package/dist-esm/src/tokenCredentialOptions.js.map +1 -1
  192. package/dist-esm/src/tokenProvider.js +4 -4
  193. package/dist-esm/src/tokenProvider.js.map +1 -1
  194. package/dist-esm/src/util/authHostEnv.browser.js +1 -1
  195. package/dist-esm/src/util/authHostEnv.browser.js.map +1 -1
  196. package/dist-esm/src/util/identityTokenEndpoint.js +1 -1
  197. package/dist-esm/src/util/identityTokenEndpoint.js.map +1 -1
  198. package/dist-esm/src/util/logging.js +1 -1
  199. package/dist-esm/src/util/logging.js.map +1 -1
  200. package/dist-esm/src/util/processMultiTenantRequest.browser.js +1 -1
  201. package/dist-esm/src/util/processMultiTenantRequest.browser.js.map +1 -1
  202. package/dist-esm/src/util/processMultiTenantRequest.js +1 -1
  203. package/dist-esm/src/util/processMultiTenantRequest.js.map +1 -1
  204. package/dist-esm/src/util/processUtils.js +1 -1
  205. package/dist-esm/src/util/processUtils.js.map +1 -1
  206. package/dist-esm/src/util/scopeUtils.js +1 -1
  207. package/dist-esm/src/util/scopeUtils.js.map +1 -1
  208. package/dist-esm/src/util/tenantIdUtils.js +1 -1
  209. package/dist-esm/src/util/tenantIdUtils.js.map +1 -1
  210. package/dist-esm/src/util/tracing.js +1 -1
  211. package/dist-esm/src/util/tracing.js.map +1 -1
  212. package/package.json +20 -19
  213. package/types/identity.d.ts +74 -50
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@azure/identity",
3
3
  "sdk-type": "client",
4
- "version": "4.5.0-beta.2",
4
+ "version": "4.5.0",
5
5
  "description": "Provides credential implementations for Azure SDK libraries that can authenticate with Microsoft Entra ID",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist-esm/src/index.js",
@@ -47,28 +47,29 @@
47
47
  },
48
48
  "scripts": {
49
49
  "audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit",
50
+ "build": "npm run clean && npm run extract-api && tsc -p . && dev-tool run bundle",
50
51
  "build:samples": "echo Obsolete.",
51
52
  "build:test": "echo skipped. actual commands inlined in browser test scripts",
52
- "build": "npm run clean && npm run extract-api && tsc -p . && dev-tool run bundle",
53
+ "check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
53
54
  "clean": "rimraf --glob dist dist-* types *.tgz *.log",
54
55
  "execute:samples": "dev-tool samples run samples-dev",
55
56
  "extract-api": "tsc -p . && dev-tool run extract-api",
56
57
  "format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
57
- "check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
58
+ "integration-test": "npm run integration-test:node && npm run integration-test:browser",
58
59
  "integration-test:browser": "echo skipped",
59
- "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 180000 'test/public/node/*.spec.ts' 'test/internal/node/*.spec.ts'",
60
60
  "integration-test:managed-identity": "dev-tool run test:node-ts-input -- --timeout 180000 'test/integration/**/*.spec.ts'",
61
- "integration-test": "npm run integration-test:node && npm run integration-test:browser",
62
- "lint:fix": "eslint package.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]",
63
- "lint": "eslint package.json api-extractor.json src test --ext .ts",
61
+ "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 180000 'test/public/node/*.spec.ts' 'test/internal/node/*.spec.ts'",
62
+ "lint": "eslint package.json api-extractor.json src test",
63
+ "lint:fix": "eslint package.json api-extractor.json src test --fix --fix-type [problem,suggestion]",
64
64
  "pack": "npm pack 2>&1",
65
+ "test": "npm run clean && npm run build:test && npm run unit-test && npm run integration-test",
65
66
  "test:browser": "npm run clean && tsc -p . && dev-tool run bundle && npm run unit-test:browser && npm run integration-test:browser",
66
67
  "test:node": "npm run clean && npm run unit-test:node && npm run integration-test:node",
67
- "test": "npm run clean && npm run build:test && npm run unit-test && npm run integration-test",
68
+ "unit-test": "npm run unit-test:node && npm run unit-test:browser",
68
69
  "unit-test:browser": "dev-tool run test:browser",
69
- "unit-test:node": "dev-tool run test:node-ts-input -- --timeout 300000 --exclude 'test/**/browser/**/*.spec.ts' --exclude 'test/integration/**/*.spec.ts' 'test/**/**/*.spec.ts'",
70
- "unit-test:node:no-timeouts": "dev-tool run test:node-ts-input -- --timeout Infinite --exclude 'test/**/browser/**/*.spec.ts' 'test/**/**/*.spec.ts'",
71
- "unit-test": "npm run unit-test:node && npm run unit-test:browser"
70
+ "unit-test:node": "dev-tool run test:node-ts-input -- --timeout 300000 --exclude 'test/**/browser/**/*.spec.ts' --exclude 'test/snippets.spec.ts' --exclude 'test/integration/**/*.spec.ts' 'test/**/**/*.spec.ts'",
71
+ "unit-test:node:no-timeouts": "dev-tool run test:node-ts-input -- --timeout Infinite --exclude 'test/snippets.spec.ts' --exclude 'test/**/browser/**/*.spec.ts' 'test/**/**/*.spec.ts'",
72
+ "update-snippets": "dev-tool run update-snippets"
72
73
  },
73
74
  "files": [
74
75
  "dist/",
@@ -109,14 +110,14 @@
109
110
  "sideEffects": false,
110
111
  "dependencies": {
111
112
  "@azure/abort-controller": "^2.0.0",
112
- "@azure/core-auth": "^1.5.0",
113
+ "@azure/core-auth": "^1.9.0",
113
114
  "@azure/core-client": "^1.9.2",
114
- "@azure/core-rest-pipeline": "^1.1.0",
115
+ "@azure/core-rest-pipeline": "^1.17.0",
115
116
  "@azure/core-tracing": "^1.0.0",
116
- "@azure/core-util": "^1.3.0",
117
+ "@azure/core-util": "^1.11.0",
117
118
  "@azure/logger": "^1.0.0",
118
- "@azure/msal-node": "^2.9.2",
119
- "@azure/msal-browser": "^3.14.0",
119
+ "@azure/msal-node": "^2.15.0",
120
+ "@azure/msal-browser": "^3.26.1",
120
121
  "events": "^3.0.0",
121
122
  "jws": "^4.0.0",
122
123
  "open": "^8.0.0",
@@ -125,10 +126,10 @@
125
126
  },
126
127
  "devDependencies": {
127
128
  "@azure-tools/test-recorder": "^3.0.0",
129
+ "@azure-tools/test-utils": "^1.0.1",
128
130
  "@azure/dev-tool": "^1.0.0",
129
131
  "@azure/eslint-plugin-azure-sdk": "^3.0.0",
130
132
  "@azure/keyvault-keys": "^4.2.0",
131
- "@azure-tools/test-utils": "^1.0.1",
132
133
  "@microsoft/api-extractor": "^7.31.1",
133
134
  "@types/chai": "^4.1.6",
134
135
  "@types/jsonwebtoken": "^9.0.0",
@@ -142,7 +143,7 @@
142
143
  "chai": "^4.2.0",
143
144
  "cross-env": "^7.0.3",
144
145
  "dotenv": "^16.0.0",
145
- "eslint": "^8.0.0",
146
+ "eslint": "^9.9.0",
146
147
  "inherits": "^2.0.3",
147
148
  "jsonwebtoken": "^9.0.0",
148
149
  "karma": "^6.2.0",
@@ -160,7 +161,7 @@
160
161
  "rimraf": "^5.0.5",
161
162
  "sinon": "^17.0.0",
162
163
  "ts-node": "^10.0.0",
163
- "typescript": "~5.5.3",
164
+ "typescript": "~5.6.2",
164
165
  "util": "^0.12.1"
165
166
  }
166
167
  }
@@ -540,7 +540,14 @@ export declare class ChainedTokenCredential implements TokenCredential {
540
540
  * @param sources - `TokenCredential` implementations to be tried in order.
541
541
  *
542
542
  * Example usage:
543
- * ```javascript
543
+ * ```ts snippet:chained_token_credential_example
544
+ * import { ClientSecretCredential, ChainedTokenCredential } from "@azure/identity";
545
+ *
546
+ * const tenantId = "<tenant-id>";
547
+ * const clientId = "<client-id>";
548
+ * const clientSecret = "<client-secret>";
549
+ * const anotherClientId = "<another-client-id>";
550
+ * const anotherSecret = "<another-client-secret>";
544
551
  * const firstCredential = new ClientSecretCredential(tenantId, clientId, clientSecret);
545
552
  * const secondCredential = new ClientSecretCredential(tenantId, anotherClientId, anotherSecret);
546
553
  * const credentialChain = new ChainedTokenCredential(firstCredential, secondCredential);
@@ -598,7 +605,7 @@ export declare class ClientAssertionCredential implements TokenCredential {
598
605
  /**
599
606
  * Options for the {@link ClientAssertionCredential}
600
607
  */
601
- export declare interface ClientAssertionCredentialOptions extends MultiTenantTokenCredentialOptions, AuthorityValidationOptions {
608
+ export declare interface ClientAssertionCredentialOptions extends MultiTenantTokenCredentialOptions, CredentialPersistenceOptions, AuthorityValidationOptions {
602
609
  }
603
610
 
604
611
  /**
@@ -758,23 +765,14 @@ export declare interface CredentialPersistenceOptions {
758
765
  *
759
766
  * Example:
760
767
  *
761
- * ```javascript
762
- * import { cachePersistencePlugin } from "@azure/identity-cache-persistence";
768
+ * ```ts snippet:credential_persistence_options_example
763
769
  * import { useIdentityPlugin, DeviceCodeCredential } from "@azure/identity";
764
770
  *
765
771
  * useIdentityPlugin(cachePersistencePlugin);
766
- *
767
- * async function main() {
768
- * const credential = new DeviceCodeCredential({
769
- * tokenCachePersistenceOptions: {
770
- * enabled: true
771
- * }
772
- * });
773
- * }
774
- *
775
- * main().catch((error) => {
776
- * console.error("An error occurred:", error);
777
- * process.exit(1);
772
+ * const credential = new DeviceCodeCredential({
773
+ * tokenCachePersistenceOptions: {
774
+ * enabled: true,
775
+ * },
778
776
  * });
779
777
  * ```
780
778
  */
@@ -955,13 +953,15 @@ export declare class DeviceCodeCredential implements TokenCredential {
955
953
  *
956
954
  * Developers can configure how this message is shown by passing a custom `userPromptCallback`:
957
955
  *
958
- * ```js
956
+ * ```ts snippet:device_code_credential_example
957
+ * import { DeviceCodeCredential } from "@azure/identity";
958
+ *
959
959
  * const credential = new DeviceCodeCredential({
960
- * tenantId: env.AZURE_TENANT_ID,
961
- * clientId: env.AZURE_CLIENT_ID,
960
+ * tenantId: process.env.AZURE_TENANT_ID,
961
+ * clientId: process.env.AZURE_CLIENT_ID,
962
962
  * userPromptCallback: (info) => {
963
963
  * console.log("CUSTOMIZED PROMPT CALLBACK", info.message);
964
- * }
964
+ * },
965
965
  * });
966
966
  * ```
967
967
  *
@@ -1133,14 +1133,14 @@ export declare interface ErrorResponse {
1133
1133
  /**
1134
1134
  * Returns a callback that provides a bearer token.
1135
1135
  * For example, the bearer token can be used to authenticate a request as follows:
1136
- * ```js
1137
- * import { DefaultAzureCredential } from "@azure/identity";
1136
+ * ```ts snippet:token_provider_example
1137
+ * import { DefaultAzureCredential, getBearerTokenProvider } from "@azure/identity";
1138
+ * import { createPipelineRequest } from "@azure/core-rest-pipeline";
1138
1139
  *
1139
1140
  * const credential = new DefaultAzureCredential();
1140
1141
  * const scope = "https://cognitiveservices.azure.com/.default";
1141
1142
  * const getAccessToken = getBearerTokenProvider(credential, scope);
1142
1143
  * const token = await getAccessToken();
1143
- *
1144
1144
  * // usage
1145
1145
  * const request = createPipelineRequest({ url: "https://example.com" });
1146
1146
  * request.headers.set("Authorization", `Bearer ${token}`);
@@ -1344,17 +1344,23 @@ export declare class ManagedIdentityCredential implements TokenCredential {
1344
1344
  */
1345
1345
  constructor(clientId: string, options?: TokenCredentialOptions);
1346
1346
  /**
1347
- * Creates an instance of ManagedIdentityCredential with clientId
1347
+ * Creates an instance of ManagedIdentityCredential with a client ID
1348
1348
  *
1349
1349
  * @param options - Options for configuring the client which makes the access token request.
1350
1350
  */
1351
1351
  constructor(options?: ManagedIdentityCredentialClientIdOptions);
1352
1352
  /**
1353
- * Creates an instance of ManagedIdentityCredential with Resource Id
1353
+ * Creates an instance of ManagedIdentityCredential with a resource ID
1354
1354
  *
1355
1355
  * @param options - Options for configuring the resource which makes the access token request.
1356
1356
  */
1357
1357
  constructor(options?: ManagedIdentityCredentialResourceIdOptions);
1358
+ /**
1359
+ * Creates an instance of ManagedIdentityCredential with an object ID
1360
+ *
1361
+ * @param options - Options for configuring the resource which makes the access token request.
1362
+ */
1363
+ constructor(options?: ManagedIdentityCredentialObjectIdOptions);
1358
1364
  /**
1359
1365
  * Authenticates with Microsoft Entra ID and returns an access token if successful.
1360
1366
  * If authentication fails, a {@link CredentialUnavailableError} will be thrown with the details of the failure.
@@ -1378,6 +1384,18 @@ export declare interface ManagedIdentityCredentialClientIdOptions extends TokenC
1378
1384
  clientId?: string;
1379
1385
  }
1380
1386
 
1387
+ /**
1388
+ * Options to send on the {@link ManagedIdentityCredential} constructor.
1389
+ * This variation supports `objectId` as a constructor argument.
1390
+ */
1391
+ export declare interface ManagedIdentityCredentialObjectIdOptions extends TokenCredentialOptions {
1392
+ /**
1393
+ * Allows specifying the object ID of the underlying service principal used to authenticate a user-assigned managed identity.
1394
+ * This is an alternative to providing a client ID or resource ID and is not required for system-assigned managed identities.
1395
+ */
1396
+ objectId: string;
1397
+ }
1398
+
1381
1399
  /**
1382
1400
  * Options to send on the {@link ManagedIdentityCredential} constructor.
1383
1401
  * This variation supports `resourceId` and not `clientId`, since only one of both is supported.
@@ -1423,15 +1441,17 @@ export declare class OnBehalfOfCredential implements TokenCredential {
1423
1441
  *
1424
1442
  * Example using the `KeyClient` from [\@azure/keyvault-keys](https://www.npmjs.com/package/\@azure/keyvault-keys):
1425
1443
  *
1426
- * ```ts
1444
+ * ```ts snippet:on_behalf_of_credential_pem_example
1445
+ * import { OnBehalfOfCredential } from "@azure/identity";
1446
+ * import { KeyClient } from "@azure/keyvault-keys";
1447
+ *
1427
1448
  * const tokenCredential = new OnBehalfOfCredential({
1428
- * tenantId,
1429
- * clientId,
1449
+ * tenantId: "tenant-id",
1450
+ * clientId: "client-id",
1430
1451
  * certificatePath: "/path/to/certificate.pem",
1431
- * userAssertionToken: "access-token"
1452
+ * userAssertionToken: "access-token",
1432
1453
  * });
1433
1454
  * const client = new KeyClient("vault-url", tokenCredential);
1434
- *
1435
1455
  * await client.getKey("key-name");
1436
1456
  * ```
1437
1457
  *
@@ -1445,15 +1465,17 @@ export declare class OnBehalfOfCredential implements TokenCredential {
1445
1465
  *
1446
1466
  * Example using the `KeyClient` from [\@azure/keyvault-keys](https://www.npmjs.com/package/\@azure/keyvault-keys):
1447
1467
  *
1448
- * ```ts
1468
+ * ```ts snippet:on_behalf_of_credential_secret_example
1469
+ * import { OnBehalfOfCredential } from "@azure/identity";
1470
+ * import { KeyClient } from "@azure/keyvault-keys";
1471
+ *
1449
1472
  * const tokenCredential = new OnBehalfOfCredential({
1450
- * tenantId,
1451
- * clientId,
1452
- * clientSecret,
1453
- * userAssertionToken: "access-token"
1473
+ * tenantId: "tenant-id",
1474
+ * clientId: "client-id",
1475
+ * clientSecret: "client-secret",
1476
+ * userAssertionToken: "access-token",
1454
1477
  * });
1455
1478
  * const client = new KeyClient("vault-url", tokenCredential);
1456
- *
1457
1479
  * await client.getKey("key-name");
1458
1480
  * ```
1459
1481
  *
@@ -1467,15 +1489,19 @@ export declare class OnBehalfOfCredential implements TokenCredential {
1467
1489
  *
1468
1490
  * Example using the `KeyClient` from [\@azure/keyvault-keys](https://www.npmjs.com/package/\@azure/keyvault-keys):
1469
1491
  *
1470
- * ```ts
1492
+ * ```ts snippet:on_behalf_of_credential_assertion_example
1493
+ * import { OnBehalfOfCredential } from "@azure/identity";
1494
+ * import { KeyClient } from "@azure/keyvault-keys";
1495
+ *
1471
1496
  * const tokenCredential = new OnBehalfOfCredential({
1472
- * tenantId,
1473
- * clientId,
1474
- * getAssertion: () => { return Promise.resolve("my-jwt")},
1475
- * userAssertionToken: "access-token"
1497
+ * tenantId: "tenant-id",
1498
+ * clientId: "client-id",
1499
+ * getAssertion: () => {
1500
+ * return Promise.resolve("my-jwt");
1501
+ * },
1502
+ * userAssertionToken: "access-token",
1476
1503
  * });
1477
1504
  * const client = new KeyClient("vault-url", tokenCredential);
1478
- *
1479
1505
  * await client.getKey("key-name");
1480
1506
  * ```
1481
1507
  *
@@ -1648,18 +1674,16 @@ export declare interface TokenCredentialOptions extends CommonClientOptions {
1648
1674
  *
1649
1675
  * Example:
1650
1676
  *
1651
- * ```javascript
1652
- * import { cachePersistencePlugin } from "@azure/identity-cache-persistence";
1677
+ * ```ts snippet:consumer_example
1678
+ * import { useIdentityPlugin, DeviceCodeCredential } from "@azure/identity";
1653
1679
  *
1654
- * import { useIdentityPlugin, DefaultAzureCredential } from "@azure/identity";
1655
1680
  * useIdentityPlugin(cachePersistencePlugin);
1656
- *
1657
- * // The plugin has the capability to extend `DefaultAzureCredential` and to
1681
+ * // The plugin has the capability to extend `DeviceCodeCredential` and to
1658
1682
  * // add middleware to the underlying credentials, such as persistence.
1659
- * const credential = new DefaultAzureCredential({
1683
+ * const credential = new DeviceCodeCredential({
1660
1684
  * tokenCachePersistenceOptions: {
1661
- * enabled: true
1662
- * }
1685
+ * enabled: true,
1686
+ * },
1663
1687
  * });
1664
1688
  * ```
1665
1689
  *