/
onBehalfOfCredentialOptions.ts
64 lines (60 loc) · 1.79 KB
/
onBehalfOfCredentialOptions.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { TokenCredentialOptions } from "../tokenCredentialOptions";
import { CredentialPersistenceOptions } from "./credentialPersistenceOptions";
/**
* Defines the parameters to authenticate the {@link OnBehalfOfCredential} with a secret.
*/
export interface OnBehalfOfCredentialSecretOptions {
/**
* The Azure Active Directory tenant (directory) ID.
*/
tenantId: string;
/**
* The client (application) ID of an App Registration in the tenant.
*/
clientId: string;
/**
* A client secret that was generated for the App Registration.
*/
clientSecret: string;
/**
* The user assertion for the On-Behalf-Of flow.
*/
userAssertionToken: string;
}
/**
* Defines the parameters to authenticate the {@link OnBehalfOfCredential} with a certificate.
*/
export interface OnBehalfOfCredentialCertificateOptions {
/**
* The Azure Active Directory tenant (directory) ID.
*/
tenantId: string;
/**
* The client (application) ID of an App Registration in the tenant.
*/
clientId: string;
/**
* The path to a PEM-encoded public/private key certificate on the filesystem.
*/
certificatePath: string;
/**
* The user assertion for the On-Behalf-Of flow.
*/
userAssertionToken: string;
/**
* Option to include x5c header for SubjectName and Issuer name authorization.
* Set this option to send base64 encoded public certificate in the client assertion header as an x5c claim
*/
sendCertificateChain?: boolean;
}
/**
* Optional parameters for the {@link OnBehalfOfCredential} class.
*/
export type OnBehalfOfCredentialOptions = (
| OnBehalfOfCredentialSecretOptions
| OnBehalfOfCredentialCertificateOptions
) &
TokenCredentialOptions &
CredentialPersistenceOptions;