@azure/identity 2.0.0-beta.5 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of @azure/identity might be problematic. Click here for more details.

Files changed (130) hide show
  1. package/CHANGELOG.md +189 -12
  2. package/README.md +77 -24
  3. package/dist/index.js +705 -386
  4. package/dist/index.js.map +1 -1
  5. package/dist-esm/src/client/identityClient.js +3 -7
  6. package/dist-esm/src/client/identityClient.js.map +1 -1
  7. package/dist-esm/src/credentials/authorizationCodeCredential.browser.js +1 -1
  8. package/dist-esm/src/credentials/authorizationCodeCredential.browser.js.map +1 -1
  9. package/dist-esm/src/credentials/authorizationCodeCredential.js +12 -76
  10. package/dist-esm/src/credentials/authorizationCodeCredential.js.map +1 -1
  11. package/dist-esm/src/credentials/{applicationCredential.browser.js → azureApplicationCredential.browser.js} +9 -4
  12. package/dist-esm/src/credentials/azureApplicationCredential.browser.js.map +1 -0
  13. package/dist-esm/src/credentials/azureApplicationCredential.js +36 -0
  14. package/dist-esm/src/credentials/azureApplicationCredential.js.map +1 -0
  15. package/dist-esm/src/credentials/azureCliCredential.browser.js +7 -0
  16. package/dist-esm/src/credentials/azureCliCredential.browser.js.map +1 -1
  17. package/dist-esm/src/credentials/azureCliCredential.js +10 -10
  18. package/dist-esm/src/credentials/azureCliCredential.js.map +1 -1
  19. package/dist-esm/src/credentials/azurePowerShellCredential.browser.js +3 -1
  20. package/dist-esm/src/credentials/azurePowerShellCredential.browser.js.map +1 -1
  21. package/dist-esm/src/credentials/azurePowerShellCredential.js +13 -13
  22. package/dist-esm/src/credentials/azurePowerShellCredential.js.map +1 -1
  23. package/dist-esm/src/credentials/chainedTokenCredential.js +6 -5
  24. package/dist-esm/src/credentials/chainedTokenCredential.js.map +1 -1
  25. package/dist-esm/src/credentials/clientCertificateCredential.browser.js +7 -0
  26. package/dist-esm/src/credentials/clientCertificateCredential.browser.js.map +1 -1
  27. package/dist-esm/src/credentials/clientCertificateCredential.js +19 -13
  28. package/dist-esm/src/credentials/clientCertificateCredential.js.map +1 -1
  29. package/dist-esm/src/credentials/clientCertificateCredentialOptions.js.map +1 -1
  30. package/dist-esm/src/credentials/clientSecretCredential.browser.js +2 -5
  31. package/dist-esm/src/credentials/clientSecretCredential.browser.js.map +1 -1
  32. package/dist-esm/src/credentials/clientSecretCredential.js +3 -0
  33. package/dist-esm/src/credentials/clientSecretCredential.js.map +1 -1
  34. package/dist-esm/src/credentials/clientSecretCredentialOptions.js.map +1 -1
  35. package/dist-esm/src/credentials/credentialPersistenceOptions.js.map +1 -1
  36. package/dist-esm/src/credentials/defaultAzureCredential.js +21 -20
  37. package/dist-esm/src/credentials/defaultAzureCredential.js.map +1 -1
  38. package/dist-esm/src/credentials/deviceCodeCredential.browser.js +7 -0
  39. package/dist-esm/src/credentials/deviceCodeCredential.browser.js.map +1 -1
  40. package/dist-esm/src/credentials/deviceCodeCredential.js +14 -0
  41. package/dist-esm/src/credentials/deviceCodeCredential.js.map +1 -1
  42. package/dist-esm/src/credentials/environmentCredential.browser.js +7 -0
  43. package/dist-esm/src/credentials/environmentCredential.browser.js.map +1 -1
  44. package/dist-esm/src/credentials/environmentCredential.js +5 -21
  45. package/dist-esm/src/credentials/environmentCredential.js.map +1 -1
  46. package/dist-esm/src/credentials/interactiveBrowserCredential.browser.js +7 -7
  47. package/dist-esm/src/credentials/interactiveBrowserCredential.browser.js.map +1 -1
  48. package/dist-esm/src/credentials/interactiveBrowserCredential.js +7 -7
  49. package/dist-esm/src/credentials/interactiveBrowserCredential.js.map +1 -1
  50. package/dist-esm/src/credentials/interactiveBrowserCredentialOptions.js.map +1 -1
  51. package/dist-esm/src/credentials/managedIdentityCredential/appServiceMsi2017.js +21 -10
  52. package/dist-esm/src/credentials/managedIdentityCredential/appServiceMsi2017.js.map +1 -1
  53. package/dist-esm/src/credentials/managedIdentityCredential/arcMsi.js +24 -13
  54. package/dist-esm/src/credentials/managedIdentityCredential/arcMsi.js.map +1 -1
  55. package/dist-esm/src/credentials/managedIdentityCredential/cloudShellMsi.js +22 -11
  56. package/dist-esm/src/credentials/managedIdentityCredential/cloudShellMsi.js.map +1 -1
  57. package/dist-esm/src/credentials/managedIdentityCredential/fabricMsi.js +24 -7
  58. package/dist-esm/src/credentials/managedIdentityCredential/fabricMsi.js.map +1 -1
  59. package/dist-esm/src/credentials/managedIdentityCredential/imdsMsi.js +57 -39
  60. package/dist-esm/src/credentials/managedIdentityCredential/imdsMsi.js.map +1 -1
  61. package/dist-esm/src/credentials/managedIdentityCredential/index.js +16 -14
  62. package/dist-esm/src/credentials/managedIdentityCredential/index.js.map +1 -1
  63. package/dist-esm/src/credentials/managedIdentityCredential/models.js.map +1 -1
  64. package/dist-esm/src/credentials/managedIdentityCredential/tokenExchangeMsi.js +82 -0
  65. package/dist-esm/src/credentials/managedIdentityCredential/tokenExchangeMsi.js.map +1 -0
  66. package/dist-esm/src/credentials/managedIdentityCredential/utils.js +14 -6
  67. package/dist-esm/src/credentials/managedIdentityCredential/utils.js.map +1 -1
  68. package/dist-esm/src/credentials/onBehalfOfCredential.browser.js +23 -0
  69. package/dist-esm/src/credentials/onBehalfOfCredential.browser.js.map +1 -0
  70. package/dist-esm/src/credentials/onBehalfOfCredential.js +57 -0
  71. package/dist-esm/src/credentials/onBehalfOfCredential.js.map +1 -0
  72. package/dist-esm/src/credentials/{visualStudioCodeCredentialExtension.js → onBehalfOfCredentialOptions.js} +1 -1
  73. package/dist-esm/src/credentials/onBehalfOfCredentialOptions.js.map +1 -0
  74. package/dist-esm/src/credentials/usernamePasswordCredential.browser.js +11 -14
  75. package/dist-esm/src/credentials/usernamePasswordCredential.browser.js.map +1 -1
  76. package/dist-esm/src/credentials/usernamePasswordCredential.js +3 -2
  77. package/dist-esm/src/credentials/usernamePasswordCredential.js.map +1 -1
  78. package/dist-esm/src/credentials/visualStudioCodeCredential.browser.js +7 -1
  79. package/dist-esm/src/credentials/visualStudioCodeCredential.browser.js.map +1 -1
  80. package/dist-esm/src/credentials/visualStudioCodeCredential.js +16 -8
  81. package/dist-esm/src/credentials/visualStudioCodeCredential.js.map +1 -1
  82. package/dist-esm/src/credentials/visualStudioCodeCredentialPlugin.js +4 -0
  83. package/dist-esm/src/credentials/visualStudioCodeCredentialPlugin.js.map +1 -0
  84. package/dist-esm/src/{client/errors.js → errors.js} +16 -1
  85. package/dist-esm/src/errors.js.map +1 -0
  86. package/dist-esm/src/index.js +3 -5
  87. package/dist-esm/src/index.js.map +1 -1
  88. package/dist-esm/src/msal/browserFlows/browserCommon.js +8 -7
  89. package/dist-esm/src/msal/browserFlows/browserCommon.js.map +1 -1
  90. package/dist-esm/src/msal/browserFlows/msalAuthCode.js +12 -4
  91. package/dist-esm/src/msal/browserFlows/msalAuthCode.js.map +1 -1
  92. package/dist-esm/src/msal/nodeFlows/msalAuthorizationCode.js +41 -0
  93. package/dist-esm/src/msal/nodeFlows/msalAuthorizationCode.js.map +1 -0
  94. package/dist-esm/src/msal/nodeFlows/msalClientCertificate.js +49 -29
  95. package/dist-esm/src/msal/nodeFlows/msalClientCertificate.js.map +1 -1
  96. package/dist-esm/src/msal/nodeFlows/msalClientSecret.js.map +1 -1
  97. package/dist-esm/src/msal/nodeFlows/msalOnBehalfOf.js +56 -0
  98. package/dist-esm/src/msal/nodeFlows/msalOnBehalfOf.js.map +1 -0
  99. package/dist-esm/src/msal/nodeFlows/msalOpenBrowser.js +1 -1
  100. package/dist-esm/src/msal/nodeFlows/msalOpenBrowser.js.map +1 -1
  101. package/dist-esm/src/msal/nodeFlows/nodeCommon.js +19 -8
  102. package/dist-esm/src/msal/nodeFlows/nodeCommon.js.map +1 -1
  103. package/dist-esm/src/msal/nodeFlows/tokenCachePersistenceOptions.js.map +1 -1
  104. package/dist-esm/src/msal/utils.js +7 -4
  105. package/dist-esm/src/msal/utils.js.map +1 -1
  106. package/dist-esm/src/plugins/consumer.browser.js +7 -0
  107. package/dist-esm/src/plugins/consumer.browser.js.map +1 -0
  108. package/dist-esm/src/{extensions → plugins}/consumer.js +12 -12
  109. package/dist-esm/src/plugins/consumer.js.map +1 -0
  110. package/dist-esm/src/{extensions → plugins}/provider.js +0 -0
  111. package/dist-esm/src/plugins/provider.js.map +1 -0
  112. package/dist-esm/src/util/tracing.js +1 -1
  113. package/dist-esm/src/util/tracing.js.map +1 -1
  114. package/dist-esm/src/util/validateMultiTenant.browser.js +22 -0
  115. package/dist-esm/src/util/validateMultiTenant.browser.js.map +1 -0
  116. package/dist-esm/src/util/validateMultiTenant.js +17 -12
  117. package/dist-esm/src/util/validateMultiTenant.js.map +1 -1
  118. package/package.json +16 -16
  119. package/types/identity.d.ts +246 -261
  120. package/dist-esm/src/client/errors.js.map +0 -1
  121. package/dist-esm/src/credentials/applicationCredential.browser.js.map +0 -1
  122. package/dist-esm/src/credentials/applicationCredential.js +0 -37
  123. package/dist-esm/src/credentials/applicationCredential.js.map +0 -1
  124. package/dist-esm/src/credentials/visualStudioCodeCredentialExtension.js.map +0 -1
  125. package/dist-esm/src/extensions/consumer.browser.js +0 -7
  126. package/dist-esm/src/extensions/consumer.browser.js.map +0 -1
  127. package/dist-esm/src/extensions/consumer.js.map +0 -1
  128. package/dist-esm/src/extensions/provider.js.map +0 -1
  129. package/dist-esm/src/msal/errors.js +0 -22
  130. package/dist-esm/src/msal/errors.js.map +0 -1
