@azure/identity 2.1.0-beta.1 → 2.1.1-alpha.20220712.2
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 +66 -33
- package/dist/index.js +526 -389
- package/dist/index.js.map +1 -1
- package/dist-esm/src/client/identityClient.js +71 -46
- package/dist-esm/src/client/identityClient.js.map +1 -1
- package/dist-esm/src/constants.js +4 -0
- package/dist-esm/src/constants.js.map +1 -1
- package/dist-esm/src/credentials/authorizationCodeCredential.browser.js.map +1 -1
- package/dist-esm/src/credentials/authorizationCodeCredential.js +4 -3
- package/dist-esm/src/credentials/authorizationCodeCredential.js.map +1 -1
- package/dist-esm/src/credentials/azureCliCredential.js +34 -34
- package/dist-esm/src/credentials/azureCliCredential.js.map +1 -1
- package/dist-esm/src/credentials/azurePowerShellCredential.browser.js.map +1 -1
- package/dist-esm/src/credentials/azurePowerShellCredential.js +3 -3
- package/dist-esm/src/credentials/azurePowerShellCredential.js.map +1 -1
- package/dist-esm/src/credentials/chainedTokenCredential.js +28 -33
- package/dist-esm/src/credentials/chainedTokenCredential.js.map +1 -1
- package/dist-esm/src/credentials/clientAssertionCredential.browser.js +22 -0
- package/dist-esm/src/credentials/clientAssertionCredential.browser.js.map +1 -0
- package/dist-esm/src/credentials/clientAssertionCredential.js +45 -0
- package/dist-esm/src/credentials/clientAssertionCredential.js.map +1 -0
- package/dist-esm/src/credentials/clientCertificateCredential.browser.js.map +1 -1
- package/dist-esm/src/credentials/clientCertificateCredential.js +7 -4
- package/dist-esm/src/credentials/clientCertificateCredential.js.map +1 -1
- package/dist-esm/src/credentials/clientSecretCredential.browser.js +31 -38
- package/dist-esm/src/credentials/clientSecretCredential.browser.js.map +1 -1
- package/dist-esm/src/credentials/clientSecretCredential.js +2 -2
- package/dist-esm/src/credentials/clientSecretCredential.js.map +1 -1
- package/dist-esm/src/credentials/defaultAzureCredential.js +16 -29
- package/dist-esm/src/credentials/defaultAzureCredential.js.map +1 -1
- package/dist-esm/src/credentials/deviceCodeCredential.browser.js.map +1 -1
- package/dist-esm/src/credentials/deviceCodeCredential.js +3 -3
- package/dist-esm/src/credentials/deviceCodeCredential.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/interactiveBrowserCredential.browser.js +3 -3
- package/dist-esm/src/credentials/interactiveBrowserCredential.browser.js.map +1 -1
- package/dist-esm/src/credentials/interactiveBrowserCredential.js +3 -3
- package/dist-esm/src/credentials/interactiveBrowserCredential.js.map +1 -1
- package/dist-esm/src/credentials/managedIdentityCredential/appServiceMsi2017.js.map +1 -1
- package/dist-esm/src/credentials/managedIdentityCredential/appServiceMsi2019.js +77 -0
- package/dist-esm/src/credentials/managedIdentityCredential/appServiceMsi2019.js.map +1 -0
- package/dist-esm/src/credentials/managedIdentityCredential/arcMsi.js.map +1 -1
- package/dist-esm/src/credentials/managedIdentityCredential/cloudShellMsi.js.map +1 -1
- package/dist-esm/src/credentials/managedIdentityCredential/fabricMsi.js.map +1 -1
- package/dist-esm/src/credentials/managedIdentityCredential/imdsMsi.js +38 -49
- package/dist-esm/src/credentials/managedIdentityCredential/imdsMsi.js.map +1 -1
- package/dist-esm/src/credentials/managedIdentityCredential/index.js +20 -13
- package/dist-esm/src/credentials/managedIdentityCredential/index.js.map +1 -1
- package/dist-esm/src/credentials/managedIdentityCredential/tokenExchangeMsi.js.map +1 -1
- package/dist-esm/src/credentials/onBehalfOfCredential.browser.js.map +1 -1
- package/dist-esm/src/credentials/onBehalfOfCredential.js +2 -23
- 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 +5 -6
- package/dist-esm/src/credentials/usernamePasswordCredential.browser.js.map +1 -1
- package/dist-esm/src/credentials/usernamePasswordCredential.js +2 -2
- package/dist-esm/src/credentials/usernamePasswordCredential.js.map +1 -1
- package/dist-esm/src/credentials/visualStudioCodeCredential.browser.js.map +1 -1
- package/dist-esm/src/credentials/visualStudioCodeCredential.js.map +1 -1
- package/dist-esm/src/errors.js.map +1 -1
- package/dist-esm/src/index.js +1 -0
- package/dist-esm/src/index.js.map +1 -1
- package/dist-esm/src/msal/browserFlows/msalAuthCode.js.map +1 -1
- package/dist-esm/src/msal/browserFlows/msalBrowserCommon.js +1 -1
- 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/msalAuthorizationCode.js +2 -2
- package/dist-esm/src/msal/nodeFlows/msalAuthorizationCode.js.map +1 -1
- package/dist-esm/src/msal/nodeFlows/msalClientAssertion.js +42 -0
- package/dist-esm/src/msal/nodeFlows/msalClientAssertion.js.map +1 -0
- package/dist-esm/src/msal/nodeFlows/msalClientCertificate.js +8 -3
- package/dist-esm/src/msal/nodeFlows/msalClientCertificate.js.map +1 -1
- package/dist-esm/src/msal/nodeFlows/msalClientSecret.js.map +1 -1
- package/dist-esm/src/msal/nodeFlows/msalDeviceCode.js +0 -2
- package/dist-esm/src/msal/nodeFlows/msalDeviceCode.js.map +1 -1
- package/dist-esm/src/msal/nodeFlows/msalNodeCommon.js +19 -2
- package/dist-esm/src/msal/nodeFlows/msalNodeCommon.js.map +1 -1
- package/dist-esm/src/msal/nodeFlows/msalOnBehalfOf.js.map +1 -1
- package/dist-esm/src/msal/nodeFlows/msalOpenBrowser.js +2 -1
- package/dist-esm/src/msal/nodeFlows/msalOpenBrowser.js.map +1 -1
- package/dist-esm/src/msal/nodeFlows/msalUsernamePassword.js.map +1 -1
- package/dist-esm/src/msal/utils.js +1 -1
- package/dist-esm/src/msal/utils.js.map +1 -1
- package/dist-esm/src/tokenCredentialOptions.js.map +1 -1
- package/dist-esm/src/util/logging.js.map +1 -1
- package/dist-esm/src/util/tracing.js +5 -36
- package/dist-esm/src/util/tracing.js.map +1 -1
- package/package.json +31 -25
- package/types/identity.d.ts +162 -57
- package/CHANGELOG.md +0 -530
package/types/identity.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { AccessToken } from '@azure/core-auth';
|
|
|
2
2
|
import { AzureLogger } from '@azure/logger';
|
|
3
3
|
import { CommonClientOptions } from '@azure/core-client';
|
|
4
4
|
import { GetTokenOptions } from '@azure/core-auth';
|
|
5
|
+
import { LogPolicyOptions } from '@azure/core-rest-pipeline';
|
|
5
6
|
import { TokenCredential } from '@azure/core-auth';
|
|
6
7
|
|
|
7
8
|
export { AccessToken }
|
|
@@ -122,7 +123,7 @@ export declare class AuthorizationCodeCredential implements TokenCredential {
|
|
|
122
123
|
private authorizationCode;
|
|
123
124
|
private redirectUri;
|
|
124
125
|
/**
|
|
125
|
-
* Creates an instance of
|
|
126
|
+
* Creates an instance of AuthorizationCodeCredential with the details needed
|
|
126
127
|
* to request an access token using an authentication that was obtained
|
|
127
128
|
* from Azure Active Directory.
|
|
128
129
|
*
|
|
@@ -145,7 +146,7 @@ export declare class AuthorizationCodeCredential implements TokenCredential {
|
|
|
145
146
|
*/
|
|
146
147
|
constructor(tenantId: string | "common", clientId: string, clientSecret: string, authorizationCode: string, redirectUri: string, options?: TokenCredentialOptions);
|
|
147
148
|
/**
|
|
148
|
-
* Creates an instance of
|
|
149
|
+
* Creates an instance of AuthorizationCodeCredential with the details needed
|
|
149
150
|
* to request an access token using an authentication that was obtained
|
|
150
151
|
* from Azure Active Directory.
|
|
151
152
|
*
|
|
@@ -331,6 +332,36 @@ export declare class ChainedTokenCredential implements TokenCredential {
|
|
|
331
332
|
getToken(scopes: string | string[], options?: GetTokenOptions): Promise<AccessToken>;
|
|
332
333
|
}
|
|
333
334
|
|
|
335
|
+
/**
|
|
336
|
+
* Authenticates a service principal with a JWT assertion.
|
|
337
|
+
*/
|
|
338
|
+
export declare class ClientAssertionCredential implements TokenCredential {
|
|
339
|
+
private msalFlow;
|
|
340
|
+
private tenantId;
|
|
341
|
+
private clientId;
|
|
342
|
+
private options;
|
|
343
|
+
/**
|
|
344
|
+
* Creates an instance of the ClientAssertionCredential with the details
|
|
345
|
+
* needed to authenticate against Azure Active Directory with a client
|
|
346
|
+
* assertion provided by the developer through the `getAssertion` function parameter.
|
|
347
|
+
*
|
|
348
|
+
* @param tenantId - The Azure Active Directory tenant (directory) ID.
|
|
349
|
+
* @param clientId - The client (application) ID of an App Registration in the tenant.
|
|
350
|
+
* @param getAssertion - A function that retrieves the assertion for the credential to use.
|
|
351
|
+
* @param options - Options for configuring the client which makes the authentication request.
|
|
352
|
+
*/
|
|
353
|
+
constructor(tenantId: string, clientId: string, getAssertion: () => Promise<string>, options?: TokenCredentialOptions);
|
|
354
|
+
/**
|
|
355
|
+
* Authenticates with Azure Active Directory and returns an access token if successful.
|
|
356
|
+
* If authentication fails, a {@link CredentialUnavailableError} will be thrown with the details of the failure.
|
|
357
|
+
*
|
|
358
|
+
* @param scopes - The list of scopes for which the token will have access.
|
|
359
|
+
* @param options - The options used to configure any requests this
|
|
360
|
+
* TokenCredential implementation might make.
|
|
361
|
+
*/
|
|
362
|
+
getToken(scopes: string | string[], options?: GetTokenOptions): Promise<AccessToken>;
|
|
363
|
+
}
|
|
364
|
+
|
|
334
365
|
/**
|
|
335
366
|
* Enables authentication to Azure Active Directory using a PEM-encoded
|
|
336
367
|
* certificate that is assigned to an App Registration. More information
|
|
@@ -357,11 +388,22 @@ export declare class ClientCertificateCredential implements TokenCredential {
|
|
|
357
388
|
*
|
|
358
389
|
* @param tenantId - The Azure Active Directory tenant (directory) ID.
|
|
359
390
|
* @param clientId - The client (application) ID of an App Registration in the tenant.
|
|
360
|
-
* @param configuration - Other parameters required, including the
|
|
361
|
-
* If the type is ignored, we will throw
|
|
391
|
+
* @param configuration - Other parameters required, including the path of the certificate on the filesystem.
|
|
392
|
+
* If the type is ignored, we will throw the value of the path to a PEM certificate.
|
|
393
|
+
* @param options - Options for configuring the client which makes the authentication request.
|
|
394
|
+
*/
|
|
395
|
+
constructor(tenantId: string, clientId: string, configuration: ClientCertificatePEMCertificatePath, options?: ClientCertificateCredentialOptions);
|
|
396
|
+
/**
|
|
397
|
+
* Creates an instance of the ClientCertificateCredential with the details
|
|
398
|
+
* needed to authenticate against Azure Active Directory with a certificate.
|
|
399
|
+
*
|
|
400
|
+
* @param tenantId - The Azure Active Directory tenant (directory) ID.
|
|
401
|
+
* @param clientId - The client (application) ID of an App Registration in the tenant.
|
|
402
|
+
* @param configuration - Other parameters required, including the PEM-encoded certificate as a string.
|
|
403
|
+
* If the type is ignored, we will throw the value of the PEM-encoded certificate.
|
|
362
404
|
* @param options - Options for configuring the client which makes the authentication request.
|
|
363
405
|
*/
|
|
364
|
-
constructor(tenantId: string, clientId: string, configuration:
|
|
406
|
+
constructor(tenantId: string, clientId: string, configuration: ClientCertificatePEMCertificate, options?: ClientCertificateCredentialOptions);
|
|
365
407
|
/**
|
|
366
408
|
* Authenticates with Azure Active Directory and returns an access token if successful.
|
|
367
409
|
* If authentication fails, a {@link CredentialUnavailableError} will be thrown with the details of the failure.
|
|
@@ -387,25 +429,27 @@ export declare interface ClientCertificateCredentialOptions extends TokenCredent
|
|
|
387
429
|
/**
|
|
388
430
|
* Required configuration options for the {@link ClientCertificateCredential}, with either the string contents of a PEM certificate, or the path to a PEM certificate.
|
|
389
431
|
*/
|
|
390
|
-
export declare type ClientCertificateCredentialPEMConfiguration =
|
|
432
|
+
export declare type ClientCertificateCredentialPEMConfiguration = ClientCertificatePEMCertificate | ClientCertificatePEMCertificatePath;
|
|
433
|
+
|
|
434
|
+
/**
|
|
435
|
+
* Required configuration options for the {@link ClientCertificateCredential}, with the string contents of a PEM certificate
|
|
436
|
+
*/
|
|
437
|
+
export declare interface ClientCertificatePEMCertificate {
|
|
391
438
|
/**
|
|
392
439
|
* The PEM-encoded public/private key certificate on the filesystem.
|
|
393
440
|
*/
|
|
394
441
|
certificate: string;
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
* The PEM-encoded public/private key certificate on the filesystem should not be provided if `certificatePath` is provided.
|
|
402
|
-
*/
|
|
403
|
-
certificate?: never;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* Required configuration options for the {@link ClientCertificateCredential}, with the path to a PEM certificate.
|
|
446
|
+
*/
|
|
447
|
+
export declare interface ClientCertificatePEMCertificatePath {
|
|
404
448
|
/**
|
|
405
449
|
* The path to the PEM-encoded public/private key certificate on the filesystem.
|
|
406
450
|
*/
|
|
407
451
|
certificatePath: string;
|
|
408
|
-
}
|
|
452
|
+
}
|
|
409
453
|
|
|
410
454
|
/**
|
|
411
455
|
* Enables authentication to Azure Active Directory using a client secret
|
|
@@ -502,7 +546,55 @@ export declare const CredentialUnavailableErrorName = "CredentialUnavailableErro
|
|
|
502
546
|
*/
|
|
503
547
|
export declare class DefaultAzureCredential extends ChainedTokenCredential {
|
|
504
548
|
/**
|
|
505
|
-
* Creates an instance of the DefaultAzureCredential class
|
|
549
|
+
* Creates an instance of the DefaultAzureCredential class with {@link DefaultAzureCredentialClientIdOptions}
|
|
550
|
+
*
|
|
551
|
+
* This credential provides a default {@link ChainedTokenCredential} configuration that should
|
|
552
|
+
* work for most applications that use the Azure SDK.
|
|
553
|
+
*
|
|
554
|
+
* The following credential types will be tried, in order:
|
|
555
|
+
*
|
|
556
|
+
* - {@link EnvironmentCredential}
|
|
557
|
+
* - {@link ManagedIdentityCredential}
|
|
558
|
+
* - {@link VisualStudioCodeCredential}
|
|
559
|
+
* - {@link AzureCliCredential}
|
|
560
|
+
* - {@link AzurePowerShellCredential}
|
|
561
|
+
*
|
|
562
|
+
* Consult the documentation of these credential types for more information
|
|
563
|
+
* on how they attempt authentication.
|
|
564
|
+
*
|
|
565
|
+
* **Note**: `VisualStudioCodeCredential` is provided by a plugin package:
|
|
566
|
+
* `@azure/identity-vscode`. If this package is not installed and registered
|
|
567
|
+
* using the plugin API (`useIdentityPlugin`), then authentication using
|
|
568
|
+
* `VisualStudioCodeCredential` will not be available.
|
|
569
|
+
* @param options - Optional parameters. See {@link DefaultAzureCredentialClientIdOptions}.
|
|
570
|
+
*/
|
|
571
|
+
constructor(options?: DefaultAzureCredentialClientIdOptions);
|
|
572
|
+
/**
|
|
573
|
+
* Creates an instance of the DefaultAzureCredential class with {@link DefaultAzureCredentialResourceIdOptions}
|
|
574
|
+
*
|
|
575
|
+
* This credential provides a default {@link ChainedTokenCredential} configuration that should
|
|
576
|
+
* work for most applications that use the Azure SDK.
|
|
577
|
+
*
|
|
578
|
+
* The following credential types will be tried, in order:
|
|
579
|
+
*
|
|
580
|
+
* - {@link EnvironmentCredential}
|
|
581
|
+
* - {@link ManagedIdentityCredential}
|
|
582
|
+
* - {@link VisualStudioCodeCredential}
|
|
583
|
+
* - {@link AzureCliCredential}
|
|
584
|
+
* - {@link AzurePowerShellCredential}
|
|
585
|
+
*
|
|
586
|
+
* Consult the documentation of these credential types for more information
|
|
587
|
+
* on how they attempt authentication.
|
|
588
|
+
*
|
|
589
|
+
* **Note**: `VisualStudioCodeCredential` is provided by a plugin package:
|
|
590
|
+
* `@azure/identity-vscode`. If this package is not installed and registered
|
|
591
|
+
* using the plugin API (`useIdentityPlugin`), then authentication using
|
|
592
|
+
* `VisualStudioCodeCredential` will not be available.
|
|
593
|
+
* @param options - Optional parameters. See {@link DefaultAzureCredentialResourceIdOptions}.
|
|
594
|
+
*/
|
|
595
|
+
constructor(options?: DefaultAzureCredentialResourceIdOptions);
|
|
596
|
+
/**
|
|
597
|
+
* Creates an instance of the DefaultAzureCredential class with {@link DefaultAzureCredentialOptions}
|
|
506
598
|
*
|
|
507
599
|
* This credential provides a default {@link ChainedTokenCredential} configuration that should
|
|
508
600
|
* work for most applications that use the Azure SDK.
|
|
@@ -532,12 +624,7 @@ export declare class DefaultAzureCredential extends ChainedTokenCredential {
|
|
|
532
624
|
* Provides options to configure the {@link DefaultAzureCredential} class.
|
|
533
625
|
* This variation supports `managedIdentityClientId` and not `managedIdentityResourceId`, since only one of both is supported.
|
|
534
626
|
*/
|
|
535
|
-
export declare interface DefaultAzureCredentialClientIdOptions extends
|
|
536
|
-
/**
|
|
537
|
-
* Optionally pass in a Tenant ID to be used as part of the credential.
|
|
538
|
-
* By default it may use a generic tenant ID depending on the underlying credential.
|
|
539
|
-
*/
|
|
540
|
-
tenantId?: string;
|
|
627
|
+
export declare interface DefaultAzureCredentialClientIdOptions extends DefaultAzureCredentialOptions {
|
|
541
628
|
/**
|
|
542
629
|
* Optionally pass in a user assigned client ID to be used by the {@link ManagedIdentityCredential}.
|
|
543
630
|
* This client ID can also be passed through to the {@link ManagedIdentityCredential} through the environment variable: AZURE_CLIENT_ID.
|
|
@@ -548,18 +635,19 @@ export declare interface DefaultAzureCredentialClientIdOptions extends TokenCred
|
|
|
548
635
|
/**
|
|
549
636
|
* Provides options to configure the {@link DefaultAzureCredential} class.
|
|
550
637
|
*/
|
|
551
|
-
export declare
|
|
552
|
-
|
|
553
|
-
/**
|
|
554
|
-
* Provides options to configure the {@link DefaultAzureCredential} class.
|
|
555
|
-
* This variation supports `managedIdentityResourceId` and not `managedIdentityClientId`, since only one of both is supported.
|
|
556
|
-
*/
|
|
557
|
-
export declare interface DefaultAzureCredentialResourceIdOptions extends TokenCredentialOptions {
|
|
638
|
+
export declare interface DefaultAzureCredentialOptions extends TokenCredentialOptions {
|
|
558
639
|
/**
|
|
559
640
|
* Optionally pass in a Tenant ID to be used as part of the credential.
|
|
560
641
|
* By default it may use a generic tenant ID depending on the underlying credential.
|
|
561
642
|
*/
|
|
562
643
|
tenantId?: string;
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
/**
|
|
647
|
+
* Provides options to configure the {@link DefaultAzureCredential} class.
|
|
648
|
+
* This variation supports `managedIdentityResourceId` and not `managedIdentityClientId`, since only one of both is supported.
|
|
649
|
+
*/
|
|
650
|
+
export declare interface DefaultAzureCredentialResourceIdOptions extends DefaultAzureCredentialOptions {
|
|
563
651
|
/**
|
|
564
652
|
* Optionally pass in a resource ID to be used by the {@link ManagedIdentityCredential}.
|
|
565
653
|
* In scenarios such as when user assigned identities are created using an ARM template,
|
|
@@ -567,7 +655,7 @@ export declare interface DefaultAzureCredentialResourceIdOptions extends TokenCr
|
|
|
567
655
|
* this parameter allows programs to use these user assigned identities
|
|
568
656
|
* without having to first determine the client Id of the created identity.
|
|
569
657
|
*/
|
|
570
|
-
managedIdentityResourceId
|
|
658
|
+
managedIdentityResourceId: string;
|
|
571
659
|
}
|
|
572
660
|
|
|
573
661
|
/**
|
|
@@ -940,11 +1028,17 @@ export declare class ManagedIdentityCredential implements TokenCredential {
|
|
|
940
1028
|
*/
|
|
941
1029
|
constructor(clientId: string, options?: TokenCredentialOptions);
|
|
942
1030
|
/**
|
|
943
|
-
* Creates an instance of ManagedIdentityCredential
|
|
1031
|
+
* Creates an instance of ManagedIdentityCredential with clientId
|
|
944
1032
|
*
|
|
945
1033
|
* @param options - Options for configuring the client which makes the access token request.
|
|
946
1034
|
*/
|
|
947
|
-
constructor(options?:
|
|
1035
|
+
constructor(options?: ManagedIdentityCredentialClientIdOptions);
|
|
1036
|
+
/**
|
|
1037
|
+
* Creates an instance of ManagedIdentityCredential with Resource Id
|
|
1038
|
+
*
|
|
1039
|
+
* @param options - Options for configuring the resource which makes the access token request.
|
|
1040
|
+
*/
|
|
1041
|
+
constructor(options?: ManagedIdentityCredentialResourceIdOptions);
|
|
948
1042
|
private cachedMSI;
|
|
949
1043
|
private cachedAvailableMSI;
|
|
950
1044
|
private authenticateManagedIdentity;
|
|
@@ -971,11 +1065,6 @@ export declare interface ManagedIdentityCredentialClientIdOptions extends TokenC
|
|
|
971
1065
|
clientId?: string;
|
|
972
1066
|
}
|
|
973
1067
|
|
|
974
|
-
/**
|
|
975
|
-
* Options to send on the {@link ManagedIdentityCredential} constructor.
|
|
976
|
-
*/
|
|
977
|
-
export declare type ManagedIdentityCredentialOptions = ManagedIdentityCredentialClientIdOptions | ManagedIdentityCredentialResourceIdOptions;
|
|
978
|
-
|
|
979
1068
|
/**
|
|
980
1069
|
* Options to send on the {@link ManagedIdentityCredential} constructor.
|
|
981
1070
|
* This variation supports `resourceId` and not `clientId`, since only one of both is supported.
|
|
@@ -988,7 +1077,7 @@ export declare interface ManagedIdentityCredentialResourceIdOptions extends Toke
|
|
|
988
1077
|
* this parameter allows programs to use these user assigned identities
|
|
989
1078
|
* without having to first determine the client Id of the created identity.
|
|
990
1079
|
*/
|
|
991
|
-
resourceId
|
|
1080
|
+
resourceId: string;
|
|
992
1081
|
}
|
|
993
1082
|
|
|
994
1083
|
/**
|
|
@@ -997,10 +1086,32 @@ export declare interface ManagedIdentityCredentialResourceIdOptions extends Toke
|
|
|
997
1086
|
export declare class OnBehalfOfCredential implements TokenCredential {
|
|
998
1087
|
private options;
|
|
999
1088
|
private msalFlow;
|
|
1089
|
+
/**
|
|
1090
|
+
* Creates an instance of the {@link OnBehalfOfCredential} with the details
|
|
1091
|
+
* needed to authenticate against Azure Active Directory with path to a PEM certificate,
|
|
1092
|
+
* and an user assertion.
|
|
1093
|
+
*
|
|
1094
|
+
* Example using the `KeyClient` from [\@azure/keyvault-keys](https://www.npmjs.com/package/\@azure/keyvault-keys):
|
|
1095
|
+
*
|
|
1096
|
+
* ```ts
|
|
1097
|
+
* const tokenCredential = new OnBehalfOfCredential({
|
|
1098
|
+
* tenantId,
|
|
1099
|
+
* clientId,
|
|
1100
|
+
* certificatePath: "/path/to/certificate.pem",
|
|
1101
|
+
* userAssertionToken: "access-token"
|
|
1102
|
+
* });
|
|
1103
|
+
* const client = new KeyClient("vault-url", tokenCredential);
|
|
1104
|
+
*
|
|
1105
|
+
* await client.getKey("key-name");
|
|
1106
|
+
* ```
|
|
1107
|
+
*
|
|
1108
|
+
* @param options - Optional parameters, generally common across credentials.
|
|
1109
|
+
*/
|
|
1110
|
+
constructor(options: OnBehalfOfCredentialCertificateOptions & TokenCredentialOptions & CredentialPersistenceOptions);
|
|
1000
1111
|
/**
|
|
1001
1112
|
* Creates an instance of the {@link OnBehalfOfCredential} with the details
|
|
1002
1113
|
* needed to authenticate against Azure Active Directory with a client
|
|
1003
|
-
* secret
|
|
1114
|
+
* secret and an user assertion.
|
|
1004
1115
|
*
|
|
1005
1116
|
* Example using the `KeyClient` from [\@azure/keyvault-keys](https://www.npmjs.com/package/\@azure/keyvault-keys):
|
|
1006
1117
|
*
|
|
@@ -1008,7 +1119,7 @@ export declare class OnBehalfOfCredential implements TokenCredential {
|
|
|
1008
1119
|
* const tokenCredential = new OnBehalfOfCredential({
|
|
1009
1120
|
* tenantId,
|
|
1010
1121
|
* clientId,
|
|
1011
|
-
* clientSecret,
|
|
1122
|
+
* clientSecret,
|
|
1012
1123
|
* userAssertionToken: "access-token"
|
|
1013
1124
|
* });
|
|
1014
1125
|
* const client = new KeyClient("vault-url", tokenCredential);
|
|
@@ -1018,7 +1129,7 @@ export declare class OnBehalfOfCredential implements TokenCredential {
|
|
|
1018
1129
|
*
|
|
1019
1130
|
* @param options - Optional parameters, generally common across credentials.
|
|
1020
1131
|
*/
|
|
1021
|
-
constructor(options:
|
|
1132
|
+
constructor(options: OnBehalfOfCredentialSecretOptions & TokenCredentialOptions & CredentialPersistenceOptions);
|
|
1022
1133
|
/**
|
|
1023
1134
|
* Authenticates with Azure Active Directory and returns an access token if successful.
|
|
1024
1135
|
* If authentication fails, a {@link CredentialUnavailableError} will be thrown with the details of the failure.
|
|
@@ -1045,19 +1156,15 @@ export declare interface OnBehalfOfCredentialCertificateOptions {
|
|
|
1045
1156
|
* The path to a PEM-encoded public/private key certificate on the filesystem.
|
|
1046
1157
|
*/
|
|
1047
1158
|
certificatePath: string;
|
|
1048
|
-
/**
|
|
1049
|
-
* Option to include x5c header for SubjectName and Issuer name authorization.
|
|
1050
|
-
* Set this option to send base64 encoded public certificate in the client assertion header as an x5c claim
|
|
1051
|
-
*/
|
|
1052
|
-
sendCertificateChain?: boolean;
|
|
1053
1159
|
/**
|
|
1054
1160
|
* The user assertion for the On-Behalf-Of flow.
|
|
1055
1161
|
*/
|
|
1056
1162
|
userAssertionToken: string;
|
|
1057
1163
|
/**
|
|
1058
|
-
*
|
|
1164
|
+
* Option to include x5c header for SubjectName and Issuer name authorization.
|
|
1165
|
+
* Set this option to send base64 encoded public certificate in the client assertion header as an x5c claim
|
|
1059
1166
|
*/
|
|
1060
|
-
|
|
1167
|
+
sendCertificateChain?: boolean;
|
|
1061
1168
|
}
|
|
1062
1169
|
|
|
1063
1170
|
/**
|
|
@@ -1085,14 +1192,6 @@ export declare interface OnBehalfOfCredentialSecretOptions {
|
|
|
1085
1192
|
* The user assertion for the On-Behalf-Of flow.
|
|
1086
1193
|
*/
|
|
1087
1194
|
userAssertionToken: string;
|
|
1088
|
-
/**
|
|
1089
|
-
* The path to a PEM-encoded certificate should not be provided when the secret options are provided.
|
|
1090
|
-
*/
|
|
1091
|
-
certificatePath?: never;
|
|
1092
|
-
/**
|
|
1093
|
-
* Option to include x5c header should not be provided when the secret options are provided.
|
|
1094
|
-
*/
|
|
1095
|
-
sendCertificateChain?: never;
|
|
1096
1195
|
}
|
|
1097
1196
|
|
|
1098
1197
|
/**
|
|
@@ -1148,6 +1247,12 @@ export declare interface TokenCredentialOptions extends CommonClientOptions {
|
|
|
1148
1247
|
* The default is "https://login.microsoftonline.com".
|
|
1149
1248
|
*/
|
|
1150
1249
|
authorityHost?: string;
|
|
1250
|
+
/**
|
|
1251
|
+
* Allows logging account information once the authentication flow succeeds.
|
|
1252
|
+
*/
|
|
1253
|
+
loggingOptions?: LogPolicyOptions & {
|
|
1254
|
+
allowLoggingAccountIdentifiers?: boolean;
|
|
1255
|
+
};
|
|
1151
1256
|
}
|
|
1152
1257
|
|
|
1153
1258
|
/**
|