/
interactiveBrowserCredentialOptions.ts
81 lines (70 loc) · 2.62 KB
/
interactiveBrowserCredentialOptions.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { InteractiveCredentialOptions } from "./interactiveCredentialOptions";
import { CredentialPersistenceOptions } from "./credentialPersistenceOptions";
/**
* (Browser-only feature)
* The "login style" to use in the authentication flow:
* - "redirect" redirects the user to the authentication page and then
* redirects them back to the page once authentication is completed.
* - "popup" opens a new browser window through with the redirect flow
* is initiated. The user's existing browser window does not leave
* the current page
*/
export type BrowserLoginStyle = "redirect" | "popup";
/**
* Defines the common options for the InteractiveBrowserCredential class.
*/
export interface InteractiveBrowserCredentialOptions
extends InteractiveCredentialOptions,
CredentialPersistenceOptions {
/**
* Gets the redirect URI of the application. This should be same as the value
* in the application registration portal. Defaults to `window.location.href`.
*/
redirectUri?: string | (() => string);
/**
* The Azure Active Directory tenant (directory) ID.
*/
tenantId?: string;
/**
* The client (application) ID of an App Registration in the tenant.
*/
clientId?: string;
/**
* loginHint allows a user name to be pre-selected for interactive logins.
* Setting this option skips the account selection prompt and immediately attempts to login with the specified account.
*/
loginHint?: string;
}
/**
* Defines the common options for the InteractiveBrowserCredential class.
*/
export interface InteractiveBrowserCredentialBrowserOptions extends InteractiveCredentialOptions {
/**
* Gets the redirect URI of the application. This should be same as the value
* in the application registration portal. Defaults to `window.location.href`.
*/
redirectUri?: string | (() => string);
/**
* The Azure Active Directory tenant (directory) ID.
*/
tenantId?: string;
/**
* The client (application) ID of an App Registration in the tenant.
* This parameter is required on the browser.
*/
clientId: string;
/**
* Specifies whether a redirect or a popup window should be used to
* initiate the user authentication flow. Possible values are "redirect"
* or "popup" (default) for browser and "popup" (default) for node.
*
*/
loginStyle?: BrowserLoginStyle;
/**
* loginHint allows a user name to be pre-selected for interactive logins.
* Setting this option skips the account selection prompt and immediately attempts to login with the specified account.
*/
loginHint?: string;
}