@@ -3,6 +3,7 @@ import { AzureLogger } from '@azure/logger';
3
3
  import { CommonClientOptions } from '@azure/core-client';
4
4
  import { GetTokenOptions } from '@azure/core-auth';
5
5
  import { TokenCredential } from '@azure/core-auth';
6
+
6
7
  export { AccessToken }
7
8
 
8
9
  /**
@@ -23,41 +24,6 @@ export declare class AggregateAuthenticationError extends Error {
23
24
  */
24
25
  export declare const AggregateAuthenticationErrorName = "AggregateAuthenticationError";
25
26
 
26
- /**
27
- * Provides a default {@link ChainedTokenCredential} configuration that should
28
- * work for most applications that use the Azure SDK. The following credential
29
- * types will be tried, in order:
30
- *
31
- * - {@link EnvironmentCredential}
32
- * - {@link ManagedIdentityCredential}
33
-
34
- *
35
- * Consult the documentation of these credential types for more information
36
- * on how they attempt authentication.
37
- *
38
- * Azure Identity extensions may add credential types to the default credential
39
- * stack.
40
- */
41
- export declare class ApplicationCredential extends ChainedTokenCredential {
42
- /**
43
- * Creates an instance of the ApplicationCredential class.
44
- *
45
- * @param options - Optional parameters. See {@link ApplicationCredentialOptions}.
46
- */
47
- constructor(options?: ApplicationCredentialOptions);
48
- }
49
-
50
- /**
51
- * Provides options to configure the {@link ApplicationCredential} class.
52
- */
53
- export declare interface ApplicationCredentialOptions extends TokenCredentialOptions, CredentialPersistenceOptions {
54
- /**
55
- * Optionally pass in a user assigned client ID to be used by the {@link ManagedIdentityCredential}.
56
- * This client ID can also be passed through to the {@link ManagedIdentityCredential} through the environment variable: AZURE_CLIENT_ID.
57
- */
58
- managedIdentityClientId?: string;
59
- }
60
-
61
27
  /**
62
28
  * Provides details about a failure to authenticate with Azure Active
63
29
  * Directory. The `errorResponse` field contains more details about
@@ -115,18 +81,32 @@ export declare class AuthenticationRequiredError extends Error {
115
81
  */
