@azure/msal-browser 3.2.0 → 3.4.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 +274 -0
- package/dist/app/PublicClientNext.d.ts.map +1 -0
- package/dist/app/PublicClientNext.mjs +360 -0
- package/dist/app/PublicClientNext.mjs.map +1 -0
- 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 +2 -13
- package/dist/cache/BrowserCacheManager.d.ts.map +1 -1
- package/dist/cache/BrowserCacheManager.mjs +26 -83
- 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.d.ts +4 -0
- package/dist/config/Configuration.d.ts.map +1 -1
- package/dist/config/Configuration.mjs +2 -1
- package/dist/config/Configuration.mjs.map +1 -1
- package/dist/controllers/ControllerFactory.d.ts +2 -7
- package/dist/controllers/ControllerFactory.d.ts.map +1 -1
- package/dist/controllers/ControllerFactory.mjs +24 -34
- 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.d.ts +96 -0
- package/dist/controllers/NestedAppAuthController.d.ts.map +1 -0
- package/dist/controllers/NestedAppAuthController.mjs +345 -0
- package/dist/controllers/NestedAppAuthController.mjs.map +1 -0
- package/dist/controllers/StandardController.d.ts +4 -4
- package/dist/controllers/StandardController.d.ts.map +1 -1
- package/dist/controllers/StandardController.mjs +43 -42
- package/dist/controllers/StandardController.mjs.map +1 -1
- package/dist/controllers/UnknownOperatingContextController.d.ts +88 -0
- package/dist/controllers/UnknownOperatingContextController.d.ts.map +1 -0
- package/dist/controllers/UnknownOperatingContextController.mjs +275 -0
- package/dist/controllers/UnknownOperatingContextController.mjs.map +1 -0
- package/dist/crypto/BrowserCrypto.d.ts.map +1 -1
- package/dist/crypto/BrowserCrypto.mjs +3 -3
- package/dist/crypto/BrowserCrypto.mjs.map +1 -1
- package/dist/crypto/CryptoOps.d.ts.map +1 -1
- package/dist/crypto/CryptoOps.mjs +8 -5
- 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.d.ts +15 -0
- package/dist/error/NestedAppAuthError.d.ts.map +1 -0
- package/dist/error/NestedAppAuthError.mjs +30 -0
- package/dist/error/NestedAppAuthError.mjs.map +1 -0
- 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 +3 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +4 -2
- package/dist/index.mjs.map +1 -1
- package/dist/interaction_client/BaseInteractionClient.mjs +4 -4
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
- package/dist/interaction_client/NativeInteractionClient.d.ts.map +1 -1
- package/dist/interaction_client/NativeInteractionClient.mjs +18 -7
- package/dist/interaction_client/NativeInteractionClient.mjs.map +1 -1
- package/dist/interaction_client/PopupClient.d.ts +1 -2
- package/dist/interaction_client/PopupClient.d.ts.map +1 -1
- package/dist/interaction_client/PopupClient.mjs +13 -25
- package/dist/interaction_client/PopupClient.mjs.map +1 -1
- package/dist/interaction_client/RedirectClient.d.ts.map +1 -1
- package/dist/interaction_client/RedirectClient.mjs +17 -25
- 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 +6 -8
- package/dist/interaction_client/SilentAuthCodeClient.mjs.map +1 -1
- package/dist/interaction_client/SilentCacheClient.d.ts.map +1 -1
- package/dist/interaction_client/SilentCacheClient.mjs +4 -3
- package/dist/interaction_client/SilentCacheClient.mjs.map +1 -1
- package/dist/interaction_client/SilentIframeClient.d.ts.map +1 -1
- package/dist/interaction_client/SilentIframeClient.mjs +28 -19
- 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.mjs +5 -5
- 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 +29 -56
- 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 +28 -9
- package/dist/interaction_handler/RedirectHandler.mjs.map +1 -1
- package/dist/interaction_handler/SilentHandler.d.ts +13 -47
- package/dist/interaction_handler/SilentHandler.d.ts.map +1 -1
- package/dist/interaction_handler/SilentHandler.mjs +120 -155
- package/dist/interaction_handler/SilentHandler.mjs.map +1 -1
- package/dist/naa/AccountInfo.d.ts +13 -0
- package/dist/naa/AccountInfo.d.ts.map +1 -0
- package/dist/naa/AccountRequests.d.ts +10 -0
- package/dist/naa/AccountRequests.d.ts.map +1 -0
- package/dist/naa/AuthBridge.d.ts +6 -0
- package/dist/naa/AuthBridge.d.ts.map +1 -0
- package/dist/naa/BridgeCapabilities.d.ts +4 -0
- package/dist/naa/BridgeCapabilities.d.ts.map +1 -0
- package/dist/naa/BridgeError.d.ts +10 -0
- package/dist/naa/BridgeError.d.ts.map +1 -0
- package/dist/naa/BridgeError.mjs +12 -0
- package/dist/naa/BridgeError.mjs.map +1 -0
- package/dist/naa/BridgeProxy.d.ts +72 -0
- package/dist/naa/BridgeProxy.d.ts.map +1 -0
- package/dist/naa/BridgeProxy.mjs +154 -0
- package/dist/naa/BridgeProxy.mjs.map +1 -0
- package/dist/naa/BridgeRequest.d.ts +7 -0
- package/dist/naa/BridgeRequest.d.ts.map +1 -0
- package/dist/naa/BridgeRequestEnvelope.d.ts +14 -0
- package/dist/naa/BridgeRequestEnvelope.d.ts.map +1 -0
- package/dist/naa/BridgeResponseEnvelope.d.ts +11 -0
- package/dist/naa/BridgeResponseEnvelope.d.ts.map +1 -0
- package/dist/naa/BridgeStatusCode.d.ts +11 -0
- package/dist/naa/BridgeStatusCode.d.ts.map +1 -0
- package/dist/naa/BridgeStatusCode.mjs +20 -0
- package/dist/naa/BridgeStatusCode.mjs.map +1 -0
- package/dist/naa/IBridgeProxy.d.ts +11 -0
- package/dist/naa/IBridgeProxy.d.ts.map +1 -0
- package/dist/naa/InitializeBridgeResponse.d.ts +7 -0
- package/dist/naa/InitializeBridgeResponse.d.ts.map +1 -0
- package/dist/naa/TokenRequest.d.ts +22 -0
- package/dist/naa/TokenRequest.d.ts.map +1 -0
- package/dist/naa/TokenResponse.d.ts +17 -0
- package/dist/naa/TokenResponse.d.ts.map +1 -0
- package/dist/naa/mapping/NestedAppAuthAdapter.d.ts +26 -0
- package/dist/naa/mapping/NestedAppAuthAdapter.d.ts.map +1 -0
- package/dist/naa/mapping/NestedAppAuthAdapter.mjs +178 -0
- package/dist/naa/mapping/NestedAppAuthAdapter.mjs.map +1 -0
- 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.d.ts +7 -0
- package/dist/operatingcontext/TeamsAppOperatingContext.d.ts.map +1 -1
- package/dist/operatingcontext/TeamsAppOperatingContext.mjs +45 -4
- package/dist/operatingcontext/TeamsAppOperatingContext.mjs.map +1 -1
- package/dist/operatingcontext/UnknownOperatingContext.d.ts +26 -0
- package/dist/operatingcontext/UnknownOperatingContext.d.ts.map +1 -0
- package/dist/operatingcontext/UnknownOperatingContext.mjs +49 -0
- package/dist/operatingcontext/UnknownOperatingContext.mjs.map +1 -0
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/packageMetadata.mjs +2 -2
- 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.mjs +1 -1
- package/dist/utils/BrowserUtils.d.ts +54 -53
- package/dist/utils/BrowserUtils.d.ts.map +1 -1
- package/dist/utils/BrowserUtils.mjs +114 -102
- package/dist/utils/BrowserUtils.mjs.map +1 -1
- package/lib/msal-browser.cjs +13221 -12385
- package/lib/msal-browser.cjs.map +1 -1
- package/lib/msal-browser.js +13221 -12385
- package/lib/msal-browser.js.map +1 -1
- package/lib/msal-browser.min.js +67 -68
- package/package.json +2 -2
- package/src/app/PublicClientApplication.ts +4 -3
- package/src/app/PublicClientNext.ts +444 -0
- package/src/cache/BrowserCacheManager.ts +33 -140
- package/src/cache/TokenCache.ts +5 -4
- package/src/config/Configuration.ts +5 -0
- package/src/controllers/ControllerFactory.ts +35 -43
- package/src/controllers/IController.ts +0 -6
- package/src/controllers/NestedAppAuthController.ts +525 -0
- package/src/controllers/StandardController.ts +50 -52
- package/src/controllers/UnknownOperatingContextController.ts +383 -0
- package/src/crypto/BrowserCrypto.ts +2 -2
- package/src/crypto/CryptoOps.ts +8 -5
- package/src/error/NestedAppAuthError.ts +32 -0
- package/src/index.ts +3 -10
- package/src/interaction_client/BaseInteractionClient.ts +1 -1
- package/src/interaction_client/NativeInteractionClient.ts +23 -6
- package/src/interaction_client/PopupClient.ts +41 -61
- package/src/interaction_client/RedirectClient.ts +42 -47
- package/src/interaction_client/SilentAuthCodeClient.ts +6 -16
- package/src/interaction_client/SilentCacheClient.ts +11 -3
- package/src/interaction_client/SilentIframeClient.ts +54 -34
- package/src/interaction_client/SilentRefreshClient.ts +5 -19
- package/src/interaction_client/StandardInteractionClient.ts +1 -1
- package/src/interaction_handler/InteractionHandler.ts +34 -104
- package/src/interaction_handler/RedirectHandler.ts +48 -22
- package/src/interaction_handler/SilentHandler.ts +177 -233
- package/src/naa/AccountInfo.ts +17 -0
- package/src/naa/AccountRequests.ts +16 -0
- package/src/naa/AuthBridge.ts +16 -0
- package/src/naa/BridgeCapabilities.ts +8 -0
- package/src/naa/BridgeError.ts +18 -0
- package/src/naa/BridgeProxy.ts +230 -0
- package/src/naa/BridgeRequest.ts +12 -0
- package/src/naa/BridgeRequestEnvelope.ts +46 -0
- package/src/naa/BridgeResponseEnvelope.ts +21 -0
- package/src/naa/BridgeStatusCode.ts +15 -0
- package/src/naa/IBridgeProxy.ts +25 -0
- package/src/naa/InitializeBridgeResponse.ts +12 -0
- package/src/naa/TokenRequest.ts +26 -0
- package/src/naa/TokenResponse.ts +61 -0
- package/src/naa/mapping/NestedAppAuthAdapter.ts +252 -0
- package/src/operatingcontext/TeamsAppOperatingContext.ts +43 -3
- package/src/operatingcontext/UnknownOperatingContext.ts +48 -0
- package/src/packageMetadata.ts +1 -1
- package/src/utils/BrowserUtils.ts +133 -125
- package/dist/utils/BrowserStringUtils.d.ts +0 -22
- package/dist/utils/BrowserStringUtils.d.ts.map +0 -1
- package/dist/utils/BrowserStringUtils.mjs +0 -144
- package/dist/utils/BrowserStringUtils.mjs.map +0 -1
- package/src/utils/BrowserStringUtils.ts +0 -143
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/*! @azure/msal-browser v3.
|
|
1
|
+
/*! @azure/msal-browser v3.4.0 2023-10-30 */
|
|
2
2
|
'use strict';
|
|
3
|
-
import {
|
|
3
|
+
import { invokeAsync, PerformanceEvents, AuthError, UrlString, Constants, ProtocolUtils, ThrottlingUtils, ProtocolMode } 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';
|
|
7
|
-
import {
|
|
7
|
+
import { replaceHash, isInIframe, getHomepage, clearHash, getCurrentUri } from '../utils/BrowserUtils.mjs';
|
|
8
8
|
import { EventType } from '../event/EventType.mjs';
|
|
9
9
|
import { createBrowserAuthError } from '../error/BrowserAuthError.mjs';
|
|
10
10
|
import { NativeInteractionClient } from './NativeInteractionClient.mjs';
|
|
@@ -25,9 +25,8 @@ class RedirectClient extends StandardInteractionClient {
|
|
|
25
25
|
* @param request
|
|
26
26
|
*/
|
|
27
27
|
async acquireToken(request) {
|
|
28
|
-
this.
|
|
29
|
-
|
|
30
|
-
this.browserStorage.updateCacheEntries(validRequest.state, validRequest.nonce, validRequest.authority, validRequest.loginHint || Constants.EMPTY_STRING, validRequest.account || null);
|
|
28
|
+
const validRequest = await invokeAsync(this.initializeAuthorizationRequest.bind(this), PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, this.logger, this.performanceClient, this.correlationId)(request, InteractionType.Redirect);
|
|
29
|
+
this.browserStorage.updateCacheEntries(validRequest.state, validRequest.nonce, validRequest.authority, validRequest.loginHint || "", validRequest.account || null);
|
|
31
30
|
const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenRedirect);
|
|
32
31
|
const handleBackButton = (event) => {
|
|
33
32
|
// Clear temporary cache if the back button is clicked during the redirect flow.
|
|
@@ -39,14 +38,11 @@ class RedirectClient extends StandardInteractionClient {
|
|
|
39
38
|
};
|
|
40
39
|
try {
|
|
41
40
|
// Create auth code request and generate PKCE params
|
|
42
|
-
this.
|
|
43
|
-
const authCodeRequest = await this.initializeAuthorizationCodeRequest(validRequest);
|
|
41
|
+
const authCodeRequest = await invokeAsync(this.initializeAuthorizationCodeRequest.bind(this), PerformanceEvents.StandardInteractionClientInitializeAuthorizationCodeRequest, this.logger, this.performanceClient, this.correlationId)(validRequest);
|
|
44
42
|
// Initialize the client
|
|
45
|
-
this.
|
|
46
|
-
const authClient = await this.createAuthCodeClient(serverTelemetryManager, validRequest.authority, validRequest.azureCloudOptions);
|
|
47
|
-
this.logger.verbose("Auth code client created");
|
|
43
|
+
const authClient = await invokeAsync(this.createAuthCodeClient.bind(this), PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, this.logger, this.performanceClient, this.correlationId)(serverTelemetryManager, validRequest.authority, validRequest.azureCloudOptions);
|
|
48
44
|
// Create redirect interaction handler.
|
|
49
|
-
const interactionHandler = new RedirectHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.
|
|
45
|
+
const interactionHandler = new RedirectHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.performanceClient);
|
|
50
46
|
// Create acquire token url.
|
|
51
47
|
const navigateUrl = await authClient.getAuthCodeUrl({
|
|
52
48
|
...validRequest,
|
|
@@ -117,7 +113,7 @@ class RedirectClient extends StandardInteractionClient {
|
|
|
117
113
|
const handleHashResult = await this.handleHash(responseHash, state, serverTelemetryManager);
|
|
118
114
|
if (loginRequestUrl.indexOf("#") > -1) {
|
|
119
115
|
// Replace current hash with non-msal hash, if present
|
|
120
|
-
|
|
116
|
+
replaceHash(loginRequestUrl);
|
|
121
117
|
}
|
|
122
118
|
return handleHashResult;
|
|
123
119
|
}
|
|
@@ -125,7 +121,7 @@ class RedirectClient extends StandardInteractionClient {
|
|
|
125
121
|
this.logger.verbose("NavigateToLoginRequestUrl set to false, handling hash");
|
|
126
122
|
return this.handleHash(responseHash, state, serverTelemetryManager);
|
|
127
123
|
}
|
|
128
|
-
else if (!
|
|
124
|
+
else if (!isInIframe() ||
|
|
129
125
|
this.config.system.allowRedirectInIframe) {
|
|
130
126
|
/*
|
|
131
127
|
* Returned from authority using redirect - need to perform navigation before processing response
|
|
@@ -144,7 +140,7 @@ class RedirectClient extends StandardInteractionClient {
|
|
|
144
140
|
let processHashOnRedirect = true;
|
|
145
141
|
if (!loginRequestUrl || loginRequestUrl === "null") {
|
|
146
142
|
// Redirect to home page if login request url is null (real null or the string null)
|
|
147
|
-
const homepage =
|
|
143
|
+
const homepage = getHomepage();
|
|
148
144
|
// Cache the homepage under ORIGIN_URI to ensure cached hash is processed on homepage
|
|
149
145
|
this.browserStorage.setTemporaryCache(TemporaryCacheKeys.ORIGIN_URI, homepage, true);
|
|
150
146
|
this.logger.warning("Unable to get valid login request url from cache, redirecting to home page");
|
|
@@ -183,7 +179,7 @@ class RedirectClient extends StandardInteractionClient {
|
|
|
183
179
|
// Get current location hash from window or cache.
|
|
184
180
|
const isResponseHash = UrlString.hashContainsKnownProperties(hash);
|
|
185
181
|
if (isResponseHash) {
|
|
186
|
-
|
|
182
|
+
clearHash(window);
|
|
187
183
|
this.logger.verbose("Hash contains known properties, returning response hash");
|
|
188
184
|
return hash;
|
|
189
185
|
}
|
|
@@ -223,12 +219,10 @@ class RedirectClient extends StandardInteractionClient {
|
|
|
223
219
|
if (!currentAuthority) {
|
|
224
220
|
throw createBrowserAuthError(noCachedAuthorityError);
|
|
225
221
|
}
|
|
226
|
-
this.
|
|
227
|
-
const authClient = await this.createAuthCodeClient(serverTelemetryManager, currentAuthority);
|
|
228
|
-
this.logger.verbose("Auth code client created");
|
|
222
|
+
const authClient = await invokeAsync(this.createAuthCodeClient.bind(this), PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, this.logger, this.performanceClient, this.correlationId)(serverTelemetryManager, currentAuthority);
|
|
229
223
|
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.handleCodeResponseFromHash(hash, state
|
|
224
|
+
const interactionHandler = new RedirectHandler(authClient, this.browserStorage, cachedRequest, this.logger, this.performanceClient);
|
|
225
|
+
return await interactionHandler.handleCodeResponseFromHash(hash, state);
|
|
232
226
|
}
|
|
233
227
|
/**
|
|
234
228
|
* Use to log out the current user, and redirect the user to the postLogoutRedirectUri.
|
|
@@ -248,9 +242,7 @@ class RedirectClient extends StandardInteractionClient {
|
|
|
248
242
|
timeout: this.config.system.redirectNavigationTimeout,
|
|
249
243
|
noHistory: false,
|
|
250
244
|
};
|
|
251
|
-
this.
|
|
252
|
-
const authClient = await this.createAuthCodeClient(serverTelemetryManager, logoutRequest && logoutRequest.authority);
|
|
253
|
-
this.logger.verbose("Auth code client created");
|
|
245
|
+
const authClient = await invokeAsync(this.createAuthCodeClient.bind(this), PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, this.logger, this.performanceClient, this.correlationId)(serverTelemetryManager, logoutRequest && logoutRequest.authority);
|
|
254
246
|
if (authClient.authority.protocolMode === ProtocolMode.OIDC) {
|
|
255
247
|
try {
|
|
256
248
|
authClient.authority.endSessionEndpoint;
|
|
@@ -311,7 +303,7 @@ class RedirectClient extends StandardInteractionClient {
|
|
|
311
303
|
*/
|
|
312
304
|
getRedirectStartPage(requestStartPage) {
|
|
313
305
|
const redirectStartPage = requestStartPage || window.location.href;
|
|
314
|
-
return UrlString.getAbsoluteUrl(redirectStartPage,
|
|
306
|
+
return UrlString.getAbsoluteUrl(redirectStartPage, getCurrentUri());
|
|
315
307
|
}
|
|
316
308
|
}
|
|
317
309
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RedirectClient.mjs","sources":["../../src/interaction_client/RedirectClient.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;AAKA;
|
|
1
|
+
{"version":3,"file":"RedirectClient.mjs","sources":["../../src/interaction_client/RedirectClient.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;AAKA;AAiBA;AAQA;AAOA;AAuCI,MAAA,cAAA,SAAA,yBAAA,CAAA;;;AAGG,QAAA,IAAA,CAAA,aAAA,GAAA,iBAAA,CAAA;KACe;AAwGlB;;;;;AAKG,QAAA,MAAA,YAAA,GAAA,MAAA,WAAA,CAAA,IAAA,CAAA,8BAAA,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;QACwB,IAAA,CAAA,cACnB,CAAA,kBACL,CAAA,YAAQ,CAAA,KAAA,EAAA,YAA4B,CAAA,KAAA,EAAA,YAAA,CAAA,SAAA,EAAA,YAAA,CAAA,SAAA,IAAA,EAAA,EAAA,YAAA,CAAA,OAAA,IAAA,IAAA,CAAA,CAAA;AAkKvC,QAAA,MAAA,sBAAA,GAAA,IAAA,CAAA,gCAAA,CAAA,KAAA,CAAA,oBAAA,CAAA,CAAA;;;;AAIG,gBAAA,IAAA,CAAA,MAAA,CAAA,OAAA,CAAA,sEAAA,CAAA,CAAA;uDACoD,CAAA,YAAO,CAAA,KAAA,CAAA,CAAA;AA4B9D,gBAAA,IAAA,CAAA,YAAA,CAAA,SAAA,CAAA,SAAA,CAAA,oBAAA,EAAA,eAAA,CAAA,QAAA,CAAA,CAAA;;;;AAIG;AACa,YAAA,MAAA,eACA,GAAA,iBAEZ,CAAA,IAAA,CAAA,kCAA8C,CAAA,IAAA,CAAA,IAC/C,CAAO,EAAA,6EAAsB,EAAA,IAAA,CAAA,MAAA,EAAA,IAAA,CAAA,iBAAA,EAAA,IAAA,CAAA,aAAA,CAAA,CAAA,YAAA,CAAA,CAAA;AA4EhC;;;;AAIG;gDAC8C,CAAA,cAAa,CAAA;AA0H9D,gBAAA,GAAA,YAAA;;;AAGG,YAAA,MAAA,iBAAA,GAAA,IAAA,CAAA,oBAAA,CAAA,OAAA,CAAA,iBAAA,CAAA,CAAA;YACM,sBAAqB,CAAC,CAAA,qBAAmB,EAAA,iBAAe,CAAA,CAAA,CAAA,CAAA;AAOpE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -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,11 +1,11 @@
|
|
|
1
|
-
/*! @azure/msal-browser v3.
|
|
1
|
+
/*! @azure/msal-browser v3.4.0 2023-10-30 */
|
|
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';
|
|
7
|
-
import { SilentHandler } from '../interaction_handler/SilentHandler.mjs';
|
|
8
7
|
import { HybridSpaAuthorizationCodeClient } from './HybridSpaAuthorizationCodeClient.mjs';
|
|
8
|
+
import { InteractionHandler } from '../interaction_handler/InteractionHandler.mjs';
|
|
9
9
|
import { authCodeRequired, silentLogoutUnsupported } from '../error/BrowserAuthErrorCodes.mjs';
|
|
10
10
|
|
|
11
11
|
/*
|
|
@@ -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)
|
|
@@ -41,21 +40,20 @@ class SilentAuthCodeClient extends StandardInteractionClient {
|
|
|
41
40
|
const authClient = new HybridSpaAuthorizationCodeClient(clientConfig);
|
|
42
41
|
this.logger.verbose("Auth code client created");
|
|
43
42
|
// Create silent handler
|
|
44
|
-
const
|
|
43
|
+
const interactionHandler = new InteractionHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.performanceClient);
|
|
45
44
|
// Handle auth code parameters from request
|
|
46
|
-
return invokeAsync(
|
|
45
|
+
return invokeAsync(interactionHandler.handleCodeResponseFromServer.bind(interactionHandler), PerformanceEvents.HandleCodeResponseFromServer, this.logger, this.performanceClient, request.correlationId)({
|
|
47
46
|
code: request.code,
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SilentCacheClient.d.ts","sourceRoot":"","sources":["../../src/interaction_client/SilentCacheClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EACH,uBAAuB,EACvB,gBAAgB,EAChB,sBAAsB,EACtB,WAAW,EACX,iBAAiB,EAGpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAMzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEjE,qBAAa,iBAAkB,SAAQ,yBAAyB;IAC5D;;;OAGG;IACG,YAAY,CACd,aAAa,EAAE,uBAAuB,GACvC,OAAO,CAAC,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"SilentCacheClient.d.ts","sourceRoot":"","sources":["../../src/interaction_client/SilentCacheClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EACH,uBAAuB,EACvB,gBAAgB,EAChB,sBAAsB,EACtB,WAAW,EACX,iBAAiB,EAGpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAMzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEjE,qBAAa,iBAAkB,SAAQ,yBAAyB;IAC5D;;;OAGG;IACG,YAAY,CACd,aAAa,EAAE,uBAAuB,GACvC,OAAO,CAAC,oBAAoB,CAAC;IA+ChC;;;OAGG;IACH,MAAM,CAAC,aAAa,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAMxD;;;;OAIG;cACa,sBAAsB,CAClC,sBAAsB,EAAE,sBAAsB,EAC9C,YAAY,CAAC,EAAE,MAAM,EACrB,iBAAiB,CAAC,EAAE,iBAAiB,GACtC,OAAO,CAAC,gBAAgB,CAAC;IAYtB,uBAAuB,CACzB,OAAO,EAAE,aAAa,EACtB,OAAO,EAAE,WAAW,GACrB,OAAO,CAAC,uBAAuB,CAAC;CAoBtC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! @azure/msal-browser v3.
|
|
1
|
+
/*! @azure/msal-browser v3.4.0 2023-10-30 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { StandardInteractionClient } from './StandardInteractionClient.mjs';
|
|
4
|
-
import {
|
|
4
|
+
import { PerformanceEvents, invokeAsync, SilentFlowClient } from '@azure/msal-common';
|
|
5
5
|
import { ApiId } from '../utils/BrowserConstants.mjs';
|
|
6
6
|
import { BrowserAuthError } from '../error/BrowserAuthError.mjs';
|
|
7
7
|
import { cryptoKeyNotFound } from '../error/BrowserAuthErrorCodes.mjs';
|
|
@@ -16,12 +16,13 @@ class SilentCacheClient extends StandardInteractionClient {
|
|
|
16
16
|
* @param silentRequest
|
|
17
17
|
*/
|
|
18
18
|
async acquireToken(silentRequest) {
|
|
19
|
+
this.performanceClient.addQueueMeasurement(PerformanceEvents.SilentCacheClientAcquireToken, silentRequest.correlationId);
|
|
19
20
|
// Telemetry manager only used to increment cacheHits here
|
|
20
21
|
const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenSilent_silentFlow);
|
|
21
22
|
const silentAuthClient = await this.createSilentFlowClient(serverTelemetryManager, silentRequest.authority, silentRequest.azureCloudOptions);
|
|
22
23
|
this.logger.verbose("Silent auth client created");
|
|
23
24
|
try {
|
|
24
|
-
const response = await silentAuthClient.acquireCachedToken(silentRequest);
|
|
25
|
+
const response = await invokeAsync(silentAuthClient.acquireCachedToken.bind(silentAuthClient), PerformanceEvents.SilentFlowClientAcquireCachedToken, this.logger, this.performanceClient, silentRequest.correlationId)(silentRequest);
|
|
25
26
|
const authResponse = response[0];
|
|
26
27
|
this.performanceClient.addFields({
|
|
27
28
|
fromCache: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SilentCacheClient.mjs","sources":["../../src/interaction_client/SilentCacheClient.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;AAKA;AACA;AASA;AAMA;;AAOO;;
|
|
1
|
+
{"version":3,"file":"SilentCacheClient.mjs","sources":["../../src/interaction_client/SilentCacheClient.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;AAKA;AACA;AASA;AAMA;;AAOO;;AAkDH;;;AAGG,QAAA,IAAA,CAAA,iBAAA,CAAA,mBAAA,CAAA,iBAAA,CAAA,6BAAA,EAAA,aAAA,CAAA,aAAA,CAAA,CAAA;;AAOH,QAAA,MAAA,sBAAA,GAAA,IAAA,CAAA,gCAAA,CAAA,KAAA,CAAA,6BAAA,CAAA,CAAA;;;;AAIG,YAAA,MAAA,QAAA,GAAA,MAAA,WAAA,CAAA,gBAAA,CAAA,kBAAA,CAAA,IAAA,CAAA,gBAAA,CAAA,EAAA,iBAAA,CAAA,kCAAA,EAAA,IAAA,CAAA,MAAA,EAAA,IAAA,CAAA,iBAAA,EAAA,aAAA,CAAA,aAAA,CAAA,CAAA,aAAA,CAAA,CAAA;AACa,YAAA,MAAA,YAAA,GAAA,QACU,CAAA,CAAA,CAAA,CAAA;AAepB,YAAA,IAAA,CAAA,iBACF,CAAO,SAAE,CAAA;AAsBhB,gBAAA,SAAA,EAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -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,EAKvB,kBAAkB,EAGrB,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;AAIxE,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;CA+InC"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
/*! @azure/msal-browser v3.
|
|
1
|
+
/*! @azure/msal-browser v3.4.0 2023-10-30 */
|
|
2
2
|
'use strict';
|
|
3
|
-
import { PerformanceEvents, PromptValue, invokeAsync,
|
|
3
|
+
import { PerformanceEvents, PromptValue, invokeAsync, AuthError, UrlString, 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';
|
|
7
|
-
import {
|
|
7
|
+
import { initiateAuthRequest, monitorIframeForHash } from '../interaction_handler/SilentHandler.mjs';
|
|
8
8
|
import { NativeMessageHandler } from '../broker/nativeBroker/NativeMessageHandler.mjs';
|
|
9
9
|
import { NativeInteractionClient } from './NativeInteractionClient.mjs';
|
|
10
|
-
import {
|
|
10
|
+
import { InteractionHandler } from '../interaction_handler/InteractionHandler.mjs';
|
|
11
|
+
import { preconnect } from '../utils/BrowserUtils.mjs';
|
|
12
|
+
import { silentPromptValueError, silentLogoutUnsupported, hashEmptyError, hashDoesNotContainKnownProperties, nativeConnectionNotEstablished } from '../error/BrowserAuthErrorCodes.mjs';
|
|
11
13
|
|
|
12
14
|
/*
|
|
13
15
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -42,7 +44,7 @@ class SilentIframeClient extends StandardInteractionClient {
|
|
|
42
44
|
...request,
|
|
43
45
|
prompt: request.prompt || PromptValue.NONE,
|
|
44
46
|
}, InteractionType.Silent);
|
|
45
|
-
|
|
47
|
+
preconnect(silentRequest.authority);
|
|
46
48
|
const serverTelemetryManager = this.initializeServerTelemetryManager(this.apiId);
|
|
47
49
|
try {
|
|
48
50
|
// Initialize the client
|
|
@@ -54,7 +56,6 @@ class SilentIframeClient extends StandardInteractionClient {
|
|
|
54
56
|
e.setCorrelationId(this.correlationId);
|
|
55
57
|
serverTelemetryManager.cacheFailedRequest(e);
|
|
56
58
|
}
|
|
57
|
-
this.browserStorage.cleanRequestByState(silentRequest.state);
|
|
58
59
|
throw e;
|
|
59
60
|
}
|
|
60
61
|
}
|
|
@@ -72,40 +73,48 @@ class SilentIframeClient extends StandardInteractionClient {
|
|
|
72
73
|
* @param userRequestScopes
|
|
73
74
|
*/
|
|
74
75
|
async silentTokenHelper(authClient, silentRequest) {
|
|
75
|
-
|
|
76
|
+
const correlationId = silentRequest.correlationId;
|
|
77
|
+
this.performanceClient.addQueueMeasurement(PerformanceEvents.SilentIframeClientTokenHelper, correlationId);
|
|
76
78
|
// Create auth code request and generate PKCE params
|
|
77
|
-
const authCodeRequest = await invokeAsync(this.initializeAuthorizationCodeRequest.bind(this), PerformanceEvents.StandardInteractionClientInitializeAuthorizationCodeRequest, this.logger, this.performanceClient,
|
|
79
|
+
const authCodeRequest = await invokeAsync(this.initializeAuthorizationCodeRequest.bind(this), PerformanceEvents.StandardInteractionClientInitializeAuthorizationCodeRequest, this.logger, this.performanceClient, correlationId)(silentRequest);
|
|
78
80
|
// Create authorize request url
|
|
79
|
-
const navigateUrl = await invokeAsync(authClient.getAuthCodeUrl.bind(authClient), PerformanceEvents.GetAuthCodeUrl, this.logger, this.performanceClient,
|
|
81
|
+
const navigateUrl = await invokeAsync(authClient.getAuthCodeUrl.bind(authClient), PerformanceEvents.GetAuthCodeUrl, this.logger, this.performanceClient, correlationId)({
|
|
80
82
|
...silentRequest,
|
|
81
83
|
nativeBroker: NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeMessageHandler, silentRequest.authenticationScheme),
|
|
82
84
|
});
|
|
83
85
|
// Create silent handler
|
|
84
|
-
const
|
|
86
|
+
const interactionHandler = new InteractionHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.performanceClient);
|
|
85
87
|
// Get the frame handle for the silent request
|
|
86
|
-
const msalFrame = await invokeAsync(
|
|
88
|
+
const msalFrame = await invokeAsync(initiateAuthRequest, PerformanceEvents.SilentHandlerInitiateAuthRequest, this.logger, this.performanceClient, correlationId)(navigateUrl, this.performanceClient, this.logger, correlationId, this.config.system.navigateFrameWait);
|
|
87
89
|
// Monitor the window for the hash. Return the string value and close the popup when the hash is received. Default timeout is 60 seconds.
|
|
88
|
-
const hash = await invokeAsync(
|
|
90
|
+
const hash = await invokeAsync(monitorIframeForHash, PerformanceEvents.SilentHandlerMonitorIframeForHash, this.logger, this.performanceClient, correlationId)(msalFrame, this.config.system.iframeHashTimeout, this.config.system.pollIntervalMilliseconds, this.performanceClient, this.logger, correlationId);
|
|
91
|
+
if (!hash) {
|
|
92
|
+
// No hash is present
|
|
93
|
+
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.");
|
|
94
|
+
throw createBrowserAuthError(hashEmptyError);
|
|
95
|
+
}
|
|
96
|
+
else if (!UrlString.hashContainsKnownProperties(hash)) {
|
|
97
|
+
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.");
|
|
98
|
+
this.logger.errorPii(`The hash detected in the iframe is: ${hash}`);
|
|
99
|
+
throw createBrowserAuthError(hashDoesNotContainKnownProperties);
|
|
100
|
+
}
|
|
89
101
|
// Deserialize hash fragment response parameters.
|
|
90
102
|
const serverParams = UrlString.getDeserializedHash(hash);
|
|
91
|
-
const state = this.validateAndExtractStateFromHash(serverParams, InteractionType.Silent, authCodeRequest.correlationId);
|
|
92
103
|
if (serverParams.accountId) {
|
|
93
104
|
this.logger.verbose("Account id found in hash, calling WAM for token");
|
|
94
105
|
if (!this.nativeMessageHandler) {
|
|
95
106
|
throw createBrowserAuthError(nativeConnectionNotEstablished);
|
|
96
107
|
}
|
|
97
|
-
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,
|
|
98
|
-
const { userRequestState } = ProtocolUtils.parseRequestState(this.browserCrypto, state);
|
|
99
|
-
return invokeAsync(nativeInteractionClient.acquireToken.bind(nativeInteractionClient), PerformanceEvents.NativeInteractionClientAcquireToken, this.logger, this.performanceClient,
|
|
108
|
+
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);
|
|
109
|
+
const { userRequestState } = ProtocolUtils.parseRequestState(this.browserCrypto, silentRequest.state);
|
|
110
|
+
return invokeAsync(nativeInteractionClient.acquireToken.bind(nativeInteractionClient), PerformanceEvents.NativeInteractionClientAcquireToken, this.logger, this.performanceClient, correlationId)({
|
|
100
111
|
...silentRequest,
|
|
101
112
|
state: userRequestState,
|
|
102
113
|
prompt: silentRequest.prompt || PromptValue.NONE,
|
|
103
|
-
}).finally(() => {
|
|
104
|
-
this.browserStorage.cleanRequestByState(state);
|
|
105
114
|
});
|
|
106
115
|
}
|
|
107
116
|
// Handle response from hash string
|
|
108
|
-
return invokeAsync(
|
|
117
|
+
return invokeAsync(interactionHandler.handleCodeResponseFromHash.bind(interactionHandler), PerformanceEvents.HandleCodeResponseFromHash, this.logger, this.performanceClient, correlationId)(hash, silentRequest);
|
|
109
118
|
}
|
|
110
119
|
}
|
|
111
120
|
|
|
@@ -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;AAcA;AACA;AACA;AAsBI,MAAS,kBAAgB,SAAA,yBAAoB,CAAA;AAGzC,IAAA,WAAA,CAAA,MAAM,EAAE,WAAoB,EAAA,qBACf,EAAA,YAAA,EAAA,gBACA,EAAA,wBACC,EAAA,iBACA,EAAA,oBACE,EAAA;AAsBpB,QAAA,KAAA,CAAA,MAAA,EAAA,WAAA,EAAA,aAAA,EAAA,MAAA,EAAA,YAAA,EAAA,gBAAA,EAAA,iBAAA,EAAA,oBAAA,EAAA,aAAA,CAAA,CAAA;;;AAGG,KAAA;;AAgFH;;AAEG;AACH,IAAA,MAAM,YAAY,CAAA,OAAK,EAAA;AASvB,QAAA,IAAA,CAAA,iBAAA,CAAA,mBAAA,CAAA,iBAAA,CAAA,8BAAA,EAAA,OAAA,CAAA,aAAA,CAAA,CAAA;;;;;AAKG,YAAA,IAAA,CAAA,MAAA,CAAA,OAAA,CAAA,qGAAA,CAAA,CAAA;AACa,SAAA;AAkJnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -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.4.0 2023-10-30 */
|
|
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
|
-
/*! @azure/msal-browser v3.
|
|
1
|
+
/*! @azure/msal-browser v3.4.0 2023-10-30 */
|
|
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';
|
|
@@ -6,7 +6,7 @@ import { BrowserConstants } from '../utils/BrowserConstants.mjs';
|
|
|
6
6
|
import { version } from '../packageMetadata.mjs';
|
|
7
7
|
import { createBrowserAuthError } from '../error/BrowserAuthError.mjs';
|
|
8
8
|
import { BrowserProtocolUtils } from '../utils/BrowserProtocolUtils.mjs';
|
|
9
|
-
import {
|
|
9
|
+
import { getCurrentUri } from '../utils/BrowserUtils.mjs';
|
|
10
10
|
import { generatePkceCodes } from '../crypto/PkceGenerator.mjs';
|
|
11
11
|
import { createNewGuid } from '../crypto/BrowserCrypto.mjs';
|
|
12
12
|
import { noStateInHash, unableToParseState, stateInteractionTypeMismatch } from '../error/BrowserAuthErrorCodes.mjs';
|
|
@@ -79,7 +79,7 @@ class StandardInteractionClient extends BaseInteractionClient {
|
|
|
79
79
|
if (logoutRequest && logoutRequest.postLogoutRedirectUri) {
|
|
80
80
|
this.logger.verbose("Setting postLogoutRedirectUri to uri set on logout request", validLogoutRequest.correlationId);
|
|
81
81
|
validLogoutRequest.postLogoutRedirectUri =
|
|
82
|
-
UrlString.getAbsoluteUrl(logoutRequest.postLogoutRedirectUri,
|
|
82
|
+
UrlString.getAbsoluteUrl(logoutRequest.postLogoutRedirectUri, getCurrentUri());
|
|
83
83
|
}
|
|
84
84
|
else if (this.config.auth.postLogoutRedirectUri === null) {
|
|
85
85
|
this.logger.verbose("postLogoutRedirectUri configured as null and no uri set on request, not passing post logout redirect", validLogoutRequest.correlationId);
|
|
@@ -87,12 +87,12 @@ class StandardInteractionClient extends BaseInteractionClient {
|
|
|
87
87
|
else if (this.config.auth.postLogoutRedirectUri) {
|
|
88
88
|
this.logger.verbose("Setting postLogoutRedirectUri to configured uri", validLogoutRequest.correlationId);
|
|
89
89
|
validLogoutRequest.postLogoutRedirectUri =
|
|
90
|
-
UrlString.getAbsoluteUrl(this.config.auth.postLogoutRedirectUri,
|
|
90
|
+
UrlString.getAbsoluteUrl(this.config.auth.postLogoutRedirectUri, getCurrentUri());
|
|
91
91
|
}
|
|
92
92
|
else {
|
|
93
93
|
this.logger.verbose("Setting postLogoutRedirectUri to current page", validLogoutRequest.correlationId);
|
|
94
94
|
validLogoutRequest.postLogoutRedirectUri =
|
|
95
|
-
UrlString.getAbsoluteUrl(
|
|
95
|
+
UrlString.getAbsoluteUrl(getCurrentUri(), getCurrentUri());
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
else {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { AuthorizationCodePayload, CommonAuthorizationCodeRequest, AuthorizationCodeClient,
|
|
1
|
+
import { AuthorizationCodePayload, CommonAuthorizationCodeRequest, AuthorizationCodeClient, CcsCredential, Logger, IPerformanceClient } 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
|
-
handleCodeResponseFromHash(locationHash: string,
|
|
19
|
+
handleCodeResponseFromHash(locationHash: string, 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,EAIrB,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,0BAA0B,CAC5B,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,uBAAuB,GACjC,OAAO,CAAC,oBAAoB,CAAC;IAuChC;;;;;;;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"}
|