-
Notifications
You must be signed in to change notification settings - Fork 7
/
PublicClientApplication.yml
356 lines (316 loc) · 12.7 KB
/
PublicClientApplication.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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
### YamlMime:TSType
name: PublicClientApplication
uid: '@azure/msal-node.PublicClientApplication'
package: '@azure/msal-node'
summary: >-
This class is to be used to acquire tokens for public client applications
(desktop, mobile). Public client applications
are not trusted to safely store application secrets, and therefore can only
request tokens in the name of an user.
fullName: PublicClientApplication
remarks: ''
isPreview: false
isDeprecated: false
type: class
constructors:
- name: PublicClientApplication(Configuration)
uid: '@azure/msal-node.PublicClientApplication.constructor'
package: '@azure/msal-node'
summary: >
Important attributes in the Configuration object for auth are:
- clientID: the application ID of your application. You can obtain one by
registering your application with our Application registration portal.
- authority: the authority URL for your application.
AAD authorities are of the form
https://login.microsoftonline.com/\{Enter_the_Tenant_Info_Here\}.
- If your application supports Accounts in one organizational directory,
replace "Enter_the_Tenant_Info_Here" value with the Tenant Id or Tenant
name (for example, contoso.microsoft.com).
- If your application supports Accounts in any organizational directory,
replace "Enter_the_Tenant_Info_Here" value with organizations.
- If your application supports Accounts in any organizational directory
and personal Microsoft accounts, replace "Enter_the_Tenant_Info_Here"
value with common.
- To restrict support to Personal Microsoft accounts only, replace
"Enter_the_Tenant_Info_Here" value with consumers.
Azure B2C authorities are of the form
https://\{instance\}/\{tenant\}/\{policy\}. Each policy is considered
its own authority. You will have to set the all of the knownAuthorities at
the time of the client application
construction.
ADFS authorities are of the form https://\{instance\}/adfs.
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: 'new PublicClientApplication(configuration: Configuration)'
parameters:
- id: configuration
type: <xref uid="@azure/msal-node.Configuration" />
description: ''
inheritedMethods:
- name: 'acquireTokenByCode(AuthorizationCodeRequest, AuthorizationCodePayload)'
uid: '@azure/msal-node.PublicClientApplication.acquireTokenByCode'
package: '@azure/msal-node'
summary: >
Acquires a token by exchanging the Authorization Code received from the
first step of OAuth2.0
Authorization Code flow.
`getAuthCodeUrl(AuthorizationCodeUrlRequest)` can be used to create the
URL for the first step of OAuth2.0
Authorization Code flow. Ensure that values for redirectUri and scopes in
AuthorizationCodeUrlRequest and
AuthorizationCodeRequest are the same.
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: >-
function acquireTokenByCode(request: AuthorizationCodeRequest,
authCodePayLoad?: AuthorizationCodePayload):
Promise<AuthenticationResult>
parameters:
- id: request
type: <xref uid="@azure/msal-node.AuthorizationCodeRequest" />
description: ''
- id: authCodePayLoad
type: AuthorizationCodePayload
description: ''
return:
description: ''
type: Promise<AuthenticationResult>
inheritanceDescription: >-
<b>Inherited From</b>
[ClientApplication.acquireTokenByCode](xref:@azure/msal-node.ClientApplication.acquireTokenByCode)
- name: acquireTokenByRefreshToken(RefreshTokenRequest)
uid: '@azure/msal-node.PublicClientApplication.acquireTokenByRefreshToken'
package: '@azure/msal-node'
summary: >
Acquires a token by exchanging the refresh token provided for a new set of
tokens.
This API is provided only for scenarios where you would like to migrate
from ADAL to MSAL. Otherwise, it is
recommended that you use `acquireTokenSilent()` for silent scenarios. When
using `acquireTokenSilent()`, MSAL will
handle the caching and refreshing of tokens automatically.
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: >-
function acquireTokenByRefreshToken(request: RefreshTokenRequest):
Promise<AuthenticationResult | null>
parameters:
- id: request
type: <xref uid="@azure/msal-node.RefreshTokenRequest" />
description: ''
return:
description: ''
type: Promise<AuthenticationResult | null>
inheritanceDescription: >-
<b>Inherited From</b>
[ClientApplication.acquireTokenByRefreshToken](xref:@azure/msal-node.ClientApplication.acquireTokenByRefreshToken)
- name: acquireTokenByUsernamePassword(UsernamePasswordRequest)
uid: '@azure/msal-node.PublicClientApplication.acquireTokenByUsernamePassword'
package: '@azure/msal-node'
summary: >
Acquires tokens with password grant by exchanging client applications
username and password for credentials
The latest OAuth 2.0 Security Best Current Practice disallows the password
grant entirely.
More details on this recommendation at
https://tools.ietf.org/html/draft-ietf-oauth-security-topics-13#section-3.4
Microsoft's documentation and recommendations are at:
https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-authentication-flows#usernamepassword
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: >-
function acquireTokenByUsernamePassword(request:
UsernamePasswordRequest): Promise<AuthenticationResult | null>
parameters:
- id: request
type: <xref uid="@azure/msal-node.UsernamePasswordRequest" />
description: |
UsenamePasswordRequest
return:
description: ''
type: Promise<AuthenticationResult | null>
inheritanceDescription: >-
<b>Inherited From</b>
[ClientApplication.acquireTokenByUsernamePassword](xref:@azure/msal-node.ClientApplication.acquireTokenByUsernamePassword)
- name: acquireTokenSilent(SilentFlowRequest)
uid: '@azure/msal-node.PublicClientApplication.acquireTokenSilent'
package: '@azure/msal-node'
summary: >
Acquires a token silently when a user specifies the account the token is
requested for.
This API expects the user to provide an account object and looks into the
cache to retrieve the token if present.
There is also an optional "forceRefresh" boolean the user can send to
bypass the cache for access_token and id_token.
In case the refresh_token is expired or not found, an error is thrown
and the guidance is for the user to call any interactive token acquisition
API (eg: `acquireTokenByCode()`).
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: >-
function acquireTokenSilent(request: SilentFlowRequest):
Promise<AuthenticationResult | null>
parameters:
- id: request
type: <xref uid="@azure/msal-node.SilentFlowRequest" />
description: ''
return:
description: ''
type: Promise<AuthenticationResult | null>
inheritanceDescription: >-
<b>Inherited From</b>
[ClientApplication.acquireTokenSilent](xref:@azure/msal-node.ClientApplication.acquireTokenSilent)
- name: clearCache()
uid: '@azure/msal-node.PublicClientApplication.clearCache'
package: '@azure/msal-node'
summary: Clear the cache
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: function clearCache()
inheritanceDescription: >-
<b>Inherited From</b>
[ClientApplication.clearCache](xref:@azure/msal-node.ClientApplication.clearCache)
- name: getAuthCodeUrl(AuthorizationUrlRequest)
uid: '@azure/msal-node.PublicClientApplication.getAuthCodeUrl'
package: '@azure/msal-node'
summary: >
Creates the URL of the authorization request, letting the user input
credentials and consent to the
application. The URL targets the /authorize endpoint of the authority
configured in the
application object.
Once the user inputs their credentials and consents, the authority will
send a response to the redirect URI
sent in the request and should contain an authorization code, which can
then be used to acquire tokens via
`acquireTokenByCode(AuthorizationCodeRequest)`.
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: >-
function getAuthCodeUrl(request: AuthorizationUrlRequest):
Promise<string>
parameters:
- id: request
type: <xref uid="@azure/msal-node.AuthorizationUrlRequest" />
description: ''
return:
description: ''
type: Promise<string>
inheritanceDescription: >-
<b>Inherited From</b>
[ClientApplication.getAuthCodeUrl](xref:@azure/msal-node.ClientApplication.getAuthCodeUrl)
- name: getLogger()
uid: '@azure/msal-node.PublicClientApplication.getLogger'
package: '@azure/msal-node'
summary: Returns the logger instance
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: 'function getLogger(): Logger'
return:
description: ''
type: Logger
inheritanceDescription: >-
<b>Inherited From</b>
[ClientApplication.getLogger](xref:@azure/msal-node.ClientApplication.getLogger)
- name: getTokenCache()
uid: '@azure/msal-node.PublicClientApplication.getTokenCache'
package: '@azure/msal-node'
summary: Gets the token cache for the application.
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: 'function getTokenCache(): TokenCache'
return:
description: ''
type: <xref uid="@azure/msal-node.TokenCache" />
inheritanceDescription: >-
<b>Inherited From</b>
[ClientApplication.getTokenCache](xref:@azure/msal-node.ClientApplication.getTokenCache)
- name: setLogger(Logger)
uid: '@azure/msal-node.PublicClientApplication.setLogger'
package: '@azure/msal-node'
summary: >-
Replaces the default logger set in configurations with new Logger with new
configurations
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: 'function setLogger(logger: Logger)'
parameters:
- id: logger
type: Logger
description: |
Logger instance
inheritanceDescription: >-
<b>Inherited From</b>
[ClientApplication.setLogger](xref:@azure/msal-node.ClientApplication.setLogger)
methods:
- name: acquireTokenByDeviceCode(DeviceCodeRequest)
uid: '@azure/msal-node.PublicClientApplication.acquireTokenByDeviceCode'
package: '@azure/msal-node'
summary: >-
Acquires a token from the authority using OAuth2.0 device code flow.
This flow is designed for devices that do not have access to a browser or
have input constraints.
The authorization server issues a DeviceCode object with a verification
code, an end-user code,
and the end-user verification URI. The DeviceCode object is provided
through a callback, and the end-user should be
instructed to use another device to navigate to the verification URI to
input credentials.
Since the client cannot receive incoming requests, it polls the
authorization server repeatedly
until the end-user completes input of credentials.
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: >-
function acquireTokenByDeviceCode(request: DeviceCodeRequest):
Promise<AuthenticationResult | null>
parameters:
- id: request
type: <xref uid="@azure/msal-node.DeviceCodeRequest" />
description: ''
return:
description: ''
type: Promise<AuthenticationResult | null>
- name: acquireTokenInteractive(InteractiveRequest)
uid: '@azure/msal-node.PublicClientApplication.acquireTokenInteractive'
package: '@azure/msal-node'
summary: >-
Acquires a token by requesting an Authorization code then exchanging it
for a token.
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: >-
function acquireTokenInteractive(request: InteractiveRequest):
Promise<AuthenticationResult>
parameters:
- id: request
type: <xref uid="@azure/msal-node.InteractiveRequest" />
description: ''
return:
description: ''
type: Promise<AuthenticationResult>
extends: <xref uid="@azure/msal-node.ClientApplication" />