@azure/msal-browser 3.0.1 → 3.1.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/README.md +5 -5
- package/dist/app/IPublicClientApplication.d.ts +6 -2
- package/dist/app/IPublicClientApplication.d.ts.map +1 -1
- package/dist/app/IPublicClientApplication.mjs +4 -1
- package/dist/app/IPublicClientApplication.mjs.map +1 -1
- package/dist/app/PublicClientApplication.d.ts +11 -3
- package/dist/app/PublicClientApplication.d.ts.map +1 -1
- package/dist/app/PublicClientApplication.mjs +10 -2
- package/dist/app/PublicClientApplication.mjs.map +1 -1
- package/dist/broker/nativeBroker/NativeMessageHandler.d.ts.map +1 -1
- package/dist/broker/nativeBroker/NativeMessageHandler.mjs +5 -4
- package/dist/broker/nativeBroker/NativeMessageHandler.mjs.map +1 -1
- package/dist/cache/AsyncMemoryStorage.mjs +4 -3
- package/dist/cache/AsyncMemoryStorage.mjs.map +1 -1
- package/dist/cache/BrowserCacheManager.d.ts +13 -3
- package/dist/cache/BrowserCacheManager.d.ts.map +1 -1
- package/dist/cache/BrowserCacheManager.mjs +54 -26
- package/dist/cache/BrowserCacheManager.mjs.map +1 -1
- package/dist/cache/BrowserStorage.mjs +1 -1
- package/dist/cache/BrowserStorage.mjs.map +1 -1
- package/dist/cache/CryptoKeyStore.mjs +1 -1
- package/dist/cache/CryptoKeyStore.mjs.map +1 -1
- package/dist/cache/DatabaseStorage.d.ts.map +1 -1
- package/dist/cache/DatabaseStorage.mjs +9 -8
- package/dist/cache/DatabaseStorage.mjs.map +1 -1
- package/dist/cache/MemoryStorage.mjs +1 -1
- package/dist/cache/MemoryStorage.mjs.map +1 -1
- package/dist/cache/TokenCache.d.ts.map +1 -1
- package/dist/cache/TokenCache.mjs +30 -30
- package/dist/cache/TokenCache.mjs.map +1 -1
- package/dist/config/Configuration.d.ts +3 -0
- package/dist/config/Configuration.d.ts.map +1 -1
- package/dist/config/Configuration.mjs +7 -11
- package/dist/config/Configuration.mjs.map +1 -1
- package/dist/controllers/ControllerFactory.mjs +1 -1
- package/dist/controllers/ControllerFactory.mjs.map +1 -1
- package/dist/controllers/IController.d.ts +11 -18
- package/dist/controllers/IController.d.ts.map +1 -1
- package/dist/controllers/StandardController.d.ts +7 -26
- package/dist/controllers/StandardController.d.ts.map +1 -1
- package/dist/controllers/StandardController.mjs +28 -52
- package/dist/controllers/StandardController.mjs.map +1 -1
- package/dist/crypto/BrowserCrypto.d.ts.map +1 -1
- package/dist/crypto/BrowserCrypto.mjs +4 -3
- package/dist/crypto/BrowserCrypto.mjs.map +1 -1
- package/dist/crypto/CryptoOps.d.ts +0 -3
- package/dist/crypto/CryptoOps.d.ts.map +1 -1
- package/dist/crypto/CryptoOps.mjs +14 -17
- package/dist/crypto/CryptoOps.mjs.map +1 -1
- package/dist/crypto/ModernBrowserCrypto.mjs +1 -1
- package/dist/crypto/ModernBrowserCrypto.mjs.map +1 -1
- package/dist/crypto/PkceGenerator.d.ts +0 -1
- package/dist/crypto/PkceGenerator.d.ts.map +1 -1
- package/dist/crypto/PkceGenerator.mjs +8 -8
- package/dist/crypto/PkceGenerator.mjs.map +1 -1
- package/dist/crypto/SignedHttpRequest.mjs +1 -1
- package/dist/crypto/SignedHttpRequest.mjs.map +1 -1
- package/dist/encode/Base64Decode.d.ts +6 -19
- package/dist/encode/Base64Decode.d.ts.map +1 -1
- package/dist/encode/Base64Decode.mjs +17 -70
- package/dist/encode/Base64Decode.mjs.map +1 -1
- package/dist/encode/Base64Encode.d.ts +15 -27
- package/dist/encode/Base64Encode.d.ts.map +1 -1
- package/dist/encode/Base64Encode.mjs +36 -75
- package/dist/encode/Base64Encode.mjs.map +1 -1
- package/dist/error/BrowserAuthError.d.ts +54 -195
- package/dist/error/BrowserAuthError.d.ts.map +1 -1
- package/dist/error/BrowserAuthError.mjs +150 -381
- package/dist/error/BrowserAuthError.mjs.map +1 -1
- package/dist/error/BrowserAuthErrorCodes.d.ts +45 -0
- package/dist/error/BrowserAuthErrorCodes.d.ts.map +1 -0
- package/dist/error/BrowserAuthErrorCodes.mjs +53 -0
- package/dist/error/BrowserAuthErrorCodes.mjs.map +1 -0
- package/dist/error/BrowserConfigurationAuthError.mjs +1 -1
- package/dist/error/BrowserConfigurationAuthError.mjs.map +1 -1
- package/dist/error/NativeAuthError.d.ts.map +1 -1
- package/dist/error/NativeAuthError.mjs +5 -4
- package/dist/error/NativeAuthError.mjs.map +1 -1
- package/dist/event/EventHandler.mjs +1 -1
- package/dist/event/EventHandler.mjs.map +1 -1
- package/dist/event/EventMessage.mjs +1 -1
- package/dist/event/EventMessage.mjs.map +1 -1
- package/dist/event/EventType.mjs +1 -1
- package/dist/event/EventType.mjs.map +1 -1
- package/dist/index.d.ts +9 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +5 -3
- package/dist/index.mjs.map +1 -1
- package/dist/interaction_client/BaseInteractionClient.d.ts +2 -1
- package/dist/interaction_client/BaseInteractionClient.d.ts.map +1 -1
- package/dist/interaction_client/BaseInteractionClient.mjs +1 -1
- package/dist/interaction_client/BaseInteractionClient.mjs.map +1 -1
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs.map +1 -1
- package/dist/interaction_client/NativeInteractionClient.d.ts +4 -10
- package/dist/interaction_client/NativeInteractionClient.d.ts.map +1 -1
- package/dist/interaction_client/NativeInteractionClient.mjs +22 -30
- package/dist/interaction_client/NativeInteractionClient.mjs.map +1 -1
- package/dist/interaction_client/PopupClient.d.ts.map +1 -1
- package/dist/interaction_client/PopupClient.mjs +16 -15
- 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 +7 -6
- 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 +5 -4
- package/dist/interaction_client/SilentAuthCodeClient.mjs.map +1 -1
- package/dist/interaction_client/SilentCacheClient.d.ts +4 -2
- package/dist/interaction_client/SilentCacheClient.d.ts.map +1 -1
- package/dist/interaction_client/SilentCacheClient.mjs +10 -8
- 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 +20 -47
- 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 +4 -3
- package/dist/interaction_client/SilentRefreshClient.mjs.map +1 -1
- package/dist/interaction_client/StandardInteractionClient.d.ts.map +1 -1
- package/dist/interaction_client/StandardInteractionClient.mjs +8 -7
- package/dist/interaction_client/StandardInteractionClient.mjs.map +1 -1
- package/dist/interaction_handler/InteractionHandler.d.ts.map +1 -1
- package/dist/interaction_handler/InteractionHandler.mjs +9 -9
- package/dist/interaction_handler/InteractionHandler.mjs.map +1 -1
- package/dist/interaction_handler/RedirectHandler.d.ts.map +1 -1
- package/dist/interaction_handler/RedirectHandler.mjs +11 -10
- package/dist/interaction_handler/RedirectHandler.mjs.map +1 -1
- package/dist/interaction_handler/SilentHandler.d.ts.map +1 -1
- package/dist/interaction_handler/SilentHandler.mjs +10 -9
- package/dist/interaction_handler/SilentHandler.mjs.map +1 -1
- package/dist/navigation/NavigationClient.mjs +1 -1
- package/dist/navigation/NavigationClient.mjs.map +1 -1
- package/dist/network/FetchClient.d.ts.map +1 -1
- package/dist/network/FetchClient.mjs +9 -8
- package/dist/network/FetchClient.mjs.map +1 -1
- package/dist/operatingcontext/BaseOperatingContext.mjs +1 -1
- package/dist/operatingcontext/BaseOperatingContext.mjs.map +1 -1
- package/dist/operatingcontext/StandardOperatingContext.mjs +1 -1
- package/dist/operatingcontext/StandardOperatingContext.mjs.map +1 -1
- package/dist/operatingcontext/TeamsAppOperatingContext.mjs +1 -1
- package/dist/operatingcontext/TeamsAppOperatingContext.mjs.map +1 -1
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/packageMetadata.mjs +2 -2
- package/dist/packageMetadata.mjs.map +1 -1
- package/dist/request/ClearCacheRequest.d.ts +11 -0
- package/dist/request/ClearCacheRequest.d.ts.map +1 -0
- package/dist/telemetry/BrowserPerformanceClient.d.ts +2 -4
- package/dist/telemetry/BrowserPerformanceClient.d.ts.map +1 -1
- package/dist/telemetry/BrowserPerformanceClient.mjs +2 -6
- package/dist/telemetry/BrowserPerformanceClient.mjs.map +1 -1
- package/dist/telemetry/BrowserPerformanceMeasurement.mjs +1 -1
- package/dist/telemetry/BrowserPerformanceMeasurement.mjs.map +1 -1
- package/dist/utils/BrowserConstants.mjs +1 -1
- package/dist/utils/BrowserConstants.mjs.map +1 -1
- package/dist/utils/BrowserProtocolUtils.d.ts.map +1 -1
- package/dist/utils/BrowserProtocolUtils.mjs +3 -3
- package/dist/utils/BrowserProtocolUtils.mjs.map +1 -1
- package/dist/utils/BrowserStringUtils.mjs +1 -1
- package/dist/utils/BrowserStringUtils.mjs.map +1 -1
- package/dist/utils/BrowserUtils.d.ts +0 -9
- package/dist/utils/BrowserUtils.d.ts.map +1 -1
- package/dist/utils/BrowserUtils.mjs +8 -33
- package/dist/utils/BrowserUtils.mjs.map +1 -1
- package/lib/msal-browser.cjs +6601 -7104
- package/lib/msal-browser.cjs.map +1 -1
- package/lib/msal-browser.js +6601 -7104
- package/lib/msal-browser.js.map +1 -1
- package/lib/msal-browser.min.js +65 -62
- package/package.json +7 -5
- package/src/app/IPublicClientApplication.ts +199 -0
- package/src/app/PublicClientApplication.ts +405 -0
- package/src/broker/nativeBroker/NativeMessageHandler.ts +419 -0
- package/src/broker/nativeBroker/NativeRequest.ts +52 -0
- package/src/broker/nativeBroker/NativeResponse.ts +56 -0
- package/src/cache/AsyncMemoryStorage.ts +158 -0
- package/src/cache/BrowserCacheManager.ts +1994 -0
- package/src/cache/BrowserStorage.ts +54 -0
- package/src/cache/CryptoKeyStore.ts +63 -0
- package/src/cache/DatabaseStorage.ts +287 -0
- package/src/cache/IAsyncMemoryStorage.ts +36 -0
- package/src/cache/ITokenCache.ts +21 -0
- package/src/cache/IWindowStorage.ts +36 -0
- package/src/cache/MemoryStorage.ts +42 -0
- package/src/cache/TokenCache.ts +484 -0
- package/src/config/Configuration.ts +375 -0
- package/src/controllers/ControllerFactory.ts +55 -0
- package/src/controllers/IController.ts +131 -0
- package/src/controllers/StandardController.ts +2107 -0
- package/src/crypto/BrowserCrypto.ts +135 -0
- package/src/crypto/CryptoOps.ts +247 -0
- package/src/crypto/ISubtleCrypto.ts +30 -0
- package/src/crypto/ModernBrowserCrypto.ts +69 -0
- package/src/crypto/PkceGenerator.ts +76 -0
- package/src/crypto/SignedHttpRequest.ts +76 -0
- package/src/encode/Base64Decode.ts +26 -0
- package/src/encode/Base64Encode.ts +52 -0
- package/src/error/BrowserAuthError.ts +340 -0
- package/src/error/BrowserAuthErrorCodes.ts +56 -0
- package/src/error/BrowserConfigurationAuthError.ts +133 -0
- package/src/error/NativeAuthError.ts +141 -0
- package/src/event/EventHandler.ts +176 -0
- package/src/event/EventMessage.ts +125 -0
- package/src/event/EventType.ts +33 -0
- package/src/index.ts +152 -0
- package/src/interaction_client/BaseInteractionClient.ts +301 -0
- package/src/interaction_client/HybridSpaAuthorizationCodeClient.ts +16 -0
- package/src/interaction_client/NativeInteractionClient.ts +907 -0
- package/src/interaction_client/PopupClient.ts +926 -0
- package/src/interaction_client/RedirectClient.ts +616 -0
- package/src/interaction_client/SilentAuthCodeClient.ts +163 -0
- package/src/interaction_client/SilentCacheClient.ts +133 -0
- package/src/interaction_client/SilentIframeClient.ts +301 -0
- package/src/interaction_client/SilentRefreshClient.ts +120 -0
- package/src/interaction_client/StandardInteractionClient.ts +481 -0
- package/src/interaction_handler/InteractionHandler.ts +246 -0
- package/src/interaction_handler/RedirectHandler.ts +225 -0
- package/src/interaction_handler/SilentHandler.ts +266 -0
- package/src/navigation/INavigationClient.ts +23 -0
- package/src/navigation/NavigationClient.ts +55 -0
- package/src/navigation/NavigationOptions.ts +18 -0
- package/src/network/FetchClient.ts +130 -0
- package/src/operatingcontext/BaseOperatingContext.ts +82 -0
- package/src/operatingcontext/StandardOperatingContext.ts +49 -0
- package/src/operatingcontext/TeamsAppOperatingContext.ts +48 -0
- package/src/packageMetadata.ts +3 -0
- package/src/request/AuthorizationCodeRequest.ts +19 -0
- package/src/request/AuthorizationUrlRequest.ts +17 -0
- package/src/request/ClearCacheRequest.ts +16 -0
- package/src/request/EndSessionPopupRequest.ts +26 -0
- package/src/request/EndSessionRequest.ts +23 -0
- package/src/request/PopupRequest.ts +51 -0
- package/src/request/PopupWindowAttributes.ts +22 -0
- package/src/request/RedirectRequest.ts +51 -0
- package/src/request/SilentRequest.ts +49 -0
- package/src/request/SsoSilentRequest.ts +44 -0
- package/src/response/AuthenticationResult.ts +13 -0
- package/src/telemetry/BrowserPerformanceClient.ts +226 -0
- package/src/telemetry/BrowserPerformanceMeasurement.ts +144 -0
- package/src/utils/BrowserConstants.ts +241 -0
- package/src/utils/BrowserProtocolUtils.ts +57 -0
- package/src/utils/BrowserStringUtils.ts +143 -0
- package/src/utils/BrowserUtils.ts +156 -0
- package/dist/crypto/GuidGenerator.d.ts +0 -13
- package/dist/crypto/GuidGenerator.d.ts.map +0 -1
- package/dist/crypto/GuidGenerator.mjs +0 -104
- package/dist/crypto/GuidGenerator.mjs.map +0 -1
- package/dist/internals.d.ts +0 -23
- package/dist/internals.d.ts.map +0 -1
- package/dist/internals.mjs +0 -28
- package/dist/internals.mjs.map +0 -1
- package/dist/network/XhrClient.d.ts +0 -41
- package/dist/network/XhrClient.d.ts.map +0 -1
- package/dist/network/XhrClient.mjs +0 -125
- package/dist/network/XhrClient.mjs.map +0 -1
- package/dist/utils/MathUtils.d.ts +0 -12
- package/dist/utils/MathUtils.d.ts.map +0 -1
- package/dist/utils/MathUtils.mjs +0 -26
- package/dist/utils/MathUtils.mjs.map +0 -1
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
/*! @azure/msal-browser v3.0
|
|
1
|
+
/*! @azure/msal-browser v3.1.0 2023-09-05 */
|
|
2
2
|
'use strict';
|
|
3
|
-
import { PerformanceEvents,
|
|
3
|
+
import { PerformanceEvents, PromptValue, invokeAsync, Constants, AuthError, UrlString, ProtocolUtils } from '@azure/msal-common';
|
|
4
4
|
import { StandardInteractionClient } from './StandardInteractionClient.mjs';
|
|
5
|
-
import {
|
|
5
|
+
import { createBrowserAuthError } from '../error/BrowserAuthError.mjs';
|
|
6
6
|
import { InteractionType } from '../utils/BrowserConstants.mjs';
|
|
7
7
|
import { SilentHandler } from '../interaction_handler/SilentHandler.mjs';
|
|
8
8
|
import { NativeMessageHandler } from '../broker/nativeBroker/NativeMessageHandler.mjs';
|
|
9
9
|
import { NativeInteractionClient } from './NativeInteractionClient.mjs';
|
|
10
|
+
import { silentPromptValueError, silentLogoutUnsupported, nativeConnectionNotEstablished } from '../error/BrowserAuthErrorCodes.mjs';
|
|
10
11
|
|
|
11
12
|
/*
|
|
12
13
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -24,26 +25,20 @@ class SilentIframeClient extends StandardInteractionClient {
|
|
|
24
25
|
*/
|
|
25
26
|
async acquireToken(request) {
|
|
26
27
|
this.performanceClient.addQueueMeasurement(PerformanceEvents.SilentIframeClientAcquireToken, request.correlationId);
|
|
27
|
-
this.logger.verbose("acquireTokenByIframe called");
|
|
28
|
-
const acquireTokenMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.SilentIframeClientAcquireToken, request.correlationId);
|
|
29
28
|
// Check that we have some SSO data
|
|
30
|
-
if (
|
|
31
|
-
|
|
32
|
-
(!request.account ||
|
|
29
|
+
if (!request.loginHint &&
|
|
30
|
+
!request.sid &&
|
|
31
|
+
(!request.account || !request.account.username)) {
|
|
33
32
|
this.logger.warning("No user hint provided. The authorization server may need more information to complete this request.");
|
|
34
33
|
}
|
|
35
34
|
// Check that prompt is set to none or no_session, throw error if it is set to anything else.
|
|
36
35
|
if (request.prompt &&
|
|
37
36
|
request.prompt !== PromptValue.NONE &&
|
|
38
37
|
request.prompt !== PromptValue.NO_SESSION) {
|
|
39
|
-
|
|
40
|
-
success: false,
|
|
41
|
-
});
|
|
42
|
-
throw BrowserAuthError.createSilentPromptValueError(request.prompt);
|
|
38
|
+
throw createBrowserAuthError(silentPromptValueError);
|
|
43
39
|
}
|
|
44
40
|
// Create silent request
|
|
45
|
-
this.
|
|
46
|
-
const silentRequest = await this.initializeAuthorizationRequest({
|
|
41
|
+
const silentRequest = await invokeAsync(this.initializeAuthorizationRequest.bind(this), PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, this.logger, this.performanceClient, request.correlationId)({
|
|
47
42
|
...request,
|
|
48
43
|
prompt: request.prompt || PromptValue.NONE,
|
|
49
44
|
}, InteractionType.Silent);
|
|
@@ -51,18 +46,8 @@ class SilentIframeClient extends StandardInteractionClient {
|
|
|
51
46
|
const serverTelemetryManager = this.initializeServerTelemetryManager(this.apiId);
|
|
52
47
|
try {
|
|
53
48
|
// Initialize the client
|
|
54
|
-
this.
|
|
55
|
-
|
|
56
|
-
this.logger.verbose("Auth code client created");
|
|
57
|
-
this.performanceClient.setPreQueueTime(PerformanceEvents.SilentIframeClientTokenHelper, request.correlationId);
|
|
58
|
-
return await this.silentTokenHelper(authClient, silentRequest).then((result) => {
|
|
59
|
-
acquireTokenMeasurement.end({
|
|
60
|
-
success: true,
|
|
61
|
-
fromCache: false,
|
|
62
|
-
requestId: result.requestId,
|
|
63
|
-
});
|
|
64
|
-
return result;
|
|
65
|
-
});
|
|
49
|
+
const authClient = await invokeAsync(this.createAuthCodeClient.bind(this), PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, this.logger, this.performanceClient, request.correlationId)(serverTelemetryManager, silentRequest.authority, silentRequest.azureCloudOptions);
|
|
50
|
+
return await invokeAsync(this.silentTokenHelper.bind(this), PerformanceEvents.SilentIframeClientTokenHelper, this.logger, this.performanceClient, request.correlationId)(authClient, silentRequest);
|
|
66
51
|
}
|
|
67
52
|
catch (e) {
|
|
68
53
|
if (e instanceof AuthError) {
|
|
@@ -70,11 +55,6 @@ class SilentIframeClient extends StandardInteractionClient {
|
|
|
70
55
|
serverTelemetryManager.cacheFailedRequest(e);
|
|
71
56
|
}
|
|
72
57
|
this.browserStorage.cleanRequestByState(silentRequest.state);
|
|
73
|
-
acquireTokenMeasurement.end({
|
|
74
|
-
errorCode: (e instanceof AuthError && e.errorCode) || undefined,
|
|
75
|
-
subErrorCode: (e instanceof AuthError && e.subError) || undefined,
|
|
76
|
-
success: false,
|
|
77
|
-
});
|
|
78
58
|
throw e;
|
|
79
59
|
}
|
|
80
60
|
}
|
|
@@ -83,7 +63,7 @@ class SilentIframeClient extends StandardInteractionClient {
|
|
|
83
63
|
*/
|
|
84
64
|
logout() {
|
|
85
65
|
// Synchronous so we must reject
|
|
86
|
-
return Promise.reject(
|
|
66
|
+
return Promise.reject(createBrowserAuthError(silentLogoutUnsupported));
|
|
87
67
|
}
|
|
88
68
|
/**
|
|
89
69
|
* Helper which acquires an authorization code silently using a hidden iframe from given url
|
|
@@ -94,45 +74,38 @@ class SilentIframeClient extends StandardInteractionClient {
|
|
|
94
74
|
async silentTokenHelper(authClient, silentRequest) {
|
|
95
75
|
this.performanceClient.addQueueMeasurement(PerformanceEvents.SilentIframeClientTokenHelper, silentRequest.correlationId);
|
|
96
76
|
// Create auth code request and generate PKCE params
|
|
97
|
-
this.
|
|
98
|
-
const authCodeRequest = await this.initializeAuthorizationCodeRequest(silentRequest);
|
|
77
|
+
const authCodeRequest = await invokeAsync(this.initializeAuthorizationCodeRequest.bind(this), PerformanceEvents.StandardInteractionClientInitializeAuthorizationCodeRequest, this.logger, this.performanceClient, silentRequest.correlationId)(silentRequest);
|
|
99
78
|
// Create authorize request url
|
|
100
|
-
|
|
101
|
-
const navigateUrl = await authClient.getAuthCodeUrl({
|
|
79
|
+
const navigateUrl = await invokeAsync(authClient.getAuthCodeUrl.bind(authClient), PerformanceEvents.GetAuthCodeUrl, this.logger, this.performanceClient, silentRequest.correlationId)({
|
|
102
80
|
...silentRequest,
|
|
103
81
|
nativeBroker: NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeMessageHandler, silentRequest.authenticationScheme),
|
|
104
82
|
});
|
|
105
83
|
// Create silent handler
|
|
106
84
|
const silentHandler = new SilentHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.config.system, this.performanceClient);
|
|
107
85
|
// Get the frame handle for the silent request
|
|
108
|
-
|
|
109
|
-
const msalFrame = await silentHandler.initiateAuthRequest(navigateUrl);
|
|
86
|
+
const msalFrame = await invokeAsync(silentHandler.initiateAuthRequest.bind(silentHandler), PerformanceEvents.SilentHandlerInitiateAuthRequest, this.logger, this.performanceClient, silentRequest.correlationId)(navigateUrl);
|
|
110
87
|
// Monitor the window for the hash. Return the string value and close the popup when the hash is received. Default timeout is 60 seconds.
|
|
111
|
-
|
|
112
|
-
const hash = await silentHandler.monitorIframeForHash(msalFrame, this.config.system.iframeHashTimeout);
|
|
88
|
+
const hash = await invokeAsync(silentHandler.monitorIframeForHash.bind(silentHandler), PerformanceEvents.SilentHandlerInitiateAuthRequest, this.logger, this.performanceClient, silentRequest.correlationId)(msalFrame, this.config.system.iframeHashTimeout);
|
|
113
89
|
// Deserialize hash fragment response parameters.
|
|
114
90
|
const serverParams = UrlString.getDeserializedHash(hash);
|
|
115
91
|
const state = this.validateAndExtractStateFromHash(serverParams, InteractionType.Silent, authCodeRequest.correlationId);
|
|
116
92
|
if (serverParams.accountId) {
|
|
117
93
|
this.logger.verbose("Account id found in hash, calling WAM for token");
|
|
118
94
|
if (!this.nativeMessageHandler) {
|
|
119
|
-
throw
|
|
95
|
+
throw createBrowserAuthError(nativeConnectionNotEstablished);
|
|
120
96
|
}
|
|
121
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, this.correlationId);
|
|
122
98
|
const { userRequestState } = ProtocolUtils.parseRequestState(this.browserCrypto, state);
|
|
123
|
-
return nativeInteractionClient
|
|
124
|
-
.acquireToken({
|
|
99
|
+
return invokeAsync(nativeInteractionClient.acquireToken.bind(nativeInteractionClient), PerformanceEvents.NativeInteractionClientAcquireToken, this.logger, this.performanceClient, silentRequest.correlationId)({
|
|
125
100
|
...silentRequest,
|
|
126
101
|
state: userRequestState,
|
|
127
102
|
prompt: silentRequest.prompt || PromptValue.NONE,
|
|
128
|
-
})
|
|
129
|
-
.finally(() => {
|
|
103
|
+
}).finally(() => {
|
|
130
104
|
this.browserStorage.cleanRequestByState(state);
|
|
131
105
|
});
|
|
132
106
|
}
|
|
133
107
|
// Handle response from hash string
|
|
134
|
-
|
|
135
|
-
return silentHandler.handleCodeResponseFromHash(hash, state, authClient.authority, this.networkClient);
|
|
108
|
+
return invokeAsync(silentHandler.handleCodeResponseFromHash.bind(silentHandler), PerformanceEvents.HandleCodeResponseFromHash, this.logger, this.performanceClient, silentRequest.correlationId)(hash, state, authClient.authority, this.networkClient);
|
|
136
109
|
}
|
|
137
110
|
}
|
|
138
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;AAeA;AACA;AACA;AAea,MAAA,kBAAA,kCAAoD,CAAA;AAC7D,IAAA,WAAU,CAAA,MAAO,EAAA,WAAM,EAAA,aAAA,EAAA,MAAA,EAAA,YAAA,EAAA,gBAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,iBAAA,EAAA,oBAAA,EAAA,aAAA,EAAA;AACvB,QAAA,KAAS,CAAC,MAAA,EAAA,WAAe,EAAA,aAAmB,EAAC,MAAA,EAAA,YAAA,EAAA,gBAAA,EAAA,iBAAA,EAAA,oBAAA,EAAA,aAAA,CAAA,CAAA;AAGzC,QAAA,IAAA,CAAA,KAAA,GAAA,KAA4B,CAAA;AA2BhC,QAAA,IAAA,CAAA,aAAA,GAAA,iBAAA,CAAA;;;AAGG;;AAuFH;;AAEG,QAAA,IAAA,CAAA,iBAAA,CAAA,mBAAA,CAAA,iBAAA,CAAA,8BAAA,EAAA,OAAA,CAAA,aAAA,CAAA,CAAA;AACH;AASA,QAAA,IAAA,CAAA,OAAA,CAAA,SAAA;;;;;AAKG;AACa,QAAA,IAAA,OAAA,CAAA,MAAA;AA2HnB,YAAA,OAAA,CAAA,MAAA,KAAA,WAAA,CAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -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,EAEpB,MAAM,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,EAEpB,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;IAyDhC;;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;CAajC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
/*! @azure/msal-browser v3.0
|
|
1
|
+
/*! @azure/msal-browser v3.1.0 2023-09-05 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { StandardInteractionClient } from './StandardInteractionClient.mjs';
|
|
4
4
|
import { PerformanceEvents, RefreshTokenClient } from '@azure/msal-common';
|
|
5
5
|
import { ApiId } from '../utils/BrowserConstants.mjs';
|
|
6
|
-
import {
|
|
6
|
+
import { createBrowserAuthError } from '../error/BrowserAuthError.mjs';
|
|
7
|
+
import { silentLogoutUnsupported } from '../error/BrowserAuthErrorCodes.mjs';
|
|
7
8
|
|
|
8
9
|
/*
|
|
9
10
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -54,7 +55,7 @@ class SilentRefreshClient extends StandardInteractionClient {
|
|
|
54
55
|
*/
|
|
55
56
|
logout() {
|
|
56
57
|
// Synchronous so we must reject
|
|
57
|
-
return Promise.reject(
|
|
58
|
+
return Promise.reject(createBrowserAuthError(silentLogoutUnsupported));
|
|
58
59
|
}
|
|
59
60
|
/**
|
|
60
61
|
* Creates a Refresh Client with the given authority, or the default authority.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SilentRefreshClient.mjs","sources":["../../src/interaction_client/SilentRefreshClient.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SilentRefreshClient.mjs","sources":["../../src/interaction_client/SilentRefreshClient.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;AAKA;AACA;AAaA;AAEA;AAKsB,MAAA,mBACL,SAAA;AA0Db;;AAEG;AACH;AASA,IAAA,MAAA,YAAA,CAAA,OAAA,EAAA;;;;AAIG,YAAA,GAAA,OAAA;AACa,YAAA,IAAA,MAAA,IAAA,CAAA,qBACU,CAAA,OAAA,EAAA;AAgB7B,SAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -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,EAET,+BAA+B,EAE/B,uBAAuB,
|
|
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,EAET,+BAA+B,EAE/B,uBAAuB,EAIvB,WAAW,EACX,iBAAiB,EAGpB,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;AAU9E,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;AAE/D;;GAEG;AACH,8BAAsB,yBAA0B,SAAQ,qBAAqB;IACzE;;;OAGG;cACa,kCAAkC,CAC9C,OAAO,EAAE,uBAAuB,GACjC,OAAO,CAAC,8BAA8B,CAAC;IAyB1C;;;OAGG;IACH,SAAS,CAAC,uBAAuB,CAC7B,aAAa,CAAC,EAAE,iBAAiB,GAClC,uBAAuB;IAgG1B;;;;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;IAqBnC;;;;;OAKG;cACa,sBAAsB,CAClC,sBAAsB,EAAE,sBAAsB,EAC9C,gBAAgB,CAAC,EAAE,MAAM,EACzB,wBAAwB,CAAC,EAAE,iBAAiB,GAC7C,OAAO,CAAC,mBAAmB,CAAC;IAsD/B;;;OAGG;IACH,SAAS,CAAC,+BAA+B,CACrC,YAAY,EAAE,+BAA+B,EAC7C,eAAe,EAAE,eAAe,EAChC,oBAAoB,CAAC,EAAE,MAAM,GAC9B,MAAM;IA8BT;;;;OAIG;cACa,sBAAsB,CAClC,gBAAgB,CAAC,EAAE,MAAM,EACzB,wBAAwB,CAAC,EAAE,iBAAiB,GAC7C,OAAO,CAAC,SAAS,CAAC;IAqErB;;;;OAIG;cACa,8BAA8B,CAC1C,OAAO,EAAE,eAAe,GAAG,YAAY,GAAG,gBAAgB,EAC1D,eAAe,EAAE,eAAe,GACjC,OAAO,CAAC,uBAAuB,CAAC;CAyDtC"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
/*! @azure/msal-browser v3.0
|
|
1
|
+
/*! @azure/msal-browser v3.1.0 2023-09-05 */
|
|
2
2
|
'use strict';
|
|
3
|
-
import { PerformanceEvents, Constants, UrlString, AuthorizationCodeClient, Authority, AuthorityFactory, ProtocolUtils
|
|
3
|
+
import { PerformanceEvents, 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 {
|
|
7
|
+
import { createBrowserAuthError } from '../error/BrowserAuthError.mjs';
|
|
8
8
|
import { BrowserProtocolUtils } from '../utils/BrowserProtocolUtils.mjs';
|
|
9
9
|
import { BrowserUtils } from '../utils/BrowserUtils.mjs';
|
|
10
|
+
import { noStateInHash, unableToParseState, stateInteractionTypeMismatch } from '../error/BrowserAuthErrorCodes.mjs';
|
|
10
11
|
|
|
11
12
|
/*
|
|
12
13
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -181,14 +182,14 @@ class StandardInteractionClient extends BaseInteractionClient {
|
|
|
181
182
|
validateAndExtractStateFromHash(serverParams, interactionType, requestCorrelationId) {
|
|
182
183
|
this.logger.verbose("validateAndExtractStateFromHash called", requestCorrelationId);
|
|
183
184
|
if (!serverParams.state) {
|
|
184
|
-
throw
|
|
185
|
+
throw createBrowserAuthError(noStateInHash);
|
|
185
186
|
}
|
|
186
187
|
const platformStateObj = BrowserProtocolUtils.extractBrowserRequestState(this.browserCrypto, serverParams.state);
|
|
187
188
|
if (!platformStateObj) {
|
|
188
|
-
throw
|
|
189
|
+
throw createBrowserAuthError(unableToParseState);
|
|
189
190
|
}
|
|
190
191
|
if (platformStateObj.interactionType !== interactionType) {
|
|
191
|
-
throw
|
|
192
|
+
throw createBrowserAuthError(stateInteractionTypeMismatch);
|
|
192
193
|
}
|
|
193
194
|
this.logger.verbose("Returning state from hash", requestCorrelationId);
|
|
194
195
|
return serverParams.state;
|
|
@@ -263,7 +264,7 @@ class StandardInteractionClient extends BaseInteractionClient {
|
|
|
263
264
|
validatedRequest.account = account;
|
|
264
265
|
}
|
|
265
266
|
// Check for ADAL/MSAL v1 SSO
|
|
266
|
-
if (
|
|
267
|
+
if (!validatedRequest.loginHint && !account) {
|
|
267
268
|
const legacyLoginHint = this.browserStorage.getLegacyLoginHint();
|
|
268
269
|
if (legacyLoginHint) {
|
|
269
270
|
validatedRequest.loginHint = legacyLoginHint;
|
|
@@ -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;AAmBA;AACI;;;AAGG;;AA4BH;;;AAGG,QAAA,IAAA,CAAA,iBAAA,CAAA,mBAAA,CAAA,iBAAA,CAAA,2DAAA,EAAA,OAAA,CAAA,aAAA,CAAA,CAAA;QACM,IAAA,CAAA,sDACW,EAAA,OACM,CAAA,aAAA,CAAA,CAAA;AAgG1B,QAAA,MAAA,mBAAA,GAAA,MAAA,IAAA,CAAA,aAAA,CAAA,iBAAA,EAAA,CAAA;;;;AAIG,YAAA,IAAA,EAAA,SAAA,CAAA,YAAA;YACM,iCACL,CAAA,QAAS;AAoBb,SAAA,CAAA;;;;AAIG,KAAA;AACa;AAyBhB;;;;;AAKG,QAAA,MAAA,kBAAA,GAAA;AACa,YAAA,aAAA,EAAA,IAAA,CAAA,aACU,IAAA,IAAA,CAAA,6BAAwB;AAyDlD,YAAA,GAAA,aAAA;;;AAGG;AACH;AAkCA;;;;AAIG,gBAAA,IAAA,aAAA,CAAA,OAAA,EAAA;AACa,oBAAA,MAAA,UAAsB,GAClC,IAAA,CAAA,8BACA,CAAA,aAAwB,CAAC,OAAmB,CAAA,CAAA;AAsEhD,oBAAA,IAAA,UAAA,EAAA;;;;AAIG,iBAAA;AACa,qBAAA;AA4DnB,oBAAA,IAAA,CAAA,MAAA,CAAA,OAAA,CAAA,mGAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InteractionHandler.d.ts","sourceRoot":"","sources":["../../src/interaction_handler/InteractionHandler.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,wBAAwB,
|
|
1
|
+
{"version":3,"file":"InteractionHandler.d.ts","sourceRoot":"","sources":["../../src/interaction_handler/InteractionHandler.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,wBAAwB,EACxB,8BAA8B,EAC9B,uBAAuB,EAEvB,SAAS,EACT,cAAc,EAEd,aAAa,EACb,MAAM,EAEN,kBAAkB,EAGrB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAMnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAExE,MAAM,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAEnC;;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,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,SAAS,EACpB,aAAa,EAAE,cAAc,GAC9B,OAAO,CAAC,oBAAoB,CAAC;IAkDhC;;;;;;;OAOG;IACG,4BAA4B,CAC9B,gBAAgB,EAAE,wBAAwB,EAC1C,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,SAAS,EACpB,aAAa,EAAE,cAAc,EAC7B,aAAa,GAAE,OAAc,GAC9B,OAAO,CAAC,oBAAoB,CAAC;IAiEhC;;;;;OAKG;cACa,4BAA4B,CACxC,qBAAqB,EAAE,MAAM,EAC7B,SAAS,EAAE,SAAS,EACpB,aAAa,EAAE,cAAc,GAC9B,OAAO,CAAC,IAAI,CAAC;IAmBhB;;OAEG;IACH,SAAS,CAAC,mBAAmB,IAAI,aAAa,GAAG,IAAI;CAoBxD"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
/*! @azure/msal-browser v3.0
|
|
1
|
+
/*! @azure/msal-browser v3.1.0 2023-09-05 */
|
|
2
2
|
'use strict';
|
|
3
|
-
import { PerformanceEvents,
|
|
4
|
-
import {
|
|
3
|
+
import { PerformanceEvents, ClientAuthError, ServerError, invokeAsync, AuthorityFactory } from '@azure/msal-common';
|
|
4
|
+
import { createBrowserAuthError } from '../error/BrowserAuthError.mjs';
|
|
5
5
|
import { TemporaryCacheKeys } from '../utils/BrowserConstants.mjs';
|
|
6
|
+
import { hashEmptyError, userCancelled } from '../error/BrowserAuthErrorCodes.mjs';
|
|
6
7
|
|
|
7
8
|
/*
|
|
8
9
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -27,8 +28,8 @@ class InteractionHandler {
|
|
|
27
28
|
this.performanceClient.addQueueMeasurement(PerformanceEvents.HandleCodeResponseFromHash, this.authCodeRequest.correlationId);
|
|
28
29
|
this.logger.verbose("InteractionHandler.handleCodeResponse called");
|
|
29
30
|
// Check that location hash isn't empty.
|
|
30
|
-
if (
|
|
31
|
-
throw
|
|
31
|
+
if (!locationHash) {
|
|
32
|
+
throw createBrowserAuthError(hashEmptyError);
|
|
32
33
|
}
|
|
33
34
|
// Handle code response.
|
|
34
35
|
const stateKey = this.browserStorage.generateStateKey(state);
|
|
@@ -42,9 +43,9 @@ class InteractionHandler {
|
|
|
42
43
|
}
|
|
43
44
|
catch (e) {
|
|
44
45
|
if (e instanceof ServerError &&
|
|
45
|
-
e.subError ===
|
|
46
|
+
e.subError === userCancelled) {
|
|
46
47
|
// Translate server error caused by user closing native prompt to corresponding first class MSAL error
|
|
47
|
-
throw
|
|
48
|
+
throw createBrowserAuthError(userCancelled);
|
|
48
49
|
}
|
|
49
50
|
else {
|
|
50
51
|
throw e;
|
|
@@ -96,8 +97,7 @@ class InteractionHandler {
|
|
|
96
97
|
}
|
|
97
98
|
}
|
|
98
99
|
// Acquire token with retrieved code.
|
|
99
|
-
this.
|
|
100
|
-
const tokenResponse = (await this.authModule.acquireToken(this.authCodeRequest, authCodeResponse));
|
|
100
|
+
const tokenResponse = (await invokeAsync(this.authModule.acquireToken.bind(this.authModule), PerformanceEvents.AuthClientAcquireToken, this.logger, this.performanceClient, this.authCodeRequest.correlationId)(this.authCodeRequest, authCodeResponse));
|
|
101
101
|
this.browserStorage.cleanRequestByState(state);
|
|
102
102
|
return tokenResponse;
|
|
103
103
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InteractionHandler.mjs","sources":["../../src/interaction_handler/InteractionHandler.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"InteractionHandler.mjs","sources":["../../src/interaction_handler/InteractionHandler.ts"],"sourcesContent":[null],"names":["BrowserAuthErrorCodes.hashEmptyError"],"mappings":";;;;;;;AAKA;AAgBA;AAMA;AAEA;AAKA;AACI;AACA;AACA,MAAS,kBAAkB,CAAA;AAC3B,IAAA,WAAU,CAAA,cAAe,EAAA,WAAA,EAAA,eAAA,EAAA,MAAA,EAAA,iBAAA,EAAA;AACzB,QAAA,IAAA,CAAS,UAAC,GAAA,cAAmB,CAAA;AAGzB,QAAA,IAAA,CAAA,cAAA,GAAc,WAAyB,CAAA;AAa3C,QAAA,IAAA,CAAA,eAAA,GAAA,eAAA,CAAA;;;AAGG,KAAA;;AAwDH;;;;;;;AAOG,QAAA,IAAA,CAAA,YAAA,EAAA;YAC+B,MAAA,sBACd,CAAAA,cAChB;AAqEJ,SAAA;;;;;AAKG,YAAA,MAAA,eAAA,CAAA,wBAAA,CAAA,cAAA,CAAA,CAAA;AACa,SAAA;AAuBhB,QAAA,IAAA,gBAAA,CAAA;;AAEG,YAAA,gBAAA,GAAA,IAAA,CAAA,UAAA,CAAA,sBAAA,CAAA,YAAA,EAAA,YAAA,CAAA,CAAA;AACH,SAAA;AAoBH,QAAA,OAAA,CAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RedirectHandler.d.ts","sourceRoot":"","sources":["../../src/interaction_handler/RedirectHandler.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,uBAAuB,
|
|
1
|
+
{"version":3,"file":"RedirectHandler.d.ts","sourceRoot":"","sources":["../../src/interaction_handler/RedirectHandler.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,uBAAuB,EACvB,8BAA8B,EAC9B,OAAO,EACP,SAAS,EACT,cAAc,EAEd,MAAM,EAEN,kBAAkB,EACrB,MAAM,oBAAoB,CAAC;AAM5B,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAEpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAExE,MAAM,MAAM,cAAc,GAAG,iBAAiB,GAAG;IAC7C,gBAAgB,EAAE,iBAAiB,CAAC;IACpC,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,kBAAkB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC;CACxD,CAAC;AAEF,qBAAa,eAAgB,SAAQ,kBAAkB;IACnD,OAAO,CAAC,aAAa,CAAU;gBAG3B,cAAc,EAAE,uBAAuB,EACvC,WAAW,EAAE,mBAAmB,EAChC,eAAe,EAAE,8BAA8B,EAC/C,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,OAAO,EACtB,iBAAiB,EAAE,kBAAkB;IAYzC;;;OAGG;IACG,mBAAmB,CACrB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,cAAc,GACvB,OAAO,CAAC,IAAI,CAAC;IA6EhB;;;OAGG;IACG,0BAA0B,CAC5B,YAAY,EAAE,MAAM,EACpB,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,SAAS,EACpB,aAAa,EAAE,cAAc,GAC9B,OAAO,CAAC,oBAAoB,CAAC;CA4EnC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
/*! @azure/msal-browser v3.0
|
|
1
|
+
/*! @azure/msal-browser v3.1.0 2023-09-05 */
|
|
2
2
|
'use strict';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { ClientAuthError, ServerError } from '@azure/msal-common';
|
|
4
|
+
import { createBrowserAuthError } from '../error/BrowserAuthError.mjs';
|
|
5
5
|
import { TemporaryCacheKeys, ApiId } from '../utils/BrowserConstants.mjs';
|
|
6
6
|
import { InteractionHandler } from './InteractionHandler.mjs';
|
|
7
|
+
import { emptyNavigateUri, hashEmptyError, userCancelled } from '../error/BrowserAuthErrorCodes.mjs';
|
|
7
8
|
|
|
8
9
|
/*
|
|
9
10
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -21,7 +22,7 @@ class RedirectHandler extends InteractionHandler {
|
|
|
21
22
|
async initiateAuthRequest(requestUrl, params) {
|
|
22
23
|
this.logger.verbose("RedirectHandler.initiateAuthRequest called");
|
|
23
24
|
// Navigate if valid URL
|
|
24
|
-
if (
|
|
25
|
+
if (requestUrl) {
|
|
25
26
|
// Cache start page, returns to this page after redirectUri if navigateToLoginRequestUrl is true
|
|
26
27
|
if (params.redirectStartPage) {
|
|
27
28
|
this.logger.verbose("RedirectHandler.initiateAuthRequest: redirectStartPage set, caching start page");
|
|
@@ -29,7 +30,7 @@ class RedirectHandler extends InteractionHandler {
|
|
|
29
30
|
}
|
|
30
31
|
// Set interaction status in the library.
|
|
31
32
|
this.browserStorage.setTemporaryCache(TemporaryCacheKeys.CORRELATION_ID, this.authCodeRequest.correlationId, true);
|
|
32
|
-
this.browserStorage.cacheCodeRequest(this.authCodeRequest
|
|
33
|
+
this.browserStorage.cacheCodeRequest(this.authCodeRequest);
|
|
33
34
|
this.logger.infoPii(`RedirectHandler.initiateAuthRequest: Navigate to: ${requestUrl}`);
|
|
34
35
|
const navigationOptions = {
|
|
35
36
|
apiId: ApiId.acquireTokenRedirect,
|
|
@@ -61,7 +62,7 @@ class RedirectHandler extends InteractionHandler {
|
|
|
61
62
|
else {
|
|
62
63
|
// Throw error if request URL is empty.
|
|
63
64
|
this.logger.info("RedirectHandler.initiateAuthRequest: Navigate url is empty");
|
|
64
|
-
throw
|
|
65
|
+
throw createBrowserAuthError(emptyNavigateUri);
|
|
65
66
|
}
|
|
66
67
|
}
|
|
67
68
|
/**
|
|
@@ -71,8 +72,8 @@ class RedirectHandler extends InteractionHandler {
|
|
|
71
72
|
async handleCodeResponseFromHash(locationHash, state, authority, networkModule) {
|
|
72
73
|
this.logger.verbose("RedirectHandler.handleCodeResponse called");
|
|
73
74
|
// Check that location hash isn't empty.
|
|
74
|
-
if (
|
|
75
|
-
throw
|
|
75
|
+
if (!locationHash) {
|
|
76
|
+
throw createBrowserAuthError(hashEmptyError);
|
|
76
77
|
}
|
|
77
78
|
// Interaction is completed - remove interaction status.
|
|
78
79
|
this.browserStorage.setInteractionInProgress(false);
|
|
@@ -88,9 +89,9 @@ class RedirectHandler extends InteractionHandler {
|
|
|
88
89
|
}
|
|
89
90
|
catch (e) {
|
|
90
91
|
if (e instanceof ServerError &&
|
|
91
|
-
e.subError ===
|
|
92
|
+
e.subError === userCancelled) {
|
|
92
93
|
// Translate server error caused by user closing native prompt to corresponding first class MSAL error
|
|
93
|
-
throw
|
|
94
|
+
throw createBrowserAuthError(userCancelled);
|
|
94
95
|
}
|
|
95
96
|
else {
|
|
96
97
|
throw e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RedirectHandler.mjs","sources":["../../src/interaction_handler/RedirectHandler.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RedirectHandler.mjs","sources":["../../src/interaction_handler/RedirectHandler.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;AAKA;AAgBA;AACA;AACA;AAOqB,MAAA,wBAAS,kBAAA,CAAA;IAC1B,WAAkB,CAAA,cAAO,aAAa,EAAA,eAAe,EAAA,MAAA,EAAA,aAAA,EAAA,iBAAA,EAAA;QACvD,KAAA,CAAA,cAAA,EAAA,WAAA,EAAA,eAAA,EAAA,MAAA,EAAA,iBAAA,CAAA,CAAA;AAEF,QAAa,IAAA,CAAA,aAAA,GAAA;KACF;;AAoBP;;;AAGG,IAAA,MAAA,mBAAA,CAAA,UAAA,EAAA,MAAA,EAAA;AACG,QAAA,IAAA,CAAA,MAAA,CAAA,OACF,CAAA,4CAED,CAAA,CAAA;AA6EH;;;AAGG,YAAA,IAAA,MAAA,CAAA,iBAAA,EAAA;gBAC6B,IAAA,CAAA,MAAA,CAAA,wFAIb,CAAA,CAAA;AA6EtB,gBAAA,IAAA,CAAA,cAAA,CAAA,iBAAA,CAAA,kBAAA,CAAA,UAAA,EAAA,MAAA,CAAA,iBAAA,EAAA,IAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SilentHandler.d.ts","sourceRoot":"","sources":["../../src/interaction_handler/SilentHandler.ts"],"names":[],"mappings":"AAKA,OAAO,
|
|
1
|
+
{"version":3,"file":"SilentHandler.d.ts","sourceRoot":"","sources":["../../src/interaction_handler/SilentHandler.ts"],"names":[],"mappings":"AAKA,OAAO,EAEH,8BAA8B,EAC9B,uBAAuB,EAEvB,MAAM,EACN,kBAAkB,EAErB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAK1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EACH,oBAAoB,EAEvB,MAAM,yBAAyB,CAAC;AAEjC,qBAAa,aAAc,SAAQ,kBAAkB;IACjD,OAAO,CAAC,iBAAiB,CAAS;IAClC,OAAO,CAAC,wBAAwB,CAAS;gBAGrC,cAAc,EAAE,uBAAuB,EACvC,WAAW,EAAE,mBAAmB,EAChC,eAAe,EAAE,8BAA8B,EAC/C,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,QAAQ,CACnB,IAAI,CACA,oBAAoB,EACpB,mBAAmB,GAAG,0BAA0B,CACnD,CACJ,EACD,iBAAiB,EAAE,kBAAkB;IAazC;;;;OAIG;IACG,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAwBzE;;;;OAIG;IACH,oBAAoB,CAChB,MAAM,EAAE,iBAAiB,EACzB,OAAO,EAAE,MAAM,GAChB,OAAO,CAAC,MAAM,CAAC;IAiGlB;;;;OAIG;IACH,OAAO,CAAC,SAAS;IA2BjB;;;;;;OAMG;IACH,OAAO,CAAC,aAAa;IAQrB;;;;OAIG;IACH,OAAO,CAAC,kBAAkB;IAgB1B;;;;OAIG;IACH,OAAO,CAAC,kBAAkB;CAK7B"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
/*! @azure/msal-browser v3.0
|
|
1
|
+
/*! @azure/msal-browser v3.1.0 2023-09-05 */
|
|
2
2
|
'use strict';
|
|
3
|
-
import { PerformanceEvents,
|
|
3
|
+
import { PerformanceEvents, Constants, UrlString } from '@azure/msal-common';
|
|
4
4
|
import { InteractionHandler } from './InteractionHandler.mjs';
|
|
5
|
-
import {
|
|
5
|
+
import { createBrowserAuthError } from '../error/BrowserAuthError.mjs';
|
|
6
6
|
import { DEFAULT_IFRAME_TIMEOUT_MS } from '../config/Configuration.mjs';
|
|
7
|
+
import { emptyNavigateUri, monitorWindowTimeout, hashDoesNotContainKnownProperties, hashEmptyError } from '../error/BrowserAuthErrorCodes.mjs';
|
|
7
8
|
|
|
8
9
|
/*
|
|
9
10
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -22,10 +23,10 @@ class SilentHandler extends InteractionHandler {
|
|
|
22
23
|
*/
|
|
23
24
|
async initiateAuthRequest(requestUrl) {
|
|
24
25
|
this.performanceClient.addQueueMeasurement(PerformanceEvents.SilentHandlerInitiateAuthRequest, this.authCodeRequest.correlationId);
|
|
25
|
-
if (
|
|
26
|
+
if (!requestUrl) {
|
|
26
27
|
// Throw error if request URL is empty.
|
|
27
28
|
this.logger.info("Navigate url is empty");
|
|
28
|
-
throw
|
|
29
|
+
throw createBrowserAuthError(emptyNavigateUri);
|
|
29
30
|
}
|
|
30
31
|
if (this.navigateFrameWait) {
|
|
31
32
|
this.performanceClient.setPreQueueTime(PerformanceEvents.SilentHandlerLoadFrame, this.authCodeRequest.correlationId);
|
|
@@ -54,7 +55,7 @@ class SilentHandler extends InteractionHandler {
|
|
|
54
55
|
if (window.performance.now() > timeoutMark) {
|
|
55
56
|
this.removeHiddenIframe(iframe);
|
|
56
57
|
clearInterval(intervalId);
|
|
57
|
-
reject(
|
|
58
|
+
reject(createBrowserAuthError(monitorWindowTimeout));
|
|
58
59
|
return;
|
|
59
60
|
}
|
|
60
61
|
let href = Constants.EMPTY_STRING;
|
|
@@ -70,7 +71,7 @@ class SilentHandler extends InteractionHandler {
|
|
|
70
71
|
: Constants.EMPTY_STRING;
|
|
71
72
|
}
|
|
72
73
|
catch (e) { }
|
|
73
|
-
if (
|
|
74
|
+
if (!href || href === "about:blank") {
|
|
74
75
|
return;
|
|
75
76
|
}
|
|
76
77
|
const contentHash = contentWindow
|
|
@@ -90,7 +91,7 @@ class SilentHandler extends InteractionHandler {
|
|
|
90
91
|
this.logger.errorPii(`SilentHandler:monitorIFrameForHash - the url detected in the iframe is: ${href}`);
|
|
91
92
|
this.removeHiddenIframe(iframe);
|
|
92
93
|
clearInterval(intervalId);
|
|
93
|
-
reject(
|
|
94
|
+
reject(createBrowserAuthError(hashDoesNotContainKnownProperties));
|
|
94
95
|
return;
|
|
95
96
|
}
|
|
96
97
|
}
|
|
@@ -100,7 +101,7 @@ class SilentHandler extends InteractionHandler {
|
|
|
100
101
|
this.logger.errorPii(`SilentHandler:monitorIFrameForHash - the url detected in the iframe is: ${href}`);
|
|
101
102
|
this.removeHiddenIframe(iframe);
|
|
102
103
|
clearInterval(intervalId);
|
|
103
|
-
reject(
|
|
104
|
+
reject(createBrowserAuthError(hashEmptyError));
|
|
104
105
|
return;
|
|
105
106
|
}
|
|
106
107
|
}, this.pollIntervalMilliseconds);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SilentHandler.mjs","sources":["../../src/interaction_handler/SilentHandler.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SilentHandler.mjs","sources":["../../src/interaction_handler/SilentHandler.ts"],"sourcesContent":[null],"names":["BrowserAuthErrorCodes.emptyNavigateUri"],"mappings":";;;;;;;;AAKA;AASA;AAKA;AACA;AAiCI,MAAA,aAAA,SAAA,kBAAA,CAAA;;;;AAIG,QAAA,IAAA,CAAA,wBAAA,GAAA,aAAA,CAAA,wBAAA,CAAA;KACsB;AAwBzB;;;;AAIG;AACH,IAAA,MAAA,mBACI,CAAA,UAAQ,EAAA;AAmGZ,QAAA,IAAA,CAAA,iBAAA,CAAA,mBAAA,CAAA,iBAAA,CAAA,gCAAA,EAAA,IAAA,CAAA,eAAA,CAAA,aAAA,CAAA,CAAA;;;;AAIG,YAAA,MAAA,sBAAA,CAAAA,gBAAA,CAAA,CAAA;AACH,SAAA;AA2BA,QAAA,IAAA,IAAA,CAAA,iBAAA,EAAA;;;;;;AAMG;AACH;AAQA;;;;AAIG,QAAA,IAAA,CAAA,iBAAA,CAAA,mBAAA,CAAA,iBAAA,CAAA,iCAAA,EAAA,IAAA,CAAA,eAAA,CAAA,aAAA,CAAA,CAAA;AACH,QAAA,OAA0B,IAAA,OAAA,CAAA,CAAA,OAAA,EAAA,MAAA,KAAA;AAgB1B,YAAA,IAAA,OAAA,GAAA,yBAAA,EAAA;;;;AAIG;AACH;AAKH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationClient.mjs","sources":["../../src/navigation/NavigationClient.ts"],"sourcesContent":[null],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"NavigationClient.mjs","sources":["../../src/navigation/NavigationClient.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAKA;AACA;AAEA;AACI;;;;AAIG;AACH;AAOA;;;;AAIG;AACH;AAOA;;;;AAIG,QAAA,OAAA,gBAAA,CAAA,qBAAA,CAAA,GAAA,EAAA,OAAA,CAAA,CAAA;KACI;AAgBV;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FetchClient.d.ts","sourceRoot":"","sources":["../../src/network/FetchClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAEH,cAAc,EACd,qBAAqB,EACrB,eAAe,EAClB,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"FetchClient.d.ts","sourceRoot":"","sources":["../../src/network/FetchClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAEH,cAAc,EACd,qBAAqB,EACrB,eAAe,EAClB,MAAM,oBAAoB,CAAC;AAO5B;;GAEG;AACH,qBAAa,WAAY,YAAW,cAAc;IAC9C;;;;;OAKG;IACG,mBAAmB,CAAC,CAAC,EACvB,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,qBAAqB,GAChC,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IAgC9B;;;;;OAKG;IACG,oBAAoB,CAAC,CAAC,EACxB,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,qBAAqB,GAChC,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IAmC9B;;;OAGG;IACH,OAAO,CAAC,eAAe;IAYvB,OAAO,CAAC,aAAa;CAOxB"}
|