116
82
  scopes: string[];
117
83
  /**
118
- * The options used to configure the getToken request.
84
+ * The options passed to the getToken request.
119
85
  */
120
- getTokenOptions: GetTokenOptions;
86
+ getTokenOptions?: GetTokenOptions;
121
87
  constructor(
88
+ /**
89
+ * Optional parameters. A message can be specified. The {@link GetTokenOptions} of the request can also be specified to more easily associate the error with the received parameters.
90
+ */
91
+ options: AuthenticationRequiredErrorOptions);
92
+ }
93
+
94
+ /**
95
+ * Optional parameters to the {@link AuthenticationRequiredError}
96
+ */
97
+ export declare interface AuthenticationRequiredErrorOptions {
122
98
  /**
123
99
  * The list of scopes for which the token will have access.
124
100
  */
125
- scopes: string[],
101
+ scopes: string[];
126
102
  /**
127
- * The options used to configure the getToken request.
103
+ * The options passed to the getToken request.
128
104
  */
129
- getTokenOptions?: GetTokenOptions, message?: string);
105
+ getTokenOptions?: GetTokenOptions;
106
+ /**
107
+ * The message of the error.
108
+ */
109
+ message?: string;
130
110
  }
131
111
 
132
112
  /**
@@ -137,14 +117,10 @@ export declare class AuthenticationRequiredError extends Error {
137
117
  * https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-auth-code-flow
138
118
  */
