@azure/identity 3.3.2 → 4.0.0-alpha.20231026.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of @azure/identity might be problematic. Click here for more details.
- package/README.md +14 -14
- package/dist/index.js +228 -225
- package/dist/index.js.map +1 -1
- package/dist-esm/src/client/identityClient.js.map +1 -1
- package/dist-esm/src/constants.js +1 -1
- 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 +4 -4
- package/dist-esm/src/credentials/authorizationCodeCredential.js.map +1 -1
- package/dist-esm/src/credentials/azureCliCredential.js +1 -1
- package/dist-esm/src/credentials/azureCliCredential.js.map +1 -1
- package/dist-esm/src/credentials/azureDeveloperCliCredential.js +4 -4
- package/dist-esm/src/credentials/azureDeveloperCliCredential.js.map +1 -1
- package/dist-esm/src/credentials/azurePowerShellCredential.js +1 -1
- package/dist-esm/src/credentials/azurePowerShellCredential.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/clientAssertionCredential.js +3 -3
- 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 +2 -2
- package/dist-esm/src/credentials/clientCertificateCredential.js.map +1 -1
- package/dist-esm/src/credentials/clientSecretCredential.browser.js +4 -4
- package/dist-esm/src/credentials/clientSecretCredential.browser.js.map +1 -1
- package/dist-esm/src/credentials/clientSecretCredential.js +5 -5
- package/dist-esm/src/credentials/clientSecretCredential.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 +4 -4
- 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 +4 -4
- package/dist-esm/src/credentials/interactiveBrowserCredential.browser.js.map +1 -1
- package/dist-esm/src/credentials/interactiveBrowserCredential.js +26 -9
- 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/index.js +3 -2
- package/dist-esm/src/credentials/managedIdentityCredential/index.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 +1 -1
- 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 +4 -4
- package/dist-esm/src/credentials/usernamePasswordCredential.browser.js.map +1 -1
- package/dist-esm/src/credentials/usernamePasswordCredential.js +4 -4
- package/dist-esm/src/credentials/usernamePasswordCredential.js.map +1 -1
- package/dist-esm/src/credentials/workloadIdentityCredential.browser.js +2 -2
- package/dist-esm/src/credentials/workloadIdentityCredential.browser.js.map +1 -1
- package/dist-esm/src/credentials/workloadIdentityCredential.js +5 -5
- package/dist-esm/src/credentials/workloadIdentityCredential.js.map +1 -1
- package/dist-esm/src/credentials/workloadIdentityCredentialOptions.js.map +1 -1
- package/dist-esm/src/index.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/msalNodeCommon.js +56 -8
- package/dist-esm/src/msal/nodeFlows/msalNodeCommon.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/utils.browser.js +236 -0
- package/dist-esm/src/msal/utils.browser.js.map +1 -0
- package/dist-esm/src/msal/utils.js +7 -4
- 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/package.json +17 -18
- package/types/identity.d.ts +142 -68
package/types/identity.d.ts
CHANGED
|
@@ -113,7 +113,7 @@ 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
|
/**
|
|
@@ -127,11 +127,11 @@ export declare interface AuthorityValidationOptions {
|
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
/**
|
|
130
|
-
* Enables authentication to
|
|
130
|
+
* Enables authentication to Microsoft Entra ID using an authorization code
|
|
131
131
|
* that was obtained through the authorization code flow, described in more detail
|
|
132
|
-
* in the
|
|
132
|
+
* in the Microsoft Entra ID documentation:
|
|
133
133
|
*
|
|
134
|
-
* https://
|
|
134
|
+
* https://learn.microsoft.com/azure/active-directory/develop/v2-oauth2-auth-code-flow
|
|
135
135
|
*/
|
|
136
136
|
export declare class AuthorizationCodeCredential implements TokenCredential {
|
|
137
137
|
private msalFlow;
|
|
@@ -143,7 +143,7 @@ export declare class AuthorizationCodeCredential implements TokenCredential {
|
|
|
143
143
|
/**
|
|
144
144
|
* Creates an instance of AuthorizationCodeCredential with the details needed
|
|
145
145
|
* to request an access token using an authentication that was obtained
|
|
146
|
-
* from
|
|
146
|
+
* from Microsoft Entra ID.
|
|
147
147
|
*
|
|
148
148
|
* It is currently necessary for the user of this credential to initiate
|
|
149
149
|
* the authorization code flow to obtain an authorization code to be used
|
|
@@ -151,7 +151,7 @@ export declare class AuthorizationCodeCredential implements TokenCredential {
|
|
|
151
151
|
*
|
|
152
152
|
* https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/samples/v2/manual/authorizationCodeSample.ts
|
|
153
153
|
*
|
|
154
|
-
* @param tenantId - The
|
|
154
|
+
* @param tenantId - The Microsoft Entra tenant (directory) ID or name.
|
|
155
155
|
* 'common' may be used when dealing with multi-tenant scenarios.
|
|
156
156
|
* @param clientId - The client (application) ID of an App Registration in the tenant.
|
|
157
157
|
* @param clientSecret - A client secret that was generated for the App Registration
|
|
@@ -166,7 +166,7 @@ export declare class AuthorizationCodeCredential implements TokenCredential {
|
|
|
166
166
|
/**
|
|
167
167
|
* Creates an instance of AuthorizationCodeCredential with the details needed
|
|
168
168
|
* to request an access token using an authentication that was obtained
|
|
169
|
-
* from
|
|
169
|
+
* from Microsoft Entra ID.
|
|
170
170
|
*
|
|
171
171
|
* It is currently necessary for the user of this credential to initiate
|
|
172
172
|
* the authorization code flow to obtain an authorization code to be used
|
|
@@ -174,7 +174,7 @@ export declare class AuthorizationCodeCredential implements TokenCredential {
|
|
|
174
174
|
*
|
|
175
175
|
* https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/samples/v2/manual/authorizationCodeSample.ts
|
|
176
176
|
*
|
|
177
|
-
* @param tenantId - The
|
|
177
|
+
* @param tenantId - The Microsoft Entra tenant (directory) ID or name.
|
|
178
178
|
* 'common' may be used when dealing with multi-tenant scenarios.
|
|
179
179
|
* @param clientId - The client (application) ID of an App Registration in the tenant.
|
|
180
180
|
* @param authorizationCode - An authorization code that was received from following the
|
|
@@ -186,7 +186,7 @@ export declare class AuthorizationCodeCredential implements TokenCredential {
|
|
|
186
186
|
*/
|
|
187
187
|
constructor(tenantId: string | "common", clientId: string, authorizationCode: string, redirectUri: string, options?: AuthorizationCodeCredentialOptions);
|
|
188
188
|
/**
|
|
189
|
-
* Authenticates with
|
|
189
|
+
* Authenticates with Microsoft Entra ID and returns an access token if successful.
|
|
190
190
|
* If authentication fails, a {@link CredentialUnavailableError} will be thrown with the details of the failure.
|
|
191
191
|
*
|
|
192
192
|
* @param scopes - The list of scopes for which the token will have access.
|
|
@@ -244,7 +244,7 @@ export declare class AzureCliCredential implements TokenCredential {
|
|
|
244
244
|
*/
|
|
245
245
|
constructor(options?: AzureCliCredentialOptions);
|
|
246
246
|
/**
|
|
247
|
-
* Authenticates with
|
|
247
|
+
* Authenticates with Microsoft Entra ID and returns an access token if successful.
|
|
248
248
|
* If authentication fails, a {@link CredentialUnavailableError} will be thrown with the details of the failure.
|
|
249
249
|
*
|
|
250
250
|
* @param scopes - The list of scopes for which the token will have access.
|
|
@@ -272,11 +272,11 @@ export declare interface AzureCliCredentialOptions extends MultiTenantTokenCrede
|
|
|
272
272
|
* Azure Developer CLI is a command-line interface tool that allows developers to create, manage, and deploy
|
|
273
273
|
* resources in Azure. It's built on top of the Azure CLI and provides additional functionality specific
|
|
274
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/">
|
|
276
|
-
*
|
|
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
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
278
|
* service principal and executes an Azure CLI command underneath to authenticate the application against
|
|
279
|
-
*
|
|
279
|
+
* Microsoft Entra ID.
|
|
280
280
|
*
|
|
281
281
|
* <h2> Configure AzureDeveloperCliCredential </h2>
|
|
282
282
|
*
|
|
@@ -307,7 +307,7 @@ export declare class AzureDeveloperCliCredential implements TokenCredential {
|
|
|
307
307
|
*/
|
|
308
308
|
constructor(options?: AzureDeveloperCliCredentialOptions);
|
|
309
309
|
/**
|
|
310
|
-
* Authenticates with
|
|
310
|
+
* Authenticates with Microsoft Entra ID and returns an access token if successful.
|
|
311
311
|
* If authentication fails, a {@link CredentialUnavailableError} will be thrown with the details of the failure.
|
|
312
312
|
*
|
|
313
313
|
* @param scopes - The list of scopes for which the token will have access.
|
|
@@ -358,7 +358,7 @@ export declare class AzurePowerShellCredential implements TokenCredential {
|
|
|
358
358
|
*/
|
|
359
359
|
private getAzurePowerShellAccessToken;
|
|
360
360
|
/**
|
|
361
|
-
* Authenticates with
|
|
361
|
+
* Authenticates with Microsoft Entra ID and returns an access token if successful.
|
|
362
362
|
* If the authentication cannot be performed through PowerShell, a {@link CredentialUnavailableError} will be thrown.
|
|
363
363
|
*
|
|
364
364
|
* @param scopes - The list of scopes for which the token will have access.
|
|
@@ -381,6 +381,78 @@ export declare interface AzurePowerShellCredentialOptions extends MultiTenantTok
|
|
|
381
381
|
processTimeoutInMs?: number;
|
|
382
382
|
}
|
|
383
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
|
+
};
|
|
454
|
+
}
|
|
455
|
+
|
|
384
456
|
/**
|
|
385
457
|
* (Browser-only feature)
|
|
386
458
|
* The "login style" to use in the authentication flow:
|
|
@@ -439,17 +511,17 @@ export declare class ClientAssertionCredential implements TokenCredential {
|
|
|
439
511
|
private options;
|
|
440
512
|
/**
|
|
441
513
|
* Creates an instance of the ClientAssertionCredential with the details
|
|
442
|
-
* needed to authenticate against
|
|
514
|
+
* needed to authenticate against Microsoft Entra ID with a client
|
|
443
515
|
* assertion provided by the developer through the `getAssertion` function parameter.
|
|
444
516
|
*
|
|
445
|
-
* @param tenantId - The
|
|
517
|
+
* @param tenantId - The Microsoft Entra tenant (directory) ID.
|
|
446
518
|
* @param clientId - The client (application) ID of an App Registration in the tenant.
|
|
447
519
|
* @param getAssertion - A function that retrieves the assertion for the credential to use.
|
|
448
520
|
* @param options - Options for configuring the client which makes the authentication request.
|
|
449
521
|
*/
|
|
450
522
|
constructor(tenantId: string, clientId: string, getAssertion: () => Promise<string>, options?: ClientAssertionCredentialOptions);
|
|
451
523
|
/**
|
|
452
|
-
* Authenticates with
|
|
524
|
+
* Authenticates with Microsoft Entra ID and returns an access token if successful.
|
|
453
525
|
* If authentication fails, a {@link CredentialUnavailableError} will be thrown with the details of the failure.
|
|
454
526
|
*
|
|
455
527
|
* @param scopes - The list of scopes for which the token will have access.
|
|
@@ -466,7 +538,7 @@ export declare interface ClientAssertionCredentialOptions extends MultiTenantTok
|
|
|
466
538
|
}
|
|
467
539
|
|
|
468
540
|
/**
|
|
469
|
-
* Enables authentication to
|
|
541
|
+
* Enables authentication to Microsoft Entra ID using a PEM-encoded
|
|
470
542
|
* certificate that is assigned to an App Registration. More information
|
|
471
543
|
* on how to configure certificate authentication can be found here:
|
|
472
544
|
*
|
|
@@ -479,9 +551,9 @@ export declare class ClientCertificateCredential implements TokenCredential {
|
|
|
479
551
|
private msalFlow;
|
|
480
552
|
/**
|
|
481
553
|
* Creates an instance of the ClientCertificateCredential with the details
|
|
482
|
-
* needed to authenticate against
|
|
554
|
+
* needed to authenticate against Microsoft Entra ID with a certificate.
|
|
483
555
|
*
|
|
484
|
-
* @param tenantId - The
|
|
556
|
+
* @param tenantId - The Microsoft Entra tenant (directory) ID.
|
|
485
557
|
* @param clientId - The client (application) ID of an App Registration in the tenant.
|
|
486
558
|
* @param certificatePath - The path to a PEM-encoded public/private key certificate on the filesystem.
|
|
487
559
|
* @param options - Options for configuring the client which makes the authentication request.
|
|
@@ -489,9 +561,9 @@ export declare class ClientCertificateCredential implements TokenCredential {
|
|
|
489
561
|
constructor(tenantId: string, clientId: string, certificatePath: string, options?: ClientCertificateCredentialOptions);
|
|
490
562
|
/**
|
|
491
563
|
* Creates an instance of the ClientCertificateCredential with the details
|
|
492
|
-
* needed to authenticate against
|
|
564
|
+
* needed to authenticate against Microsoft Entra ID with a certificate.
|
|
493
565
|
*
|
|
494
|
-
* @param tenantId - The
|
|
566
|
+
* @param tenantId - The Microsoft Entra tenant (directory) ID.
|
|
495
567
|
* @param clientId - The client (application) ID of an App Registration in the tenant.
|
|
496
568
|
* @param configuration - Other parameters required, including the path of the certificate on the filesystem.
|
|
497
569
|
* If the type is ignored, we will throw the value of the path to a PEM certificate.
|
|
@@ -500,9 +572,9 @@ export declare class ClientCertificateCredential implements TokenCredential {
|
|
|
500
572
|
constructor(tenantId: string, clientId: string, configuration: ClientCertificatePEMCertificatePath, options?: ClientCertificateCredentialOptions);
|
|
501
573
|
/**
|
|
502
574
|
* Creates an instance of the ClientCertificateCredential with the details
|
|
503
|
-
* needed to authenticate against
|
|
575
|
+
* needed to authenticate against Microsoft Entra ID with a certificate.
|
|
504
576
|
*
|
|
505
|
-
* @param tenantId - The
|
|
577
|
+
* @param tenantId - The Microsoft Entra tenant (directory) ID.
|
|
506
578
|
* @param clientId - The client (application) ID of an App Registration in the tenant.
|
|
507
579
|
* @param configuration - Other parameters required, including the PEM-encoded certificate as a string.
|
|
508
580
|
* If the type is ignored, we will throw the value of the PEM-encoded certificate.
|
|
@@ -510,7 +582,7 @@ export declare class ClientCertificateCredential implements TokenCredential {
|
|
|
510
582
|
*/
|
|
511
583
|
constructor(tenantId: string, clientId: string, configuration: ClientCertificatePEMCertificate, options?: ClientCertificateCredentialOptions);
|
|
512
584
|
/**
|
|
513
|
-
* Authenticates with
|
|
585
|
+
* Authenticates with Microsoft Entra ID and returns an access token if successful.
|
|
514
586
|
* If authentication fails, a {@link CredentialUnavailableError} will be thrown with the details of the failure.
|
|
515
587
|
*
|
|
516
588
|
* @param scopes - The list of scopes for which the token will have access.
|
|
@@ -565,11 +637,11 @@ export declare interface ClientCertificatePEMCertificatePath {
|
|
|
565
637
|
}
|
|
566
638
|
|
|
567
639
|
/**
|
|
568
|
-
* Enables authentication to
|
|
640
|
+
* Enables authentication to Microsoft Entra ID using a client secret
|
|
569
641
|
* that was generated for an App Registration. More information on how
|
|
570
642
|
* to configure a client secret can be found here:
|
|
571
643
|
*
|
|
572
|
-
* https://
|
|
644
|
+
* https://learn.microsoft.com/azure/active-directory/develop/quickstart-configure-app-access-web-apis#add-credentials-to-your-web-application
|
|
573
645
|
*
|
|
574
646
|
*/
|
|
575
647
|
export declare class ClientSecretCredential implements TokenCredential {
|
|
@@ -578,17 +650,17 @@ export declare class ClientSecretCredential implements TokenCredential {
|
|
|
578
650
|
private msalFlow;
|
|
579
651
|
/**
|
|
580
652
|
* Creates an instance of the ClientSecretCredential with the details
|
|
581
|
-
* needed to authenticate against
|
|
653
|
+
* needed to authenticate against Microsoft Entra ID with a client
|
|
582
654
|
* secret.
|
|
583
655
|
*
|
|
584
|
-
* @param tenantId - The
|
|
656
|
+
* @param tenantId - The Microsoft Entra tenant (directory) ID.
|
|
585
657
|
* @param clientId - The client (application) ID of an App Registration in the tenant.
|
|
586
658
|
* @param clientSecret - A client secret that was generated for the App Registration.
|
|
587
659
|
* @param options - Options for configuring the client which makes the authentication request.
|
|
588
660
|
*/
|
|
589
661
|
constructor(tenantId: string, clientId: string, clientSecret: string, options?: ClientSecretCredentialOptions);
|
|
590
662
|
/**
|
|
591
|
-
* Authenticates with
|
|
663
|
+
* Authenticates with Microsoft Entra ID and returns an access token if successful.
|
|
592
664
|
* If authentication fails, a {@link CredentialUnavailableError} will be thrown with the details of the failure.
|
|
593
665
|
*
|
|
594
666
|
* @param scopes - The list of scopes for which the token will have access.
|
|
@@ -796,7 +868,7 @@ export declare interface DefaultAzureCredentialResourceIdOptions extends Default
|
|
|
796
868
|
export declare function deserializeAuthenticationRecord(serializedRecord: string): AuthenticationRecord;
|
|
797
869
|
|
|
798
870
|
/**
|
|
799
|
-
* Enables authentication to
|
|
871
|
+
* Enables authentication to Microsoft Entra ID using a device code
|
|
800
872
|
* that the user can enter into https://microsoft.com/devicelogin.
|
|
801
873
|
*/
|
|
802
874
|
export declare class DeviceCodeCredential implements TokenCredential {
|
|
@@ -806,7 +878,7 @@ export declare class DeviceCodeCredential implements TokenCredential {
|
|
|
806
878
|
private disableAutomaticAuthentication?;
|
|
807
879
|
/**
|
|
808
880
|
* Creates an instance of DeviceCodeCredential with the details needed
|
|
809
|
-
* to initiate the device code authorization flow with
|
|
881
|
+
* to initiate the device code authorization flow with Microsoft Entra ID.
|
|
810
882
|
*
|
|
811
883
|
* A message will be logged, giving users a code that they can use to authenticate once they go to https://microsoft.com/devicelogin
|
|
812
884
|
*
|
|
@@ -826,7 +898,7 @@ export declare class DeviceCodeCredential implements TokenCredential {
|
|
|
826
898
|
*/
|
|
827
899
|
constructor(options?: DeviceCodeCredentialOptions);
|
|
828
900
|
/**
|
|
829
|
-
* Authenticates with
|
|
901
|
+
* Authenticates with Microsoft Entra ID and returns an access token if successful.
|
|
830
902
|
* If authentication fails, a {@link CredentialUnavailableError} will be thrown with the details of the failure.
|
|
831
903
|
*
|
|
832
904
|
* If the user provided the option `disableAutomaticAuthentication`,
|
|
@@ -839,7 +911,7 @@ export declare class DeviceCodeCredential implements TokenCredential {
|
|
|
839
911
|
*/
|
|
840
912
|
getToken(scopes: string | string[], options?: GetTokenOptions): Promise<AccessToken>;
|
|
841
913
|
/**
|
|
842
|
-
* Authenticates with
|
|
914
|
+
* Authenticates with Microsoft Entra ID and returns an access token if successful.
|
|
843
915
|
* If authentication fails, a {@link CredentialUnavailableError} will be thrown with the details of the failure.
|
|
844
916
|
*
|
|
845
917
|
* If the token can't be retrieved silently, this method will require user interaction to retrieve the token.
|
|
@@ -856,7 +928,7 @@ export declare class DeviceCodeCredential implements TokenCredential {
|
|
|
856
928
|
*/
|
|
857
929
|
export declare interface DeviceCodeCredentialOptions extends InteractiveCredentialOptions, CredentialPersistenceOptions {
|
|
858
930
|
/**
|
|
859
|
-
* The
|
|
931
|
+
* The Microsoft Entra tenant (directory) ID.
|
|
860
932
|
*/
|
|
861
933
|
tenantId?: string;
|
|
862
934
|
/**
|
|
@@ -901,7 +973,7 @@ export declare interface DeviceCodeInfo {
|
|
|
901
973
|
export declare type DeviceCodePromptCallback = (deviceCodeInfo: DeviceCodeInfo) => void;
|
|
902
974
|
|
|
903
975
|
/**
|
|
904
|
-
* Enables authentication to
|
|
976
|
+
* Enables authentication to Microsoft Entra ID using a client secret or certificate, or as a user
|
|
905
977
|
* with a username and password.
|
|
906
978
|
*/
|
|
907
979
|
export declare class EnvironmentCredential implements TokenCredential {
|
|
@@ -910,7 +982,7 @@ export declare class EnvironmentCredential implements TokenCredential {
|
|
|
910
982
|
* Creates an instance of the EnvironmentCredential class and decides what credential to use depending on the available environment variables.
|
|
911
983
|
*
|
|
912
984
|
* Required environment variables:
|
|
913
|
-
* - `AZURE_TENANT_ID`: The
|
|
985
|
+
* - `AZURE_TENANT_ID`: The Microsoft Entra tenant (directory) ID.
|
|
914
986
|
* - `AZURE_CLIENT_ID`: The client (application) ID of an App Registration in the tenant.
|
|
915
987
|
*
|
|
916
988
|
* If setting the AZURE_TENANT_ID, then you can also set the additionally allowed tenants
|
|
@@ -932,7 +1004,7 @@ export declare class EnvironmentCredential implements TokenCredential {
|
|
|
932
1004
|
*/
|
|
933
1005
|
constructor(options?: EnvironmentCredentialOptions);
|
|
934
1006
|
/**
|
|
935
|
-
* Authenticates with
|
|
1007
|
+
* Authenticates with Microsoft Entra ID and returns an access token if successful.
|
|
936
1008
|
*
|
|
937
1009
|
* @param scopes - The list of scopes for which the token will have access.
|
|
938
1010
|
* @param options - Optional parameters. See {@link GetTokenOptions}.
|
|
@@ -941,7 +1013,7 @@ export declare class EnvironmentCredential implements TokenCredential {
|
|
|
941
1013
|
}
|
|
942
1014
|
|
|
943
1015
|
/**
|
|
944
|
-
* Enables authentication to
|
|
1016
|
+
* Enables authentication to Microsoft Entra ID depending on the available environment variables.
|
|
945
1017
|
* Defines options for the EnvironmentCredential class.
|
|
946
1018
|
*/
|
|
947
1019
|
export declare interface EnvironmentCredentialOptions extends MultiTenantTokenCredentialOptions, AuthorityValidationOptions {
|
|
@@ -996,7 +1068,7 @@ export { GetTokenOptions }
|
|
|
996
1068
|
export declare type IdentityPlugin = (context: unknown) => void;
|
|
997
1069
|
|
|
998
1070
|
/**
|
|
999
|
-
* Enables authentication to
|
|
1071
|
+
* Enables authentication to Microsoft Entra ID inside of the web browser
|
|
1000
1072
|
* using the interactive login flow.
|
|
1001
1073
|
*/
|
|
1002
1074
|
export declare class InteractiveBrowserCredential implements TokenCredential {
|
|
@@ -1007,18 +1079,18 @@ export declare class InteractiveBrowserCredential implements TokenCredential {
|
|
|
1007
1079
|
/**
|
|
1008
1080
|
* Creates an instance of InteractiveBrowserCredential with the details needed.
|
|
1009
1081
|
*
|
|
1010
|
-
* 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).
|
|
1011
1083
|
* On Node.js, it will open a browser window while it listens for a redirect response from the authentication service.
|
|
1012
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.
|
|
1013
1085
|
*
|
|
1014
|
-
* For Node.js, if a `clientId` is provided, the
|
|
1015
|
-
* 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).
|
|
1016
1088
|
*
|
|
1017
1089
|
* @param options - Options for configuring the client which makes the authentication requests.
|
|
1018
1090
|
*/
|
|
1019
|
-
constructor(options
|
|
1091
|
+
constructor(options: InteractiveBrowserCredentialNodeOptions | InteractiveBrowserCredentialInBrowserOptions);
|
|
1020
1092
|
/**
|
|
1021
|
-
* Authenticates with
|
|
1093
|
+
* Authenticates with Microsoft Entra ID and returns an access token if successful.
|
|
1022
1094
|
* If authentication fails, a {@link CredentialUnavailableError} will be thrown with the details of the failure.
|
|
1023
1095
|
*
|
|
1024
1096
|
* If the user provided the option `disableAutomaticAuthentication`,
|
|
@@ -1031,7 +1103,7 @@ export declare class InteractiveBrowserCredential implements TokenCredential {
|
|
|
1031
1103
|
*/
|
|
1032
1104
|
getToken(scopes: string | string[], options?: GetTokenOptions): Promise<AccessToken>;
|
|
1033
1105
|
/**
|
|
1034
|
-
* Authenticates with
|
|
1106
|
+
* Authenticates with Microsoft Entra ID and returns an access token if successful.
|
|
1035
1107
|
* If authentication fails, a {@link CredentialUnavailableError} will be thrown with the details of the failure.
|
|
1036
1108
|
*
|
|
1037
1109
|
* If the token can't be retrieved silently, this method will require user interaction to retrieve the token.
|
|
@@ -1053,10 +1125,11 @@ export declare interface InteractiveBrowserCredentialInBrowserOptions extends In
|
|
|
1053
1125
|
/**
|
|
1054
1126
|
* Gets the redirect URI of the application. This should be same as the value
|
|
1055
1127
|
* in the application registration portal. Defaults to `window.location.href`.
|
|
1128
|
+
* This field is no longer required for Node.js.
|
|
1056
1129
|
*/
|
|
1057
1130
|
redirectUri?: string | (() => string);
|
|
1058
1131
|
/**
|
|
1059
|
-
* The
|
|
1132
|
+
* The Microsoft Entra tenant (directory) ID.
|
|
1060
1133
|
*/
|
|
1061
1134
|
tenantId?: string;
|
|
1062
1135
|
/**
|
|
@@ -1081,14 +1154,15 @@ export declare interface InteractiveBrowserCredentialInBrowserOptions extends In
|
|
|
1081
1154
|
/**
|
|
1082
1155
|
* Defines the common options for the InteractiveBrowserCredential class.
|
|
1083
1156
|
*/
|
|
1084
|
-
export declare interface InteractiveBrowserCredentialNodeOptions extends InteractiveCredentialOptions, CredentialPersistenceOptions {
|
|
1157
|
+
export declare interface InteractiveBrowserCredentialNodeOptions extends InteractiveCredentialOptions, CredentialPersistenceOptions, BrowserCustomizationOptions, BrokerAuthOptions {
|
|
1085
1158
|
/**
|
|
1086
1159
|
* Gets the redirect URI of the application. This should be same as the value
|
|
1087
1160
|
* in the application registration portal. Defaults to `window.location.href`.
|
|
1161
|
+
* This field is no longer required for Node.js.
|
|
1088
1162
|
*/
|
|
1089
1163
|
redirectUri?: string | (() => string);
|
|
1090
1164
|
/**
|
|
1091
|
-
* The
|
|
1165
|
+
* The Microsoft Entra tenant (directory) ID.
|
|
1092
1166
|
*/
|
|
1093
1167
|
tenantId?: string;
|
|
1094
1168
|
/**
|
|
@@ -1169,7 +1243,7 @@ export declare class ManagedIdentityCredential implements TokenCredential {
|
|
|
1169
1243
|
private cachedAvailableMSI;
|
|
1170
1244
|
private authenticateManagedIdentity;
|
|
1171
1245
|
/**
|
|
1172
|
-
* Authenticates with
|
|
1246
|
+
* Authenticates with Microsoft Entra ID and returns an access token if successful.
|
|
1173
1247
|
* If authentication fails, a {@link CredentialUnavailableError} will be thrown with the details of the failure.
|
|
1174
1248
|
* If an unexpected error occurs, an {@link AuthenticationError} will be thrown with the details of the failure.
|
|
1175
1249
|
*
|
|
@@ -1235,7 +1309,7 @@ export declare class OnBehalfOfCredential implements TokenCredential {
|
|
|
1235
1309
|
private msalFlow;
|
|
1236
1310
|
/**
|
|
1237
1311
|
* Creates an instance of the {@link OnBehalfOfCredential} with the details
|
|
1238
|
-
* needed to authenticate against
|
|
1312
|
+
* needed to authenticate against Microsoft Entra ID with path to a PEM certificate,
|
|
1239
1313
|
* and an user assertion.
|
|
1240
1314
|
*
|
|
1241
1315
|
* Example using the `KeyClient` from [\@azure/keyvault-keys](https://www.npmjs.com/package/\@azure/keyvault-keys):
|
|
@@ -1257,7 +1331,7 @@ export declare class OnBehalfOfCredential implements TokenCredential {
|
|
|
1257
1331
|
constructor(options: OnBehalfOfCredentialCertificateOptions & MultiTenantTokenCredentialOptions & CredentialPersistenceOptions);
|
|
1258
1332
|
/**
|
|
1259
1333
|
* Creates an instance of the {@link OnBehalfOfCredential} with the details
|
|
1260
|
-
* needed to authenticate against
|
|
1334
|
+
* needed to authenticate against Microsoft Entra ID with a client
|
|
1261
1335
|
* secret and an user assertion.
|
|
1262
1336
|
*
|
|
1263
1337
|
* Example using the `KeyClient` from [\@azure/keyvault-keys](https://www.npmjs.com/package/\@azure/keyvault-keys):
|
|
@@ -1278,7 +1352,7 @@ export declare class OnBehalfOfCredential implements TokenCredential {
|
|
|
1278
1352
|
*/
|
|
1279
1353
|
constructor(options: OnBehalfOfCredentialSecretOptions & MultiTenantTokenCredentialOptions & CredentialPersistenceOptions);
|
|
1280
1354
|
/**
|
|
1281
|
-
* Authenticates with
|
|
1355
|
+
* Authenticates with Microsoft Entra ID and returns an access token if successful.
|
|
1282
1356
|
* If authentication fails, a {@link CredentialUnavailableError} will be thrown with the details of the failure.
|
|
1283
1357
|
*
|
|
1284
1358
|
* @param scopes - The list of scopes for which the token will have access.
|
|
@@ -1292,7 +1366,7 @@ export declare class OnBehalfOfCredential implements TokenCredential {
|
|
|
1292
1366
|
*/
|
|
1293
1367
|
export declare interface OnBehalfOfCredentialCertificateOptions {
|
|
1294
1368
|
/**
|
|
1295
|
-
* The
|
|
1369
|
+
* The Microsoft Entra tenant (directory) ID.
|
|
1296
1370
|
*/
|
|
1297
1371
|
tenantId: string;
|
|
1298
1372
|
/**
|
|
@@ -1324,7 +1398,7 @@ export declare type OnBehalfOfCredentialOptions = (OnBehalfOfCredentialSecretOpt
|
|
|
1324
1398
|
*/
|
|
1325
1399
|
export declare interface OnBehalfOfCredentialSecretOptions {
|
|
1326
1400
|
/**
|
|
1327
|
-
* The
|
|
1401
|
+
* The Microsoft Entra tenant (directory) ID.
|
|
1328
1402
|
*/
|
|
1329
1403
|
tenantId: string;
|
|
1330
1404
|
/**
|
|
@@ -1385,7 +1459,7 @@ export { TokenCredential }
|
|
|
1385
1459
|
|
|
1386
1460
|
/**
|
|
1387
1461
|
* Provides options to configure how the Identity library makes authentication
|
|
1388
|
-
* requests to
|
|
1462
|
+
* requests to Microsoft Entra ID.
|
|
1389
1463
|
*/
|
|
1390
1464
|
export declare interface TokenCredentialOptions extends CommonClientOptions {
|
|
1391
1465
|
/**
|
|
@@ -1439,7 +1513,7 @@ export declare interface TokenCredentialOptions extends CommonClientOptions {
|
|
|
1439
1513
|
export declare function useIdentityPlugin(plugin: IdentityPlugin): void;
|
|
1440
1514
|
|
|
1441
1515
|
/**
|
|
1442
|
-
* Enables authentication to
|
|
1516
|
+
* Enables authentication to Microsoft Entra ID with a user's
|
|
1443
1517
|
* username and password. This credential requires a high degree of
|
|
1444
1518
|
* trust so you should only use it when other, more secure credential
|
|
1445
1519
|
* types can't be used.
|
|
@@ -1450,10 +1524,10 @@ export declare class UsernamePasswordCredential implements TokenCredential {
|
|
|
1450
1524
|
private msalFlow;
|
|
1451
1525
|
/**
|
|
1452
1526
|
* Creates an instance of the UsernamePasswordCredential with the details
|
|
1453
|
-
* needed to authenticate against
|
|
1527
|
+
* needed to authenticate against Microsoft Entra ID with a username
|
|
1454
1528
|
* and password.
|
|
1455
1529
|
*
|
|
1456
|
-
* @param tenantId - The
|
|
1530
|
+
* @param tenantId - The Microsoft Entra tenant (directory).
|
|
1457
1531
|
* @param clientId - The client (application) ID of an App Registration in the tenant.
|
|
1458
1532
|
* @param username - The user account's e-mail address (user name).
|
|
1459
1533
|
* @param password - The user account's account password
|
|
@@ -1461,7 +1535,7 @@ export declare class UsernamePasswordCredential implements TokenCredential {
|
|
|
1461
1535
|
*/
|
|
1462
1536
|
constructor(tenantId: string, clientId: string, username: string, password: string, options?: UsernamePasswordCredentialOptions);
|
|
1463
1537
|
/**
|
|
1464
|
-
* Authenticates with
|
|
1538
|
+
* Authenticates with Microsoft Entra ID and returns an access token if successful.
|
|
1465
1539
|
* If authentication fails, a {@link CredentialUnavailableError} will be thrown with the details of the failure.
|
|
1466
1540
|
*
|
|
1467
1541
|
* If the user provided the option `disableAutomaticAuthentication`,
|
|
@@ -1549,10 +1623,10 @@ export declare interface VisualStudioCodeCredentialOptions extends MultiTenantTo
|
|
|
1549
1623
|
* Identity authentication, you can avoid the need to manage and rotate service principals or managed identities for
|
|
1550
1624
|
* each application on each VM. Additionally, because SACs are created automatically and managed by Azure, you don't
|
|
1551
1625
|
* need to worry about storing and securing sensitive credentials themselves.
|
|
1552
|
-
* The WorkloadIdentityCredential supports
|
|
1626
|
+
* The WorkloadIdentityCredential supports Microsoft Entra Workload ID authentication on Azure Kubernetes and acquires
|
|
1553
1627
|
* a token using the SACs available in the Azure Kubernetes environment.
|
|
1554
|
-
* Refer to <a href="https://learn.microsoft.com/azure/aks/workload-identity-overview">
|
|
1555
|
-
* Workload
|
|
1628
|
+
* Refer to <a href="https://learn.microsoft.com/azure/aks/workload-identity-overview">Microsoft Entra
|
|
1629
|
+
* Workload ID</a> for more information.
|
|
1556
1630
|
*/
|
|
1557
1631
|
export declare class WorkloadIdentityCredential implements TokenCredential {
|
|
1558
1632
|
private client;
|
|
@@ -1560,13 +1634,13 @@ export declare class WorkloadIdentityCredential implements TokenCredential {
|
|
|
1560
1634
|
private cacheDate;
|
|
1561
1635
|
private federatedTokenFilePath;
|
|
1562
1636
|
/**
|
|
1563
|
-
* WorkloadIdentityCredential supports
|
|
1637
|
+
* WorkloadIdentityCredential supports Microsoft Entra Workload ID on Kubernetes.
|
|
1564
1638
|
*
|
|
1565
1639
|
* @param options - The identity client options to use for authentication.
|
|
1566
1640
|
*/
|
|
1567
1641
|
constructor(options?: WorkloadIdentityCredentialOptions);
|
|
1568
1642
|
/**
|
|
1569
|
-
* Authenticates with
|
|
1643
|
+
* Authenticates with Microsoft Entra ID and returns an access token if successful.
|
|
1570
1644
|
* If authentication fails, a {@link CredentialUnavailableError} will be thrown with the details of the failure.
|
|
1571
1645
|
*
|
|
1572
1646
|
* @param scopes - The list of scopes for which the token will have access.
|
|
@@ -1582,11 +1656,11 @@ export declare class WorkloadIdentityCredential implements TokenCredential {
|
|
|
1582
1656
|
*/
|
|
1583
1657
|
export declare interface WorkloadIdentityCredentialOptions extends MultiTenantTokenCredentialOptions, AuthorityValidationOptions {
|
|
1584
1658
|
/**
|
|
1585
|
-
* ID of the application's
|
|
1659
|
+
* ID of the application's Microsoft Entra tenant. Also called its directory ID.
|
|
1586
1660
|
*/
|
|
1587
1661
|
tenantId?: string;
|
|
1588
1662
|
/**
|
|
1589
|
-
* The client ID of
|
|
1663
|
+
* The client ID of a Microsoft Entra app registration.
|
|
1590
1664
|
*/
|
|
1591
1665
|
clientId?: string;
|
|
1592
1666
|
/**
|