-
Notifications
You must be signed in to change notification settings - Fork 2.6k
/
Constants.ts
154 lines (131 loc) · 5.63 KB
/
Constants.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
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
import { CacheLocation } from "./Configuration";
import { InteractionRequiredAuthErrorMessage as InteractionError } from "./error/InteractionRequiredAuthError";
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
/**
* @hidden
* Constants
*/
export class Constants {
static get errorDescription(): string { return "error_description"; }
static get error(): string { return "error"; }
static get scope(): string { return "scope"; }
static get clientInfo(): string { return "client_info"; }
static get clientId(): string { return "clientId"; }
static get idToken(): string { return "id_token"; }
static get adalIdToken(): string { return "adal.idtoken"; }
static get accessToken(): string { return "access_token"; }
static get expiresIn(): string { return "expires_in"; }
static get sessionState(): string { return "session_state"; }
static get claims(): string { return "claims"; }
static get msalClientInfo(): string { return "msal.client.info"; }
static get msalError(): string { return "msal.error"; }
static get msalErrorDescription(): string { return "msal.error.description"; }
static get msalSessionState(): string { return "msal.session.state"; }
static get tokenKeys(): string { return "msal.token.keys"; }
static get accessTokenKey(): string { return "msal.access.token.key"; }
static get expirationKey(): string { return "msal.expiration.key"; }
static get stateLogin(): string { return "msal.state.login"; }
static get stateAcquireToken(): string { return "msal.state.acquireToken"; }
static get stateRenew(): string { return "msal.state.renew"; }
static get nonceIdToken(): string { return "msal.nonce.idtoken"; }
static get userName(): string { return "msal.username"; }
static get idTokenKey(): string { return "msal.idtoken"; }
static get loginRequest(): string { return "msal.login.request"; }
static get loginError(): string { return "msal.login.error"; }
static get renewStatus(): string { return "msal.token.renew.status"; }
static get urlHash(): string { return "msal.urlHash"; }
static get angularLoginRequest(): string { return "msal.angular.login.request"; }
static get msal(): string { return "msal"; }
static get no_account(): string { return "NO_ACCOUNT"; }
static get consumersUtid(): string { return "9188040d-6c67-4c5b-b112-36a304b66dad"; }
static get upn(): string { return "upn"; }
static get prompt_select_account(): string { return "&prompt=select_account"; }
static get prompt_none(): string { return "&prompt=none"; }
static get prompt(): string { return "prompt"; }
static get response_mode_fragment(): string { return "&response_mode=fragment"; }
static get resourceDelimiter(): string { return "|"; }
static get tokenRenewStatusCancelled(): string { return "Canceled"; }
static get tokenRenewStatusCompleted(): string { return "Completed"; }
static get tokenRenewStatusInProgress(): string { return "In Progress"; }
private static _popUpWidth: number = 483;
static get popUpWidth(): number { return this._popUpWidth; }
static set popUpWidth(width: number) {
this._popUpWidth = width;
}
private static _popUpHeight: number = 600;
static get popUpHeight(): number { return this._popUpHeight; }
static set popUpHeight(height: number) {
this._popUpHeight = height;
}
static get login(): string { return "LOGIN"; }
static get renewToken(): string { return "RENEW_TOKEN"; }
static get unknown(): string { return "UNKNOWN"; }
static get homeAccountIdentifier(): string { return "homeAccountIdentifier"; }
static get common(): string { return "common"; }
static get openidScope(): string { return "openid"; }
static get profileScope(): string { return "profile"; }
static get cacheLocationLocal(): CacheLocation { return "localStorage"; }
static get cacheLocationSession(): CacheLocation { return "sessionStorage"; }
static get interactionTypeRedirect(): InteractionType { return "redirectInteraction"; }
static get interactionTypePopup(): InteractionType { return "popupInteraction"; }
}
/**
* @hidden
* CacheKeys for 'authority' and 'account'
*/
export const CacheKeys = {
AUTHORITY: "msal.authority",
ACQUIRE_TOKEN_ACCOUNT: "msal.acquireTokenAccount"
};
export const AADTrustedHostList = {
"login.windows.net": "login.windows.net",
"login.chinacloudapi.cn": "login.chinacloudapi.cn",
"login.cloudgovapi.us": "login.cloudgovapi.us",
"login.microsoftonline.com": "login.microsoftonline.com",
"login.microsoftonline.de": "login.microsoftonline.de",
"login.microsoftonline.us": "login.microsoftonline.us"
};
/**
* @hidden
* SSO Types - generated to populate hints
*/
export const SSOTypes = {
ACCOUNT: "account",
SID: "sid",
LOGIN_HINT: "login_hint",
ID_TOKEN: "id_token",
DOMAIN_HINT: "domain_hint",
ORGANIZATIONS: "organizations",
CONSUMERS: "consumers",
ACCOUNT_ID: "accountIdentifier",
HOMEACCOUNT_ID: "homeAccountIdentifier",
LOGIN_REQ: "login_req",
DOMAIN_REQ: "domain_req"
};
/**
* @hidden
*/
export const BlacklistedEQParams = [
SSOTypes.SID,
SSOTypes.LOGIN_HINT
];
export type InteractionType = "redirectInteraction" | "popupInteraction";
/**
* we considered making this "enum" in the request instead of string, however it looks like the allowed list of
* prompt values kept changing over past couple of years. There are some undocumented prompt values for some
* internal partners too, hence the choice of generic "string" type instead of the "enum"
* @hidden
*/
export const PromptState = {
LOGIN: "login",
SELECT_ACCOUNT: "select_account",
CONSENT: "consent",
NONE: "none",
};
/**
* @hidden
*/
export const Library = {
version: "1.0.2"
};