139
119
  export declare class AuthorizationCodeCredential implements TokenCredential {
140
- private identityClient;
141
- private tenantId;
142
- private clientId;
143
- private clientSecret;
120
+ private msalFlow;
121
+ private disableAutomaticAuthentication?;
144
122
  private authorizationCode;
145
123
  private redirectUri;
146
- private lastTokenResponse;
147
- private allowMultiTenantAuthentication?;
148
124
  /**
149
125
  * Creates an instance of CodeFlowCredential with the details needed
150
126
  * to request an access token using an authentication that was obtained
@@ -161,10 +137,10 @@ export declare class AuthorizationCodeCredential implements TokenCredential {
161
137
  * @param clientId - The client (application) ID of an App Registration in the tenant.
162
138
  * @param clientSecret - A client secret that was generated for the App Registration
163
139
  * @param authorizationCode - An authorization code that was received from following the
164
- authorization code flow. This authorization code must not
165
- have already been used to obtain an access token.
140
+ authorization code flow. This authorization code must not
141
+ have already been used to obtain an access token.
166
142
  * @param redirectUri - The redirect URI that was used to request the authorization code.
167
- Must be the same URI that is configured for the App Registration.
143
+ Must be the same URI that is configured for the App Registration.
168
144
  * @param options - Options for configuring the client which makes the access token request.
169
145
  */
170
146
  constructor(tenantId: string | "common", clientId: string, clientSecret: string, authorizationCode: string, redirectUri: string, options?: TokenCredentialOptions);
@@ -183,10 +159,10 @@ export declare class AuthorizationCodeCredential implements TokenCredential {
183
159
  * 'common' may be used when dealing with multi-tenant scenarios.
184
160
  * @param clientId - The client (application) ID of an App Registration in the tenant.
185
161
  * @param authorizationCode - An authorization code that was received from following the
186
- authorization code flow. This authorization code must not
187
- have already been used to obtain an access token.
162
+ authorization code flow. This authorization code must not
163
+ have already been used to obtain an access token.
188
164
  * @param redirectUri - The redirect URI that was used to request the authorization code.
189
- Must be the same URI that is configured for the App Registration.
165
+ Must be the same URI that is configured for the App Registration.
190
166
  * @param options - Options for configuring the client which makes the access token request.
191
167
  */
192
168
  constructor(tenantId: string | "common", clientId: string, authorizationCode: string, redirectUri: string, options?: TokenCredentialOptions);
@@ -228,15 +204,15 @@ export declare enum AzureAuthorityHosts {
228
204
  * via the Azure CLI ('az') commandline tool.
229
205
  * To do so, it will read the user access token and expire time
230
206
  * with Azure CLI command "az account get-access-token".
231
- * To be able to use this credential, ensure that you have already logged
232
- * in via the 'az' tool using the command "az login" from the commandline.
233
207
  */
234
208
  export declare class AzureCliCredential implements TokenCredential {
235
209
  private tenantId?;
236
- private allowMultiTenantAuthentication?;
237
210
  /**
238
211
  * Creates an instance of the {@link AzureCliCredential}.
239
212
  *
213
+ * To use this credential, ensure that you have already logged
214
+ * in via the 'az' tool using the command "az login" from the commandline.
215
+ *
240
216
  * @param options - Options, to optionally allow multi-tenant requests.
241
217
  */
242
218
  constructor(options?: AzureCliCredentialOptions);
@@ -265,18 +241,17 @@ export declare interface AzureCliCredentialOptions extends TokenCredentialOption
265
241
  * This credential will use the currently logged-in user information from the
266
242
  * Azure PowerShell module. To do so, it will read the user access token and
267
243
  * expire time with Azure PowerShell command `Get-AzAccessToken -ResourceUrl {ResourceScope}`
268
- *
269
- * To be able to use this credential:
270
- * - Install the Azure Az PowerShell module with:
271
- * `Install-Module -Name Az -Scope CurrentUser -Repository PSGallery -Force`.
272
- * - You have already logged in to Azure PowerShell using the command
273
- * `Connect-AzAccount` from the command line.
274
244
  */
275
245
  export declare class AzurePowerShellCredential implements TokenCredential {
276
246
  private tenantId?;
277
- private allowMultiTenantAuthentication?;
278
247
  /**
279
- * Creates an instance of the {@link AzurePowershellCredential}.
248
+ * Creates an instance of the {@link AzurePowerShellCredential}.
249
+ *
250
+ * To use this credential:
251
+ * - Install the Azure Az PowerShell module with:
252
+ * `Install-Module -Name Az -Scope CurrentUser -Repository PSGallery -Force`.
253
+ * - You have already logged in to Azure PowerShell using the command
254
+ * `Connect-AzAccount` from the command line.
280
255
  *
281
256
  * @param options - Options, to optionally allow multi-tenant requests.
282
257
  */
@@ -293,7 +268,7 @@ export declare class AzurePowerShellCredential implements TokenCredential {
293
268
  * @param scopes - The list of scopes for which the token will have access.
294
269
  * @param options - The options used to configure any requests this TokenCredential implementation might make.
295
270
  */
296
- getToken(scopes: string | string[], options?: GetTokenOptions): Promise<AccessToken | null>;
271
+ getToken(scopes: string | string[], options?: GetTokenOptions): Promise<AccessToken>;
297
272
  }
298
273
 
299
274
  /**
@@ -327,10 +302,6 @@ export declare class ChainedTokenCredential implements TokenCredential {
327
302
  */
328
303
  protected UnavailableMessage: string;
329
304
  private _sources;
330
- /**
331
- * The selected credential, in case users want to read it or use it directly.
332
- */
333
- selectedCredential?: TokenCredential;
334
305
  /**
335
306
  * Creates an instance of ChainedTokenCredential using the given credentials.
336
307
  *
@@ -380,6 +351,17 @@ export declare class ClientCertificateCredential implements TokenCredential {
380
351
  * @param options - Options for configuring the client which makes the authentication request.
381
352
  */
382
353
  constructor(tenantId: string, clientId: string, certificatePath: string, options?: ClientCertificateCredentialOptions);
354
+ /**
355
+ * Creates an instance of the ClientCertificateCredential with the details
356
+ * needed to authenticate against Azure Active Directory with a certificate.
357
+ *
358
+ * @param tenantId - The Azure Active Directory tenant (directory) ID.
359
+ * @param clientId - The client (application) ID of an App Registration in the tenant.
360
+ * @param configuration - Other parameters required, including the PEM-encoded certificate as a string, or as a path on the filesystem.
361
+ * If the type is ignored, we will throw if both the value of the PEM certificate and the path to a PEM certificate are provided at the same time.
362
+ * @param options - Options for configuring the client which makes the authentication request.
363
+ */
364
+ constructor(tenantId: string, clientId: string, configuration: ClientCertificateCredentialPEMConfiguration, options?: ClientCertificateCredentialOptions);
383
365
  /**
384
366
  * Authenticates with Azure Active Directory and returns an access token if successful.
385
367
  * If authentication fails, a {@link CredentialUnavailableError} will be thrown with the details of the failure.
@@ -400,13 +382,30 @@ export declare interface ClientCertificateCredentialOptions extends TokenCredent
400
382
  * Set this option to send base64 encoded public certificate in the client assertion header as an x5c claim
401
383
  */
402
384
  sendCertificateChain?: boolean;
385
+ }
386
+
387
+ /**
388
+ * Required configuration options for the {@link ClientCertificateCredential}, with either the string contents of a PEM certificate, or the path to a PEM certificate.
389
+ */
390
+ export declare type ClientCertificateCredentialPEMConfiguration = {
403
391
  /**
404
- * Specifies a regional authority. Please refer to the {@link RegionalAuthority} type for the accepted values.
405
- * If {@link RegionalAuthority.AutoDiscoverRegion} is specified, we will try to discover the regional authority endpoint.
406
- * If the property is not specified, the credential uses the global authority endpoint.
392
+ * The PEM-encoded public/private key certificate on the filesystem.
407
393
  */
408
- regionalAuthority?: string;
409
- }
394
+ certificate: string;
395
+ /**
396
+ * The PEM-encoded public/private key certificate on the filesystem should not be provided if `certificate` is provided.
397
+ */
398
+ certificatePath?: never;
399
+ } | {
400
+ /**
401
+ * The PEM-encoded public/private key certificate on the filesystem should not be provided if `certificatePath` is provided.
402
+ */
403
+ certificate?: never;
404
+ /**
405
+ * The path to the PEM-encoded public/private key certificate on the filesystem.
406
+ */
407
+ certificatePath: string;
408
+ };
410
409
 
411
410
  /**
412
411
  * Enables authentication to Azure Active Directory using a client secret
@@ -444,12 +443,6 @@ export declare class ClientSecretCredential implements TokenCredential {
444
443
  * Optional parameters for the {@link ClientSecretCredential} class.
445
444
  */
446
445
  export declare interface ClientSecretCredentialOptions extends TokenCredentialOptions, CredentialPersistenceOptions {
447
- /**
448
- * Specifies a regional authority. Please refer to the {@link RegionalAuthority} type for the accepted values.
449
- * If {@link RegionalAuthority.AutoDiscoverRegion} is specified, we will try to discover the regional authority endpoint.
450
- * If the property is not specified, the credential uses the global authority endpoint.
451
- */
452
- regionalAuthority?: string;
453
446
  }
454
447
 
455
448
  /**
@@ -461,21 +454,21 @@ export declare interface CredentialPersistenceOptions {
461
454
  * Options to provide to the persistence layer (if one is available) when
462
455
  * storing credentials.
463
456
  *
464
- * You must first register a persistence provider as an extension. See the
457
+ * You must first register a persistence provider plugin. See the
465
458
  * `@azure/identity-cache-persistence` package on NPM.
466
459
  *
467
460
  * Example:
468
461
  *
469
- * ```typescript
470
- * import persistence from "@azure/identity-cache-persistence";
471
- * import { useIdentityExtension, DeviceCodeCredential } from "@azure/identity";
462
+ * ```javascript
463
+ * import { cachePersistencePlugin } from "@azure/identity-cache-persistence";
464
+ * import { useIdentityPlugin, DeviceCodeCredential } from "@azure/identity";
472
465
  *
473
- * useIdentityExtension(persistence);
466
+ * useIdentityPlugin(cachePersistencePlugin);
474
467
  *
475
468
  * async function main() {
476
469
  * const credential = new DeviceCodeCredential({
477
470
  * tokenCachePersistenceOptions: {
478
- * name: "mycustomcachename"
471
+ * enabled: true
479
472
  * }
480
473
  * });
481
474
  * }
@@ -485,7 +478,7 @@ export declare interface CredentialPersistenceOptions {
485
478
  * process.exit(1);
486
479
  * });
487
480
  * ```
488
- - */
481
+ */
489
482
  tokenCachePersistenceOptions?: TokenCachePersistenceOptions;
490
483
  }
491
484
 
@@ -505,30 +498,31 @@ export declare const CredentialUnavailableErrorName = "CredentialUnavailableErro
505
498
 
506
499
  /**
507
500
  * Provides a default {@link ChainedTokenCredential} configuration that should
508
- * work for most applications that use the Azure SDK. The following credential
509
- * types will be tried, in order:
510
- *
511
- * - {@link EnvironmentCredential}
512
- * - {@link ManagedIdentityCredential}
513
- * - {@link VisualStudioCodeCredential}
514
- * - {@link AzureCliCredential}
515
- * - {@link AzurePowerShellCredential}
516
- *
517
- * Consult the documentation of these credential types for more information
518
- * on how they attempt authentication.
519
- *
520
- * **Note**: `VisualStudioCodeCredential` is provided by an extension package:
521
- * `@azure/identity-vscode`. If this package is not installed and registered
522
- * using the extension API (`useIdentityExtension`), then authentication using
523
- * `VisualStudioCodeCredential` will not be available.
524
- *
525
- * Azure Identity extensions may add credential types to the default credential
526
- * stack.
501
+ * work for most applications that use the Azure SDK.
527
502
  */
528
503
  export declare class DefaultAzureCredential extends ChainedTokenCredential {
529
504
  /**
530
505
  * Creates an instance of the DefaultAzureCredential class.
531
506
  *
507
+ * This credential provides a default {@link ChainedTokenCredential} configuration that should
508
+ * work for most applications that use the Azure SDK.
509
+ *
510
+ * The following credential types will be tried, in order:
511
+ *
512
+ * - {@link EnvironmentCredential}
513
+ * - {@link ManagedIdentityCredential}
514
+ * - {@link VisualStudioCodeCredential}
515
+ * - {@link AzureCliCredential}
516
+ * - {@link AzurePowerShellCredential}
517
+ *
518
+ * Consult the documentation of these credential types for more information
519
+ * on how they attempt authentication.
520
+ *
521
+ * **Note**: `VisualStudioCodeCredential` is provided by a plugin package:
522
+ * `@azure/identity-vscode`. If this package is not installed and registered
523
+ * using the plugin API (`useIdentityPlugin`), then authentication using
524
+ * `VisualStudioCodeCredential` will not be available.
525
+ *
532
526
  * @param options - Optional parameters. See {@link DefaultAzureCredentialOptions}.
533
527
  */
534
528
  constructor(options?: DefaultAzureCredentialOptions);
@@ -537,7 +531,7 @@ export declare class DefaultAzureCredential extends ChainedTokenCredential {
537
531
  /**
538
532
  * Provides options to configure the {@link DefaultAzureCredential} class.
539
533
  */
540
- export declare interface DefaultAzureCredentialOptions extends TokenCredentialOptions, CredentialPersistenceOptions {
534
+ export declare interface DefaultAzureCredentialOptions extends TokenCredentialOptions {
541
535
  /**
542
536
  * Optionally pass in a Tenant ID to be used as part of the credential.
543
537
  * By default it may use a generic tenant ID depending on the underlying credential.
@@ -582,6 +576,20 @@ export declare class DeviceCodeCredential implements TokenCredential {
582
576
  * Creates an instance of DeviceCodeCredential with the details needed
583
577
  * to initiate the device code authorization flow with Azure Active Directory.
584
578
  *
579
+ * A message will be logged, giving users a code that they can use to authenticate once they go to https://microsoft.com/devicelogin
580
+ *
581
+ * Developers can configure how this message is shown by passing a custom `userPromptCallback`:
582
+ *
583
+ * ```js
584
+ * const credential = new DeviceCodeCredential({
585
+ * tenantId: env.AZURE_TENANT_ID,
586
+ * clientId: env.AZURE_CLIENT_ID,
587
+ * userPromptCallback: (info) => {
588
+ * console.log("CUSTOMIZED PROMPT CALLBACK", info.message);
589
+ * }
590
+ * });
591
+ * ```
592
+ *
585
593
  * @param options - Options for configuring the client which makes the authentication requests.
586
594
  */
587
595
  constructor(options?: DeviceCodeCredentialOptions);
@@ -662,23 +670,7 @@ export declare type DeviceCodePromptCallback = (deviceCodeInfo: DeviceCodeInfo)
662
670
 
663
671
  /**
664
672
  * Enables authentication to Azure Active Directory using client secret
665
- * details configured in the following environment variables:
666
- *
667
- * Required environment variables:
668
- * - `AZURE_TENANT_ID`: The Azure Active Directory tenant (directory) ID.
669
- * - `AZURE_CLIENT_ID`: The client (application) ID of an App Registration in the tenant.
670
- *
671
- * Environment variables used for client credential authentication:
672
- * - `AZURE_CLIENT_SECRET`: A client secret that was generated for the App Registration.
673
- * - `AZURE_CLIENT_CERTIFICATE_PATH`: The path to a PEM certificate to use during the authentication, instead of the client secret.
674
- *
675
- * Alternatively, users can provide environment variables for username and password authentication:
676
- * - `AZURE_USERNAME`: Username to authenticate with.
677
- * - `AZURE_PASSWORD`: Password to authenticate with.
678
- *
679
- * This credential ultimately uses a {@link ClientSecretCredential} to
680
- * perform the authentication using these details. Please consult the
681
- * documentation of that class for more details.
673
+ * details configured in environment variables
682
674
  */
683
675
  export declare class EnvironmentCredential implements TokenCredential {
684
676
  private _credential?;
@@ -716,7 +708,7 @@ export declare class EnvironmentCredential implements TokenCredential {
716
708
  * Enables authentication to Azure Active Directory depending on the available environment variables.
717
709
  * Defines options for the EnvironmentCredential class.
718
710
  */
719
- export declare interface EnvironmentCredentialOptions extends TokenCredentialOptions, CredentialPersistenceOptions {
711
+ export declare interface EnvironmentCredentialOptions extends TokenCredentialOptions {
720
712
  }
721
713
 
722
714
  /**
@@ -758,24 +750,18 @@ export declare interface ErrorResponse {
758
750
  * Returns a new instance of the {@link DefaultAzureCredential}.
759
751
  */
760
752
  export declare function getDefaultAzureCredential(): TokenCredential;
753
+
761
754
  export { GetTokenOptions }
762
755
 
763
756
  /**
764
- * The type of an Azure Identity Extension, a function accepting an extension
757
+ * The type of an Azure Identity plugin, a function accepting a plugin
765
758
  * context.
766
759
  */
767
- export declare type IdentityExtension = (context: unknown) => void;
760
+ export declare type IdentityPlugin = (context: unknown) => void;
768
761
 
769
762
  /**
770
763
  * Enables authentication to Azure Active Directory inside of the web browser
771
764
  * using the interactive login flow.
772
- *
773
- * This credential uses the [Authorization Code Flow](https://docs.microsoft.com/azure/active-directory/develop/v2-oauth2-auth-code-flow).
774
- * On Node.js, it will open a browser window while it listens for a redirect response from the authentication service.
775
- * On browsers, it authenticates via popups. The `loginStyle` optional parameter can be set to `redirect` to authenticate by redirecting the user to an Azure secure login page, which then will redirect the user back to the web application where the authentication started.
776
- *
777
- * For Node.js, if a `clientId` is provided, the Azure Active Directory application will need to be configured to have a "Mobile and desktop applications" redirect endpoint.
778
- * Follow our guide on [setting up Redirect URIs for Desktop apps that calls to web APIs](https://docs.microsoft.com/azure/active-directory/develop/scenario-desktop-app-registration#redirect-uris).
779
765
  */
780
766
  export declare class InteractiveBrowserCredential implements TokenCredential {
781
767
  private msalFlow;
@@ -783,9 +769,16 @@ export declare class InteractiveBrowserCredential implements TokenCredential {
783
769
  /**
784
770
  * Creates an instance of InteractiveBrowserCredential with the details needed.
785
771
  *
772
+ * This credential uses the [Authorization Code Flow](https://docs.microsoft.com/azure/active-directory/develop/v2-oauth2-auth-code-flow).
773
+ * On Node.js, it will open a browser window while it listens for a redirect response from the authentication service.
774
+ * On browsers, it authenticates via popups. The `loginStyle` optional parameter can be set to `redirect` to authenticate by redirecting the user to an Azure secure login page, which then will redirect the user back to the web application where the authentication started.
775
+ *
776
+ * For Node.js, if a `clientId` is provided, the Azure Active Directory application will need to be configured to have a "Mobile and desktop applications" redirect endpoint.
777
+ * Follow our guide on [setting up Redirect URIs for Desktop apps that calls to web APIs](https://docs.microsoft.com/azure/active-directory/develop/scenario-desktop-app-registration#redirect-uris).
778
+ *
786
779
  * @param options - Options for configuring the client which makes the authentication requests.
787
780
  */
788
- constructor(options?: InteractiveBrowserCredentialOptions | InteractiveBrowserCredentialBrowserOptions);
781
+ constructor(options?: InteractiveBrowserCredentialNodeOptions | InteractiveBrowserCredentialInBrowserOptions);
789
782
  /**
790
783
  * Authenticates with Azure Active Directory and returns an access token if successful.
791
784
  * If authentication fails, a {@link CredentialUnavailableError} will be thrown with the details of the failure.
@@ -818,7 +811,7 @@ export declare class InteractiveBrowserCredential implements TokenCredential {
818
811
  /**
819
812
  * Defines the common options for the InteractiveBrowserCredential class.
820
813
  */
821
- export declare interface InteractiveBrowserCredentialBrowserOptions extends InteractiveCredentialOptions {
814
+ export declare interface InteractiveBrowserCredentialInBrowserOptions extends InteractiveCredentialOptions {
822
815
  /**
823
816
  * Gets the redirect URI of the application. This should be same as the value
824
817
  * in the application registration portal. Defaults to `window.location.href`.
@@ -850,7 +843,7 @@ export declare interface InteractiveBrowserCredentialBrowserOptions extends Inte
850
843
  /**
851
844
  * Defines the common options for the InteractiveBrowserCredential class.
852
845
  */
853
- export declare interface InteractiveBrowserCredentialOptions extends InteractiveCredentialOptions, CredentialPersistenceOptions {
846
+ export declare interface InteractiveBrowserCredentialNodeOptions extends InteractiveCredentialOptions, CredentialPersistenceOptions {
854
847
  /**
855
848
  * Gets the redirect URI of the application. This should be same as the value
856
849
  * in the application registration portal. Defaults to `window.location.href`.
@@ -941,115 +934,107 @@ export declare class ManagedIdentityCredential implements TokenCredential {
941
934
  }
942
935
 
943
936
  /**
944
- * Helps specify a regional authority, or "AutoDiscoverRegion" to auto-detect the region.
937
+ * Enables authentication to Azure Active Directory using the [On Behalf Of flow](https://docs.microsoft.com/azure/active-directory/develop/v2-oauth2-on-behalf-of-flow).
945
938
  */
946
- export declare enum RegionalAuthority {
947
- /** Instructs MSAL to attempt to discover the region */
948
- AutoDiscoverRegion = "AutoDiscoverRegion",
949
- /** Uses the {@link RegionalAuthority} for the Azure 'westus' region. */
950
- USWest = "westus",
951
- /** Uses the {@link RegionalAuthority} for the Azure 'westus2' region. */
952
- USWest2 = "westus2",
953
- /** Uses the {@link RegionalAuthority} for the Azure 'centralus' region. */
954
- USCentral = "centralus",
955
- /** Uses the {@link RegionalAuthority} for the Azure 'eastus' region. */
956
- USEast = "eastus",
957
- /** Uses the {@link RegionalAuthority} for the Azure 'eastus2' region. */
958
- USEast2 = "eastus2",
959
- /** Uses the {@link RegionalAuthority} for the Azure 'northcentralus' region. */
960
- USNorthCentral = "northcentralus",
961
- /** Uses the {@link RegionalAuthority} for the Azure 'southcentralus' region. */
962
- USSouthCentral = "southcentralus",
963
- /** Uses the {@link RegionalAuthority} for the Azure 'westcentralus' region. */
964
- USWestCentral = "westcentralus",
965
- /** Uses the {@link RegionalAuthority} for the Azure 'canadacentral' region. */
966
- CanadaCentral = "canadacentral",
967
- /** Uses the {@link RegionalAuthority} for the Azure 'canadaeast' region. */
968
- CanadaEast = "canadaeast",
969
- /** Uses the {@link RegionalAuthority} for the Azure 'brazilsouth' region. */
970
- BrazilSouth = "brazilsouth",
971
- /** Uses the {@link RegionalAuthority} for the Azure 'northeurope' region. */
972
- EuropeNorth = "northeurope",
973
- /** Uses the {@link RegionalAuthority} for the Azure 'westeurope' region. */
974
- EuropeWest = "westeurope",
975
- /** Uses the {@link RegionalAuthority} for the Azure 'uksouth' region. */
976
- UKSouth = "uksouth",
977
- /** Uses the {@link RegionalAuthority} for the Azure 'ukwest' region. */
978
- UKWest = "ukwest",
979
- /** Uses the {@link RegionalAuthority} for the Azure 'francecentral' region. */
980
- FranceCentral = "francecentral",
981
- /** Uses the {@link RegionalAuthority} for the Azure 'francesouth' region. */
982
- FranceSouth = "francesouth",
983
- /** Uses the {@link RegionalAuthority} for the Azure 'switzerlandnorth' region. */
984
- SwitzerlandNorth = "switzerlandnorth",
985
- /** Uses the {@link RegionalAuthority} for the Azure 'switzerlandwest' region. */
986
- SwitzerlandWest = "switzerlandwest",
987
- /** Uses the {@link RegionalAuthority} for the Azure 'germanynorth' region. */
988
- GermanyNorth = "germanynorth",
989
- /** Uses the {@link RegionalAuthority} for the Azure 'germanywestcentral' region. */
990
- GermanyWestCentral = "germanywestcentral",
991
- /** Uses the {@link RegionalAuthority} for the Azure 'norwaywest' region. */
992
- NorwayWest = "norwaywest",
993
- /** Uses the {@link RegionalAuthority} for the Azure 'norwayeast' region. */
994
- NorwayEast = "norwayeast",
995
- /** Uses the {@link RegionalAuthority} for the Azure 'eastasia' region. */
996
- AsiaEast = "eastasia",
997
- /** Uses the {@link RegionalAuthority} for the Azure 'southeastasia' region. */
998
- AsiaSouthEast = "southeastasia",
999
- /** Uses the {@link RegionalAuthority} for the Azure 'japaneast' region. */
1000
- JapanEast = "japaneast",
1001
- /** Uses the {@link RegionalAuthority} for the Azure 'japanwest' region. */
1002
- JapanWest = "japanwest",
1003
- /** Uses the {@link RegionalAuthority} for the Azure 'australiaeast' region. */
1004
- AustraliaEast = "australiaeast",
1005
- /** Uses the {@link RegionalAuthority} for the Azure 'australiasoutheast' region. */
1006
- AustraliaSouthEast = "australiasoutheast",
1007
- /** Uses the {@link RegionalAuthority} for the Azure 'australiacentral' region. */
1008
- AustraliaCentral = "australiacentral",
1009
- /** Uses the {@link RegionalAuthority} for the Azure 'australiacentral2' region. */
1010
- AustraliaCentral2 = "australiacentral2",
1011
- /** Uses the {@link RegionalAuthority} for the Azure 'centralindia' region. */
1012
- IndiaCentral = "centralindia",
1013
- /** Uses the {@link RegionalAuthority} for the Azure 'southindia' region. */
1014
- IndiaSouth = "southindia",
1015
- /** Uses the {@link RegionalAuthority} for the Azure 'westindia' region. */
1016
- IndiaWest = "westindia",
1017
- /** Uses the {@link RegionalAuthority} for the Azure 'koreasouth' region. */
1018
- KoreaSouth = "koreasouth",
1019
- /** Uses the {@link RegionalAuthority} for the Azure 'koreacentral' region. */
1020
- KoreaCentral = "koreacentral",
1021
- /** Uses the {@link RegionalAuthority} for the Azure 'uaecentral' region. */
1022
- UAECentral = "uaecentral",
1023
- /** Uses the {@link RegionalAuthority} for the Azure 'uaenorth' region. */
1024
- UAENorth = "uaenorth",
1025
- /** Uses the {@link RegionalAuthority} for the Azure 'southafricanorth' region. */
1026
- SouthAfricaNorth = "southafricanorth",
1027
- /** Uses the {@link RegionalAuthority} for the Azure 'southafricawest' region. */
1028
- SouthAfricaWest = "southafricawest",
1029
- /** Uses the {@link RegionalAuthority} for the Azure 'chinanorth' region. */
1030
- ChinaNorth = "chinanorth",
1031
- /** Uses the {@link RegionalAuthority} for the Azure 'chinaeast' region. */
1032
- ChinaEast = "chinaeast",
1033
- /** Uses the {@link RegionalAuthority} for the Azure 'chinanorth2' region. */
1034
- ChinaNorth2 = "chinanorth2",
1035
- /** Uses the {@link RegionalAuthority} for the Azure 'chinaeast2' region. */
1036
- ChinaEast2 = "chinaeast2",
1037
- /** Uses the {@link RegionalAuthority} for the Azure 'germanycentral' region. */
1038
- GermanyCentral = "germanycentral",
1039
- /** Uses the {@link RegionalAuthority} for the Azure 'germanynortheast' region. */
1040
- GermanyNorthEast = "germanynortheast",
1041
- /** Uses the {@link RegionalAuthority} for the Azure 'usgovvirginia' region. */
1042
- GovernmentUSVirginia = "usgovvirginia",
1043
- /** Uses the {@link RegionalAuthority} for the Azure 'usgoviowa' region. */
1044
- GovernmentUSIowa = "usgoviowa",
1045
- /** Uses the {@link RegionalAuthority} for the Azure 'usgovarizona' region. */
1046
- GovernmentUSArizona = "usgovarizona",
1047
- /** Uses the {@link RegionalAuthority} for the Azure 'usgovtexas' region. */
1048
- GovernmentUSTexas = "usgovtexas",
1049
- /** Uses the {@link RegionalAuthority} for the Azure 'usdodeast' region. */
1050
- GovernmentUSDodEast = "usdodeast",
1051
- /** Uses the {@link RegionalAuthority} for the Azure 'usdodcentral' region. */
1052
- GovernmentUSDodCentral = "usdodcentral"
939
+ export declare class OnBehalfOfCredential implements TokenCredential {
940
+ private options;
941
+ private msalFlow;
942
+ /**
943
+ * Creates an instance of the {@link OnBehalfOfCredential} with the details
944
+ * needed to authenticate against Azure Active Directory with a client
945
+ * secret or a path to a PEM certificate, and an user assertion.
946
+ *
947
+ * Example using the `KeyClient` from [\@azure/keyvault-keys](https://www.npmjs.com/package/\@azure/keyvault-keys):
948
+ *
949
+ * ```ts
950
+ * const tokenCredential = new OnBehalfOfCredential({
951
+ * tenantId,
952
+ * clientId,
953
+ * clientSecret, // or `certificatePath: "/path/to/certificate.pem"
954
+ * userAssertionToken: "access-token"
955
+ * });
956
+ * const client = new KeyClient("vault-url", tokenCredential);
957
+ *
958
+ * await client.getKey("key-name");
959
+ * ```
960
+ *
961
+ * @param options - Optional parameters, generally common across credentials.
962
+ */
963
+ constructor(options: OnBehalfOfCredentialOptions);
964
+ /**
965
+ * Authenticates with Azure Active Directory and returns an access token if successful.
966
+ * If authentication fails, a {@link CredentialUnavailableError} will be thrown with the details of the failure.
967
+ *
968
+ * @param scopes - The list of scopes for which the token will have access.
969
+ * @param options - The options used to configure the underlying network requests.
970
+ */
971
+ getToken(scopes: string | string[], options?: GetTokenOptions): Promise<AccessToken>;
972
+ }
973
+
974
+ /**
975
+ * Defines the parameters to authenticate the {@link OnBehalfOfCredential} with a certificate.
976
+ */
977
+ export declare interface OnBehalfOfCredentialCertificateOptions {
978
+ /**
979
+ * The Azure Active Directory tenant (directory) ID.
980
+ */
981
+ tenantId: string;
982
+ /**
983
+ * The client (application) ID of an App Registration in the tenant.
984
+ */
985
+ clientId: string;
986
+ /**
987
+ * The path to a PEM-encoded public/private key certificate on the filesystem.
988
+ */
989
+ certificatePath: string;
990
+ /**
991
+ * Option to include x5c header for SubjectName and Issuer name authorization.
992
+ * Set this option to send base64 encoded public certificate in the client assertion header as an x5c claim
993
+ */
994
+ sendCertificateChain?: boolean;
995
+ /**
996
+ * The user assertion for the On-Behalf-Of flow.
997
+ */
998
+ userAssertionToken: string;
999
+ /**
1000
+ * Client secret should not be provided when certificate options are provided.
1001
+ */
1002
+ clientSecret?: never;
1003
+ }
1004
+
1005
+ /**
1006
+ * Optional parameters for the {@link OnBehalfOfCredential} class.
1007
+ */
1008
+ export declare type OnBehalfOfCredentialOptions = (OnBehalfOfCredentialSecretOptions | OnBehalfOfCredentialCertificateOptions) & TokenCredentialOptions & CredentialPersistenceOptions;
1009
+
1010
+ /**
1011
+ * Defines the parameters to authenticate the {@link OnBehalfOfCredential} with a secret.
1012
+ */
1013
+ export declare interface OnBehalfOfCredentialSecretOptions {
1014
+ /**
1015
+ * The Azure Active Directory tenant (directory) ID.
1016
+ */
1017
+ tenantId: string;
1018
+ /**
1019
+ * The client (application) ID of an App Registration in the tenant.
1020
+ */
1021
+ clientId: string;
1022
+ /**
1023
+ * A client secret that was generated for the App Registration.
1024
+ */
1025
+ clientSecret: string;
1026
+ /**
1027
+ * The user assertion for the On-Behalf-Of flow.
1028
+ */
1029
+ userAssertionToken: string;
1030
+ /**
1031
+ * The path to a PEM-encoded certificate should not be provided when the secret options are provided.
1032
+ */
1033
+ certificatePath?: never;
1034
+ /**
1035
+ * Option to include x5c header should not be provided when the secret options are provided.
1036
+ */
1037
+ sendCertificateChain?: never;
1053
1038
  }
1054
1039
 
1055
1040
  /**
@@ -1081,8 +1066,7 @@ export declare interface TokenCachePersistenceOptions {
1081
1066
  *
1082
1067
  * Based on this identifier, the persistence file will be located in any of the following places:
1083
1068
  * - Darwin: '/Users/user/.IdentityService/<name>'
1084
- * - Windows 8: 'C:\\Users\\user\\AppData\\Local\\.IdentityService\\<name>'
1085
- * - Windows XP: 'C:\\Documents and Settings\\user\\Application Data\\Local\\.IdentityService\\<name>'
1069
+ * - Windows 8+: 'C:\\Users\\user\\AppData\\Local\\.IdentityService\\<name>'
1086
1070
  * - Linux: '/home/user/.IdentityService/<name>'
1087
1071
  */
1088
1072
  name?: string;
@@ -1090,8 +1074,9 @@ export declare interface TokenCachePersistenceOptions {
1090
1074
  * If set to true, the cache will be stored without encryption if no OS level user encryption is available.
1091
1075
  * When set to false, the PersistentTokenCache will throw an error if no OS level user encryption is available.
1092
1076
  */
1093
- allowUnencryptedStorage?: boolean;
1077
+ unsafeAllowUnencryptedStorage?: boolean;
1094
1078
  }
1079
+
1095
1080
  export { TokenCredential }
1096
1081
 
1097
1082
  /**
@@ -1105,15 +1090,11 @@ export declare interface TokenCredentialOptions extends CommonClientOptions {
1105
1090
  * The default is "https://login.microsoftonline.com".
1106
1091
  */
1107
1092
  authorityHost?: string;
1108
- /**
1109
- * If set to true, allows authentication flows to change the tenantId of the request if a different tenantId is received from a challenge or through a direct getToken call.
1110
- */
1111
- allowMultiTenantAuthentication?: boolean;
1112
1093
  }
1113
1094
 
1114
1095
  /**
1115
- * Extend Azure Identity with additional functionality. Pass an extension from
1116
- * an extension package, such as:
1096
+ * Extend Azure Identity with additional functionality. Pass a plugin from
1097
+ * a plugin package, such as:
1117
1098
  *
1118
1099
  * - `@azure/identity-cache-persistence`: provides persistent token caching
1119
1100
  * - `@azure/identity-vscode`: provides the dependencies of
@@ -1122,12 +1103,12 @@ export declare interface TokenCredentialOptions extends CommonClientOptions {
1122
1103
  * Example:
1123
1104
  *
1124
1105
  * ```javascript
1125
- * import { cachePersistenceExtension } from "@azure/identity-cache-persistence";
1106
+ * import { cachePersistencePlugin } from "@azure/identity-cache-persistence";
1126
1107
  *
1127
- * import { useIdentityExtension, DefaultAzureCredential } from "@azure/identity";
1128
- * useIdentityExtension(persistence);
1108
+ * import { useIdentityPlugin, DefaultAzureCredential } from "@azure/identity";
1109
+ * useIdentityPlugin(cachePersistencePlugin);
1129
1110
  *
1130
- * // The extension has the capability to extend `DefaultAzureCredential` and to
1111
+ * // The plugin has the capability to extend `DefaultAzureCredential` and to
1131
1112
  * // add middleware to the underlying credentials, such as persistence.
1132
1113
  * const credential = new DefaultAzureCredential({
1133
1114
  * tokenCachePersistenceOptions: {
@@ -1136,9 +1117,9 @@ export declare interface TokenCredentialOptions extends CommonClientOptions {
1136
1117
  * });
1137
1118
  * ```
1138
1119
  *
1139
- * @param extension - the extension to register
1120
+ * @param plugin - the plugin to register
1140
1121
  */
1141
- export declare function useIdentityExtension(extension: IdentityExtension): void;
1122
+ export declare function useIdentityPlugin(plugin: IdentityPlugin): void;
1142
1123
 
1143
1124
  /**
1144
1125
  * Enables authentication to Azure Active Directory with a user's
@@ -1182,7 +1163,7 @@ export declare interface UsernamePasswordCredentialOptions extends TokenCredenti
1182
1163
  }
1183
1164
 
1184
1165
  /**
1185
- * Connect to Azure using the credential provided by the VSCode extension 'Azure Account'.
1166
+ * Connects to Azure using the credential provided by the VSCode extension 'Azure Account'.
1186
1167
  * Once the user has logged in via the extension, this credential can share the same refresh token
1187
1168
  * that is cached by the extension.
1188
1169
  */
@@ -1190,10 +1171,14 @@ export declare class VisualStudioCodeCredential implements TokenCredential {
1190
1171
  private identityClient;
1191
1172
  private tenantId;
1192
1173
  private cloudName;
1193
- private allowMultiTenantAuthentication?;
1194
1174
  /**
1195
1175
  * Creates an instance of VisualStudioCodeCredential to use for automatically authenticating via VSCode.
1196
1176
  *
1177
+ * **Note**: `VisualStudioCodeCredential` is provided by a plugin package:
1178
+ * `@azure/identity-vscode`. If this package is not installed and registered
1179
+ * using the plugin API (`useIdentityPlugin`), then authentication using
1180
+ * `VisualStudioCodeCredential` will not be available.
1181
+ *
1197
1182
  * @param options - Options for configuring the client which makes the authentication request.
1198
1183
  */
1199
1184
  constructor(options?: VisualStudioCodeCredentialOptions);