@azure/identity 4.0.0-alpha.20230210.3 → 4.0.0-beta.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.
- package/README.md +39 -65
- package/dist/index.js +846 -577
- package/dist/index.js.map +1 -1
- package/dist-esm/src/client/identityClient.js +11 -2
- package/dist-esm/src/client/identityClient.js.map +1 -1
- package/dist-esm/src/constants.js +2 -0
- package/dist-esm/src/constants.js.map +1 -1
- package/dist-esm/src/credentials/authorityValidationOptions.js.map +1 -1
- package/dist-esm/src/credentials/authorizationCodeCredential.js +6 -6
- package/dist-esm/src/credentials/authorizationCodeCredential.js.map +1 -1
- package/dist-esm/src/credentials/azureCliCredential.js +17 -10
- package/dist-esm/src/credentials/azureCliCredential.js.map +1 -1
- package/dist-esm/src/credentials/azureCliCredentialOptions.js.map +1 -1
- package/dist-esm/src/credentials/azureDeveloperCliCredential.js +52 -18
- package/dist-esm/src/credentials/azureDeveloperCliCredential.js.map +1 -1
- package/dist-esm/src/credentials/azureDeveloperCliCredentialOptions.js.map +1 -1
- package/dist-esm/src/credentials/azurePowerShellCredential.js +27 -13
- package/dist-esm/src/credentials/azurePowerShellCredential.js.map +1 -1
- package/dist-esm/src/credentials/azurePowerShellCredentialOptions.js.map +1 -1
- package/dist-esm/src/credentials/brokerAuthOptions.js +2 -0
- package/dist-esm/src/credentials/brokerAuthOptions.js.map +1 -0
- package/dist-esm/src/credentials/browserCustomizationOptions.js +4 -0
- package/dist-esm/src/credentials/browserCustomizationOptions.js.map +1 -0
- package/dist-esm/src/credentials/chainedTokenCredential.js +8 -4
- package/dist-esm/src/credentials/chainedTokenCredential.js.map +1 -1
- package/dist-esm/src/credentials/clientAssertionCredential.js +6 -6
- package/dist-esm/src/credentials/clientAssertionCredential.js.map +1 -1
- package/dist-esm/src/credentials/clientCertificateCredential.browser.js +1 -1
- package/dist-esm/src/credentials/clientCertificateCredential.browser.js.map +1 -1
- package/dist-esm/src/credentials/clientCertificateCredential.js +6 -6
- package/dist-esm/src/credentials/clientCertificateCredential.js.map +1 -1
- package/dist-esm/src/credentials/clientSecretCredential.browser.js +7 -7
- package/dist-esm/src/credentials/clientSecretCredential.browser.js.map +1 -1
- package/dist-esm/src/credentials/clientSecretCredential.js +8 -8
- package/dist-esm/src/credentials/clientSecretCredential.js.map +1 -1
- package/dist-esm/src/credentials/defaultAzureCredential.js +56 -4
- package/dist-esm/src/credentials/defaultAzureCredential.js.map +1 -1
- package/dist-esm/src/credentials/defaultAzureCredentialOptions.js.map +1 -1
- package/dist-esm/src/credentials/deviceCodeCredential.browser.js +1 -1
- package/dist-esm/src/credentials/deviceCodeCredential.browser.js.map +1 -1
- package/dist-esm/src/credentials/deviceCodeCredential.js +7 -7
- package/dist-esm/src/credentials/deviceCodeCredential.js.map +1 -1
- package/dist-esm/src/credentials/deviceCodeCredentialOptions.js.map +1 -1
- package/dist-esm/src/credentials/environmentCredential.browser.js +1 -1
- package/dist-esm/src/credentials/environmentCredential.browser.js.map +1 -1
- package/dist-esm/src/credentials/environmentCredential.js +3 -3
- package/dist-esm/src/credentials/environmentCredential.js.map +1 -1
- package/dist-esm/src/credentials/environmentCredentialOptions.js.map +1 -1
- package/dist-esm/src/credentials/interactiveBrowserCredential.browser.js +9 -9
- package/dist-esm/src/credentials/interactiveBrowserCredential.browser.js.map +1 -1
- package/dist-esm/src/credentials/interactiveBrowserCredential.js +29 -12
- package/dist-esm/src/credentials/interactiveBrowserCredential.js.map +1 -1
- package/dist-esm/src/credentials/interactiveBrowserCredentialOptions.js.map +1 -1
- package/dist-esm/src/credentials/managedIdentityCredential/appServiceMsi2017.js +1 -0
- package/dist-esm/src/credentials/managedIdentityCredential/appServiceMsi2017.js.map +1 -1
- package/dist-esm/src/credentials/managedIdentityCredential/appServiceMsi2019.js +1 -0
- package/dist-esm/src/credentials/managedIdentityCredential/appServiceMsi2019.js.map +1 -1
- package/dist-esm/src/credentials/managedIdentityCredential/arcMsi.js +1 -0
- package/dist-esm/src/credentials/managedIdentityCredential/arcMsi.js.map +1 -1
- package/dist-esm/src/credentials/managedIdentityCredential/cloudShellMsi.js +1 -0
- package/dist-esm/src/credentials/managedIdentityCredential/cloudShellMsi.js.map +1 -1
- package/dist-esm/src/credentials/managedIdentityCredential/fabricMsi.js +1 -0
- package/dist-esm/src/credentials/managedIdentityCredential/fabricMsi.js.map +1 -1
- package/dist-esm/src/credentials/managedIdentityCredential/imdsMsi.js +15 -4
- package/dist-esm/src/credentials/managedIdentityCredential/imdsMsi.js.map +1 -1
- package/dist-esm/src/credentials/managedIdentityCredential/index.js +65 -31
- package/dist-esm/src/credentials/managedIdentityCredential/index.js.map +1 -1
- package/dist-esm/src/credentials/managedIdentityCredential/models.js.map +1 -1
- package/dist-esm/src/credentials/managedIdentityCredential/tokenExchangeMsi.js +10 -65
- package/dist-esm/src/credentials/managedIdentityCredential/tokenExchangeMsi.js.map +1 -1
- package/dist-esm/src/credentials/managedIdentityCredential/utils.js +1 -1
- package/dist-esm/src/credentials/managedIdentityCredential/utils.js.map +1 -1
- package/dist-esm/src/credentials/onBehalfOfCredential.browser.js +1 -1
- package/dist-esm/src/credentials/onBehalfOfCredential.browser.js.map +1 -1
- package/dist-esm/src/credentials/onBehalfOfCredential.js +5 -5
- package/dist-esm/src/credentials/onBehalfOfCredential.js.map +1 -1
- package/dist-esm/src/credentials/onBehalfOfCredentialOptions.js.map +1 -1
- package/dist-esm/src/credentials/usernamePasswordCredential.browser.js +6 -6
- package/dist-esm/src/credentials/usernamePasswordCredential.browser.js.map +1 -1
- package/dist-esm/src/credentials/usernamePasswordCredential.js +7 -7
- package/dist-esm/src/credentials/usernamePasswordCredential.js.map +1 -1
- package/dist-esm/src/credentials/usernamePasswordCredentialOptions.js.map +1 -1
- package/dist-esm/src/credentials/visualStudioCodeCredential.js +3 -4
- package/dist-esm/src/credentials/visualStudioCodeCredential.js.map +1 -1
- package/dist-esm/src/credentials/workloadIdentityCredential.browser.js +27 -0
- package/dist-esm/src/credentials/workloadIdentityCredential.browser.js.map +1 -0
- package/dist-esm/src/credentials/workloadIdentityCredential.js +104 -0
- package/dist-esm/src/credentials/workloadIdentityCredential.js.map +1 -0
- package/dist-esm/src/credentials/workloadIdentityCredentialOptions.js +4 -0
- package/dist-esm/src/credentials/workloadIdentityCredentialOptions.js.map +1 -0
- package/dist-esm/src/errors.js.map +1 -1
- package/dist-esm/src/index.js +2 -0
- package/dist-esm/src/index.js.map +1 -1
- package/dist-esm/src/msal/browserFlows/msalAuthCode.js +3 -1
- package/dist-esm/src/msal/browserFlows/msalAuthCode.js.map +1 -1
- package/dist-esm/src/msal/browserFlows/msalBrowserCommon.js +2 -2
- package/dist-esm/src/msal/browserFlows/msalBrowserCommon.js.map +1 -1
- package/dist-esm/src/msal/credentials.js.map +1 -1
- package/dist-esm/src/msal/flows.js.map +1 -1
- package/dist-esm/src/msal/nodeFlows/brokerOptions.js +2 -0
- package/dist-esm/src/msal/nodeFlows/brokerOptions.js.map +1 -0
- package/dist-esm/src/msal/nodeFlows/msalAuthorizationCode.js +6 -4
- package/dist-esm/src/msal/nodeFlows/msalAuthorizationCode.js.map +1 -1
- package/dist-esm/src/msal/nodeFlows/msalClientAssertion.js +1 -1
- package/dist-esm/src/msal/nodeFlows/msalClientAssertion.js.map +1 -1
- package/dist-esm/src/msal/nodeFlows/msalClientCertificate.js +1 -1
- package/dist-esm/src/msal/nodeFlows/msalClientCertificate.js.map +1 -1
- package/dist-esm/src/msal/nodeFlows/msalClientSecret.js +1 -1
- package/dist-esm/src/msal/nodeFlows/msalClientSecret.js.map +1 -1
- package/dist-esm/src/msal/nodeFlows/msalDeviceCode.js +1 -1
- package/dist-esm/src/msal/nodeFlows/msalDeviceCode.js.map +1 -1
- package/dist-esm/src/msal/nodeFlows/msalNodeCommon.js +117 -21
- package/dist-esm/src/msal/nodeFlows/msalNodeCommon.js.map +1 -1
- package/dist-esm/src/msal/nodeFlows/msalOnBehalfOf.js +1 -1
- package/dist-esm/src/msal/nodeFlows/msalOnBehalfOf.js.map +1 -1
- package/dist-esm/src/msal/nodeFlows/msalOpenBrowser.js +40 -139
- package/dist-esm/src/msal/nodeFlows/msalOpenBrowser.js.map +1 -1
- package/dist-esm/src/msal/nodeFlows/msalUsernamePassword.js +1 -1
- package/dist-esm/src/msal/nodeFlows/msalUsernamePassword.js.map +1 -1
- package/dist-esm/src/msal/types.js.map +1 -1
- package/dist-esm/src/msal/utils.browser.js +236 -0
- package/dist-esm/src/msal/utils.browser.js.map +1 -0
- package/dist-esm/src/msal/utils.js +8 -5
- package/dist-esm/src/msal/utils.js.map +1 -1
- package/dist-esm/src/plugins/consumer.js +2 -1
- package/dist-esm/src/plugins/consumer.js.map +1 -1
- package/dist-esm/src/plugins/provider.js.map +1 -1
- package/dist-esm/src/tokenCredentialOptions.js.map +1 -1
- package/dist-esm/src/util/processMultiTenantRequest.js +5 -2
- package/dist-esm/src/util/processMultiTenantRequest.js.map +1 -1
- package/dist-esm/src/util/scopeUtils.js +2 -2
- package/dist-esm/src/util/scopeUtils.js.map +1 -1
- package/dist-esm/src/util/tenantIdUtils.js +3 -3
- package/dist-esm/src/util/tenantIdUtils.js.map +1 -1
- package/package.json +24 -22
- package/types/identity.d.ts +297 -67
package/types/identity.d.ts
CHANGED
|
@@ -113,21 +113,25 @@ export declare interface AuthenticationRequiredErrorOptions {
|
|
|
113
113
|
/**
|
|
114
114
|
* Provides options to configure how the Identity library
|
|
115
115
|
* does authority validation during authentication requests
|
|
116
|
-
* to
|
|
116
|
+
* to Microsoft Entra ID.
|
|
117
117
|
*/
|
|
118
118
|
export declare interface AuthorityValidationOptions {
|
|
119
119
|
/**
|
|
120
|
-
*
|
|
120
|
+
* The field determines whether instance discovery is performed when attempting to authenticate.
|
|
121
|
+
* Setting this to `true` will completely disable both instance discovery and authority validation.
|
|
122
|
+
* As a result, it's crucial to ensure that the configured authority host is valid and trustworthy.
|
|
123
|
+
* This functionality is intended for use in scenarios where the metadata endpoint cannot be reached, such as in private clouds or Azure Stack.
|
|
124
|
+
* The process of instance discovery entails retrieving authority metadata from https://login.microsoft.com/ to validate the authority.
|
|
121
125
|
*/
|
|
122
126
|
disableInstanceDiscovery?: boolean;
|
|
123
127
|
}
|
|
124
128
|
|
|
125
129
|
/**
|
|
126
|
-
* Enables authentication to
|
|
130
|
+
* Enables authentication to Microsoft Entra ID using an authorization code
|
|
127
131
|
* that was obtained through the authorization code flow, described in more detail
|
|
128
|
-
* in the
|
|
132
|
+
* in the Microsoft Entra ID documentation:
|
|
129
133
|
*
|
|
130
|
-
* https://
|
|
134
|
+
* https://learn.microsoft.com/azure/active-directory/develop/v2-oauth2-auth-code-flow
|
|
131
135
|
*/
|
|
132
136
|
export declare class AuthorizationCodeCredential implements TokenCredential {
|
|
133
137
|
private msalFlow;
|
|
@@ -139,7 +143,7 @@ export declare class AuthorizationCodeCredential implements TokenCredential {
|
|
|
139
143
|
/**
|
|
140
144
|
* Creates an instance of AuthorizationCodeCredential with the details needed
|
|
141
145
|
* to request an access token using an authentication that was obtained
|
|
142
|
-
* from
|
|
146
|
+
* from Microsoft Entra ID.
|
|
143
147
|
*
|
|
144
148
|
* It is currently necessary for the user of this credential to initiate
|
|
145
149
|
* the authorization code flow to obtain an authorization code to be used
|
|
@@ -147,7 +151,7 @@ export declare class AuthorizationCodeCredential implements TokenCredential {
|
|
|
147
151
|
*
|
|
148
152
|
* https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/samples/v2/manual/authorizationCodeSample.ts
|
|
149
153
|
*
|
|
150
|
-
* @param tenantId - The
|
|
154
|
+
* @param tenantId - The Microsoft Entra tenant (directory) ID or name.
|
|
151
155
|
* 'common' may be used when dealing with multi-tenant scenarios.
|
|
152
156
|
* @param clientId - The client (application) ID of an App Registration in the tenant.
|
|
153
157
|
* @param clientSecret - A client secret that was generated for the App Registration
|
|
@@ -162,7 +166,7 @@ export declare class AuthorizationCodeCredential implements TokenCredential {
|
|
|
162
166
|
/**
|
|
163
167
|
* Creates an instance of AuthorizationCodeCredential with the details needed
|
|
164
168
|
* to request an access token using an authentication that was obtained
|
|
165
|
-
* from
|
|
169
|
+
* from Microsoft Entra ID.
|
|
166
170
|
*
|
|
167
171
|
* It is currently necessary for the user of this credential to initiate
|
|
168
172
|
* the authorization code flow to obtain an authorization code to be used
|
|
@@ -170,7 +174,7 @@ export declare class AuthorizationCodeCredential implements TokenCredential {
|
|
|
170
174
|
*
|
|
171
175
|
* https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/samples/v2/manual/authorizationCodeSample.ts
|
|
172
176
|
*
|
|
173
|
-
* @param tenantId - The
|
|
177
|
+
* @param tenantId - The Microsoft Entra tenant (directory) ID or name.
|
|
174
178
|
* 'common' may be used when dealing with multi-tenant scenarios.
|
|
175
179
|
* @param clientId - The client (application) ID of an App Registration in the tenant.
|
|
176
180
|
* @param authorizationCode - An authorization code that was received from following the
|
|
@@ -182,7 +186,7 @@ export declare class AuthorizationCodeCredential implements TokenCredential {
|
|
|
182
186
|
*/
|
|
183
187
|
constructor(tenantId: string | "common", clientId: string, authorizationCode: string, redirectUri: string, options?: AuthorizationCodeCredentialOptions);
|
|
184
188
|
/**
|
|
185
|
-
* Authenticates with
|
|
189
|
+
* Authenticates with Microsoft Entra ID and returns an access token if successful.
|
|
186
190
|
* If authentication fails, a {@link CredentialUnavailableError} will be thrown with the details of the failure.
|
|
187
191
|
*
|
|
188
192
|
* @param scopes - The list of scopes for which the token will have access.
|
|
@@ -229,6 +233,7 @@ export declare enum AzureAuthorityHosts {
|
|
|
229
233
|
export declare class AzureCliCredential implements TokenCredential {
|
|
230
234
|
private tenantId?;
|
|
231
235
|
private additionallyAllowedTenantIds;
|
|
236
|
+
private timeout?;
|
|
232
237
|
/**
|
|
233
238
|
* Creates an instance of the {@link AzureCliCredential}.
|
|
234
239
|
*
|
|
@@ -239,7 +244,7 @@ export declare class AzureCliCredential implements TokenCredential {
|
|
|
239
244
|
*/
|
|
240
245
|
constructor(options?: AzureCliCredentialOptions);
|
|
241
246
|
/**
|
|
242
|
-
* Authenticates with
|
|
247
|
+
* Authenticates with Microsoft Entra ID and returns an access token if successful.
|
|
243
248
|
* If authentication fails, a {@link CredentialUnavailableError} will be thrown with the details of the failure.
|
|
244
249
|
*
|
|
245
250
|
* @param scopes - The list of scopes for which the token will have access.
|
|
@@ -257,6 +262,73 @@ export declare interface AzureCliCredentialOptions extends MultiTenantTokenCrede
|
|
|
257
262
|
* Allows specifying a tenant ID
|
|
258
263
|
*/
|
|
259
264
|
tenantId?: string;
|
|
265
|
+
/**
|
|
266
|
+
* Process timeout configurable for making token requests, provided in milliseconds
|
|
267
|
+
*/
|
|
268
|
+
processTimeoutInMs?: number;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* Azure Developer CLI is a command-line interface tool that allows developers to create, manage, and deploy
|
|
273
|
+
* resources in Azure. It's built on top of the Azure CLI and provides additional functionality specific
|
|
274
|
+
* to Azure developers. It allows users to authenticate as a user and/or a service principal against
|
|
275
|
+
* <a href="https://learn.microsoft.com/azure/active-directory/fundamentals/">Microsoft Entra ID</a>. The
|
|
276
|
+
* AzureDeveloperCliCredential authenticates in a development environment and acquires a token on behalf of
|
|
277
|
+
* the logged-in user or service principal in the Azure Developer CLI. It acts as the Azure Developer CLI logged in user or
|
|
278
|
+
* service principal and executes an Azure CLI command underneath to authenticate the application against
|
|
279
|
+
* Microsoft Entra ID.
|
|
280
|
+
*
|
|
281
|
+
* <h2> Configure AzureDeveloperCliCredential </h2>
|
|
282
|
+
*
|
|
283
|
+
* To use this credential, the developer needs to authenticate locally in Azure Developer CLI using one of the
|
|
284
|
+
* commands below:
|
|
285
|
+
*
|
|
286
|
+
* <ol>
|
|
287
|
+
* <li>Run "azd auth login" in Azure Developer CLI to authenticate interactively as a user.</li>
|
|
288
|
+
* <li>Run "azd auth login --client-id clientID --client-secret clientSecret
|
|
289
|
+
* --tenant-id tenantID" to authenticate as a service principal.</li>
|
|
290
|
+
* </ol>
|
|
291
|
+
*
|
|
292
|
+
* You may need to repeat this process after a certain time period, depending on the refresh token validity in your
|
|
293
|
+
* organization. Generally, the refresh token validity period is a few weeks to a few months.
|
|
294
|
+
* AzureDeveloperCliCredential will prompt you to sign in again.
|
|
295
|
+
*/
|
|
296
|
+
export declare class AzureDeveloperCliCredential implements TokenCredential {
|
|
297
|
+
private tenantId?;
|
|
298
|
+
private additionallyAllowedTenantIds;
|
|
299
|
+
private timeout?;
|
|
300
|
+
/**
|
|
301
|
+
* Creates an instance of the {@link AzureDeveloperCliCredential}.
|
|
302
|
+
*
|
|
303
|
+
* To use this credential, ensure that you have already logged
|
|
304
|
+
* in via the 'azd' tool using the command "azd auth login" from the commandline.
|
|
305
|
+
*
|
|
306
|
+
* @param options - Options, to optionally allow multi-tenant requests.
|
|
307
|
+
*/
|
|
308
|
+
constructor(options?: AzureDeveloperCliCredentialOptions);
|
|
309
|
+
/**
|
|
310
|
+
* Authenticates with Microsoft Entra ID and returns an access token if successful.
|
|
311
|
+
* If authentication fails, a {@link CredentialUnavailableError} will be thrown with the details of the failure.
|
|
312
|
+
*
|
|
313
|
+
* @param scopes - The list of scopes for which the token will have access.
|
|
314
|
+
* @param options - The options used to configure any requests this
|
|
315
|
+
* TokenCredential implementation might make.
|
|
316
|
+
*/
|
|
317
|
+
getToken(scopes: string | string[], options?: GetTokenOptions): Promise<AccessToken>;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Options for the {@link AzureDeveloperCliCredential}
|
|
322
|
+
*/
|
|
323
|
+
export declare interface AzureDeveloperCliCredentialOptions extends MultiTenantTokenCredentialOptions {
|
|
324
|
+
/**
|
|
325
|
+
* Allows specifying a tenant ID
|
|
326
|
+
*/
|
|
327
|
+
tenantId?: string;
|
|
328
|
+
/**
|
|
329
|
+
* Process timeout configurable for making token requests, provided in milliseconds
|
|
330
|
+
*/
|
|
331
|
+
processTimeoutInMs?: number;
|
|
260
332
|
}
|
|
261
333
|
|
|
262
334
|
/**
|
|
@@ -267,6 +339,7 @@ export declare interface AzureCliCredentialOptions extends MultiTenantTokenCrede
|
|
|
267
339
|
export declare class AzurePowerShellCredential implements TokenCredential {
|
|
268
340
|
private tenantId?;
|
|
269
341
|
private additionallyAllowedTenantIds;
|
|
342
|
+
private timeout?;
|
|
270
343
|
/**
|
|
271
344
|
* Creates an instance of the {@link AzurePowerShellCredential}.
|
|
272
345
|
*
|
|
@@ -285,7 +358,7 @@ export declare class AzurePowerShellCredential implements TokenCredential {
|
|
|
285
358
|
*/
|
|
286
359
|
private getAzurePowerShellAccessToken;
|
|
287
360
|
/**
|
|
288
|
-
* Authenticates with
|
|
361
|
+
* Authenticates with Microsoft Entra ID and returns an access token if successful.
|
|
289
362
|
* If the authentication cannot be performed through PowerShell, a {@link CredentialUnavailableError} will be thrown.
|
|
290
363
|
*
|
|
291
364
|
* @param scopes - The list of scopes for which the token will have access.
|
|
@@ -302,6 +375,82 @@ export declare interface AzurePowerShellCredentialOptions extends MultiTenantTok
|
|
|
302
375
|
* Allows specifying a tenant ID
|
|
303
376
|
*/
|
|
304
377
|
tenantId?: string;
|
|
378
|
+
/**
|
|
379
|
+
* Process timeout configurable for making token requests, provided in milliseconds
|
|
380
|
+
*/
|
|
381
|
+
processTimeoutInMs?: number;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* Configuration options for InteractiveBrowserCredential
|
|
386
|
+
* to support WAM Broker Authentication.
|
|
387
|
+
*/
|
|
388
|
+
export declare interface BrokerAuthOptions {
|
|
389
|
+
/**
|
|
390
|
+
* Options to allow broker authentication when using InteractiveBrowserCredential
|
|
391
|
+
*
|
|
392
|
+
*/
|
|
393
|
+
brokerOptions: BrokerOptions;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
/**
|
|
397
|
+
* Parameters when WAM broker authentication is disabled.
|
|
398
|
+
*/
|
|
399
|
+
export declare interface BrokerDisabledOptions {
|
|
400
|
+
/**
|
|
401
|
+
* If set to true, broker will be enabled for WAM support on Windows
|
|
402
|
+
*/
|
|
403
|
+
enabled: false;
|
|
404
|
+
/**
|
|
405
|
+
* If set to true, MSA account will be passed through, required for WAM authentication.
|
|
406
|
+
*/
|
|
407
|
+
legacyEnableMsaPassthrough?: undefined;
|
|
408
|
+
/**
|
|
409
|
+
* Window handle for parent window, required for WAM authentication
|
|
410
|
+
*/
|
|
411
|
+
parentWindowHandle: undefined;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
/**
|
|
415
|
+
* Parameters when WAM broker authentication is enabled.
|
|
416
|
+
*/
|
|
417
|
+
export declare interface BrokerEnabledOptions {
|
|
418
|
+
/**
|
|
419
|
+
* If set to true, broker will be enabled for WAM support on Windows
|
|
420
|
+
*/
|
|
421
|
+
enabled: true;
|
|
422
|
+
/**
|
|
423
|
+
* If set to true, MSA account will be passed through, required for WAM authentication.
|
|
424
|
+
*/
|
|
425
|
+
legacyEnableMsaPassthrough?: boolean;
|
|
426
|
+
/**
|
|
427
|
+
* Window handle for parent window, required for WAM authentication
|
|
428
|
+
*/
|
|
429
|
+
parentWindowHandle: Uint8Array;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
/**
|
|
433
|
+
* Parameters that enable WAM broker authentication in the InteractiveBrowserCredential.
|
|
434
|
+
*/
|
|
435
|
+
export declare type BrokerOptions = BrokerEnabledOptions | BrokerDisabledOptions;
|
|
436
|
+
|
|
437
|
+
/**
|
|
438
|
+
* Shared configuration options for browser customization
|
|
439
|
+
*/
|
|
440
|
+
export declare interface BrowserCustomizationOptions {
|
|
441
|
+
/**
|
|
442
|
+
* Shared configuration options for browser customization
|
|
443
|
+
*/
|
|
444
|
+
browserCustomizationOptions?: {
|
|
445
|
+
/**
|
|
446
|
+
* Format for error messages for display in browser
|
|
447
|
+
*/
|
|
448
|
+
errorMessage: string;
|
|
449
|
+
/**
|
|
450
|
+
* Format for success messages for display in browser
|
|
451
|
+
*/
|
|
452
|
+
successMessage: string;
|
|
453
|
+
};
|
|
305
454
|
}
|
|
306
455
|
|
|
307
456
|
/**
|
|
@@ -348,6 +497,7 @@ export declare class ChainedTokenCredential implements TokenCredential {
|
|
|
348
497
|
* `TokenCredential` implementation might make.
|
|
349
498
|
*/
|
|
350
499
|
getToken(scopes: string | string[], options?: GetTokenOptions): Promise<AccessToken>;
|
|
500
|
+
private getTokenInternal;
|
|
351
501
|
}
|
|
352
502
|
|
|
353
503
|
/**
|
|
@@ -361,17 +511,17 @@ export declare class ClientAssertionCredential implements TokenCredential {
|
|
|
361
511
|
private options;
|
|
362
512
|
/**
|
|
363
513
|
* Creates an instance of the ClientAssertionCredential with the details
|
|
364
|
-
* needed to authenticate against
|
|
514
|
+
* needed to authenticate against Microsoft Entra ID with a client
|
|
365
515
|
* assertion provided by the developer through the `getAssertion` function parameter.
|
|
366
516
|
*
|
|
367
|
-
* @param tenantId - The
|
|
517
|
+
* @param tenantId - The Microsoft Entra tenant (directory) ID.
|
|
368
518
|
* @param clientId - The client (application) ID of an App Registration in the tenant.
|
|
369
519
|
* @param getAssertion - A function that retrieves the assertion for the credential to use.
|
|
370
520
|
* @param options - Options for configuring the client which makes the authentication request.
|
|
371
521
|
*/
|
|
372
522
|
constructor(tenantId: string, clientId: string, getAssertion: () => Promise<string>, options?: ClientAssertionCredentialOptions);
|
|
373
523
|
/**
|
|
374
|
-
* Authenticates with
|
|
524
|
+
* Authenticates with Microsoft Entra ID and returns an access token if successful.
|
|
375
525
|
* If authentication fails, a {@link CredentialUnavailableError} will be thrown with the details of the failure.
|
|
376
526
|
*
|
|
377
527
|
* @param scopes - The list of scopes for which the token will have access.
|
|
@@ -388,11 +538,11 @@ export declare interface ClientAssertionCredentialOptions extends MultiTenantTok
|
|
|
388
538
|
}
|
|
389
539
|
|
|
390
540
|
/**
|
|
391
|
-
* Enables authentication to
|
|
541
|
+
* Enables authentication to Microsoft Entra ID using a PEM-encoded
|
|
392
542
|
* certificate that is assigned to an App Registration. More information
|
|
393
543
|
* on how to configure certificate authentication can be found here:
|
|
394
544
|
*
|
|
395
|
-
* https://
|
|
545
|
+
* https://learn.microsoft.com/en-us/azure/active-directory/develop/active-directory-certificate-credentials#register-your-certificate-with-azure-ad
|
|
396
546
|
*
|
|
397
547
|
*/
|
|
398
548
|
export declare class ClientCertificateCredential implements TokenCredential {
|
|
@@ -401,9 +551,9 @@ export declare class ClientCertificateCredential implements TokenCredential {
|
|
|
401
551
|
private msalFlow;
|
|
402
552
|
/**
|
|
403
553
|
* Creates an instance of the ClientCertificateCredential with the details
|
|
404
|
-
* needed to authenticate against
|
|
554
|
+
* needed to authenticate against Microsoft Entra ID with a certificate.
|
|
405
555
|
*
|
|
406
|
-
* @param tenantId - The
|
|
556
|
+
* @param tenantId - The Microsoft Entra tenant (directory) ID.
|
|
407
557
|
* @param clientId - The client (application) ID of an App Registration in the tenant.
|
|
408
558
|
* @param certificatePath - The path to a PEM-encoded public/private key certificate on the filesystem.
|
|
409
559
|
* @param options - Options for configuring the client which makes the authentication request.
|
|
@@ -411,9 +561,9 @@ export declare class ClientCertificateCredential implements TokenCredential {
|
|
|
411
561
|
constructor(tenantId: string, clientId: string, certificatePath: string, options?: ClientCertificateCredentialOptions);
|
|
412
562
|
/**
|
|
413
563
|
* Creates an instance of the ClientCertificateCredential with the details
|
|
414
|
-
* needed to authenticate against
|
|
564
|
+
* needed to authenticate against Microsoft Entra ID with a certificate.
|
|
415
565
|
*
|
|
416
|
-
* @param tenantId - The
|
|
566
|
+
* @param tenantId - The Microsoft Entra tenant (directory) ID.
|
|
417
567
|
* @param clientId - The client (application) ID of an App Registration in the tenant.
|
|
418
568
|
* @param configuration - Other parameters required, including the path of the certificate on the filesystem.
|
|
419
569
|
* If the type is ignored, we will throw the value of the path to a PEM certificate.
|
|
@@ -422,9 +572,9 @@ export declare class ClientCertificateCredential implements TokenCredential {
|
|
|
422
572
|
constructor(tenantId: string, clientId: string, configuration: ClientCertificatePEMCertificatePath, options?: ClientCertificateCredentialOptions);
|
|
423
573
|
/**
|
|
424
574
|
* Creates an instance of the ClientCertificateCredential with the details
|
|
425
|
-
* needed to authenticate against
|
|
575
|
+
* needed to authenticate against Microsoft Entra ID with a certificate.
|
|
426
576
|
*
|
|
427
|
-
* @param tenantId - The
|
|
577
|
+
* @param tenantId - The Microsoft Entra tenant (directory) ID.
|
|
428
578
|
* @param clientId - The client (application) ID of an App Registration in the tenant.
|
|
429
579
|
* @param configuration - Other parameters required, including the PEM-encoded certificate as a string.
|
|
430
580
|
* If the type is ignored, we will throw the value of the PEM-encoded certificate.
|
|
@@ -432,7 +582,7 @@ export declare class ClientCertificateCredential implements TokenCredential {
|
|
|
432
582
|
*/
|
|
433
583
|
constructor(tenantId: string, clientId: string, configuration: ClientCertificatePEMCertificate, options?: ClientCertificateCredentialOptions);
|
|
434
584
|
/**
|
|
435
|
-
* Authenticates with
|
|
585
|
+
* Authenticates with Microsoft Entra ID and returns an access token if successful.
|
|
436
586
|
* If authentication fails, a {@link CredentialUnavailableError} will be thrown with the details of the failure.
|
|
437
587
|
*
|
|
438
588
|
* @param scopes - The list of scopes for which the token will have access.
|
|
@@ -487,11 +637,11 @@ export declare interface ClientCertificatePEMCertificatePath {
|
|
|
487
637
|
}
|
|
488
638
|
|
|
489
639
|
/**
|
|
490
|
-
* Enables authentication to
|
|
640
|
+
* Enables authentication to Microsoft Entra ID using a client secret
|
|
491
641
|
* that was generated for an App Registration. More information on how
|
|
492
642
|
* to configure a client secret can be found here:
|
|
493
643
|
*
|
|
494
|
-
* https://
|
|
644
|
+
* https://learn.microsoft.com/azure/active-directory/develop/quickstart-configure-app-access-web-apis#add-credentials-to-your-web-application
|
|
495
645
|
*
|
|
496
646
|
*/
|
|
497
647
|
export declare class ClientSecretCredential implements TokenCredential {
|
|
@@ -500,17 +650,17 @@ export declare class ClientSecretCredential implements TokenCredential {
|
|
|
500
650
|
private msalFlow;
|
|
501
651
|
/**
|
|
502
652
|
* Creates an instance of the ClientSecretCredential with the details
|
|
503
|
-
* needed to authenticate against
|
|
653
|
+
* needed to authenticate against Microsoft Entra ID with a client
|
|
504
654
|
* secret.
|
|
505
655
|
*
|
|
506
|
-
* @param tenantId - The
|
|
656
|
+
* @param tenantId - The Microsoft Entra tenant (directory) ID.
|
|
507
657
|
* @param clientId - The client (application) ID of an App Registration in the tenant.
|
|
508
658
|
* @param clientSecret - A client secret that was generated for the App Registration.
|
|
509
659
|
* @param options - Options for configuring the client which makes the authentication request.
|
|
510
660
|
*/
|
|
511
661
|
constructor(tenantId: string, clientId: string, clientSecret: string, options?: ClientSecretCredentialOptions);
|
|
512
662
|
/**
|
|
513
|
-
* Authenticates with
|
|
663
|
+
* Authenticates with Microsoft Entra ID and returns an access token if successful.
|
|
514
664
|
* If authentication fails, a {@link CredentialUnavailableError} will be thrown with the details of the failure.
|
|
515
665
|
*
|
|
516
666
|
* @param scopes - The list of scopes for which the token will have access.
|
|
@@ -591,10 +741,11 @@ export declare class DefaultAzureCredential extends ChainedTokenCredential {
|
|
|
591
741
|
* The following credential types will be tried, in order:
|
|
592
742
|
*
|
|
593
743
|
* - {@link EnvironmentCredential}
|
|
744
|
+
* - {@link WorkloadIdentityCredential}
|
|
594
745
|
* - {@link ManagedIdentityCredential}
|
|
595
|
-
* - {@link AzureDeveloperCliCredential}
|
|
596
746
|
* - {@link AzureCliCredential}
|
|
597
747
|
* - {@link AzurePowerShellCredential}
|
|
748
|
+
* - {@link AzureDeveloperCliCredential}
|
|
598
749
|
*
|
|
599
750
|
* Consult the documentation of these credential types for more information
|
|
600
751
|
* on how they attempt authentication.
|
|
@@ -611,10 +762,11 @@ export declare class DefaultAzureCredential extends ChainedTokenCredential {
|
|
|
611
762
|
* The following credential types will be tried, in order:
|
|
612
763
|
*
|
|
613
764
|
* - {@link EnvironmentCredential}
|
|
765
|
+
* - {@link WorkloadIdentityCredential}
|
|
614
766
|
* - {@link ManagedIdentityCredential}
|
|
615
|
-
* - {@link AzureDeveloperCliCredential}
|
|
616
767
|
* - {@link AzureCliCredential}
|
|
617
768
|
* - {@link AzurePowerShellCredential}
|
|
769
|
+
* - {@link AzureDeveloperCliCredential}
|
|
618
770
|
*
|
|
619
771
|
* Consult the documentation of these credential types for more information
|
|
620
772
|
* on how they attempt authentication.
|
|
@@ -631,10 +783,11 @@ export declare class DefaultAzureCredential extends ChainedTokenCredential {
|
|
|
631
783
|
* The following credential types will be tried, in order:
|
|
632
784
|
*
|
|
633
785
|
* - {@link EnvironmentCredential}
|
|
786
|
+
* - {@link WorkloadIdentityCredential}
|
|
634
787
|
* - {@link ManagedIdentityCredential}
|
|
635
|
-
* - {@link AzureDeveloperCliCredential}
|
|
636
788
|
* - {@link AzureCliCredential}
|
|
637
789
|
* - {@link AzurePowerShellCredential}
|
|
790
|
+
* - {@link AzureDeveloperCliCredential}
|
|
638
791
|
*
|
|
639
792
|
* Consult the documentation of these credential types for more information
|
|
640
793
|
* on how they attempt authentication.
|
|
@@ -654,6 +807,11 @@ export declare interface DefaultAzureCredentialClientIdOptions extends DefaultAz
|
|
|
654
807
|
* This client ID can also be passed through to the {@link ManagedIdentityCredential} through the environment variable: AZURE_CLIENT_ID.
|
|
655
808
|
*/
|
|
656
809
|
managedIdentityClientId?: string;
|
|
810
|
+
/**
|
|
811
|
+
* Optionally pass in a user assigned client ID to be used by the {@link WorkloadIdentityCredential}.
|
|
812
|
+
* This client ID can also be passed through to the {@link WorkloadIdentityCredential} through the environment variable: AZURE_CLIENT_ID.
|
|
813
|
+
*/
|
|
814
|
+
workloadIdentityClientId?: string;
|
|
657
815
|
}
|
|
658
816
|
|
|
659
817
|
/**
|
|
@@ -665,6 +823,12 @@ export declare interface DefaultAzureCredentialOptions extends MultiTenantTokenC
|
|
|
665
823
|
* By default it may use a generic tenant ID depending on the underlying credential.
|
|
666
824
|
*/
|
|
667
825
|
tenantId?: string;
|
|
826
|
+
/**
|
|
827
|
+
* Timeout configurable for making token requests for developer credentials, namely, {@link AzurePowershellCredential},
|
|
828
|
+
* {@link AzureDeveloperCliCredential} and {@link AzureCliCredential}.
|
|
829
|
+
* Process timeout for credentials should be provided in milliseconds.
|
|
830
|
+
*/
|
|
831
|
+
processTimeoutInMs?: number;
|
|
668
832
|
}
|
|
669
833
|
|
|
670
834
|
/**
|
|
@@ -704,7 +868,7 @@ export declare interface DefaultAzureCredentialResourceIdOptions extends Default
|
|
|
704
868
|
export declare function deserializeAuthenticationRecord(serializedRecord: string): AuthenticationRecord;
|
|
705
869
|
|
|
706
870
|
/**
|
|
707
|
-
* Enables authentication to
|
|
871
|
+
* Enables authentication to Microsoft Entra ID using a device code
|
|
708
872
|
* that the user can enter into https://microsoft.com/devicelogin.
|
|
709
873
|
*/
|
|
710
874
|
export declare class DeviceCodeCredential implements TokenCredential {
|
|
@@ -714,7 +878,7 @@ export declare class DeviceCodeCredential implements TokenCredential {
|
|
|
714
878
|
private disableAutomaticAuthentication?;
|
|
715
879
|
/**
|
|
716
880
|
* Creates an instance of DeviceCodeCredential with the details needed
|
|
717
|
-
* to initiate the device code authorization flow with
|
|
881
|
+
* to initiate the device code authorization flow with Microsoft Entra ID.
|
|
718
882
|
*
|
|
719
883
|
* A message will be logged, giving users a code that they can use to authenticate once they go to https://microsoft.com/devicelogin
|
|
720
884
|
*
|
|
@@ -734,7 +898,7 @@ export declare class DeviceCodeCredential implements TokenCredential {
|
|
|
734
898
|
*/
|
|
735
899
|
constructor(options?: DeviceCodeCredentialOptions);
|
|
736
900
|
/**
|
|
737
|
-
* Authenticates with
|
|
901
|
+
* Authenticates with Microsoft Entra ID and returns an access token if successful.
|
|
738
902
|
* If authentication fails, a {@link CredentialUnavailableError} will be thrown with the details of the failure.
|
|
739
903
|
*
|
|
740
904
|
* If the user provided the option `disableAutomaticAuthentication`,
|
|
@@ -747,7 +911,7 @@ export declare class DeviceCodeCredential implements TokenCredential {
|
|
|
747
911
|
*/
|
|
748
912
|
getToken(scopes: string | string[], options?: GetTokenOptions): Promise<AccessToken>;
|
|
749
913
|
/**
|
|
750
|
-
* Authenticates with
|
|
914
|
+
* Authenticates with Microsoft Entra ID and returns an access token if successful.
|
|
751
915
|
* If authentication fails, a {@link CredentialUnavailableError} will be thrown with the details of the failure.
|
|
752
916
|
*
|
|
753
917
|
* If the token can't be retrieved silently, this method will require user interaction to retrieve the token.
|
|
@@ -764,7 +928,7 @@ export declare class DeviceCodeCredential implements TokenCredential {
|
|
|
764
928
|
*/
|
|
765
929
|
export declare interface DeviceCodeCredentialOptions extends InteractiveCredentialOptions, CredentialPersistenceOptions {
|
|
766
930
|
/**
|
|
767
|
-
* The
|
|
931
|
+
* The Microsoft Entra tenant (directory) ID.
|
|
768
932
|
*/
|
|
769
933
|
tenantId?: string;
|
|
770
934
|
/**
|
|
@@ -809,7 +973,7 @@ export declare interface DeviceCodeInfo {
|
|
|
809
973
|
export declare type DeviceCodePromptCallback = (deviceCodeInfo: DeviceCodeInfo) => void;
|
|
810
974
|
|
|
811
975
|
/**
|
|
812
|
-
* Enables authentication to
|
|
976
|
+
* Enables authentication to Microsoft Entra ID using a client secret or certificate, or as a user
|
|
813
977
|
* with a username and password.
|
|
814
978
|
*/
|
|
815
979
|
export declare class EnvironmentCredential implements TokenCredential {
|
|
@@ -818,7 +982,7 @@ export declare class EnvironmentCredential implements TokenCredential {
|
|
|
818
982
|
* Creates an instance of the EnvironmentCredential class and decides what credential to use depending on the available environment variables.
|
|
819
983
|
*
|
|
820
984
|
* Required environment variables:
|
|
821
|
-
* - `AZURE_TENANT_ID`: The
|
|
985
|
+
* - `AZURE_TENANT_ID`: The Microsoft Entra tenant (directory) ID.
|
|
822
986
|
* - `AZURE_CLIENT_ID`: The client (application) ID of an App Registration in the tenant.
|
|
823
987
|
*
|
|
824
988
|
* If setting the AZURE_TENANT_ID, then you can also set the additionally allowed tenants
|
|
@@ -840,7 +1004,7 @@ export declare class EnvironmentCredential implements TokenCredential {
|
|
|
840
1004
|
*/
|
|
841
1005
|
constructor(options?: EnvironmentCredentialOptions);
|
|
842
1006
|
/**
|
|
843
|
-
* Authenticates with
|
|
1007
|
+
* Authenticates with Microsoft Entra ID and returns an access token if successful.
|
|
844
1008
|
*
|
|
845
1009
|
* @param scopes - The list of scopes for which the token will have access.
|
|
846
1010
|
* @param options - Optional parameters. See {@link GetTokenOptions}.
|
|
@@ -849,7 +1013,7 @@ export declare class EnvironmentCredential implements TokenCredential {
|
|
|
849
1013
|
}
|
|
850
1014
|
|
|
851
1015
|
/**
|
|
852
|
-
* Enables authentication to
|
|
1016
|
+
* Enables authentication to Microsoft Entra ID depending on the available environment variables.
|
|
853
1017
|
* Defines options for the EnvironmentCredential class.
|
|
854
1018
|
*/
|
|
855
1019
|
export declare interface EnvironmentCredentialOptions extends MultiTenantTokenCredentialOptions, AuthorityValidationOptions {
|
|
@@ -858,7 +1022,7 @@ export declare interface EnvironmentCredentialOptions extends MultiTenantTokenCr
|
|
|
858
1022
|
/**
|
|
859
1023
|
* See the official documentation for more details:
|
|
860
1024
|
*
|
|
861
|
-
* https://
|
|
1025
|
+
* https://learn.microsoft.com/en-us/azure/active-directory/develop/v1-protocols-oauth-code#error-response-1
|
|
862
1026
|
*
|
|
863
1027
|
* NOTE: This documentation is for v1 OAuth support but the same error
|
|
864
1028
|
* response details still apply to v2.
|
|
@@ -904,7 +1068,7 @@ export { GetTokenOptions }
|
|
|
904
1068
|
export declare type IdentityPlugin = (context: unknown) => void;
|
|
905
1069
|
|
|
906
1070
|
/**
|
|
907
|
-
* Enables authentication to
|
|
1071
|
+
* Enables authentication to Microsoft Entra ID inside of the web browser
|
|
908
1072
|
* using the interactive login flow.
|
|
909
1073
|
*/
|
|
910
1074
|
export declare class InteractiveBrowserCredential implements TokenCredential {
|
|
@@ -915,18 +1079,18 @@ export declare class InteractiveBrowserCredential implements TokenCredential {
|
|
|
915
1079
|
/**
|
|
916
1080
|
* Creates an instance of InteractiveBrowserCredential with the details needed.
|
|
917
1081
|
*
|
|
918
|
-
* This credential uses the [Authorization Code Flow](https://
|
|
1082
|
+
* This credential uses the [Authorization Code Flow](https://learn.microsoft.com/azure/active-directory/develop/v2-oauth2-auth-code-flow).
|
|
919
1083
|
* On Node.js, it will open a browser window while it listens for a redirect response from the authentication service.
|
|
920
1084
|
* 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.
|
|
921
1085
|
*
|
|
922
|
-
* For Node.js, if a `clientId` is provided, the
|
|
923
|
-
* Follow our guide on [setting up Redirect URIs for Desktop apps that calls to web APIs](https://
|
|
1086
|
+
* For Node.js, if a `clientId` is provided, the Microsoft Entra application will need to be configured to have a "Mobile and desktop applications" redirect endpoint.
|
|
1087
|
+
* Follow our guide on [setting up Redirect URIs for Desktop apps that calls to web APIs](https://learn.microsoft.com/azure/active-directory/develop/scenario-desktop-app-registration#redirect-uris).
|
|
924
1088
|
*
|
|
925
1089
|
* @param options - Options for configuring the client which makes the authentication requests.
|
|
926
1090
|
*/
|
|
927
|
-
constructor(options
|
|
1091
|
+
constructor(options: InteractiveBrowserCredentialNodeOptions | InteractiveBrowserCredentialInBrowserOptions);
|
|
928
1092
|
/**
|
|
929
|
-
* Authenticates with
|
|
1093
|
+
* Authenticates with Microsoft Entra ID and returns an access token if successful.
|
|
930
1094
|
* If authentication fails, a {@link CredentialUnavailableError} will be thrown with the details of the failure.
|
|
931
1095
|
*
|
|
932
1096
|
* If the user provided the option `disableAutomaticAuthentication`,
|
|
@@ -939,7 +1103,7 @@ export declare class InteractiveBrowserCredential implements TokenCredential {
|
|
|
939
1103
|
*/
|
|
940
1104
|
getToken(scopes: string | string[], options?: GetTokenOptions): Promise<AccessToken>;
|
|
941
1105
|
/**
|
|
942
|
-
* Authenticates with
|
|
1106
|
+
* Authenticates with Microsoft Entra ID and returns an access token if successful.
|
|
943
1107
|
* If authentication fails, a {@link CredentialUnavailableError} will be thrown with the details of the failure.
|
|
944
1108
|
*
|
|
945
1109
|
* If the token can't be retrieved silently, this method will require user interaction to retrieve the token.
|
|
@@ -961,10 +1125,11 @@ export declare interface InteractiveBrowserCredentialInBrowserOptions extends In
|
|
|
961
1125
|
/**
|
|
962
1126
|
* Gets the redirect URI of the application. This should be same as the value
|
|
963
1127
|
* in the application registration portal. Defaults to `window.location.href`.
|
|
1128
|
+
* This field is no longer required for Node.js.
|
|
964
1129
|
*/
|
|
965
1130
|
redirectUri?: string | (() => string);
|
|
966
1131
|
/**
|
|
967
|
-
* The
|
|
1132
|
+
* The Microsoft Entra tenant (directory) ID.
|
|
968
1133
|
*/
|
|
969
1134
|
tenantId?: string;
|
|
970
1135
|
/**
|
|
@@ -989,14 +1154,15 @@ export declare interface InteractiveBrowserCredentialInBrowserOptions extends In
|
|
|
989
1154
|
/**
|
|
990
1155
|
* Defines the common options for the InteractiveBrowserCredential class.
|
|
991
1156
|
*/
|
|
992
|
-
export declare interface InteractiveBrowserCredentialNodeOptions extends InteractiveCredentialOptions, CredentialPersistenceOptions,
|
|
1157
|
+
export declare interface InteractiveBrowserCredentialNodeOptions extends InteractiveCredentialOptions, CredentialPersistenceOptions, BrowserCustomizationOptions, BrokerAuthOptions {
|
|
993
1158
|
/**
|
|
994
1159
|
* Gets the redirect URI of the application. This should be same as the value
|
|
995
1160
|
* in the application registration portal. Defaults to `window.location.href`.
|
|
1161
|
+
* This field is no longer required for Node.js.
|
|
996
1162
|
*/
|
|
997
1163
|
redirectUri?: string | (() => string);
|
|
998
1164
|
/**
|
|
999
|
-
* The
|
|
1165
|
+
* The Microsoft Entra tenant (directory) ID.
|
|
1000
1166
|
*/
|
|
1001
1167
|
tenantId?: string;
|
|
1002
1168
|
/**
|
|
@@ -1043,7 +1209,7 @@ export declare const logger: AzureLogger;
|
|
|
1043
1209
|
* Azure Kubernetes Services, Azure Service Fabric instances and inside of the Azure Cloud Shell.
|
|
1044
1210
|
*
|
|
1045
1211
|
* More information about configuring managed identities can be found here:
|
|
1046
|
-
* https://
|
|
1212
|
+
* https://learn.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/overview
|
|
1047
1213
|
*/
|
|
1048
1214
|
export declare class ManagedIdentityCredential implements TokenCredential {
|
|
1049
1215
|
private identityClient;
|
|
@@ -1052,6 +1218,7 @@ export declare class ManagedIdentityCredential implements TokenCredential {
|
|
|
1052
1218
|
private isEndpointUnavailable;
|
|
1053
1219
|
private isAvailableIdentityClient;
|
|
1054
1220
|
private confidentialApp;
|
|
1221
|
+
private isAppTokenProviderInitialized;
|
|
1055
1222
|
/**
|
|
1056
1223
|
* Creates an instance of ManagedIdentityCredential with the client ID of a
|
|
1057
1224
|
* user-assigned identity, or app registration (when working with AKS pod-identity).
|
|
@@ -1076,7 +1243,7 @@ export declare class ManagedIdentityCredential implements TokenCredential {
|
|
|
1076
1243
|
private cachedAvailableMSI;
|
|
1077
1244
|
private authenticateManagedIdentity;
|
|
1078
1245
|
/**
|
|
1079
|
-
* Authenticates with
|
|
1246
|
+
* Authenticates with Microsoft Entra ID and returns an access token if successful.
|
|
1080
1247
|
* If authentication fails, a {@link CredentialUnavailableError} will be thrown with the details of the failure.
|
|
1081
1248
|
* If an unexpected error occurs, an {@link AuthenticationError} will be thrown with the details of the failure.
|
|
1082
1249
|
*
|
|
@@ -1092,6 +1259,7 @@ export declare class ManagedIdentityCredential implements TokenCredential {
|
|
|
1092
1259
|
*/
|
|
1093
1260
|
private handleResult;
|
|
1094
1261
|
/* Excluded from this release type: ensureValidMsalToken */
|
|
1262
|
+
private initializeSetAppTokenProvider;
|
|
1095
1263
|
}
|
|
1096
1264
|
|
|
1097
1265
|
/**
|
|
@@ -1132,7 +1300,7 @@ export declare interface MultiTenantTokenCredentialOptions extends TokenCredenti
|
|
|
1132
1300
|
}
|
|
1133
1301
|
|
|
1134
1302
|
/**
|
|
1135
|
-
* Enables authentication to
|
|
1303
|
+
* Enables authentication to Microsoft Entra ID using the [On Behalf Of flow](https://learn.microsoft.com/azure/active-directory/develop/v2-oauth2-on-behalf-of-flow).
|
|
1136
1304
|
*/
|
|
1137
1305
|
export declare class OnBehalfOfCredential implements TokenCredential {
|
|
1138
1306
|
private options;
|
|
@@ -1141,7 +1309,7 @@ export declare class OnBehalfOfCredential implements TokenCredential {
|
|
|
1141
1309
|
private msalFlow;
|
|
1142
1310
|
/**
|
|
1143
1311
|
* Creates an instance of the {@link OnBehalfOfCredential} with the details
|
|
1144
|
-
* needed to authenticate against
|
|
1312
|
+
* needed to authenticate against Microsoft Entra ID with path to a PEM certificate,
|
|
1145
1313
|
* and an user assertion.
|
|
1146
1314
|
*
|
|
1147
1315
|
* Example using the `KeyClient` from [\@azure/keyvault-keys](https://www.npmjs.com/package/\@azure/keyvault-keys):
|
|
@@ -1163,7 +1331,7 @@ export declare class OnBehalfOfCredential implements TokenCredential {
|
|
|
1163
1331
|
constructor(options: OnBehalfOfCredentialCertificateOptions & MultiTenantTokenCredentialOptions & CredentialPersistenceOptions);
|
|
1164
1332
|
/**
|
|
1165
1333
|
* Creates an instance of the {@link OnBehalfOfCredential} with the details
|
|
1166
|
-
* needed to authenticate against
|
|
1334
|
+
* needed to authenticate against Microsoft Entra ID with a client
|
|
1167
1335
|
* secret and an user assertion.
|
|
1168
1336
|
*
|
|
1169
1337
|
* Example using the `KeyClient` from [\@azure/keyvault-keys](https://www.npmjs.com/package/\@azure/keyvault-keys):
|
|
@@ -1184,7 +1352,7 @@ export declare class OnBehalfOfCredential implements TokenCredential {
|
|
|
1184
1352
|
*/
|
|
1185
1353
|
constructor(options: OnBehalfOfCredentialSecretOptions & MultiTenantTokenCredentialOptions & CredentialPersistenceOptions);
|
|
1186
1354
|
/**
|
|
1187
|
-
* Authenticates with
|
|
1355
|
+
* Authenticates with Microsoft Entra ID and returns an access token if successful.
|
|
1188
1356
|
* If authentication fails, a {@link CredentialUnavailableError} will be thrown with the details of the failure.
|
|
1189
1357
|
*
|
|
1190
1358
|
* @param scopes - The list of scopes for which the token will have access.
|
|
@@ -1198,7 +1366,7 @@ export declare class OnBehalfOfCredential implements TokenCredential {
|
|
|
1198
1366
|
*/
|
|
1199
1367
|
export declare interface OnBehalfOfCredentialCertificateOptions {
|
|
1200
1368
|
/**
|
|
1201
|
-
* The
|
|
1369
|
+
* The Microsoft Entra tenant (directory) ID.
|
|
1202
1370
|
*/
|
|
1203
1371
|
tenantId: string;
|
|
1204
1372
|
/**
|
|
@@ -1230,7 +1398,7 @@ export declare type OnBehalfOfCredentialOptions = (OnBehalfOfCredentialSecretOpt
|
|
|
1230
1398
|
*/
|
|
1231
1399
|
export declare interface OnBehalfOfCredentialSecretOptions {
|
|
1232
1400
|
/**
|
|
1233
|
-
* The
|
|
1401
|
+
* The Microsoft Entra tenant (directory) ID.
|
|
1234
1402
|
*/
|
|
1235
1403
|
tenantId: string;
|
|
1236
1404
|
/**
|
|
@@ -1291,7 +1459,7 @@ export { TokenCredential }
|
|
|
1291
1459
|
|
|
1292
1460
|
/**
|
|
1293
1461
|
* Provides options to configure how the Identity library makes authentication
|
|
1294
|
-
* requests to
|
|
1462
|
+
* requests to Microsoft Entra ID.
|
|
1295
1463
|
*/
|
|
1296
1464
|
export declare interface TokenCredentialOptions extends CommonClientOptions {
|
|
1297
1465
|
/**
|
|
@@ -1301,10 +1469,17 @@ export declare interface TokenCredentialOptions extends CommonClientOptions {
|
|
|
1301
1469
|
*/
|
|
1302
1470
|
authorityHost?: string;
|
|
1303
1471
|
/**
|
|
1304
|
-
* Allows logging account information
|
|
1472
|
+
* Allows users to configure settings for logging policy options, allow logging account information and personally identifiable information for customer support.
|
|
1305
1473
|
*/
|
|
1306
1474
|
loggingOptions?: LogPolicyOptions & {
|
|
1475
|
+
/**
|
|
1476
|
+
* Allows logging account information once the authentication flow succeeds.
|
|
1477
|
+
*/
|
|
1307
1478
|
allowLoggingAccountIdentifiers?: boolean;
|
|
1479
|
+
/**
|
|
1480
|
+
* Allows logging personally identifiable information for customer support.
|
|
1481
|
+
*/
|
|
1482
|
+
enableUnsafeSupportLogging?: boolean;
|
|
1308
1483
|
};
|
|
1309
1484
|
}
|
|
1310
1485
|
|
|
@@ -1338,7 +1513,7 @@ export declare interface TokenCredentialOptions extends CommonClientOptions {
|
|
|
1338
1513
|
export declare function useIdentityPlugin(plugin: IdentityPlugin): void;
|
|
1339
1514
|
|
|
1340
1515
|
/**
|
|
1341
|
-
* Enables authentication to
|
|
1516
|
+
* Enables authentication to Microsoft Entra ID with a user's
|
|
1342
1517
|
* username and password. This credential requires a high degree of
|
|
1343
1518
|
* trust so you should only use it when other, more secure credential
|
|
1344
1519
|
* types can't be used.
|
|
@@ -1349,10 +1524,10 @@ export declare class UsernamePasswordCredential implements TokenCredential {
|
|
|
1349
1524
|
private msalFlow;
|
|
1350
1525
|
/**
|
|
1351
1526
|
* Creates an instance of the UsernamePasswordCredential with the details
|
|
1352
|
-
* needed to authenticate against
|
|
1527
|
+
* needed to authenticate against Microsoft Entra ID with a username
|
|
1353
1528
|
* and password.
|
|
1354
1529
|
*
|
|
1355
|
-
* @param tenantId - The
|
|
1530
|
+
* @param tenantId - The Microsoft Entra tenant (directory).
|
|
1356
1531
|
* @param clientId - The client (application) ID of an App Registration in the tenant.
|
|
1357
1532
|
* @param username - The user account's e-mail address (user name).
|
|
1358
1533
|
* @param password - The user account's account password
|
|
@@ -1360,7 +1535,7 @@ export declare class UsernamePasswordCredential implements TokenCredential {
|
|
|
1360
1535
|
*/
|
|
1361
1536
|
constructor(tenantId: string, clientId: string, username: string, password: string, options?: UsernamePasswordCredentialOptions);
|
|
1362
1537
|
/**
|
|
1363
|
-
* Authenticates with
|
|
1538
|
+
* Authenticates with Microsoft Entra ID and returns an access token if successful.
|
|
1364
1539
|
* If authentication fails, a {@link CredentialUnavailableError} will be thrown with the details of the failure.
|
|
1365
1540
|
*
|
|
1366
1541
|
* If the user provided the option `disableAutomaticAuthentication`,
|
|
@@ -1377,7 +1552,7 @@ export declare class UsernamePasswordCredential implements TokenCredential {
|
|
|
1377
1552
|
/**
|
|
1378
1553
|
* Defines options for the {@link UsernamePasswordCredential} class.
|
|
1379
1554
|
*/
|
|
1380
|
-
export declare interface UsernamePasswordCredentialOptions extends MultiTenantTokenCredentialOptions, CredentialPersistenceOptions {
|
|
1555
|
+
export declare interface UsernamePasswordCredentialOptions extends MultiTenantTokenCredentialOptions, CredentialPersistenceOptions, AuthorityValidationOptions {
|
|
1381
1556
|
}
|
|
1382
1557
|
|
|
1383
1558
|
/**
|
|
@@ -1439,4 +1614,59 @@ export declare interface VisualStudioCodeCredentialOptions extends MultiTenantTo
|
|
|
1439
1614
|
tenantId?: string;
|
|
1440
1615
|
}
|
|
1441
1616
|
|
|
1617
|
+
/**
|
|
1618
|
+
* Workload Identity authentication is a feature in Azure that allows applications running on virtual machines (VMs)
|
|
1619
|
+
* to access other Azure resources without the need for a service principal or managed identity. With Workload Identity
|
|
1620
|
+
* authentication, applications authenticate themselves using their own identity, rather than using a shared service
|
|
1621
|
+
* principal or managed identity. Under the hood, Workload Identity authentication uses the concept of Service Account
|
|
1622
|
+
* Credentials (SACs), which are automatically created by Azure and stored securely in the VM. By using Workload
|
|
1623
|
+
* Identity authentication, you can avoid the need to manage and rotate service principals or managed identities for
|
|
1624
|
+
* each application on each VM. Additionally, because SACs are created automatically and managed by Azure, you don't
|
|
1625
|
+
* need to worry about storing and securing sensitive credentials themselves.
|
|
1626
|
+
* The WorkloadIdentityCredential supports Microsoft Entra Workload ID authentication on Azure Kubernetes and acquires
|
|
1627
|
+
* a token using the SACs available in the Azure Kubernetes environment.
|
|
1628
|
+
* Refer to <a href="https://learn.microsoft.com/azure/aks/workload-identity-overview">Microsoft Entra
|
|
1629
|
+
* Workload ID</a> for more information.
|
|
1630
|
+
*/
|
|
1631
|
+
export declare class WorkloadIdentityCredential implements TokenCredential {
|
|
1632
|
+
private client;
|
|
1633
|
+
private azureFederatedTokenFileContent;
|
|
1634
|
+
private cacheDate;
|
|
1635
|
+
private federatedTokenFilePath;
|
|
1636
|
+
/**
|
|
1637
|
+
* WorkloadIdentityCredential supports Microsoft Entra Workload ID on Kubernetes.
|
|
1638
|
+
*
|
|
1639
|
+
* @param options - The identity client options to use for authentication.
|
|
1640
|
+
*/
|
|
1641
|
+
constructor(options?: WorkloadIdentityCredentialOptions);
|
|
1642
|
+
/**
|
|
1643
|
+
* Authenticates with Microsoft Entra ID and returns an access token if successful.
|
|
1644
|
+
* If authentication fails, a {@link CredentialUnavailableError} will be thrown with the details of the failure.
|
|
1645
|
+
*
|
|
1646
|
+
* @param scopes - The list of scopes for which the token will have access.
|
|
1647
|
+
* @param options - The options used to configure any requests this
|
|
1648
|
+
* TokenCredential implementation might make.
|
|
1649
|
+
*/
|
|
1650
|
+
getToken(scopes: string | string[], options?: GetTokenOptions): Promise<AccessToken | null>;
|
|
1651
|
+
private readFileContents;
|
|
1652
|
+
}
|
|
1653
|
+
|
|
1654
|
+
/**
|
|
1655
|
+
* Options for the {@link WorkloadIdentityCredential}
|
|
1656
|
+
*/
|
|
1657
|
+
export declare interface WorkloadIdentityCredentialOptions extends MultiTenantTokenCredentialOptions, AuthorityValidationOptions {
|
|
1658
|
+
/**
|
|
1659
|
+
* ID of the application's Microsoft Entra tenant. Also called its directory ID.
|
|
1660
|
+
*/
|
|
1661
|
+
tenantId?: string;
|
|
1662
|
+
/**
|
|
1663
|
+
* The client ID of a Microsoft Entra app registration.
|
|
1664
|
+
*/
|
|
1665
|
+
clientId?: string;
|
|
1666
|
+
/**
|
|
1667
|
+
* The path to a file containing a Kubernetes service account token that authenticates the identity.
|
|
1668
|
+
*/
|
|
1669
|
+
tokenFilePath?: string;
|
|
1670
|
+
}
|
|
1671
|
+
|
|
1442
1672
|
export { }
|