/
EnvironmentCredential.yml
101 lines (81 loc) · 3.44 KB
/
EnvironmentCredential.yml
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
### YamlMime:TSType
name: EnvironmentCredential
uid: '@azure/identity.EnvironmentCredential'
package: '@azure/identity'
summary: >-
Enables authentication to Microsoft Entra ID using a client secret or
certificate, or as a user
with a username and password.
fullName: EnvironmentCredential
remarks: ''
isDeprecated: false
type: class
constructors:
- name: EnvironmentCredential(EnvironmentCredentialOptions)
uid: '@azure/identity.EnvironmentCredential.constructor'
package: '@azure/identity'
summary: >-
Creates an instance of the EnvironmentCredential class and decides what
credential to use depending on the available environment variables.
Required environment variables:
- `AZURE_TENANT_ID`: The Microsoft Entra tenant (directory) ID.
- `AZURE_CLIENT_ID`: The client (application) ID of an App Registration in
the tenant.
If setting the AZURE_TENANT_ID, then you can also set the additionally
allowed tenants
- `AZURE_ADDITIONALLY_ALLOWED_TENANTS`: For multi-tenant applications,
specifies additional tenants for which the credential may acquire tokens
with a single semicolon delimited string. Use * to allow all tenants.
Environment variables used for client credential authentication:
- `AZURE_CLIENT_SECRET`: A client secret that was generated for the App
Registration.
- `AZURE_CLIENT_CERTIFICATE_PATH`: The path to a PEM certificate to use
during the authentication, instead of the client secret.
- `AZURE_CLIENT_CERTIFICATE_PASSWORD`: (optional) password for the
certificate file.
Alternatively, users can provide environment variables for username and
password authentication:
- `AZURE_USERNAME`: Username to authenticate with.
- `AZURE_PASSWORD`: Password to authenticate with.
If the environment variables required to perform the authentication are
missing, a
[CredentialUnavailableError](xref:@azure/identity.CredentialUnavailableError)
will be thrown.
If the authentication fails, or if there's an unknown error, an
[AuthenticationError](xref:@azure/identity.AuthenticationError) will be
thrown.
remarks: ''
isDeprecated: false
syntax:
content: 'new EnvironmentCredential(options?: EnvironmentCredentialOptions)'
parameters:
- id: options
type: <xref uid="@azure/identity.EnvironmentCredentialOptions" />
description: >-
Options for configuring the client which makes the authentication
request.
methods:
- name: getToken(string | string[], GetTokenOptions)
uid: '@azure/identity.EnvironmentCredential.getToken'
package: '@azure/identity'
summary: >-
Authenticates with Microsoft Entra ID and returns an access token if
successful.
remarks: ''
isDeprecated: false
syntax:
content: >-
function getToken(scopes: string | string[], options?: GetTokenOptions):
Promise<AccessToken>
parameters:
- id: scopes
type: string | string[]
description: The list of scopes for which the token will have access.
- id: options
type: <xref uid="@azure/identity.GetTokenOptions" />
description: >-
Optional parameters. See
[GetTokenOptions](xref:@azure/identity.GetTokenOptions).
return:
description: ''
type: Promise<<xref uid="@azure/identity.AccessToken" />>