@azure/msal-browser 3.0.0-alpha.1 → 3.0.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +213 -213
- package/dist/app/IPublicClientApplication.d.ts +45 -45
- package/dist/app/IPublicClientApplication.js +96 -96
- package/dist/app/PublicClientApplication.d.ts +244 -244
- package/dist/app/PublicClientApplication.js +307 -307
- package/dist/broker/nativeBroker/NativeMessageHandler.d.ts +63 -63
- package/dist/broker/nativeBroker/NativeMessageHandler.js +255 -255
- package/dist/broker/nativeBroker/NativeRequest.d.ts +43 -43
- package/dist/broker/nativeBroker/NativeResponse.d.ts +48 -48
- package/dist/cache/AsyncMemoryStorage.d.ts +51 -51
- package/dist/cache/AsyncMemoryStorage.js +132 -132
- package/dist/cache/BrowserCacheManager.d.ts +377 -377
- package/dist/cache/BrowserCacheManager.js +1276 -1276
- package/dist/cache/BrowserStorage.d.ts +11 -11
- package/dist/cache/BrowserStorage.js +35 -35
- package/dist/cache/CryptoKeyStore.d.ts +17 -17
- package/dist/cache/CryptoKeyStore.js +41 -41
- package/dist/cache/DatabaseStorage.d.ts +56 -56
- package/dist/cache/DatabaseStorage.js +190 -190
- package/dist/cache/IAsyncMemoryStorage.d.ts +27 -27
- package/dist/cache/ITokenCache.d.ts +10 -10
- package/dist/cache/IWindowStorage.d.ts +27 -27
- package/dist/cache/MemoryStorage.d.ts +11 -11
- package/dist/cache/MemoryStorage.js +31 -31
- package/dist/cache/TokenCache.d.ts +76 -76
- package/dist/cache/TokenCache.js +225 -225
- package/dist/config/Configuration.d.ts +203 -203
- package/dist/config/Configuration.js +101 -101
- package/dist/controllers/ControllerFactory.d.ts +9 -9
- package/dist/controllers/ControllerFactory.js +37 -37
- package/dist/controllers/IController.d.ts +66 -66
- package/dist/controllers/StandardController.d.ts +413 -413
- package/dist/controllers/StandardController.js +1272 -1272
- package/dist/crypto/BrowserCrypto.d.ts +61 -61
- package/dist/crypto/BrowserCrypto.js +131 -131
- package/dist/crypto/CryptoOps.d.ts +73 -73
- package/dist/crypto/CryptoOps.js +150 -150
- package/dist/crypto/GuidGenerator.d.ts +12 -12
- package/dist/crypto/GuidGenerator.js +96 -96
- package/dist/crypto/ISubtleCrypto.d.ts +9 -9
- package/dist/crypto/ModernBrowserCrypto.d.ts +9 -9
- package/dist/crypto/ModernBrowserCrypto.js +24 -24
- package/dist/crypto/MsBrowserCrypto.d.ts +9 -9
- package/dist/crypto/MsBrowserCrypto.js +79 -79
- package/dist/crypto/MsrBrowserCrypto.d.ts +17 -17
- package/dist/crypto/MsrBrowserCrypto.js +28 -28
- package/dist/crypto/PkceGenerator.d.ts +24 -24
- package/dist/crypto/PkceGenerator.js +58 -58
- package/dist/crypto/SignedHttpRequest.d.ts +30 -30
- package/dist/crypto/SignedHttpRequest.js +39 -39
- package/dist/encode/Base64Decode.d.ts +22 -22
- package/dist/encode/Base64Decode.js +73 -73
- package/dist/encode/Base64Encode.d.ts +31 -31
- package/dist/encode/Base64Encode.js +79 -79
- package/dist/error/BrowserAuthError.d.ts +382 -382
- package/dist/error/BrowserAuthError.js +483 -483
- package/dist/error/BrowserConfigurationAuthError.d.ts +70 -70
- package/dist/error/BrowserConfigurationAuthError.js +96 -96
- package/dist/error/NativeAuthError.d.ts +56 -56
- package/dist/error/NativeAuthError.js +88 -88
- package/dist/event/EventHandler.d.ts +41 -41
- package/dist/event/EventHandler.js +119 -119
- package/dist/event/EventMessage.d.ts +25 -25
- package/dist/event/EventMessage.js +67 -67
- package/dist/event/EventType.d.ts +26 -26
- package/dist/event/EventType.js +31 -31
- package/dist/index.d.ts +35 -35
- package/dist/index.js +1 -1
- package/dist/interaction_client/BaseInteractionClient.d.ts +52 -52
- package/dist/interaction_client/BaseInteractionClient.js +138 -138
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.d.ts +4 -4
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.js +10 -10
- package/dist/interaction_client/NativeInteractionClient.d.ts +148 -148
- package/dist/interaction_client/NativeInteractionClient.js +516 -516
- package/dist/interaction_client/PopupClient.d.ts +111 -111
- package/dist/interaction_client/PopupClient.js +476 -476
- package/dist/interaction_client/RedirectClient.d.ts +48 -48
- package/dist/interaction_client/RedirectClient.js +290 -290
- package/dist/interaction_client/SilentAuthCodeClient.d.ts +22 -22
- package/dist/interaction_client/SilentAuthCodeClient.js +62 -62
- package/dist/interaction_client/SilentCacheClient.d.ts +21 -21
- package/dist/interaction_client/SilentCacheClient.js +67 -67
- package/dist/interaction_client/SilentIframeClient.d.ts +31 -31
- package/dist/interaction_client/SilentIframeClient.js +127 -127
- package/dist/interaction_client/SilentRefreshClient.d.ts +19 -19
- package/dist/interaction_client/SilentRefreshClient.js +62 -62
- package/dist/interaction_client/StandardInteractionClient.d.ts +59 -59
- package/dist/interaction_client/StandardInteractionClient.js +259 -259
- package/dist/interaction_handler/InteractionHandler.d.ts +39 -39
- package/dist/interaction_handler/InteractionHandler.js +127 -127
- package/dist/interaction_handler/RedirectHandler.d.ts +24 -24
- package/dist/interaction_handler/RedirectHandler.js +118 -118
- package/dist/interaction_handler/SilentHandler.d.ts +47 -47
- package/dist/interaction_handler/SilentHandler.js +162 -162
- package/dist/internals.d.ts +23 -23
- package/dist/internals.js +4 -4
- package/dist/navigation/INavigationClient.d.ts +16 -16
- package/dist/navigation/NavigationClient.d.ts +22 -22
- package/dist/navigation/NavigationClient.js +40 -40
- package/dist/navigation/NavigationOptions.d.ts +12 -12
- package/dist/network/FetchClient.d.ts +26 -26
- package/dist/network/FetchClient.js +99 -99
- package/dist/network/XhrClient.d.ts +40 -40
- package/dist/network/XhrClient.js +117 -117
- package/dist/operatingcontext/BaseOperatingContext.d.ts +40 -40
- package/dist/operatingcontext/BaseOperatingContext.js +44 -44
- package/dist/operatingcontext/StandardOperatingContext.d.ts +25 -25
- package/dist/operatingcontext/StandardOperatingContext.js +43 -43
- package/dist/operatingcontext/TeamsAppOperatingContext.d.ts +25 -25
- package/dist/operatingcontext/TeamsAppOperatingContext.js +42 -42
- package/dist/packageMetadata.d.ts +2 -2
- package/dist/packageMetadata.js +4 -4
- package/dist/request/AuthorizationCodeRequest.d.ts +8 -8
- package/dist/request/AuthorizationUrlRequest.d.ts +8 -8
- package/dist/request/EndSessionPopupRequest.d.ts +18 -18
- package/dist/request/EndSessionRequest.d.ts +15 -15
- package/dist/request/PopupRequest.d.ts +32 -32
- package/dist/request/PopupWindowAttributes.d.ts +15 -15
- package/dist/request/RedirectRequest.d.ts +33 -33
- package/dist/request/SilentRequest.d.ts +30 -30
- package/dist/request/SsoSilentRequest.d.ts +26 -26
- package/dist/telemetry/BrowserPerformanceClient.d.ts +38 -38
- package/dist/telemetry/BrowserPerformanceClient.js +124 -124
- package/dist/telemetry/BrowserPerformanceMeasurement.d.ts +21 -21
- package/dist/telemetry/BrowserPerformanceMeasurement.js +92 -92
- package/dist/utils/BrowserConstants.d.ts +166 -166
- package/dist/utils/BrowserConstants.js +214 -214
- package/dist/utils/BrowserProtocolUtils.d.ts +18 -18
- package/dist/utils/BrowserProtocolUtils.js +34 -34
- package/dist/utils/BrowserStringUtils.d.ts +26 -26
- package/dist/utils/BrowserStringUtils.js +149 -149
- package/dist/utils/BrowserUtils.d.ts +65 -65
- package/dist/utils/BrowserUtils.js +138 -138
- package/dist/utils/MathUtils.d.ts +11 -11
- package/dist/utils/MathUtils.js +21 -21
- package/lib/msal-browser.cjs.js +18383 -0
- package/lib/msal-browser.cjs.js.map +1 -0
- package/lib/msal-browser.js +18389 -0
- package/lib/msal-browser.js.map +1 -0
- package/lib/msal-browser.min.js +74 -0
- package/package.json +97 -95
|
@@ -1,220 +1,220 @@
|
|
|
1
|
-
/*! @azure/msal-browser v3.0.0-alpha.
|
|
1
|
+
/*! @azure/msal-browser v3.0.0-alpha.2 2023-05-17 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { OIDC_DEFAULT_SCOPES } from '@azure/msal-common';
|
|
4
4
|
|
|
5
|
-
/*
|
|
6
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
7
|
-
* Licensed under the MIT License.
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* Constants
|
|
11
|
-
*/
|
|
12
|
-
const BrowserConstants = {
|
|
13
|
-
/**
|
|
14
|
-
* Interaction in progress cache value
|
|
15
|
-
*/
|
|
16
|
-
INTERACTION_IN_PROGRESS_VALUE: "interaction_in_progress",
|
|
17
|
-
/**
|
|
18
|
-
* Invalid grant error code
|
|
19
|
-
*/
|
|
20
|
-
INVALID_GRANT_ERROR: "invalid_grant",
|
|
21
|
-
/**
|
|
22
|
-
* Default popup window width
|
|
23
|
-
*/
|
|
24
|
-
POPUP_WIDTH: 483,
|
|
25
|
-
/**
|
|
26
|
-
* Default popup window height
|
|
27
|
-
*/
|
|
28
|
-
POPUP_HEIGHT: 600,
|
|
29
|
-
/**
|
|
30
|
-
* Name of the popup window starts with
|
|
31
|
-
*/
|
|
32
|
-
POPUP_NAME_PREFIX: "msal",
|
|
33
|
-
/**
|
|
34
|
-
* Default popup monitor poll interval in milliseconds
|
|
35
|
-
*/
|
|
36
|
-
DEFAULT_POLL_INTERVAL_MS: 30,
|
|
37
|
-
/**
|
|
38
|
-
* Msal-browser SKU
|
|
39
|
-
*/
|
|
40
|
-
MSAL_SKU: "msal.js.browser",
|
|
41
|
-
};
|
|
42
|
-
const NativeConstants = {
|
|
43
|
-
CHANNEL_ID: "53ee284d-920a-4b59-9d30-a60315b26836",
|
|
44
|
-
PREFERRED_EXTENSION_ID: "ppnbnpeolgkicgegkbkbjmhlideopiji",
|
|
45
|
-
MATS_TELEMETRY: "MATS",
|
|
46
|
-
};
|
|
47
|
-
var NativeExtensionMethod;
|
|
48
|
-
(function (NativeExtensionMethod) {
|
|
49
|
-
NativeExtensionMethod["HandshakeRequest"] = "Handshake";
|
|
50
|
-
NativeExtensionMethod["HandshakeResponse"] = "HandshakeResponse";
|
|
51
|
-
NativeExtensionMethod["GetToken"] = "GetToken";
|
|
52
|
-
NativeExtensionMethod["Response"] = "Response";
|
|
53
|
-
})(NativeExtensionMethod || (NativeExtensionMethod = {}));
|
|
54
|
-
var BrowserCacheLocation;
|
|
55
|
-
(function (BrowserCacheLocation) {
|
|
56
|
-
BrowserCacheLocation["LocalStorage"] = "localStorage";
|
|
57
|
-
BrowserCacheLocation["SessionStorage"] = "sessionStorage";
|
|
58
|
-
BrowserCacheLocation["MemoryStorage"] = "memoryStorage";
|
|
59
|
-
})(BrowserCacheLocation || (BrowserCacheLocation = {}));
|
|
60
|
-
/**
|
|
61
|
-
* HTTP Request types supported by MSAL.
|
|
62
|
-
*/
|
|
63
|
-
var HTTP_REQUEST_TYPE;
|
|
64
|
-
(function (HTTP_REQUEST_TYPE) {
|
|
65
|
-
HTTP_REQUEST_TYPE["GET"] = "GET";
|
|
66
|
-
HTTP_REQUEST_TYPE["POST"] = "POST";
|
|
67
|
-
})(HTTP_REQUEST_TYPE || (HTTP_REQUEST_TYPE = {}));
|
|
68
|
-
/**
|
|
69
|
-
* Temporary cache keys for MSAL, deleted after any request.
|
|
70
|
-
*/
|
|
71
|
-
var TemporaryCacheKeys;
|
|
72
|
-
(function (TemporaryCacheKeys) {
|
|
73
|
-
TemporaryCacheKeys["AUTHORITY"] = "authority";
|
|
74
|
-
TemporaryCacheKeys["ACQUIRE_TOKEN_ACCOUNT"] = "acquireToken.account";
|
|
75
|
-
TemporaryCacheKeys["SESSION_STATE"] = "session.state";
|
|
76
|
-
TemporaryCacheKeys["REQUEST_STATE"] = "request.state";
|
|
77
|
-
TemporaryCacheKeys["NONCE_IDTOKEN"] = "nonce.id_token";
|
|
78
|
-
TemporaryCacheKeys["ORIGIN_URI"] = "request.origin";
|
|
79
|
-
TemporaryCacheKeys["RENEW_STATUS"] = "token.renew.status";
|
|
80
|
-
TemporaryCacheKeys["URL_HASH"] = "urlHash";
|
|
81
|
-
TemporaryCacheKeys["REQUEST_PARAMS"] = "request.params";
|
|
82
|
-
TemporaryCacheKeys["SCOPES"] = "scopes";
|
|
83
|
-
TemporaryCacheKeys["INTERACTION_STATUS_KEY"] = "interaction.status";
|
|
84
|
-
TemporaryCacheKeys["CCS_CREDENTIAL"] = "ccs.credential";
|
|
85
|
-
TemporaryCacheKeys["CORRELATION_ID"] = "request.correlationId";
|
|
86
|
-
TemporaryCacheKeys["NATIVE_REQUEST"] = "request.native";
|
|
87
|
-
TemporaryCacheKeys["REDIRECT_CONTEXT"] = "request.redirect.context";
|
|
88
|
-
})(TemporaryCacheKeys || (TemporaryCacheKeys = {}));
|
|
89
|
-
var StaticCacheKeys;
|
|
90
|
-
(function (StaticCacheKeys) {
|
|
91
|
-
StaticCacheKeys["ACCOUNT_KEYS"] = "msal.account.keys";
|
|
92
|
-
StaticCacheKeys["TOKEN_KEYS"] = "msal.token.keys";
|
|
93
|
-
})(StaticCacheKeys || (StaticCacheKeys = {}));
|
|
94
|
-
/**
|
|
95
|
-
* Cache keys stored in-memory
|
|
96
|
-
*/
|
|
97
|
-
var InMemoryCacheKeys;
|
|
98
|
-
(function (InMemoryCacheKeys) {
|
|
99
|
-
InMemoryCacheKeys["WRAPPER_SKU"] = "wrapper.sku";
|
|
100
|
-
InMemoryCacheKeys["WRAPPER_VER"] = "wrapper.version";
|
|
101
|
-
})(InMemoryCacheKeys || (InMemoryCacheKeys = {}));
|
|
102
|
-
/**
|
|
103
|
-
* API Codes for Telemetry purposes.
|
|
104
|
-
* Before adding a new code you must claim it in the MSAL Telemetry tracker as these number spaces are shared across all MSALs
|
|
105
|
-
* 0-99 Silent Flow
|
|
106
|
-
* 800-899 Auth Code Flow
|
|
107
|
-
*/
|
|
108
|
-
var ApiId;
|
|
109
|
-
(function (ApiId) {
|
|
110
|
-
ApiId[ApiId["acquireTokenRedirect"] = 861] = "acquireTokenRedirect";
|
|
111
|
-
ApiId[ApiId["acquireTokenPopup"] = 862] = "acquireTokenPopup";
|
|
112
|
-
ApiId[ApiId["ssoSilent"] = 863] = "ssoSilent";
|
|
113
|
-
ApiId[ApiId["acquireTokenSilent_authCode"] = 864] = "acquireTokenSilent_authCode";
|
|
114
|
-
ApiId[ApiId["handleRedirectPromise"] = 865] = "handleRedirectPromise";
|
|
115
|
-
ApiId[ApiId["acquireTokenByCode"] = 866] = "acquireTokenByCode";
|
|
116
|
-
ApiId[ApiId["acquireTokenSilent_silentFlow"] = 61] = "acquireTokenSilent_silentFlow";
|
|
117
|
-
ApiId[ApiId["logout"] = 961] = "logout";
|
|
118
|
-
ApiId[ApiId["logoutPopup"] = 962] = "logoutPopup";
|
|
119
|
-
})(ApiId || (ApiId = {}));
|
|
120
|
-
/*
|
|
121
|
-
* Interaction type of the API - used for state and telemetry
|
|
122
|
-
*/
|
|
123
|
-
var InteractionType;
|
|
124
|
-
(function (InteractionType) {
|
|
125
|
-
InteractionType["Redirect"] = "redirect";
|
|
126
|
-
InteractionType["Popup"] = "popup";
|
|
127
|
-
InteractionType["Silent"] = "silent";
|
|
128
|
-
InteractionType["None"] = "none";
|
|
129
|
-
})(InteractionType || (InteractionType = {}));
|
|
130
|
-
/**
|
|
131
|
-
* Types of interaction currently in progress.
|
|
132
|
-
* Used in events in wrapper libraries to invoke functions when certain interaction is in progress or all interactions are complete.
|
|
133
|
-
*/
|
|
134
|
-
var InteractionStatus;
|
|
135
|
-
(function (InteractionStatus) {
|
|
136
|
-
/**
|
|
137
|
-
* Initial status before interaction occurs
|
|
138
|
-
*/
|
|
139
|
-
InteractionStatus["Startup"] = "startup";
|
|
140
|
-
/**
|
|
141
|
-
* Status set when all login calls occuring
|
|
142
|
-
*/
|
|
143
|
-
InteractionStatus["Login"] = "login";
|
|
144
|
-
/**
|
|
145
|
-
* Status set when logout call occuring
|
|
146
|
-
*/
|
|
147
|
-
InteractionStatus["Logout"] = "logout";
|
|
148
|
-
/**
|
|
149
|
-
* Status set for acquireToken calls
|
|
150
|
-
*/
|
|
151
|
-
InteractionStatus["AcquireToken"] = "acquireToken";
|
|
152
|
-
/**
|
|
153
|
-
* Status set for ssoSilent calls
|
|
154
|
-
*/
|
|
155
|
-
InteractionStatus["SsoSilent"] = "ssoSilent";
|
|
156
|
-
/**
|
|
157
|
-
* Status set when handleRedirect in progress
|
|
158
|
-
*/
|
|
159
|
-
InteractionStatus["HandleRedirect"] = "handleRedirect";
|
|
160
|
-
/**
|
|
161
|
-
* Status set when interaction is complete
|
|
162
|
-
*/
|
|
163
|
-
InteractionStatus["None"] = "none";
|
|
164
|
-
})(InteractionStatus || (InteractionStatus = {}));
|
|
165
|
-
const DEFAULT_REQUEST = {
|
|
166
|
-
scopes: OIDC_DEFAULT_SCOPES,
|
|
167
|
-
};
|
|
168
|
-
/**
|
|
169
|
-
* JWK Key Format string (Type MUST be defined for window crypto APIs)
|
|
170
|
-
*/
|
|
171
|
-
const KEY_FORMAT_JWK = "jwk";
|
|
172
|
-
// Supported wrapper SKUs
|
|
173
|
-
var WrapperSKU;
|
|
174
|
-
(function (WrapperSKU) {
|
|
175
|
-
WrapperSKU["React"] = "@azure/msal-react";
|
|
176
|
-
WrapperSKU["Angular"] = "@azure/msal-angular";
|
|
177
|
-
})(WrapperSKU || (WrapperSKU = {}));
|
|
178
|
-
// DatabaseStorage Constants
|
|
179
|
-
const DB_NAME = "msal.db";
|
|
180
|
-
const DB_VERSION = 1;
|
|
181
|
-
const DB_TABLE_NAME = `${DB_NAME}.keys`;
|
|
182
|
-
var CacheLookupPolicy;
|
|
183
|
-
(function (CacheLookupPolicy) {
|
|
184
|
-
/*
|
|
185
|
-
* acquireTokenSilent will attempt to retrieve an access token from the cache. If the access token is expired
|
|
186
|
-
* or cannot be found the refresh token will be used to acquire a new one. Finally, if the refresh token
|
|
187
|
-
* is expired acquireTokenSilent will attempt to acquire new access and refresh tokens.
|
|
188
|
-
*/
|
|
189
|
-
CacheLookupPolicy[CacheLookupPolicy["Default"] = 0] = "Default";
|
|
190
|
-
/*
|
|
191
|
-
* acquireTokenSilent will only look for access tokens in the cache. It will not attempt to renew access or
|
|
192
|
-
* refresh tokens.
|
|
193
|
-
*/
|
|
194
|
-
CacheLookupPolicy[CacheLookupPolicy["AccessToken"] = 1] = "AccessToken";
|
|
195
|
-
/*
|
|
196
|
-
* acquireTokenSilent will attempt to retrieve an access token from the cache. If the access token is expired or
|
|
197
|
-
* cannot be found, the refresh token will be used to acquire a new one. If the refresh token is expired, it
|
|
198
|
-
* will not be renewed and acquireTokenSilent will fail.
|
|
199
|
-
*/
|
|
200
|
-
CacheLookupPolicy[CacheLookupPolicy["AccessTokenAndRefreshToken"] = 2] = "AccessTokenAndRefreshToken";
|
|
201
|
-
/*
|
|
202
|
-
* acquireTokenSilent will not attempt to retrieve access tokens from the cache and will instead attempt to
|
|
203
|
-
* exchange the cached refresh token for a new access token. If the refresh token is expired, it will not be
|
|
204
|
-
* renewed and acquireTokenSilent will fail.
|
|
205
|
-
*/
|
|
206
|
-
CacheLookupPolicy[CacheLookupPolicy["RefreshToken"] = 3] = "RefreshToken";
|
|
207
|
-
/*
|
|
208
|
-
* acquireTokenSilent will not look in the cache for the access token. It will go directly to network with the
|
|
209
|
-
* cached refresh token. If the refresh token is expired an attempt will be made to renew it. This is equivalent to
|
|
210
|
-
* setting "forceRefresh: true".
|
|
211
|
-
*/
|
|
212
|
-
CacheLookupPolicy[CacheLookupPolicy["RefreshTokenAndNetwork"] = 4] = "RefreshTokenAndNetwork";
|
|
213
|
-
/*
|
|
214
|
-
* acquireTokenSilent will attempt to renew both access and refresh tokens. It will not look in the cache. This will
|
|
215
|
-
* always fail if 3rd party cookies are blocked by the browser.
|
|
216
|
-
*/
|
|
217
|
-
CacheLookupPolicy[CacheLookupPolicy["Skip"] = 5] = "Skip";
|
|
5
|
+
/*
|
|
6
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
7
|
+
* Licensed under the MIT License.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Constants
|
|
11
|
+
*/
|
|
12
|
+
const BrowserConstants = {
|
|
13
|
+
/**
|
|
14
|
+
* Interaction in progress cache value
|
|
15
|
+
*/
|
|
16
|
+
INTERACTION_IN_PROGRESS_VALUE: "interaction_in_progress",
|
|
17
|
+
/**
|
|
18
|
+
* Invalid grant error code
|
|
19
|
+
*/
|
|
20
|
+
INVALID_GRANT_ERROR: "invalid_grant",
|
|
21
|
+
/**
|
|
22
|
+
* Default popup window width
|
|
23
|
+
*/
|
|
24
|
+
POPUP_WIDTH: 483,
|
|
25
|
+
/**
|
|
26
|
+
* Default popup window height
|
|
27
|
+
*/
|
|
28
|
+
POPUP_HEIGHT: 600,
|
|
29
|
+
/**
|
|
30
|
+
* Name of the popup window starts with
|
|
31
|
+
*/
|
|
32
|
+
POPUP_NAME_PREFIX: "msal",
|
|
33
|
+
/**
|
|
34
|
+
* Default popup monitor poll interval in milliseconds
|
|
35
|
+
*/
|
|
36
|
+
DEFAULT_POLL_INTERVAL_MS: 30,
|
|
37
|
+
/**
|
|
38
|
+
* Msal-browser SKU
|
|
39
|
+
*/
|
|
40
|
+
MSAL_SKU: "msal.js.browser",
|
|
41
|
+
};
|
|
42
|
+
const NativeConstants = {
|
|
43
|
+
CHANNEL_ID: "53ee284d-920a-4b59-9d30-a60315b26836",
|
|
44
|
+
PREFERRED_EXTENSION_ID: "ppnbnpeolgkicgegkbkbjmhlideopiji",
|
|
45
|
+
MATS_TELEMETRY: "MATS",
|
|
46
|
+
};
|
|
47
|
+
var NativeExtensionMethod;
|
|
48
|
+
(function (NativeExtensionMethod) {
|
|
49
|
+
NativeExtensionMethod["HandshakeRequest"] = "Handshake";
|
|
50
|
+
NativeExtensionMethod["HandshakeResponse"] = "HandshakeResponse";
|
|
51
|
+
NativeExtensionMethod["GetToken"] = "GetToken";
|
|
52
|
+
NativeExtensionMethod["Response"] = "Response";
|
|
53
|
+
})(NativeExtensionMethod || (NativeExtensionMethod = {}));
|
|
54
|
+
var BrowserCacheLocation;
|
|
55
|
+
(function (BrowserCacheLocation) {
|
|
56
|
+
BrowserCacheLocation["LocalStorage"] = "localStorage";
|
|
57
|
+
BrowserCacheLocation["SessionStorage"] = "sessionStorage";
|
|
58
|
+
BrowserCacheLocation["MemoryStorage"] = "memoryStorage";
|
|
59
|
+
})(BrowserCacheLocation || (BrowserCacheLocation = {}));
|
|
60
|
+
/**
|
|
61
|
+
* HTTP Request types supported by MSAL.
|
|
62
|
+
*/
|
|
63
|
+
var HTTP_REQUEST_TYPE;
|
|
64
|
+
(function (HTTP_REQUEST_TYPE) {
|
|
65
|
+
HTTP_REQUEST_TYPE["GET"] = "GET";
|
|
66
|
+
HTTP_REQUEST_TYPE["POST"] = "POST";
|
|
67
|
+
})(HTTP_REQUEST_TYPE || (HTTP_REQUEST_TYPE = {}));
|
|
68
|
+
/**
|
|
69
|
+
* Temporary cache keys for MSAL, deleted after any request.
|
|
70
|
+
*/
|
|
71
|
+
var TemporaryCacheKeys;
|
|
72
|
+
(function (TemporaryCacheKeys) {
|
|
73
|
+
TemporaryCacheKeys["AUTHORITY"] = "authority";
|
|
74
|
+
TemporaryCacheKeys["ACQUIRE_TOKEN_ACCOUNT"] = "acquireToken.account";
|
|
75
|
+
TemporaryCacheKeys["SESSION_STATE"] = "session.state";
|
|
76
|
+
TemporaryCacheKeys["REQUEST_STATE"] = "request.state";
|
|
77
|
+
TemporaryCacheKeys["NONCE_IDTOKEN"] = "nonce.id_token";
|
|
78
|
+
TemporaryCacheKeys["ORIGIN_URI"] = "request.origin";
|
|
79
|
+
TemporaryCacheKeys["RENEW_STATUS"] = "token.renew.status";
|
|
80
|
+
TemporaryCacheKeys["URL_HASH"] = "urlHash";
|
|
81
|
+
TemporaryCacheKeys["REQUEST_PARAMS"] = "request.params";
|
|
82
|
+
TemporaryCacheKeys["SCOPES"] = "scopes";
|
|
83
|
+
TemporaryCacheKeys["INTERACTION_STATUS_KEY"] = "interaction.status";
|
|
84
|
+
TemporaryCacheKeys["CCS_CREDENTIAL"] = "ccs.credential";
|
|
85
|
+
TemporaryCacheKeys["CORRELATION_ID"] = "request.correlationId";
|
|
86
|
+
TemporaryCacheKeys["NATIVE_REQUEST"] = "request.native";
|
|
87
|
+
TemporaryCacheKeys["REDIRECT_CONTEXT"] = "request.redirect.context";
|
|
88
|
+
})(TemporaryCacheKeys || (TemporaryCacheKeys = {}));
|
|
89
|
+
var StaticCacheKeys;
|
|
90
|
+
(function (StaticCacheKeys) {
|
|
91
|
+
StaticCacheKeys["ACCOUNT_KEYS"] = "msal.account.keys";
|
|
92
|
+
StaticCacheKeys["TOKEN_KEYS"] = "msal.token.keys";
|
|
93
|
+
})(StaticCacheKeys || (StaticCacheKeys = {}));
|
|
94
|
+
/**
|
|
95
|
+
* Cache keys stored in-memory
|
|
96
|
+
*/
|
|
97
|
+
var InMemoryCacheKeys;
|
|
98
|
+
(function (InMemoryCacheKeys) {
|
|
99
|
+
InMemoryCacheKeys["WRAPPER_SKU"] = "wrapper.sku";
|
|
100
|
+
InMemoryCacheKeys["WRAPPER_VER"] = "wrapper.version";
|
|
101
|
+
})(InMemoryCacheKeys || (InMemoryCacheKeys = {}));
|
|
102
|
+
/**
|
|
103
|
+
* API Codes for Telemetry purposes.
|
|
104
|
+
* Before adding a new code you must claim it in the MSAL Telemetry tracker as these number spaces are shared across all MSALs
|
|
105
|
+
* 0-99 Silent Flow
|
|
106
|
+
* 800-899 Auth Code Flow
|
|
107
|
+
*/
|
|
108
|
+
var ApiId;
|
|
109
|
+
(function (ApiId) {
|
|
110
|
+
ApiId[ApiId["acquireTokenRedirect"] = 861] = "acquireTokenRedirect";
|
|
111
|
+
ApiId[ApiId["acquireTokenPopup"] = 862] = "acquireTokenPopup";
|
|
112
|
+
ApiId[ApiId["ssoSilent"] = 863] = "ssoSilent";
|
|
113
|
+
ApiId[ApiId["acquireTokenSilent_authCode"] = 864] = "acquireTokenSilent_authCode";
|
|
114
|
+
ApiId[ApiId["handleRedirectPromise"] = 865] = "handleRedirectPromise";
|
|
115
|
+
ApiId[ApiId["acquireTokenByCode"] = 866] = "acquireTokenByCode";
|
|
116
|
+
ApiId[ApiId["acquireTokenSilent_silentFlow"] = 61] = "acquireTokenSilent_silentFlow";
|
|
117
|
+
ApiId[ApiId["logout"] = 961] = "logout";
|
|
118
|
+
ApiId[ApiId["logoutPopup"] = 962] = "logoutPopup";
|
|
119
|
+
})(ApiId || (ApiId = {}));
|
|
120
|
+
/*
|
|
121
|
+
* Interaction type of the API - used for state and telemetry
|
|
122
|
+
*/
|
|
123
|
+
var InteractionType;
|
|
124
|
+
(function (InteractionType) {
|
|
125
|
+
InteractionType["Redirect"] = "redirect";
|
|
126
|
+
InteractionType["Popup"] = "popup";
|
|
127
|
+
InteractionType["Silent"] = "silent";
|
|
128
|
+
InteractionType["None"] = "none";
|
|
129
|
+
})(InteractionType || (InteractionType = {}));
|
|
130
|
+
/**
|
|
131
|
+
* Types of interaction currently in progress.
|
|
132
|
+
* Used in events in wrapper libraries to invoke functions when certain interaction is in progress or all interactions are complete.
|
|
133
|
+
*/
|
|
134
|
+
var InteractionStatus;
|
|
135
|
+
(function (InteractionStatus) {
|
|
136
|
+
/**
|
|
137
|
+
* Initial status before interaction occurs
|
|
138
|
+
*/
|
|
139
|
+
InteractionStatus["Startup"] = "startup";
|
|
140
|
+
/**
|
|
141
|
+
* Status set when all login calls occuring
|
|
142
|
+
*/
|
|
143
|
+
InteractionStatus["Login"] = "login";
|
|
144
|
+
/**
|
|
145
|
+
* Status set when logout call occuring
|
|
146
|
+
*/
|
|
147
|
+
InteractionStatus["Logout"] = "logout";
|
|
148
|
+
/**
|
|
149
|
+
* Status set for acquireToken calls
|
|
150
|
+
*/
|
|
151
|
+
InteractionStatus["AcquireToken"] = "acquireToken";
|
|
152
|
+
/**
|
|
153
|
+
* Status set for ssoSilent calls
|
|
154
|
+
*/
|
|
155
|
+
InteractionStatus["SsoSilent"] = "ssoSilent";
|
|
156
|
+
/**
|
|
157
|
+
* Status set when handleRedirect in progress
|
|
158
|
+
*/
|
|
159
|
+
InteractionStatus["HandleRedirect"] = "handleRedirect";
|
|
160
|
+
/**
|
|
161
|
+
* Status set when interaction is complete
|
|
162
|
+
*/
|
|
163
|
+
InteractionStatus["None"] = "none";
|
|
164
|
+
})(InteractionStatus || (InteractionStatus = {}));
|
|
165
|
+
const DEFAULT_REQUEST = {
|
|
166
|
+
scopes: OIDC_DEFAULT_SCOPES,
|
|
167
|
+
};
|
|
168
|
+
/**
|
|
169
|
+
* JWK Key Format string (Type MUST be defined for window crypto APIs)
|
|
170
|
+
*/
|
|
171
|
+
const KEY_FORMAT_JWK = "jwk";
|
|
172
|
+
// Supported wrapper SKUs
|
|
173
|
+
var WrapperSKU;
|
|
174
|
+
(function (WrapperSKU) {
|
|
175
|
+
WrapperSKU["React"] = "@azure/msal-react";
|
|
176
|
+
WrapperSKU["Angular"] = "@azure/msal-angular";
|
|
177
|
+
})(WrapperSKU || (WrapperSKU = {}));
|
|
178
|
+
// DatabaseStorage Constants
|
|
179
|
+
const DB_NAME = "msal.db";
|
|
180
|
+
const DB_VERSION = 1;
|
|
181
|
+
const DB_TABLE_NAME = `${DB_NAME}.keys`;
|
|
182
|
+
var CacheLookupPolicy;
|
|
183
|
+
(function (CacheLookupPolicy) {
|
|
184
|
+
/*
|
|
185
|
+
* acquireTokenSilent will attempt to retrieve an access token from the cache. If the access token is expired
|
|
186
|
+
* or cannot be found the refresh token will be used to acquire a new one. Finally, if the refresh token
|
|
187
|
+
* is expired acquireTokenSilent will attempt to acquire new access and refresh tokens.
|
|
188
|
+
*/
|
|
189
|
+
CacheLookupPolicy[CacheLookupPolicy["Default"] = 0] = "Default";
|
|
190
|
+
/*
|
|
191
|
+
* acquireTokenSilent will only look for access tokens in the cache. It will not attempt to renew access or
|
|
192
|
+
* refresh tokens.
|
|
193
|
+
*/
|
|
194
|
+
CacheLookupPolicy[CacheLookupPolicy["AccessToken"] = 1] = "AccessToken";
|
|
195
|
+
/*
|
|
196
|
+
* acquireTokenSilent will attempt to retrieve an access token from the cache. If the access token is expired or
|
|
197
|
+
* cannot be found, the refresh token will be used to acquire a new one. If the refresh token is expired, it
|
|
198
|
+
* will not be renewed and acquireTokenSilent will fail.
|
|
199
|
+
*/
|
|
200
|
+
CacheLookupPolicy[CacheLookupPolicy["AccessTokenAndRefreshToken"] = 2] = "AccessTokenAndRefreshToken";
|
|
201
|
+
/*
|
|
202
|
+
* acquireTokenSilent will not attempt to retrieve access tokens from the cache and will instead attempt to
|
|
203
|
+
* exchange the cached refresh token for a new access token. If the refresh token is expired, it will not be
|
|
204
|
+
* renewed and acquireTokenSilent will fail.
|
|
205
|
+
*/
|
|
206
|
+
CacheLookupPolicy[CacheLookupPolicy["RefreshToken"] = 3] = "RefreshToken";
|
|
207
|
+
/*
|
|
208
|
+
* acquireTokenSilent will not look in the cache for the access token. It will go directly to network with the
|
|
209
|
+
* cached refresh token. If the refresh token is expired an attempt will be made to renew it. This is equivalent to
|
|
210
|
+
* setting "forceRefresh: true".
|
|
211
|
+
*/
|
|
212
|
+
CacheLookupPolicy[CacheLookupPolicy["RefreshTokenAndNetwork"] = 4] = "RefreshTokenAndNetwork";
|
|
213
|
+
/*
|
|
214
|
+
* acquireTokenSilent will attempt to renew both access and refresh tokens. It will not look in the cache. This will
|
|
215
|
+
* always fail if 3rd party cookies are blocked by the browser.
|
|
216
|
+
*/
|
|
217
|
+
CacheLookupPolicy[CacheLookupPolicy["Skip"] = 5] = "Skip";
|
|
218
218
|
})(CacheLookupPolicy || (CacheLookupPolicy = {}));
|
|
219
219
|
|
|
220
220
|
export { ApiId, BrowserCacheLocation, BrowserConstants, CacheLookupPolicy, DB_NAME, DB_TABLE_NAME, DB_VERSION, DEFAULT_REQUEST, HTTP_REQUEST_TYPE, InMemoryCacheKeys, InteractionStatus, InteractionType, KEY_FORMAT_JWK, NativeConstants, NativeExtensionMethod, StaticCacheKeys, TemporaryCacheKeys, WrapperSKU };
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { InteractionType } from "./BrowserConstants";
|
|
2
|
-
import { ICrypto, ServerAuthorizationCodeResponse } from "@azure/msal-common";
|
|
3
|
-
export type BrowserStateObject = {
|
|
4
|
-
interactionType: InteractionType;
|
|
5
|
-
};
|
|
6
|
-
export declare class BrowserProtocolUtils {
|
|
7
|
-
/**
|
|
8
|
-
* Extracts the BrowserStateObject from the state string.
|
|
9
|
-
* @param browserCrypto
|
|
10
|
-
* @param state
|
|
11
|
-
*/
|
|
12
|
-
static extractBrowserRequestState(browserCrypto: ICrypto, state: string): BrowserStateObject | null;
|
|
13
|
-
/**
|
|
14
|
-
* Parses properties of server response from url hash
|
|
15
|
-
* @param locationHash Hash from url
|
|
16
|
-
*/
|
|
17
|
-
static parseServerResponseFromHash(locationHash: string): ServerAuthorizationCodeResponse;
|
|
18
|
-
}
|
|
1
|
+
import { InteractionType } from "./BrowserConstants";
|
|
2
|
+
import { ICrypto, ServerAuthorizationCodeResponse } from "@azure/msal-common";
|
|
3
|
+
export type BrowserStateObject = {
|
|
4
|
+
interactionType: InteractionType;
|
|
5
|
+
};
|
|
6
|
+
export declare class BrowserProtocolUtils {
|
|
7
|
+
/**
|
|
8
|
+
* Extracts the BrowserStateObject from the state string.
|
|
9
|
+
* @param browserCrypto
|
|
10
|
+
* @param state
|
|
11
|
+
*/
|
|
12
|
+
static extractBrowserRequestState(browserCrypto: ICrypto, state: string): BrowserStateObject | null;
|
|
13
|
+
/**
|
|
14
|
+
* Parses properties of server response from url hash
|
|
15
|
+
* @param locationHash Hash from url
|
|
16
|
+
*/
|
|
17
|
+
static parseServerResponseFromHash(locationHash: string): ServerAuthorizationCodeResponse;
|
|
18
|
+
}
|
|
19
19
|
//# sourceMappingURL=BrowserProtocolUtils.d.ts.map
|
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
/*! @azure/msal-browser v3.0.0-alpha.
|
|
1
|
+
/*! @azure/msal-browser v3.0.0-alpha.2 2023-05-17 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { StringUtils, ProtocolUtils, ClientAuthError, UrlString } from '@azure/msal-common';
|
|
4
4
|
|
|
5
|
-
/*
|
|
6
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
7
|
-
* Licensed under the MIT License.
|
|
8
|
-
*/
|
|
9
|
-
class BrowserProtocolUtils {
|
|
10
|
-
/**
|
|
11
|
-
* Extracts the BrowserStateObject from the state string.
|
|
12
|
-
* @param browserCrypto
|
|
13
|
-
* @param state
|
|
14
|
-
*/
|
|
15
|
-
static extractBrowserRequestState(browserCrypto, state) {
|
|
16
|
-
if (StringUtils.isEmpty(state)) {
|
|
17
|
-
return null;
|
|
18
|
-
}
|
|
19
|
-
try {
|
|
20
|
-
const requestStateObj = ProtocolUtils.parseRequestState(browserCrypto, state);
|
|
21
|
-
return requestStateObj.libraryState.meta;
|
|
22
|
-
}
|
|
23
|
-
catch (e) {
|
|
24
|
-
throw ClientAuthError.createInvalidStateError(state, e);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Parses properties of server response from url hash
|
|
29
|
-
* @param locationHash Hash from url
|
|
30
|
-
*/
|
|
31
|
-
static parseServerResponseFromHash(locationHash) {
|
|
32
|
-
if (!locationHash) {
|
|
33
|
-
return {};
|
|
34
|
-
}
|
|
35
|
-
const hashUrlString = new UrlString(locationHash);
|
|
36
|
-
return UrlString.getDeserializedHash(hashUrlString.getHash());
|
|
37
|
-
}
|
|
5
|
+
/*
|
|
6
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
7
|
+
* Licensed under the MIT License.
|
|
8
|
+
*/
|
|
9
|
+
class BrowserProtocolUtils {
|
|
10
|
+
/**
|
|
11
|
+
* Extracts the BrowserStateObject from the state string.
|
|
12
|
+
* @param browserCrypto
|
|
13
|
+
* @param state
|
|
14
|
+
*/
|
|
15
|
+
static extractBrowserRequestState(browserCrypto, state) {
|
|
16
|
+
if (StringUtils.isEmpty(state)) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
try {
|
|
20
|
+
const requestStateObj = ProtocolUtils.parseRequestState(browserCrypto, state);
|
|
21
|
+
return requestStateObj.libraryState.meta;
|
|
22
|
+
}
|
|
23
|
+
catch (e) {
|
|
24
|
+
throw ClientAuthError.createInvalidStateError(state, e);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Parses properties of server response from url hash
|
|
29
|
+
* @param locationHash Hash from url
|
|
30
|
+
*/
|
|
31
|
+
static parseServerResponseFromHash(locationHash) {
|
|
32
|
+
if (!locationHash) {
|
|
33
|
+
return {};
|
|
34
|
+
}
|
|
35
|
+
const hashUrlString = new UrlString(locationHash);
|
|
36
|
+
return UrlString.getDeserializedHash(hashUrlString.getHash());
|
|
37
|
+
}
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
export { BrowserProtocolUtils };
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Utility functions for strings in a browser. See here for implementation details:
|
|
3
|
-
* https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding#Solution_2_%E2%80%93_JavaScript's_UTF-16_%3E_UTF-8_%3E_base64
|
|
4
|
-
*/
|
|
5
|
-
export declare class BrowserStringUtils {
|
|
6
|
-
/**
|
|
7
|
-
* Converts string to Uint8Array
|
|
8
|
-
* @param sDOMStr
|
|
9
|
-
*/
|
|
10
|
-
static stringToUtf8Arr(sDOMStr: string): Uint8Array;
|
|
11
|
-
/**
|
|
12
|
-
* Converst string to ArrayBuffer
|
|
13
|
-
* @param dataString
|
|
14
|
-
*/
|
|
15
|
-
static stringToArrayBuffer(dataString: string): ArrayBuffer;
|
|
16
|
-
/**
|
|
17
|
-
* Converts Uint8Array to a string
|
|
18
|
-
* @param aBytes
|
|
19
|
-
*/
|
|
20
|
-
static utf8ArrToString(aBytes: Uint8Array): string;
|
|
21
|
-
/**
|
|
22
|
-
* Returns stringified jwk.
|
|
23
|
-
* @param jwk
|
|
24
|
-
*/
|
|
25
|
-
static getSortedObjectString(obj: object): string;
|
|
26
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Utility functions for strings in a browser. See here for implementation details:
|
|
3
|
+
* https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding#Solution_2_%E2%80%93_JavaScript's_UTF-16_%3E_UTF-8_%3E_base64
|
|
4
|
+
*/
|
|
5
|
+
export declare class BrowserStringUtils {
|
|
6
|
+
/**
|
|
7
|
+
* Converts string to Uint8Array
|
|
8
|
+
* @param sDOMStr
|
|
9
|
+
*/
|
|
10
|
+
static stringToUtf8Arr(sDOMStr: string): Uint8Array;
|
|
11
|
+
/**
|
|
12
|
+
* Converst string to ArrayBuffer
|
|
13
|
+
* @param dataString
|
|
14
|
+
*/
|
|
15
|
+
static stringToArrayBuffer(dataString: string): ArrayBuffer;
|
|
16
|
+
/**
|
|
17
|
+
* Converts Uint8Array to a string
|
|
18
|
+
* @param aBytes
|
|
19
|
+
*/
|
|
20
|
+
static utf8ArrToString(aBytes: Uint8Array): string;
|
|
21
|
+
/**
|
|
22
|
+
* Returns stringified jwk.
|
|
23
|
+
* @param jwk
|
|
24
|
+
*/
|
|
25
|
+
static getSortedObjectString(obj: object): string;
|
|
26
|
+
}
|
|
27
27
|
//# sourceMappingURL=BrowserStringUtils.d.ts.map
|