@azure/msal-browser 3.3.0 → 3.5.0
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/dist/app/IPublicClientApplication.mjs +1 -1
- package/dist/app/PublicClientApplication.d.ts.map +1 -1
- package/dist/app/PublicClientApplication.mjs +3 -4
- package/dist/app/PublicClientApplication.mjs.map +1 -1
- package/dist/app/PublicClientNext.d.ts.map +1 -1
- package/dist/app/PublicClientNext.mjs +4 -6
- package/dist/app/PublicClientNext.mjs.map +1 -1
- package/dist/broker/nativeBroker/NativeMessageHandler.mjs +1 -1
- package/dist/broker/nativeBroker/NativeStatusCodes.mjs +1 -1
- package/dist/cache/AsyncMemoryStorage.mjs +1 -1
- package/dist/cache/BrowserCacheManager.d.ts.map +1 -1
- package/dist/cache/BrowserCacheManager.mjs +26 -26
- package/dist/cache/BrowserCacheManager.mjs.map +1 -1
- package/dist/cache/BrowserStorage.mjs +1 -1
- package/dist/cache/CryptoKeyStore.mjs +1 -1
- package/dist/cache/DatabaseStorage.mjs +1 -1
- package/dist/cache/MemoryStorage.mjs +1 -1
- package/dist/cache/TokenCache.d.ts.map +1 -1
- package/dist/cache/TokenCache.mjs +5 -5
- package/dist/cache/TokenCache.mjs.map +1 -1
- package/dist/config/Configuration.mjs +1 -1
- package/dist/controllers/ControllerFactory.d.ts +2 -8
- package/dist/controllers/ControllerFactory.d.ts.map +1 -1
- package/dist/controllers/ControllerFactory.mjs +21 -38
- package/dist/controllers/ControllerFactory.mjs.map +1 -1
- package/dist/controllers/IController.d.ts +1 -2
- package/dist/controllers/IController.d.ts.map +1 -1
- package/dist/controllers/NestedAppAuthController.mjs +1 -1
- package/dist/controllers/StandardController.d.ts +4 -4
- package/dist/controllers/StandardController.d.ts.map +1 -1
- package/dist/controllers/StandardController.mjs +50 -51
- package/dist/controllers/StandardController.mjs.map +1 -1
- package/dist/controllers/UnknownOperatingContextController.mjs +1 -1
- package/dist/crypto/BrowserCrypto.mjs +1 -1
- package/dist/crypto/CryptoOps.d.ts +2 -2
- package/dist/crypto/CryptoOps.d.ts.map +1 -1
- package/dist/crypto/CryptoOps.mjs +4 -3
- package/dist/crypto/CryptoOps.mjs.map +1 -1
- package/dist/crypto/PkceGenerator.mjs +1 -1
- package/dist/crypto/SignedHttpRequest.mjs +1 -1
- package/dist/encode/Base64Decode.mjs +1 -1
- package/dist/encode/Base64Encode.mjs +1 -1
- package/dist/error/BrowserAuthError.mjs +1 -1
- package/dist/error/BrowserAuthErrorCodes.mjs +1 -1
- package/dist/error/BrowserConfigurationAuthError.mjs +1 -1
- package/dist/error/BrowserConfigurationAuthErrorCodes.mjs +1 -1
- package/dist/error/NativeAuthError.mjs +1 -1
- package/dist/error/NativeAuthErrorCodes.mjs +1 -1
- package/dist/error/NestedAppAuthError.mjs +1 -1
- package/dist/event/EventHandler.mjs +1 -1
- package/dist/event/EventMessage.mjs +1 -1
- package/dist/event/EventType.mjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/interaction_client/BaseInteractionClient.d.ts +0 -1
- package/dist/interaction_client/BaseInteractionClient.d.ts.map +1 -1
- package/dist/interaction_client/BaseInteractionClient.mjs +2 -3
- package/dist/interaction_client/BaseInteractionClient.mjs.map +1 -1
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
- package/dist/interaction_client/NativeInteractionClient.d.ts.map +1 -1
- package/dist/interaction_client/NativeInteractionClient.mjs +4 -4
- package/dist/interaction_client/NativeInteractionClient.mjs.map +1 -1
- package/dist/interaction_client/PopupClient.d.ts +1 -12
- package/dist/interaction_client/PopupClient.d.ts.map +1 -1
- package/dist/interaction_client/PopupClient.mjs +28 -111
- package/dist/interaction_client/PopupClient.mjs.map +1 -1
- package/dist/interaction_client/RedirectClient.d.ts +3 -3
- package/dist/interaction_client/RedirectClient.d.ts.map +1 -1
- package/dist/interaction_client/RedirectClient.mjs +59 -50
- package/dist/interaction_client/RedirectClient.mjs.map +1 -1
- package/dist/interaction_client/SilentAuthCodeClient.d.ts.map +1 -1
- package/dist/interaction_client/SilentAuthCodeClient.mjs +3 -5
- package/dist/interaction_client/SilentAuthCodeClient.mjs.map +1 -1
- package/dist/interaction_client/SilentCacheClient.mjs +1 -1
- package/dist/interaction_client/SilentIframeClient.d.ts.map +1 -1
- package/dist/interaction_client/SilentIframeClient.mjs +9 -23
- package/dist/interaction_client/SilentIframeClient.mjs.map +1 -1
- package/dist/interaction_client/SilentRefreshClient.d.ts.map +1 -1
- package/dist/interaction_client/SilentRefreshClient.mjs +2 -12
- package/dist/interaction_client/SilentRefreshClient.mjs.map +1 -1
- package/dist/interaction_client/StandardInteractionClient.d.ts +1 -6
- package/dist/interaction_client/StandardInteractionClient.d.ts.map +1 -1
- package/dist/interaction_client/StandardInteractionClient.mjs +2 -24
- package/dist/interaction_client/StandardInteractionClient.mjs.map +1 -1
- package/dist/interaction_handler/InteractionHandler.d.ts +6 -13
- package/dist/interaction_handler/InteractionHandler.d.ts.map +1 -1
- package/dist/interaction_handler/InteractionHandler.mjs +30 -61
- package/dist/interaction_handler/InteractionHandler.mjs.map +1 -1
- package/dist/interaction_handler/RedirectHandler.d.ts +14 -7
- package/dist/interaction_handler/RedirectHandler.d.ts.map +1 -1
- package/dist/interaction_handler/RedirectHandler.mjs +30 -15
- package/dist/interaction_handler/RedirectHandler.mjs.map +1 -1
- package/dist/interaction_handler/SilentHandler.d.ts +2 -2
- package/dist/interaction_handler/SilentHandler.d.ts.map +1 -1
- package/dist/interaction_handler/SilentHandler.mjs +13 -7
- package/dist/interaction_handler/SilentHandler.mjs.map +1 -1
- package/dist/naa/BridgeError.mjs +1 -1
- package/dist/naa/BridgeProxy.mjs +1 -1
- package/dist/naa/BridgeStatusCode.mjs +1 -1
- package/dist/naa/mapping/NestedAppAuthAdapter.mjs +1 -1
- package/dist/navigation/NavigationClient.mjs +1 -1
- package/dist/network/FetchClient.mjs +1 -1
- package/dist/operatingcontext/BaseOperatingContext.mjs +1 -1
- package/dist/operatingcontext/StandardOperatingContext.mjs +1 -1
- package/dist/operatingcontext/TeamsAppOperatingContext.mjs +1 -1
- package/dist/operatingcontext/UnknownOperatingContext.mjs +1 -1
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/packageMetadata.mjs +2 -2
- package/dist/response/ResponseHandler.d.ts +8 -0
- package/dist/response/ResponseHandler.d.ts.map +1 -0
- package/dist/response/ResponseHandler.mjs +46 -0
- package/dist/response/ResponseHandler.mjs.map +1 -0
- package/dist/telemetry/BrowserPerformanceClient.mjs +1 -1
- package/dist/telemetry/BrowserPerformanceMeasurement.mjs +1 -1
- package/dist/utils/BrowserConstants.mjs +1 -1
- package/dist/utils/BrowserProtocolUtils.d.ts +7 -14
- package/dist/utils/BrowserProtocolUtils.d.ts.map +1 -1
- package/dist/utils/BrowserProtocolUtils.mjs +17 -30
- package/dist/utils/BrowserProtocolUtils.mjs.map +1 -1
- package/dist/utils/BrowserUtils.mjs +1 -1
- package/lib/msal-browser.cjs +18434 -61
- package/lib/msal-browser.cjs.map +1 -1
- package/lib/msal-browser.js +3037 -3733
- package/lib/msal-browser.js.map +1 -1
- package/lib/msal-browser.min.js +68 -66
- package/package.json +2 -2
- package/src/app/PublicClientApplication.ts +4 -3
- package/src/app/PublicClientNext.ts +7 -5
- package/src/cache/BrowserCacheManager.ts +29 -50
- package/src/cache/TokenCache.ts +5 -4
- package/src/controllers/ControllerFactory.ts +30 -49
- package/src/controllers/IController.ts +0 -6
- package/src/controllers/StandardController.ts +70 -85
- package/src/crypto/CryptoOps.ts +5 -3
- package/src/index.ts +1 -0
- package/src/interaction_client/BaseInteractionClient.ts +1 -2
- package/src/interaction_client/NativeInteractionClient.ts +4 -3
- package/src/interaction_client/PopupClient.ts +72 -196
- package/src/interaction_client/RedirectClient.ts +111 -100
- package/src/interaction_client/SilentAuthCodeClient.ts +1 -12
- package/src/interaction_client/SilentIframeClient.ts +17 -44
- package/src/interaction_client/SilentRefreshClient.ts +5 -19
- package/src/interaction_client/StandardInteractionClient.ts +2 -48
- package/src/interaction_handler/InteractionHandler.ts +39 -112
- package/src/interaction_handler/RedirectHandler.ts +52 -30
- package/src/interaction_handler/SilentHandler.ts +12 -5
- package/src/packageMetadata.ts +1 -1
- package/src/response/ResponseHandler.ts +73 -0
- package/src/utils/BrowserProtocolUtils.ts +17 -36
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! @azure/msal-browser v3.
|
|
1
|
+
/*! @azure/msal-browser v3.5.0 2023-11-07 */
|
|
2
2
|
'use strict';
|
|
3
|
-
import {
|
|
3
|
+
import { invokeAsync, PerformanceEvents, AuthError, Constants, UrlString, UrlUtils, ProtocolUtils, ThrottlingUtils, ProtocolMode, ServerResponseType } from '@azure/msal-common';
|
|
4
4
|
import { StandardInteractionClient } from './StandardInteractionClient.mjs';
|
|
5
5
|
import { InteractionType, ApiId, TemporaryCacheKeys } from '../utils/BrowserConstants.mjs';
|
|
6
6
|
import { RedirectHandler } from '../interaction_handler/RedirectHandler.mjs';
|
|
@@ -9,7 +9,8 @@ import { EventType } from '../event/EventType.mjs';
|
|
|
9
9
|
import { createBrowserAuthError } from '../error/BrowserAuthError.mjs';
|
|
10
10
|
import { NativeInteractionClient } from './NativeInteractionClient.mjs';
|
|
11
11
|
import { NativeMessageHandler } from '../broker/nativeBroker/NativeMessageHandler.mjs';
|
|
12
|
-
import {
|
|
12
|
+
import { validateInteractionType } from '../response/ResponseHandler.mjs';
|
|
13
|
+
import { noStateInHash, nativeConnectionNotEstablished, noCachedAuthorityError } from '../error/BrowserAuthErrorCodes.mjs';
|
|
13
14
|
|
|
14
15
|
/*
|
|
15
16
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -25,9 +26,8 @@ class RedirectClient extends StandardInteractionClient {
|
|
|
25
26
|
* @param request
|
|
26
27
|
*/
|
|
27
28
|
async acquireToken(request) {
|
|
28
|
-
this.
|
|
29
|
-
|
|
30
|
-
this.browserStorage.updateCacheEntries(validRequest.state, validRequest.nonce, validRequest.authority, validRequest.loginHint || Constants.EMPTY_STRING, validRequest.account || null);
|
|
29
|
+
const validRequest = await invokeAsync(this.initializeAuthorizationRequest.bind(this), PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, this.logger, this.performanceClient, this.correlationId)(request, InteractionType.Redirect);
|
|
30
|
+
this.browserStorage.updateCacheEntries(validRequest.state, validRequest.nonce, validRequest.authority, validRequest.loginHint || "", validRequest.account || null);
|
|
31
31
|
const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenRedirect);
|
|
32
32
|
const handleBackButton = (event) => {
|
|
33
33
|
// Clear temporary cache if the back button is clicked during the redirect flow.
|
|
@@ -39,14 +39,11 @@ class RedirectClient extends StandardInteractionClient {
|
|
|
39
39
|
};
|
|
40
40
|
try {
|
|
41
41
|
// Create auth code request and generate PKCE params
|
|
42
|
-
this.
|
|
43
|
-
const authCodeRequest = await this.initializeAuthorizationCodeRequest(validRequest);
|
|
42
|
+
const authCodeRequest = await invokeAsync(this.initializeAuthorizationCodeRequest.bind(this), PerformanceEvents.StandardInteractionClientInitializeAuthorizationCodeRequest, this.logger, this.performanceClient, this.correlationId)(validRequest);
|
|
44
43
|
// Initialize the client
|
|
45
|
-
this.
|
|
46
|
-
const authClient = await this.createAuthCodeClient(serverTelemetryManager, validRequest.authority, validRequest.azureCloudOptions);
|
|
47
|
-
this.logger.verbose("Auth code client created");
|
|
44
|
+
const authClient = await invokeAsync(this.createAuthCodeClient.bind(this), PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, this.logger, this.performanceClient, this.correlationId)(serverTelemetryManager, validRequest.authority, validRequest.azureCloudOptions);
|
|
48
45
|
// Create redirect interaction handler.
|
|
49
|
-
const interactionHandler = new RedirectHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.
|
|
46
|
+
const interactionHandler = new RedirectHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.performanceClient);
|
|
50
47
|
// Create acquire token url.
|
|
51
48
|
const navigateUrl = await authClient.getAuthCodeUrl({
|
|
52
49
|
...validRequest,
|
|
@@ -87,22 +84,10 @@ class RedirectClient extends StandardInteractionClient {
|
|
|
87
84
|
this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null.");
|
|
88
85
|
return null;
|
|
89
86
|
}
|
|
90
|
-
const
|
|
91
|
-
if (!
|
|
87
|
+
const [serverParams, responseString] = this.getRedirectResponse(hash || "");
|
|
88
|
+
if (!serverParams) {
|
|
92
89
|
// Not a recognized server response hash or hash not associated with a redirect request
|
|
93
|
-
this.logger.info("handleRedirectPromise did not detect a response
|
|
94
|
-
this.browserStorage.cleanRequestByInteractionType(InteractionType.Redirect);
|
|
95
|
-
return null;
|
|
96
|
-
}
|
|
97
|
-
let state;
|
|
98
|
-
try {
|
|
99
|
-
// Deserialize hash fragment response parameters.
|
|
100
|
-
const serverParams = UrlString.getDeserializedHash(responseHash);
|
|
101
|
-
state = this.validateAndExtractStateFromHash(serverParams, InteractionType.Redirect);
|
|
102
|
-
this.logger.verbose("State extracted from hash");
|
|
103
|
-
}
|
|
104
|
-
catch (e) {
|
|
105
|
-
this.logger.info(`handleRedirectPromise was unable to extract state due to: ${e}`);
|
|
90
|
+
this.logger.info("handleRedirectPromise did not detect a response as a result of a redirect. Cleaning temporary cache.");
|
|
106
91
|
this.browserStorage.cleanRequestByInteractionType(InteractionType.Redirect);
|
|
107
92
|
return null;
|
|
108
93
|
}
|
|
@@ -113,17 +98,17 @@ class RedirectClient extends StandardInteractionClient {
|
|
|
113
98
|
if (loginRequestUrlNormalized === currentUrlNormalized &&
|
|
114
99
|
this.config.auth.navigateToLoginRequestUrl) {
|
|
115
100
|
// We are on the page we need to navigate to - handle hash
|
|
116
|
-
this.logger.verbose("Current page is loginRequestUrl, handling
|
|
117
|
-
const handleHashResult = await this.handleHash(responseHash, state, serverTelemetryManager);
|
|
101
|
+
this.logger.verbose("Current page is loginRequestUrl, handling response");
|
|
118
102
|
if (loginRequestUrl.indexOf("#") > -1) {
|
|
119
103
|
// Replace current hash with non-msal hash, if present
|
|
120
104
|
replaceHash(loginRequestUrl);
|
|
121
105
|
}
|
|
106
|
+
const handleHashResult = await this.handleResponse(serverParams, serverTelemetryManager);
|
|
122
107
|
return handleHashResult;
|
|
123
108
|
}
|
|
124
109
|
else if (!this.config.auth.navigateToLoginRequestUrl) {
|
|
125
|
-
this.logger.verbose("NavigateToLoginRequestUrl set to false, handling
|
|
126
|
-
return this.
|
|
110
|
+
this.logger.verbose("NavigateToLoginRequestUrl set to false, handling response");
|
|
111
|
+
return this.handleResponse(serverParams, serverTelemetryManager);
|
|
127
112
|
}
|
|
128
113
|
else if (!isInIframe() ||
|
|
129
114
|
this.config.system.allowRedirectInIframe) {
|
|
@@ -131,7 +116,7 @@ class RedirectClient extends StandardInteractionClient {
|
|
|
131
116
|
* Returned from authority using redirect - need to perform navigation before processing response
|
|
132
117
|
* Cache the hash to be retrieved after the next redirect
|
|
133
118
|
*/
|
|
134
|
-
this.browserStorage.setTemporaryCache(TemporaryCacheKeys.URL_HASH,
|
|
119
|
+
this.browserStorage.setTemporaryCache(TemporaryCacheKeys.URL_HASH, responseString, true);
|
|
135
120
|
const navigationOptions = {
|
|
136
121
|
apiId: ApiId.handleRedirectPromise,
|
|
137
122
|
timeout: this.config.system.redirectNavigationTimeout,
|
|
@@ -159,7 +144,7 @@ class RedirectClient extends StandardInteractionClient {
|
|
|
159
144
|
}
|
|
160
145
|
// If navigateInternal implementation returns false, handle the hash now
|
|
161
146
|
if (!processHashOnRedirect) {
|
|
162
|
-
return this.
|
|
147
|
+
return this.handleResponse(serverParams, serverTelemetryManager);
|
|
163
148
|
}
|
|
164
149
|
}
|
|
165
150
|
return null;
|
|
@@ -178,29 +163,57 @@ class RedirectClient extends StandardInteractionClient {
|
|
|
178
163
|
* Returns null if interactionType in the state value is not "redirect" or the hash does not contain known properties
|
|
179
164
|
* @param hash
|
|
180
165
|
*/
|
|
181
|
-
|
|
166
|
+
getRedirectResponse(userProvidedResponse) {
|
|
182
167
|
this.logger.verbose("getRedirectResponseHash called");
|
|
183
168
|
// Get current location hash from window or cache.
|
|
184
|
-
|
|
185
|
-
if (
|
|
169
|
+
let responseString = userProvidedResponse;
|
|
170
|
+
if (!responseString) {
|
|
171
|
+
if (this.config.auth.OIDCOptions.serverResponseType ===
|
|
172
|
+
ServerResponseType.QUERY) {
|
|
173
|
+
responseString = window.location.search;
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
responseString = window.location.hash;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
let response = UrlUtils.getDeserializedResponse(responseString);
|
|
180
|
+
if (response) {
|
|
181
|
+
try {
|
|
182
|
+
validateInteractionType(response, this.browserCrypto, InteractionType.Redirect);
|
|
183
|
+
}
|
|
184
|
+
catch (e) {
|
|
185
|
+
if (e instanceof AuthError) {
|
|
186
|
+
this.logger.error(`Interaction type validation failed due to ${e.errorCode}: ${e.errorMessage}`);
|
|
187
|
+
}
|
|
188
|
+
return [null, ""];
|
|
189
|
+
}
|
|
186
190
|
clearHash(window);
|
|
187
191
|
this.logger.verbose("Hash contains known properties, returning response hash");
|
|
188
|
-
return
|
|
192
|
+
return [response, responseString];
|
|
189
193
|
}
|
|
190
194
|
const cachedHash = this.browserStorage.getTemporaryCache(TemporaryCacheKeys.URL_HASH, true);
|
|
191
195
|
this.browserStorage.removeItem(this.browserStorage.generateCacheKey(TemporaryCacheKeys.URL_HASH));
|
|
192
|
-
|
|
193
|
-
|
|
196
|
+
if (cachedHash) {
|
|
197
|
+
response = UrlUtils.getDeserializedResponse(cachedHash);
|
|
198
|
+
if (response) {
|
|
199
|
+
this.logger.verbose("Hash does not contain known properties, returning cached hash");
|
|
200
|
+
return [response, cachedHash];
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
return [null, ""];
|
|
194
204
|
}
|
|
195
205
|
/**
|
|
196
206
|
* Checks if hash exists and handles in window.
|
|
197
207
|
* @param hash
|
|
198
208
|
* @param state
|
|
199
209
|
*/
|
|
200
|
-
async
|
|
210
|
+
async handleResponse(serverParams, serverTelemetryManager) {
|
|
211
|
+
const state = serverParams.state;
|
|
212
|
+
if (!state) {
|
|
213
|
+
throw createBrowserAuthError(noStateInHash);
|
|
214
|
+
}
|
|
201
215
|
const cachedRequest = this.browserStorage.getCachedRequest(state);
|
|
202
|
-
this.logger.verbose("
|
|
203
|
-
const serverParams = UrlString.getDeserializedHash(hash);
|
|
216
|
+
this.logger.verbose("handleResponse called, retrieved cached request");
|
|
204
217
|
if (serverParams.accountId) {
|
|
205
218
|
this.logger.verbose("Account id found in hash, calling WAM for token");
|
|
206
219
|
if (!this.nativeMessageHandler) {
|
|
@@ -223,12 +236,10 @@ class RedirectClient extends StandardInteractionClient {
|
|
|
223
236
|
if (!currentAuthority) {
|
|
224
237
|
throw createBrowserAuthError(noCachedAuthorityError);
|
|
225
238
|
}
|
|
226
|
-
this.
|
|
227
|
-
const authClient = await this.createAuthCodeClient(serverTelemetryManager, currentAuthority);
|
|
228
|
-
this.logger.verbose("Auth code client created");
|
|
239
|
+
const authClient = await invokeAsync(this.createAuthCodeClient.bind(this), PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, this.logger, this.performanceClient, this.correlationId)(serverTelemetryManager, currentAuthority);
|
|
229
240
|
ThrottlingUtils.removeThrottle(this.browserStorage, this.config.auth.clientId, cachedRequest);
|
|
230
|
-
const interactionHandler = new RedirectHandler(authClient, this.browserStorage, cachedRequest, this.logger, this.
|
|
231
|
-
return await interactionHandler.
|
|
241
|
+
const interactionHandler = new RedirectHandler(authClient, this.browserStorage, cachedRequest, this.logger, this.performanceClient);
|
|
242
|
+
return await interactionHandler.handleCodeResponse(serverParams, state);
|
|
232
243
|
}
|
|
233
244
|
/**
|
|
234
245
|
* Use to log out the current user, and redirect the user to the postLogoutRedirectUri.
|
|
@@ -248,9 +259,7 @@ class RedirectClient extends StandardInteractionClient {
|
|
|
248
259
|
timeout: this.config.system.redirectNavigationTimeout,
|
|
249
260
|
noHistory: false,
|
|
250
261
|
};
|
|
251
|
-
this.
|
|
252
|
-
const authClient = await this.createAuthCodeClient(serverTelemetryManager, logoutRequest && logoutRequest.authority);
|
|
253
|
-
this.logger.verbose("Auth code client created");
|
|
262
|
+
const authClient = await invokeAsync(this.createAuthCodeClient.bind(this), PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, this.logger, this.performanceClient, this.correlationId)(serverTelemetryManager, logoutRequest && logoutRequest.authority);
|
|
254
263
|
if (authClient.authority.protocolMode === ProtocolMode.OIDC) {
|
|
255
264
|
try {
|
|
256
265
|
authClient.authority.endSessionEndpoint;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RedirectClient.mjs","sources":["../../src/interaction_client/RedirectClient.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RedirectClient.mjs","sources":["../../src/interaction_client/RedirectClient.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;AAKA;AAmBA;AAQA;AAOA;;;AA2CO,QAAA,KAAA,CAAA,MAAA,EAAA,WAAA,EAAA,aAAA,EAAA,MAAA,EAAA,YAAA,EAAA,gBAAA,EAAA,iBAAA,EAAA,oBAAA,EAAA,aAAA,CAAA,CAAA;QACe,IAAA,CAAA,aAAU,GAAA,iBAAyB,CAAA;AAwGrD,KAAA;;;;;AAKG,IAAA,MAAA,YAAA,CAAA,OAAA,EAAA;QACwB,MAAA,YACvB,GAAI,MAAG,WACR,CAAA,IAAQ,CAAA,8BAA4B,CAAA,IAAA,CAAA,IAAA,CAAA,EAAA,iBAAA,CAAA,uDAAA,EAAA,IAAA,CAAA,MAAA,EAAA,IAAA,CAAA,iBAAA,EAAA,IAAA,CAAA,aAAA,CAAA,CAAA,OAAA,EAAA,eAAA,CAAA,QAAA,CAAA,CAAA;AA4IvC,QAAA,IAAA,CAAA,cAAA,CAAA,kBAAA,CAAA,YAAA,CAAA,KAAA,EAAA,YAAA,CAAA,KAAA,EAAA,YAAA,CAAA,SAAA,EAAA,YAAA,CAAA,SAAA,IAAA,EAAA,EAAA,YAAA,CAAA,OAAA,IAAA,IAAA,CAAA,CAAA;;;;AAIG,YAAA,IAAA,KAAA,CAAA,SAAA,EAAA;AACH,gBAAU,IAAA,CAAA,MAAA,CAAA,OACN,CAAA,sEACwC;AA4D5C,gBAAA,IAAA,CAAA,cAAA,CAAA,mBAAA,CAAA,YAAA,CAAA,KAAA,CAAA,CAAA;;;;AAIG,QAAA,IAAA;AACa;AAiFhB,YAAA,MAAA,eAAA,GAAA,MAAA,WAAA,CAAA,IAAA,CAAA,kCAAA,CAAA,IAAA,CAAA,IAAA,CAAA,EAAA,iBAAA,CAAA,2DAAA,EAAA,IAAA,CAAA,MAAA,EAAA,IAAA,CAAA,iBAAA,EAAA,IAAA,CAAA,aAAA,CAAA,CAAA,YAAA,CAAA,CAAA;;;;AAIG,YAAA,MAAA,kBAAA,GAAA,IAAA,eAAA,CAAA,UAAA,EAAA,IAAA,CAAA,cAAA,EAAA,eAAA,EAAA,IAAA,CAAA,MAAA,EAAA,IAAA,CAAA,iBAAA,CAAA,CAAA;;AA2HH,YAAA,MAAA,WAAA,GAAA,MAAA,UAAA,CAAA,cAAA,CAAA;;;AAGG,aAAA,CAAA,CAAA;YACM,uBAAsB,GAAA,IAAA,CAAA,oBAA4B,CAAM,OAAA,CAAA,iBAAA,CAAA,CAAA;AAOpE,YAAA,IAAA,CAAA,MAAA,CAAA,UAAA,CAAA,CAAA,qBAAA,EAAA,iBAAA,CAAA,CAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SilentAuthCodeClient.d.ts","sourceRoot":"","sources":["../../src/interaction_client/SilentAuthCodeClient.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,OAAO,EACP,MAAM,
|
|
1
|
+
{"version":3,"file":"SilentAuthCodeClient.d.ts","sourceRoot":"","sources":["../../src/interaction_client/SilentAuthCodeClient.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,OAAO,EACP,MAAM,EAGN,kBAAkB,EAGrB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAExE,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAKpE,OAAO,EAAmB,KAAK,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAE/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;AACnF,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAGxE,qBAAa,oBAAqB,SAAQ,yBAAyB;IAC/D,OAAO,CAAC,KAAK,CAAQ;gBAGjB,MAAM,EAAE,oBAAoB,EAC5B,WAAW,EAAE,mBAAmB,EAChC,aAAa,EAAE,OAAO,EACtB,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,YAAY,EAC1B,gBAAgB,EAAE,iBAAiB,EACnC,KAAK,EAAE,KAAK,EACZ,iBAAiB,EAAE,kBAAkB,EACrC,oBAAoB,CAAC,EAAE,oBAAoB,EAC3C,aAAa,CAAC,EAAE,MAAM;IAgB1B;;;OAGG;IACG,YAAY,CACd,OAAO,EAAE,wBAAwB,GAClC,OAAO,CAAC,oBAAoB,CAAC;IA6EhC;;OAEG;IACH,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;CAQ1B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! @azure/msal-browser v3.
|
|
1
|
+
/*! @azure/msal-browser v3.5.0 2023-11-07 */
|
|
2
2
|
'use strict';
|
|
3
|
-
import { invokeAsync, PerformanceEvents,
|
|
3
|
+
import { invokeAsync, PerformanceEvents, AuthError } from '@azure/msal-common';
|
|
4
4
|
import { StandardInteractionClient } from './StandardInteractionClient.mjs';
|
|
5
5
|
import { createBrowserAuthError } from '../error/BrowserAuthError.mjs';
|
|
6
6
|
import { InteractionType } from '../utils/BrowserConstants.mjs';
|
|
@@ -28,7 +28,6 @@ class SilentAuthCodeClient extends StandardInteractionClient {
|
|
|
28
28
|
}
|
|
29
29
|
// Create silent request
|
|
30
30
|
const silentRequest = await invokeAsync(this.initializeAuthorizationRequest.bind(this), PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, this.logger, this.performanceClient, request.correlationId)(request, InteractionType.Silent);
|
|
31
|
-
this.browserStorage.updateCacheEntries(silentRequest.state, silentRequest.nonce, silentRequest.authority, silentRequest.loginHint || Constants.EMPTY_STRING, silentRequest.account || null);
|
|
32
31
|
const serverTelemetryManager = this.initializeServerTelemetryManager(this.apiId);
|
|
33
32
|
try {
|
|
34
33
|
// Create auth code request (PKCE not needed)
|
|
@@ -48,14 +47,13 @@ class SilentAuthCodeClient extends StandardInteractionClient {
|
|
|
48
47
|
msgraph_host: request.msGraphHost,
|
|
49
48
|
cloud_graph_host_name: request.cloudGraphHostName,
|
|
50
49
|
cloud_instance_host_name: request.cloudInstanceHostName,
|
|
51
|
-
}, silentRequest
|
|
50
|
+
}, silentRequest, false);
|
|
52
51
|
}
|
|
53
52
|
catch (e) {
|
|
54
53
|
if (e instanceof AuthError) {
|
|
55
54
|
e.setCorrelationId(this.correlationId);
|
|
56
55
|
serverTelemetryManager.cacheFailedRequest(e);
|
|
57
56
|
}
|
|
58
|
-
this.browserStorage.cleanRequestByState(silentRequest.state);
|
|
59
57
|
throw e;
|
|
60
58
|
}
|
|
61
59
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SilentAuthCodeClient.mjs","sources":["../../src/interaction_client/SilentAuthCodeClient.ts"],"sourcesContent":[null],"names":["BrowserAuthErrorCodes.authCodeRequired"],"mappings":";;;;;;;;;;AAKA;
|
|
1
|
+
{"version":3,"file":"SilentAuthCodeClient.mjs","sources":["../../src/interaction_client/SilentAuthCodeClient.ts"],"sourcesContent":[null],"names":["BrowserAuthErrorCodes.authCodeRequired"],"mappings":";;;;;;;;;;AAKA;AASA;AAEA;AACA;AAca,MAAA,oBAAA,kCAAsD,CAAA;IAC/D,kBAAqB,EAAA,WAAA,EAAA,aAAA,EAAA,MAAA,EAAA,YAAA,EAAA,gBAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,oBAAA,EAAA,aAAA,EAAA;AAGjB,QAAA,KAAA,CAAA,MAAA,EAAM,WAAsB,EAAA,aACjB,EAAA,MAAA,EAAA,8BACX,EAAA,iBACM,EAAA,oBACN,EAAA,aAA0B,CAAA,CAAA;AAqB9B,QAAA,IAAA,CAAA,KAAA,GAAA,KAAA,CAAA;;;AAGG;;AAgFH;;AAEG;AACH,QAAA,IAAU,CAAA,OAAA,CAAO,IAAC,EAAK;AAQ1B,YAAA,MAAA,sBAAA,CAAAA,gBAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-browser v3.
|
|
1
|
+
/*! @azure/msal-browser v3.5.0 2023-11-07 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { StandardInteractionClient } from './StandardInteractionClient.mjs';
|
|
4
4
|
import { PerformanceEvents, invokeAsync, SilentFlowClient } from '@azure/msal-common';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SilentIframeClient.d.ts","sourceRoot":"","sources":["../../src/interaction_client/SilentIframeClient.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,OAAO,EACP,MAAM,EAGN,uBAAuB,
|
|
1
|
+
{"version":3,"file":"SilentIframeClient.d.ts","sourceRoot":"","sources":["../../src/interaction_client/SilentIframeClient.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,OAAO,EACP,MAAM,EAGN,uBAAuB,EAGvB,kBAAkB,EAIrB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAKpE,OAAO,EAAmB,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAKnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;AAEnF,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAKxE,qBAAa,kBAAmB,SAAQ,yBAAyB;IAC7D,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC;IACvB,SAAS,CAAC,aAAa,EAAE,mBAAmB,CAAC;gBAGzC,MAAM,EAAE,oBAAoB,EAC5B,WAAW,EAAE,mBAAmB,EAChC,aAAa,EAAE,OAAO,EACtB,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,YAAY,EAC1B,gBAAgB,EAAE,iBAAiB,EACnC,KAAK,EAAE,KAAK,EACZ,iBAAiB,EAAE,kBAAkB,EACrC,iBAAiB,EAAE,mBAAmB,EACtC,oBAAoB,CAAC,EAAE,oBAAoB,EAC3C,aAAa,CAAC,EAAE,MAAM;IAiB1B;;;OAGG;IACG,YAAY,CACd,OAAO,EAAE,gBAAgB,GAC1B,OAAO,CAAC,oBAAoB,CAAC;IA6EhC;;OAEG;IACH,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IASvB;;;;;OAKG;cACa,iBAAiB,CAC7B,UAAU,EAAE,uBAAuB,EACnC,aAAa,EAAE,uBAAuB,GACvC,OAAO,CAAC,oBAAoB,CAAC;CAoInC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! @azure/msal-browser v3.
|
|
1
|
+
/*! @azure/msal-browser v3.5.0 2023-11-07 */
|
|
2
2
|
'use strict';
|
|
3
|
-
import { PerformanceEvents, PromptValue, invokeAsync,
|
|
3
|
+
import { PerformanceEvents, PromptValue, invokeAsync, AuthError, invoke, ProtocolUtils } from '@azure/msal-common';
|
|
4
4
|
import { StandardInteractionClient } from './StandardInteractionClient.mjs';
|
|
5
5
|
import { createBrowserAuthError } from '../error/BrowserAuthError.mjs';
|
|
6
6
|
import { InteractionType } from '../utils/BrowserConstants.mjs';
|
|
@@ -9,7 +9,8 @@ import { NativeMessageHandler } from '../broker/nativeBroker/NativeMessageHandle
|
|
|
9
9
|
import { NativeInteractionClient } from './NativeInteractionClient.mjs';
|
|
10
10
|
import { InteractionHandler } from '../interaction_handler/InteractionHandler.mjs';
|
|
11
11
|
import { preconnect } from '../utils/BrowserUtils.mjs';
|
|
12
|
-
import {
|
|
12
|
+
import { deserializeResponse } from '../response/ResponseHandler.mjs';
|
|
13
|
+
import { silentPromptValueError, silentLogoutUnsupported, nativeConnectionNotEstablished } from '../error/BrowserAuthErrorCodes.mjs';
|
|
13
14
|
|
|
14
15
|
/*
|
|
15
16
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -45,7 +46,6 @@ class SilentIframeClient extends StandardInteractionClient {
|
|
|
45
46
|
prompt: request.prompt || PromptValue.NONE,
|
|
46
47
|
}, InteractionType.Silent);
|
|
47
48
|
preconnect(silentRequest.authority);
|
|
48
|
-
this.browserStorage.updateCacheEntries(silentRequest.state, silentRequest.nonce, silentRequest.authority, silentRequest.loginHint || Constants.EMPTY_STRING, silentRequest.account || null);
|
|
49
49
|
const serverTelemetryManager = this.initializeServerTelemetryManager(this.apiId);
|
|
50
50
|
try {
|
|
51
51
|
// Initialize the client
|
|
@@ -57,7 +57,6 @@ class SilentIframeClient extends StandardInteractionClient {
|
|
|
57
57
|
e.setCorrelationId(this.correlationId);
|
|
58
58
|
serverTelemetryManager.cacheFailedRequest(e);
|
|
59
59
|
}
|
|
60
|
-
this.browserStorage.cleanRequestByState(silentRequest.state);
|
|
61
60
|
throw e;
|
|
62
61
|
}
|
|
63
62
|
}
|
|
@@ -88,38 +87,25 @@ class SilentIframeClient extends StandardInteractionClient {
|
|
|
88
87
|
const interactionHandler = new InteractionHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.performanceClient);
|
|
89
88
|
// Get the frame handle for the silent request
|
|
90
89
|
const msalFrame = await invokeAsync(initiateAuthRequest, PerformanceEvents.SilentHandlerInitiateAuthRequest, this.logger, this.performanceClient, correlationId)(navigateUrl, this.performanceClient, this.logger, correlationId, this.config.system.navigateFrameWait);
|
|
90
|
+
const responseType = this.config.auth.OIDCOptions.serverResponseType;
|
|
91
91
|
// Monitor the window for the hash. Return the string value and close the popup when the hash is received. Default timeout is 60 seconds.
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
// No hash is present
|
|
95
|
-
this.logger.error("The request has returned to the redirectUri but a hash is not present in the iframe. It's likely that the hash has been removed or the page has been redirected by code running on the redirectUri page.");
|
|
96
|
-
throw createBrowserAuthError(hashEmptyError);
|
|
97
|
-
}
|
|
98
|
-
else if (!UrlString.hashContainsKnownProperties(hash)) {
|
|
99
|
-
this.logger.error("A hash is present in the iframe but it does not contain known properties. It's likely that the hash has been replaced by code running on the redirectUri page.");
|
|
100
|
-
this.logger.errorPii(`The hash detected in the iframe is: ${hash}`);
|
|
101
|
-
throw createBrowserAuthError(hashDoesNotContainKnownProperties);
|
|
102
|
-
}
|
|
103
|
-
// Deserialize hash fragment response parameters.
|
|
104
|
-
const serverParams = UrlString.getDeserializedHash(hash);
|
|
105
|
-
const state = this.validateAndExtractStateFromHash(serverParams, InteractionType.Silent, correlationId);
|
|
92
|
+
const responseString = await invokeAsync(monitorIframeForHash, PerformanceEvents.SilentHandlerMonitorIframeForHash, this.logger, this.performanceClient, correlationId)(msalFrame, this.config.system.iframeHashTimeout, this.config.system.pollIntervalMilliseconds, this.performanceClient, this.logger, correlationId, responseType);
|
|
93
|
+
const serverParams = invoke(deserializeResponse, PerformanceEvents.DeserializeResponse, this.logger, this.performanceClient, this.correlationId)(responseString, responseType, this.logger);
|
|
106
94
|
if (serverParams.accountId) {
|
|
107
95
|
this.logger.verbose("Account id found in hash, calling WAM for token");
|
|
108
96
|
if (!this.nativeMessageHandler) {
|
|
109
97
|
throw createBrowserAuthError(nativeConnectionNotEstablished);
|
|
110
98
|
}
|
|
111
99
|
const nativeInteractionClient = new NativeInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, this.apiId, this.performanceClient, this.nativeMessageHandler, serverParams.accountId, this.browserStorage, correlationId);
|
|
112
|
-
const { userRequestState } = ProtocolUtils.parseRequestState(this.browserCrypto, state);
|
|
100
|
+
const { userRequestState } = ProtocolUtils.parseRequestState(this.browserCrypto, silentRequest.state);
|
|
113
101
|
return invokeAsync(nativeInteractionClient.acquireToken.bind(nativeInteractionClient), PerformanceEvents.NativeInteractionClientAcquireToken, this.logger, this.performanceClient, correlationId)({
|
|
114
102
|
...silentRequest,
|
|
115
103
|
state: userRequestState,
|
|
116
104
|
prompt: silentRequest.prompt || PromptValue.NONE,
|
|
117
|
-
}).finally(() => {
|
|
118
|
-
this.browserStorage.cleanRequestByState(state);
|
|
119
105
|
});
|
|
120
106
|
}
|
|
121
107
|
// Handle response from hash string
|
|
122
|
-
return invokeAsync(interactionHandler.
|
|
108
|
+
return invokeAsync(interactionHandler.handleCodeResponse.bind(interactionHandler), PerformanceEvents.HandleCodeResponse, this.logger, this.performanceClient, correlationId)(serverParams, silentRequest);
|
|
123
109
|
}
|
|
124
110
|
}
|
|
125
111
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SilentIframeClient.mjs","sources":["../../src/interaction_client/SilentIframeClient.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SilentIframeClient.mjs","sources":["../../src/interaction_client/SilentIframeClient.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;AAKA;AAaA;AACA;AACA;AA0BQ,MAAA,kBAA4B,SAAA,yBACf,CAAA;AA0BjB,IAAA,WAAA,CAAA,MAAA,EAAA,WAAA,EAAA,aAAA,EAAA,MAAA,EAAA,YAAA,EAAA,gBAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,iBAAA,EAAA,oBAAA,EAAA,aAAA,EAAA;;;AAGG,QAAA,IAAA,CAAA,aAAA,GAAA,iBAAA,CAAA;KACe;AA+ElB;;AAEG;AACH;AASA,IAAA,MAAA,YAAA,CAAA,OAAA,EAAA;;;;;AAKG,aAAA,CAAA,OAAA,CAAA,OAAA,IAAA,CAAA,OAAA,CAAA,OAAA,CAAA,QAAA,CAAA,EAAA;AACa,YAAA,IAAA,CAAA,MAAA,CAAA,OAAiB,CAC7B,qGAEO,CAAA,CAAA;AAoId,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SilentRefreshClient.d.ts","sourceRoot":"","sources":["../../src/interaction_client/SilentRefreshClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EACH,uBAAuB,EACvB,sBAAsB,EACtB,kBAAkB,EAElB,iBAAiB,EAGpB,MAAM,oBAAoB,CAAC;AAM5B,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAExE,qBAAa,mBAAoB,SAAQ,yBAAyB;IAC9D;;;OAGG;IACG,YAAY,CACd,OAAO,EAAE,uBAAuB,GACjC,OAAO,CAAC,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"SilentRefreshClient.d.ts","sourceRoot":"","sources":["../../src/interaction_client/SilentRefreshClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EACH,uBAAuB,EACvB,sBAAsB,EACtB,kBAAkB,EAElB,iBAAiB,EAGpB,MAAM,oBAAoB,CAAC;AAM5B,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAExE,qBAAa,mBAAoB,SAAQ,yBAAyB;IAC9D;;;OAGG;IACG,YAAY,CACd,OAAO,EAAE,uBAAuB,GACjC,OAAO,CAAC,oBAAoB,CAAC;IA0ChC;;OAEG;IACH,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IASvB;;;;OAIG;cACa,wBAAwB,CACpC,sBAAsB,EAAE,sBAAsB,EAC9C,YAAY,CAAC,EAAE,MAAM,EACrB,iBAAiB,CAAC,EAAE,iBAAiB,GACtC,OAAO,CAAC,kBAAkB,CAAC;CAWjC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-browser v3.
|
|
1
|
+
/*! @azure/msal-browser v3.5.0 2023-11-07 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { StandardInteractionClient } from './StandardInteractionClient.mjs';
|
|
4
4
|
import { PerformanceEvents, invokeAsync, RefreshTokenClient } from '@azure/msal-common';
|
|
@@ -24,18 +24,8 @@ class SilentRefreshClient extends StandardInteractionClient {
|
|
|
24
24
|
};
|
|
25
25
|
const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenSilent_silentFlow);
|
|
26
26
|
const refreshTokenClient = await this.createRefreshTokenClient(serverTelemetryManager, silentRequest.authority, silentRequest.azureCloudOptions);
|
|
27
|
-
this.logger.verbose("Refresh token client created");
|
|
28
27
|
// Send request to renew token. Auth module will throw errors if token cannot be renewed.
|
|
29
|
-
return invokeAsync(refreshTokenClient.acquireTokenByRefreshToken.bind(refreshTokenClient), PerformanceEvents.RefreshTokenClientAcquireTokenByRefreshToken, this.logger, this.performanceClient, request.correlationId)(silentRequest)
|
|
30
|
-
.then((result) => result)
|
|
31
|
-
.then((result) => {
|
|
32
|
-
this.performanceClient.addFields({
|
|
33
|
-
fromCache: result.fromCache,
|
|
34
|
-
requestId: result.requestId,
|
|
35
|
-
}, request.correlationId);
|
|
36
|
-
return result;
|
|
37
|
-
})
|
|
38
|
-
.catch((e) => {
|
|
28
|
+
return invokeAsync(refreshTokenClient.acquireTokenByRefreshToken.bind(refreshTokenClient), PerformanceEvents.RefreshTokenClientAcquireTokenByRefreshToken, this.logger, this.performanceClient, request.correlationId)(silentRequest).catch((e) => {
|
|
39
29
|
e.setCorrelationId(this.correlationId);
|
|
40
30
|
serverTelemetryManager.cacheFailedRequest(e);
|
|
41
31
|
throw e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SilentRefreshClient.mjs","sources":["../../src/interaction_client/SilentRefreshClient.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;AAKA;AACA;AAcA;AAEA;AAKsB,MAAA,mBACL,SAAA;
|
|
1
|
+
{"version":3,"file":"SilentRefreshClient.mjs","sources":["../../src/interaction_client/SilentRefreshClient.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;AAKA;AACA;AAcA;AAEA;AAKsB,MAAA,mBACL,SAAA;AA2Cb;;AAEG;AACH;AASA,IAAA,MAAA,YAAA,CAAA,OAAA,EAAA;;;;AAIG,YAAA,GAAA,OAAA;AACa,YAAA,GAAA,WAAA;AAenB,SAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ServerTelemetryManager, CommonAuthorizationCodeRequest, AuthorizationCodeClient, ClientConfiguration, Authority,
|
|
1
|
+
import { ServerTelemetryManager, CommonAuthorizationCodeRequest, AuthorizationCodeClient, ClientConfiguration, Authority, CommonEndSessionRequest, AccountInfo, AzureCloudOptions } from "@azure/msal-common";
|
|
2
2
|
import { BaseInteractionClient } from "./BaseInteractionClient";
|
|
3
3
|
import { AuthorizationUrlRequest } from "../request/AuthorizationUrlRequest";
|
|
4
4
|
import { InteractionType } from "../utils/BrowserConstants";
|
|
@@ -39,11 +39,6 @@ export declare abstract class StandardInteractionClient extends BaseInteractionC
|
|
|
39
39
|
* @param requestCorrelationId
|
|
40
40
|
*/
|
|
41
41
|
protected getClientConfiguration(serverTelemetryManager: ServerTelemetryManager, requestAuthority?: string, requestAzureCloudOptions?: AzureCloudOptions): Promise<ClientConfiguration>;
|
|
42
|
-
/**
|
|
43
|
-
* @param hash
|
|
44
|
-
* @param interactionType
|
|
45
|
-
*/
|
|
46
|
-
protected validateAndExtractStateFromHash(serverParams: ServerAuthorizationCodeResponse, interactionType: InteractionType, requestCorrelationId?: string): string;
|
|
47
42
|
/**
|
|
48
43
|
* Used to get a discovered version of the default authority.
|
|
49
44
|
* @param requestAuthority
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StandardInteractionClient.d.ts","sourceRoot":"","sources":["../../src/interaction_client/StandardInteractionClient.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,sBAAsB,EACtB,8BAA8B,EAE9B,uBAAuB,EACvB,mBAAmB,EAEnB,SAAS,
|
|
1
|
+
{"version":3,"file":"StandardInteractionClient.d.ts","sourceRoot":"","sources":["../../src/interaction_client/StandardInteractionClient.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,sBAAsB,EACtB,8BAA8B,EAE9B,uBAAuB,EACvB,mBAAmB,EAEnB,SAAS,EAGT,uBAAuB,EAIvB,WAAW,EACX,iBAAiB,EAIpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAoB,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAG9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEjE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAI/D;;GAEG;AACH,8BAAsB,yBAA0B,SAAQ,qBAAqB;IACzE;;;OAGG;cACa,kCAAkC,CAC9C,OAAO,EAAE,uBAAuB,GACjC,OAAO,CAAC,8BAA8B,CAAC;IA0B1C;;;OAGG;IACH,SAAS,CAAC,uBAAuB,CAC7B,aAAa,CAAC,EAAE,iBAAiB,GAClC,uBAAuB;IA+F1B;;;;OAIG;IACH,SAAS,CAAC,8BAA8B,CACpC,OAAO,EAAE,WAAW,GACrB,MAAM,GAAG,IAAI;IAmBhB;;;;OAIG;cACa,oBAAoB,CAChC,sBAAsB,EAAE,sBAAsB,EAC9C,YAAY,CAAC,EAAE,MAAM,EACrB,wBAAwB,CAAC,EAAE,iBAAiB,GAC7C,OAAO,CAAC,uBAAuB,CAAC;IAmBnC;;;;;OAKG;cACa,sBAAsB,CAClC,sBAAsB,EAAE,sBAAsB,EAC9C,gBAAgB,CAAC,EAAE,MAAM,EACzB,wBAAwB,CAAC,EAAE,iBAAiB,GAC7C,OAAO,CAAC,mBAAmB,CAAC;IAiD/B;;;;OAIG;cACa,sBAAsB,CAClC,gBAAgB,CAAC,EAAE,MAAM,EACzB,wBAAwB,CAAC,EAAE,iBAAiB,GAC7C,OAAO,CAAC,SAAS,CAAC;IA0CrB;;;;OAIG;cACa,8BAA8B,CAC1C,OAAO,EAAE,eAAe,GAAG,YAAY,GAAG,gBAAgB,EAC1D,eAAe,EAAE,eAAe,GACjC,OAAO,CAAC,uBAAuB,CAAC;CAyDtC"}
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
/*! @azure/msal-browser v3.
|
|
1
|
+
/*! @azure/msal-browser v3.5.0 2023-11-07 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { PerformanceEvents, invokeAsync, Constants, UrlString, AuthorizationCodeClient, Authority, AuthorityFactory, ProtocolUtils } from '@azure/msal-common';
|
|
4
4
|
import { BaseInteractionClient } from './BaseInteractionClient.mjs';
|
|
5
5
|
import { BrowserConstants } from '../utils/BrowserConstants.mjs';
|
|
6
6
|
import { version } from '../packageMetadata.mjs';
|
|
7
|
-
import { createBrowserAuthError } from '../error/BrowserAuthError.mjs';
|
|
8
|
-
import { BrowserProtocolUtils } from '../utils/BrowserProtocolUtils.mjs';
|
|
9
7
|
import { getCurrentUri } from '../utils/BrowserUtils.mjs';
|
|
10
8
|
import { generatePkceCodes } from '../crypto/PkceGenerator.mjs';
|
|
11
9
|
import { createNewGuid } from '../crypto/BrowserCrypto.mjs';
|
|
12
|
-
import { noStateInHash, unableToParseState, stateInteractionTypeMismatch } from '../error/BrowserAuthErrorCodes.mjs';
|
|
13
10
|
|
|
14
11
|
/*
|
|
15
12
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -24,7 +21,7 @@ class StandardInteractionClient extends BaseInteractionClient {
|
|
|
24
21
|
* @param request
|
|
25
22
|
*/
|
|
26
23
|
async initializeAuthorizationCodeRequest(request) {
|
|
27
|
-
this.performanceClient.addQueueMeasurement(PerformanceEvents.StandardInteractionClientInitializeAuthorizationCodeRequest,
|
|
24
|
+
this.performanceClient.addQueueMeasurement(PerformanceEvents.StandardInteractionClientInitializeAuthorizationCodeRequest, this.correlationId);
|
|
28
25
|
const generatedPkceParams = await invokeAsync(generatePkceCodes, PerformanceEvents.GeneratePkceCodes, this.logger, this.performanceClient, this.correlationId)(this.performanceClient, this.logger, this.correlationId);
|
|
29
26
|
const authCodeRequest = {
|
|
30
27
|
...request,
|
|
@@ -173,25 +170,6 @@ class StandardInteractionClient extends BaseInteractionClient {
|
|
|
173
170
|
telemetry: this.config.telemetry,
|
|
174
171
|
};
|
|
175
172
|
}
|
|
176
|
-
/**
|
|
177
|
-
* @param hash
|
|
178
|
-
* @param interactionType
|
|
179
|
-
*/
|
|
180
|
-
validateAndExtractStateFromHash(serverParams, interactionType, requestCorrelationId) {
|
|
181
|
-
this.logger.verbose("validateAndExtractStateFromHash called", requestCorrelationId);
|
|
182
|
-
if (!serverParams.state) {
|
|
183
|
-
throw createBrowserAuthError(noStateInHash);
|
|
184
|
-
}
|
|
185
|
-
const platformStateObj = BrowserProtocolUtils.extractBrowserRequestState(this.browserCrypto, serverParams.state);
|
|
186
|
-
if (!platformStateObj) {
|
|
187
|
-
throw createBrowserAuthError(unableToParseState);
|
|
188
|
-
}
|
|
189
|
-
if (platformStateObj.interactionType !== interactionType) {
|
|
190
|
-
throw createBrowserAuthError(stateInteractionTypeMismatch);
|
|
191
|
-
}
|
|
192
|
-
this.logger.verbose("Returning state from hash", requestCorrelationId);
|
|
193
|
-
return serverParams.state;
|
|
194
|
-
}
|
|
195
173
|
/**
|
|
196
174
|
* Used to get a discovered version of the default authority.
|
|
197
175
|
* @param requestAuthority
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StandardInteractionClient.mjs","sources":["../../src/interaction_client/StandardInteractionClient.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StandardInteractionClient.mjs","sources":["../../src/interaction_client/StandardInteractionClient.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;AAKA;AAoBA;AACA;AACA;AAcA;AACI;;;AAGG;;AA6BH;;;AAGG,QAAA,IAAA,CAAA,iBAAA,CAAA,mBAAA,CAAA,iBAAA,CAAA,2DAAA,EAAA,IAAA,CAAA,aAAA,CAAA,CAAA;QACM,MAAC,4BACN,WAAgB,CAAA,iBAAiB,mBACX,CAAA,iBAAA,EAAA,IAAA,CAAA,MAAA,EAAA,IAAA,CAAA,iBAAA,EAAA,IAAA,CAAA,aAAA,CAAA,CAAA,IAAA,CAAA,iBAAA,EAAA,IAAA,CAAA,MAAA,EAAA,IAAA,CAAA,aAAA,CAAA,CAAA;AA+F1B,QAAA,MAAA,eAAA,GAAA;;;;AAIG,YAAA,YAAA,EAAA,mBAAA,CAAA,QAAA;SACM,CAAA;AAqBT,QAAA,OAAA,CAAA,aAAA,GAAA,mBAAA,CAAA,SAAA,CAAA;;;;AAIG;AACa;AAuBhB;;;;;AAKG,YAAA,aAAA,EAAA,IAAA,CAAA,aAAA,IAAA,aAAA,EAAA;AACa,YAAA,GAAA,aAAA;AAqDhB,SAAA,CAAA;;;;AAIG;AACa,QAAA,IAAA,aAAA,EAAA;AA6ChB;;;;AAIG,oBAAA,IAAA,UAAA,EAAA;AACa,wBAAA,IAAA,CAAA,MAAA,CAAA,OAAA,CAA8B,gFAEV,CAAA,CAAA;AA0DvC,wBAAA,kBAAA,CAAA,UAAA,GAAA,UAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { AuthorizationCodePayload, CommonAuthorizationCodeRequest, AuthorizationCodeClient,
|
|
1
|
+
import { AuthorizationCodePayload, CommonAuthorizationCodeRequest, AuthorizationCodeClient, CcsCredential, Logger, IPerformanceClient, ServerAuthorizationCodeResponse } from "@azure/msal-common";
|
|
2
2
|
import { BrowserCacheManager } from "../cache/BrowserCacheManager";
|
|
3
3
|
import { AuthenticationResult } from "../response/AuthenticationResult";
|
|
4
|
-
|
|
4
|
+
import { AuthorizationUrlRequest } from "../request/AuthorizationUrlRequest";
|
|
5
5
|
/**
|
|
6
6
|
* Abstract class which defines operations for a browser interaction handling class.
|
|
7
7
|
*/
|
|
@@ -16,7 +16,7 @@ export declare class InteractionHandler {
|
|
|
16
16
|
* Function to handle response parameters from hash.
|
|
17
17
|
* @param locationHash
|
|
18
18
|
*/
|
|
19
|
-
|
|
19
|
+
handleCodeResponse(response: ServerAuthorizationCodeResponse, request: AuthorizationUrlRequest): Promise<AuthenticationResult>;
|
|
20
20
|
/**
|
|
21
21
|
* Process auth code response from AAD
|
|
22
22
|
* @param authCodeResponse
|
|
@@ -25,17 +25,10 @@ export declare class InteractionHandler {
|
|
|
25
25
|
* @param networkModule
|
|
26
26
|
* @returns
|
|
27
27
|
*/
|
|
28
|
-
handleCodeResponseFromServer(authCodeResponse: AuthorizationCodePayload,
|
|
28
|
+
handleCodeResponseFromServer(authCodeResponse: AuthorizationCodePayload, request: AuthorizationUrlRequest, validateNonce?: boolean): Promise<AuthenticationResult>;
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
31
|
-
* @param cloudInstanceHostname
|
|
32
|
-
* @param authority
|
|
33
|
-
* @param networkModule
|
|
34
|
-
*/
|
|
35
|
-
protected updateTokenEndpointAuthority(cloudInstanceHostname: string, authority: Authority, networkModule: INetworkModule): Promise<void>;
|
|
36
|
-
/**
|
|
37
|
-
* Looks up ccs creds in the cache
|
|
30
|
+
* Build ccs creds if available
|
|
38
31
|
*/
|
|
39
|
-
protected
|
|
32
|
+
protected createCcsCredentials(request: AuthorizationUrlRequest): CcsCredential | null;
|
|
40
33
|
}
|
|
41
34
|
//# sourceMappingURL=InteractionHandler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InteractionHandler.d.ts","sourceRoot":"","sources":["../../src/interaction_handler/InteractionHandler.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,wBAAwB,EACxB,8BAA8B,EAC9B,uBAAuB,
|
|
1
|
+
{"version":3,"file":"InteractionHandler.d.ts","sourceRoot":"","sources":["../../src/interaction_handler/InteractionHandler.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,wBAAwB,EACxB,8BAA8B,EAC9B,uBAAuB,EACvB,aAAa,EACb,MAAM,EAEN,kBAAkB,EAIlB,+BAA+B,EAClC,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAKnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAE7E;;GAEG;AACH,qBAAa,kBAAkB;IAC3B,SAAS,CAAC,UAAU,EAAE,uBAAuB,CAAC;IAC9C,SAAS,CAAC,cAAc,EAAE,mBAAmB,CAAC;IAC9C,SAAS,CAAC,eAAe,EAAE,8BAA8B,CAAC;IAC1D,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,iBAAiB,EAAE,kBAAkB,CAAC;gBAG5C,cAAc,EAAE,uBAAuB,EACvC,WAAW,EAAE,mBAAmB,EAChC,eAAe,EAAE,8BAA8B,EAC/C,MAAM,EAAE,MAAM,EACd,iBAAiB,EAAE,kBAAkB;IASzC;;;OAGG;IACG,kBAAkB,CACpB,QAAQ,EAAE,+BAA+B,EACzC,OAAO,EAAE,uBAAuB,GACjC,OAAO,CAAC,oBAAoB,CAAC;IAmChC;;;;;;;OAOG;IACG,4BAA4B,CAC9B,gBAAgB,EAAE,wBAAwB,EAC1C,OAAO,EAAE,uBAAuB,EAChC,aAAa,GAAE,OAAc,GAC9B,OAAO,CAAC,oBAAoB,CAAC;IAoDhC;;OAEG;IACH,SAAS,CAAC,oBAAoB,CAC1B,OAAO,EAAE,uBAAuB,GACjC,aAAa,GAAG,IAAI;CAe1B"}
|