@azure/msal-browser 2.38.4 → 2.39.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/LICENSE +21 -21
- package/dist/_virtual/_tslib.js +1 -1
- package/dist/app/ClientApplication.js +3 -3
- package/dist/app/ClientApplication.js.map +1 -1
- package/dist/app/IPublicClientApplication.d.ts +1 -0
- package/dist/app/IPublicClientApplication.d.ts.map +1 -1
- package/dist/app/IPublicClientApplication.js +5 -2
- package/dist/app/IPublicClientApplication.js.map +1 -1
- package/dist/app/PublicClientApplication.d.ts +8 -0
- package/dist/app/PublicClientApplication.d.ts.map +1 -1
- package/dist/app/PublicClientApplication.js +30 -3
- package/dist/app/PublicClientApplication.js.map +1 -1
- package/dist/broker/nativeBroker/NativeMessageHandler.js +1 -1
- package/dist/broker/nativeBroker/NativeMessageHandler.js.map +1 -1
- package/dist/cache/AsyncMemoryStorage.js +1 -1
- package/dist/cache/AsyncMemoryStorage.js.map +1 -1
- package/dist/cache/BrowserCacheManager.d.ts +11 -1
- package/dist/cache/BrowserCacheManager.d.ts.map +1 -1
- package/dist/cache/BrowserCacheManager.js +31 -3
- package/dist/cache/BrowserCacheManager.js.map +1 -1
- package/dist/cache/BrowserStorage.js +1 -1
- package/dist/cache/BrowserStorage.js.map +1 -1
- package/dist/cache/CryptoKeyStore.js +1 -1
- package/dist/cache/CryptoKeyStore.js.map +1 -1
- package/dist/cache/DatabaseStorage.js +1 -1
- package/dist/cache/DatabaseStorage.js.map +1 -1
- package/dist/cache/MemoryStorage.js +1 -1
- package/dist/cache/MemoryStorage.js.map +1 -1
- package/dist/cache/TokenCache.d.ts +1 -0
- package/dist/cache/TokenCache.d.ts.map +1 -1
- package/dist/cache/TokenCache.js +18 -18
- package/dist/cache/TokenCache.js.map +1 -1
- package/dist/config/Configuration.js +1 -1
- package/dist/config/Configuration.js.map +1 -1
- package/dist/crypto/BrowserCrypto.js +1 -1
- package/dist/crypto/BrowserCrypto.js.map +1 -1
- package/dist/crypto/CryptoOps.js +1 -1
- package/dist/crypto/CryptoOps.js.map +1 -1
- package/dist/crypto/GuidGenerator.js +1 -1
- package/dist/crypto/GuidGenerator.js.map +1 -1
- package/dist/crypto/ModernBrowserCrypto.js +1 -1
- package/dist/crypto/ModernBrowserCrypto.js.map +1 -1
- package/dist/crypto/MsBrowserCrypto.js +1 -1
- package/dist/crypto/MsBrowserCrypto.js.map +1 -1
- package/dist/crypto/MsrBrowserCrypto.js +1 -1
- package/dist/crypto/MsrBrowserCrypto.js.map +1 -1
- package/dist/crypto/PkceGenerator.js +1 -1
- package/dist/crypto/PkceGenerator.js.map +1 -1
- package/dist/crypto/SignedHttpRequest.js +1 -1
- package/dist/crypto/SignedHttpRequest.js.map +1 -1
- package/dist/encode/Base64Decode.js +1 -1
- package/dist/encode/Base64Decode.js.map +1 -1
- package/dist/encode/Base64Encode.js +1 -1
- package/dist/encode/Base64Encode.js.map +1 -1
- package/dist/error/BrowserAuthError.js +1 -1
- package/dist/error/BrowserAuthError.js.map +1 -1
- package/dist/error/BrowserConfigurationAuthError.js +1 -1
- package/dist/error/BrowserConfigurationAuthError.js.map +1 -1
- package/dist/error/NativeAuthError.js +1 -1
- package/dist/error/NativeAuthError.js.map +1 -1
- package/dist/event/EventHandler.js +1 -1
- package/dist/event/EventHandler.js.map +1 -1
- package/dist/event/EventMessage.js +1 -1
- package/dist/event/EventMessage.js.map +1 -1
- package/dist/event/EventType.js +1 -1
- package/dist/event/EventType.js.map +1 -1
- package/dist/index.cjs.js +228 -214
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/interaction_client/BaseInteractionClient.js +2 -2
- package/dist/interaction_client/BaseInteractionClient.js.map +1 -1
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.js +1 -1
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.js.map +1 -1
- package/dist/interaction_client/NativeInteractionClient.d.ts +1 -10
- package/dist/interaction_client/NativeInteractionClient.d.ts.map +1 -1
- package/dist/interaction_client/NativeInteractionClient.js +17 -23
- package/dist/interaction_client/NativeInteractionClient.js.map +1 -1
- package/dist/interaction_client/PopupClient.js +1 -1
- package/dist/interaction_client/PopupClient.js.map +1 -1
- package/dist/interaction_client/RedirectClient.js +1 -1
- package/dist/interaction_client/RedirectClient.js.map +1 -1
- package/dist/interaction_client/SilentAuthCodeClient.js +1 -1
- package/dist/interaction_client/SilentAuthCodeClient.js.map +1 -1
- package/dist/interaction_client/SilentCacheClient.js +1 -1
- package/dist/interaction_client/SilentCacheClient.js.map +1 -1
- package/dist/interaction_client/SilentIframeClient.js +1 -1
- package/dist/interaction_client/SilentIframeClient.js.map +1 -1
- package/dist/interaction_client/SilentRefreshClient.js +1 -1
- package/dist/interaction_client/SilentRefreshClient.js.map +1 -1
- package/dist/interaction_client/StandardInteractionClient.js +2 -2
- package/dist/interaction_client/StandardInteractionClient.js.map +1 -1
- package/dist/interaction_handler/InteractionHandler.js +1 -1
- package/dist/interaction_handler/InteractionHandler.js.map +1 -1
- package/dist/interaction_handler/RedirectHandler.js +1 -1
- package/dist/interaction_handler/RedirectHandler.js.map +1 -1
- package/dist/interaction_handler/SilentHandler.js +1 -1
- package/dist/interaction_handler/SilentHandler.js.map +1 -1
- package/dist/internals.js +1 -1
- package/dist/internals.js.map +1 -1
- package/dist/navigation/NavigationClient.js +1 -1
- package/dist/navigation/NavigationClient.js.map +1 -1
- package/dist/network/FetchClient.js +1 -1
- package/dist/network/FetchClient.js.map +1 -1
- package/dist/network/XhrClient.js +1 -1
- package/dist/network/XhrClient.js.map +1 -1
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/packageMetadata.js +2 -2
- package/dist/packageMetadata.js.map +1 -1
- package/dist/telemetry/BrowserPerformanceClient.js +1 -1
- package/dist/telemetry/BrowserPerformanceClient.js.map +1 -1
- package/dist/telemetry/BrowserPerformanceMeasurement.js +1 -1
- package/dist/telemetry/BrowserPerformanceMeasurement.js.map +1 -1
- package/dist/utils/BrowserConstants.js +1 -1
- package/dist/utils/BrowserConstants.js.map +1 -1
- package/dist/utils/BrowserProtocolUtils.js +1 -1
- package/dist/utils/BrowserProtocolUtils.js.map +1 -1
- package/dist/utils/BrowserStringUtils.js +1 -1
- package/dist/utils/BrowserStringUtils.js.map +1 -1
- package/dist/utils/BrowserUtils.js +1 -1
- package/dist/utils/BrowserUtils.js.map +1 -1
- package/dist/utils/MathUtils.js +1 -1
- package/dist/utils/MathUtils.js.map +1 -1
- package/lib/msal-browser.js +230 -216
- package/lib/msal-browser.js.map +1 -1
- package/lib/msal-browser.min.js +37 -38
- package/package.json +95 -95
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PopupClient.js","sources":["../../src/interaction_client/PopupClient.ts"],"sourcesContent":["/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { AuthenticationResult, CommonAuthorizationCodeRequest, AuthorizationCodeClient, ThrottlingUtils, CommonEndSessionRequest, UrlString, AuthError, OIDC_DEFAULT_SCOPES, Constants, ProtocolUtils, ServerAuthorizationCodeResponse, PerformanceEvents, StringUtils, IPerformanceClient, Logger, ICrypto } from \"@azure/msal-common\";\r\nimport { StandardInteractionClient } from \"./StandardInteractionClient\";\r\nimport { EventType } from \"../event/EventType\";\r\nimport { InteractionType, ApiId, BrowserConstants } from \"../utils/BrowserConstants\";\r\nimport { EndSessionPopupRequest } from \"../request/EndSessionPopupRequest\";\r\nimport { NavigationOptions } from \"../navigation/NavigationOptions\";\r\nimport { BrowserUtils } from \"../utils/BrowserUtils\";\r\nimport { PopupRequest } from \"../request/PopupRequest\";\r\nimport { NativeInteractionClient } from \"./NativeInteractionClient\";\r\nimport { NativeMessageHandler } from \"../broker/nativeBroker/NativeMessageHandler\";\r\nimport { BrowserAuthError } from \"../error/BrowserAuthError\";\r\nimport { INavigationClient } from \"../navigation/INavigationClient\";\r\nimport { EventHandler } from \"../event/EventHandler\";\r\nimport { BrowserCacheManager } from \"../cache/BrowserCacheManager\";\r\nimport { BrowserConfiguration } from \"../config/Configuration\";\r\nimport { InteractionHandler, InteractionParams } from \"../interaction_handler/InteractionHandler\";\r\nimport { PopupWindowAttributes } from \"../request/PopupWindowAttributes\";\r\n\r\nexport type PopupParams = InteractionParams & {\r\n popup?: Window|null;\r\n popupName: string;\r\n popupWindowAttributes: PopupWindowAttributes\r\n};\r\n\r\nexport class PopupClient extends StandardInteractionClient {\r\n private currentWindow: Window | undefined;\r\n protected nativeStorage: BrowserCacheManager;\r\n\r\n constructor(config: BrowserConfiguration, storageImpl: BrowserCacheManager, browserCrypto: ICrypto, logger: Logger, eventHandler: EventHandler, navigationClient: INavigationClient, performanceClient: IPerformanceClient, nativeStorageImpl: BrowserCacheManager, nativeMessageHandler?: NativeMessageHandler, correlationId?: string) {\r\n super(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, nativeMessageHandler, correlationId);\r\n // Properly sets this reference for the unload event.\r\n this.unloadWindow = this.unloadWindow.bind(this);\r\n this.nativeStorage = nativeStorageImpl;\r\n }\r\n\r\n /**\r\n * Acquires tokens by opening a popup window to the /authorize endpoint of the authority\r\n * @param request\r\n */\r\n acquireToken(request: PopupRequest): Promise<AuthenticationResult> {\r\n try {\r\n const popupName = this.generatePopupName(request.scopes || OIDC_DEFAULT_SCOPES, request.authority || this.config.auth.authority);\r\n const popupWindowAttributes = request.popupWindowAttributes || {};\r\n\r\n // asyncPopups flag is true. Acquires token without first opening popup. Popup will be opened later asynchronously.\r\n if (this.config.system.asyncPopups) {\r\n this.logger.verbose(\"asyncPopups set to true, acquiring token\");\r\n // Passes on popup position and dimensions if in request\r\n return this.acquireTokenPopupAsync(request, popupName, popupWindowAttributes);\r\n } else {\r\n // asyncPopups flag is set to false. Opens popup before acquiring token.\r\n this.logger.verbose(\"asyncPopup set to false, opening popup before acquiring token\");\r\n const popup = this.openSizedPopup(\"about:blank\", popupName, popupWindowAttributes);\r\n return this.acquireTokenPopupAsync(request, popupName, popupWindowAttributes, popup);\r\n }\r\n } catch (e) {\r\n return Promise.reject(e);\r\n }\r\n }\r\n\r\n /**\r\n * Clears local cache for the current user then opens a popup window prompting the user to sign-out of the server\r\n * @param logoutRequest\r\n */\r\n logout(logoutRequest?: EndSessionPopupRequest): Promise<void> {\r\n try {\r\n this.logger.verbose(\"logoutPopup called\");\r\n const validLogoutRequest = this.initializeLogoutRequest(logoutRequest);\r\n\r\n const popupName = this.generateLogoutPopupName(validLogoutRequest);\r\n const authority = logoutRequest && logoutRequest.authority;\r\n const mainWindowRedirectUri = logoutRequest && logoutRequest.mainWindowRedirectUri;\r\n const popupWindowAttributes = logoutRequest?.popupWindowAttributes || {};\r\n\r\n // asyncPopups flag is true. Acquires token without first opening popup. Popup will be opened later asynchronously.\r\n if (this.config.system.asyncPopups) {\r\n this.logger.verbose(\"asyncPopups set to true\");\r\n // Passes on popup position and dimensions if in request\r\n return this.logoutPopupAsync(validLogoutRequest, popupName, popupWindowAttributes, authority, undefined, mainWindowRedirectUri);\r\n } else {\r\n // asyncPopups flag is set to false. Opens popup before logging out.\r\n this.logger.verbose(\"asyncPopup set to false, opening popup\");\r\n const popup = this.openSizedPopup(\"about:blank\", popupName, popupWindowAttributes);\r\n return this.logoutPopupAsync(validLogoutRequest, popupName, popupWindowAttributes, authority, popup, mainWindowRedirectUri);\r\n }\r\n } catch (e) {\r\n // Since this function is synchronous we need to reject\r\n return Promise.reject(e);\r\n }\r\n }\r\n\r\n /**\r\n * Helper which obtains an access_token for your API via opening a popup window in the user's browser\r\n * @param validRequest\r\n * @param popupName\r\n * @param popup\r\n * @param popupWindowAttributes\r\n *\r\n * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.\r\n */\r\n protected async acquireTokenPopupAsync(request: PopupRequest, popupName: string, popupWindowAttributes: PopupWindowAttributes, popup?: Window|null): Promise<AuthenticationResult> {\r\n this.logger.verbose(\"acquireTokenPopupAsync called\");\r\n const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenPopup);\r\n\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, request.correlationId);\r\n const validRequest = await this.initializeAuthorizationRequest(request, InteractionType.Popup);\r\n this.browserStorage.updateCacheEntries(validRequest.state, validRequest.nonce, validRequest.authority, validRequest.loginHint || Constants.EMPTY_STRING, validRequest.account || null);\r\n\r\n try {\r\n // Create auth code request and generate PKCE params\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientInitializeAuthorizationCodeRequest, request.correlationId);\r\n const authCodeRequest: CommonAuthorizationCodeRequest = await this.initializeAuthorizationCodeRequest(validRequest);\r\n\r\n // Initialize the client\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, request.correlationId);\r\n const authClient: AuthorizationCodeClient = await this.createAuthCodeClient(serverTelemetryManager, validRequest.authority, validRequest.azureCloudOptions);\r\n this.logger.verbose(\"Auth code client created\");\r\n\r\n const isNativeBroker = NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeMessageHandler, request.authenticationScheme);\r\n // Start measurement for server calls with native brokering enabled\r\n let fetchNativeAccountIdMeasurement;\r\n if (isNativeBroker) {\r\n fetchNativeAccountIdMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.FetchAccountIdWithNativeBroker, request.correlationId);\r\n }\r\n\r\n // Create acquire token url.\r\n const navigateUrl = await authClient.getAuthCodeUrl({\r\n ...validRequest,\r\n nativeBroker: isNativeBroker\r\n });\r\n\r\n // Create popup interaction handler.\r\n const interactionHandler = new InteractionHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.performanceClient);\r\n\r\n // Show the UI once the url has been created. Get the window handle for the popup.\r\n const popupParameters: PopupParams = {\r\n popup,\r\n popupName,\r\n popupWindowAttributes\r\n };\r\n const popupWindow: Window = this.initiateAuthRequest(navigateUrl, popupParameters);\r\n this.eventHandler.emitEvent(EventType.POPUP_OPENED, InteractionType.Popup, {popupWindow}, null);\r\n\r\n // Monitor the window for the hash. Return the string value and close the popup when the hash is received. Default timeout is 60 seconds.\r\n const hash = await this.monitorPopupForHash(popupWindow);\r\n // Deserialize hash fragment response parameters.\r\n const serverParams: ServerAuthorizationCodeResponse = UrlString.getDeserializedHash(hash);\r\n const state = this.validateAndExtractStateFromHash(serverParams, InteractionType.Popup, validRequest.correlationId);\r\n // Remove throttle if it exists\r\n ThrottlingUtils.removeThrottle(this.browserStorage, this.config.auth.clientId, authCodeRequest);\r\n\r\n if (serverParams.accountId) {\r\n this.logger.verbose(\"Account id found in hash, calling WAM for token\");\r\n // end measurement for server call with native brokering enabled\r\n if (fetchNativeAccountIdMeasurement) {\r\n fetchNativeAccountIdMeasurement.endMeasurement({\r\n success: true,\r\n isNativeBroker: true\r\n });\r\n }\r\n\r\n if (!this.nativeMessageHandler) {\r\n throw BrowserAuthError.createNativeConnectionNotEstablishedError();\r\n }\r\n const nativeInteractionClient = new NativeInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.acquireTokenPopup, this.performanceClient, this.nativeMessageHandler, serverParams.accountId, this.nativeStorage, validRequest.correlationId);\r\n const { userRequestState } = ProtocolUtils.parseRequestState(this.browserCrypto, state);\r\n return nativeInteractionClient.acquireToken({\r\n ...validRequest,\r\n state: userRequestState,\r\n prompt: undefined // Server should handle the prompt, ideally native broker can do this part silently\r\n }).finally(() => {\r\n this.browserStorage.cleanRequestByState(state);\r\n });\r\n }\r\n\r\n // Handle response from hash string.\r\n const result = await interactionHandler.handleCodeResponseFromHash(hash, state, authClient.authority, this.networkClient);\r\n\r\n return result;\r\n } catch (e) {\r\n if (popup) {\r\n // Close the synchronous popup if an error is thrown before the window unload event is registered\r\n popup.close();\r\n }\r\n\r\n if (e instanceof AuthError) {\r\n (e as AuthError).setCorrelationId(this.correlationId);\r\n }\r\n\r\n serverTelemetryManager.cacheFailedRequest(e);\r\n this.browserStorage.cleanRequestByState(validRequest.state);\r\n throw e;\r\n }\r\n }\r\n\r\n /**\r\n *\r\n * @param validRequest\r\n * @param popupName\r\n * @param requestAuthority\r\n * @param popup\r\n * @param mainWindowRedirectUri\r\n * @param popupWindowAttributes\r\n */\r\n protected async logoutPopupAsync(validRequest: CommonEndSessionRequest, popupName: string, popupWindowAttributes: PopupWindowAttributes, requestAuthority?: string, popup?: Window|null, mainWindowRedirectUri?: string): Promise<void> {\r\n this.logger.verbose(\"logoutPopupAsync called\");\r\n this.eventHandler.emitEvent(EventType.LOGOUT_START, InteractionType.Popup, validRequest);\r\n\r\n const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.logoutPopup);\r\n\r\n try {\r\n // Clear cache on logout\r\n await this.clearCacheOnLogout(validRequest.account);\r\n\r\n // Initialize the client\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, validRequest.correlationId);\r\n const authClient = await this.createAuthCodeClient(serverTelemetryManager, requestAuthority);\r\n this.logger.verbose(\"Auth code client created\");\r\n\r\n // Create logout string and navigate user window to logout.\r\n const logoutUri: string = authClient.getLogoutUri(validRequest);\r\n\r\n this.eventHandler.emitEvent(EventType.LOGOUT_SUCCESS, InteractionType.Popup, validRequest);\r\n\r\n // Open the popup window to requestUrl.\r\n const popupWindow = this.openPopup(logoutUri, {popupName, popupWindowAttributes, popup});\r\n this.eventHandler.emitEvent(EventType.POPUP_OPENED, InteractionType.Popup, {popupWindow}, null);\r\n\r\n await this.waitForLogoutPopup(popupWindow);\r\n\r\n if (mainWindowRedirectUri) {\r\n const navigationOptions: NavigationOptions = {\r\n apiId: ApiId.logoutPopup,\r\n timeout: this.config.system.redirectNavigationTimeout,\r\n noHistory: false\r\n };\r\n const absoluteUrl = UrlString.getAbsoluteUrl(mainWindowRedirectUri, BrowserUtils.getCurrentUri());\r\n\r\n this.logger.verbose(\"Redirecting main window to url specified in the request\");\r\n this.logger.verbosePii(`Redirecting main window to: ${absoluteUrl}`);\r\n this.navigationClient.navigateInternal(absoluteUrl, navigationOptions);\r\n } else {\r\n this.logger.verbose(\"No main window navigation requested\");\r\n }\r\n } catch (e) {\r\n if (popup) {\r\n // Close the synchronous popup if an error is thrown before the window unload event is registered\r\n popup.close();\r\n }\r\n\r\n if (e instanceof AuthError) {\r\n (e as AuthError).setCorrelationId(this.correlationId);\r\n }\r\n\r\n this.browserStorage.setInteractionInProgress(false);\r\n this.eventHandler.emitEvent(EventType.LOGOUT_FAILURE, InteractionType.Popup, null, e);\r\n this.eventHandler.emitEvent(EventType.LOGOUT_END, InteractionType.Popup);\r\n serverTelemetryManager.cacheFailedRequest(e);\r\n throw e;\r\n }\r\n\r\n this.eventHandler.emitEvent(EventType.LOGOUT_END, InteractionType.Popup);\r\n }\r\n\r\n /**\r\n * Opens a popup window with given request Url.\r\n * @param requestUrl\r\n */\r\n initiateAuthRequest(requestUrl: string, params: PopupParams): Window {\r\n // Check that request url is not empty.\r\n if (!StringUtils.isEmpty(requestUrl)) {\r\n this.logger.infoPii(`Navigate to: ${requestUrl}`);\r\n // Open the popup window to requestUrl.\r\n return this.openPopup(requestUrl, params);\r\n } else {\r\n // Throw error if request URL is empty.\r\n this.logger.error(\"Navigate url is empty\");\r\n throw BrowserAuthError.createEmptyNavigationUriError();\r\n }\r\n }\r\n\r\n /**\r\n * Monitors a window until it loads a url with the same origin.\r\n * @param popupWindow - window that is being monitored\r\n * @param timeout - timeout for processing hash once popup is redirected back to application\r\n */\r\n monitorPopupForHash(popupWindow: Window): Promise<string> {\r\n return new Promise((resolve, reject) => {\r\n /*\r\n * Polling for popups needs to be tick-based,\r\n * since a non-trivial amount of time can be spent on interaction (which should not count against the timeout).\r\n */\r\n const maxTicks = this.config.system.windowHashTimeout / this.config.system.pollIntervalMilliseconds;\r\n let ticks = 0;\r\n\r\n this.logger.verbose(\"PopupHandler.monitorPopupForHash - polling started\");\r\n\r\n const intervalId = setInterval(() => {\r\n // Window is closed\r\n if (popupWindow.closed) {\r\n this.logger.error(\"PopupHandler.monitorPopupForHash - window closed\");\r\n this.cleanPopup();\r\n clearInterval(intervalId);\r\n reject(BrowserAuthError.createUserCancelledError());\r\n return;\r\n }\r\n\r\n let href: string = Constants.EMPTY_STRING;\r\n let hash: string = Constants.EMPTY_STRING;\r\n try {\r\n /*\r\n * Will throw if cross origin,\r\n * which should be caught and ignored\r\n * since we need the interval to keep running while on STS UI.\r\n */\r\n href = popupWindow.location.href;\r\n hash = popupWindow.location.hash;\r\n } catch (e) {}\r\n\r\n // Don't process blank pages or cross domain\r\n if (StringUtils.isEmpty(href) || href === \"about:blank\") {\r\n return;\r\n }\r\n\r\n this.logger.verbose(\"PopupHandler.monitorPopupForHash - popup window is on same origin as caller\");\r\n\r\n /*\r\n * Only run clock when we are on same domain for popups\r\n * as popup operations can take a long time.\r\n */\r\n ticks++;\r\n\r\n if (hash) {\r\n this.logger.verbose(\"PopupHandler.monitorPopupForHash - found hash in url\");\r\n clearInterval(intervalId);\r\n this.cleanPopup(popupWindow);\r\n\r\n if (UrlString.hashContainsKnownProperties(hash)) {\r\n this.logger.verbose(\"PopupHandler.monitorPopupForHash - hash contains known properties, returning.\");\r\n resolve(hash);\r\n } else {\r\n this.logger.error(\"PopupHandler.monitorPopupForHash - found hash in url but it does not contain known properties. Check that your router is not changing the hash prematurely.\");\r\n this.logger.errorPii(`PopupHandler.monitorPopupForHash - hash found: ${hash}`);\r\n reject(BrowserAuthError.createHashDoesNotContainKnownPropertiesError());\r\n }\r\n } else if (ticks > maxTicks) {\r\n this.logger.error(\"PopupHandler.monitorPopupForHash - unable to find hash in url, timing out\");\r\n clearInterval(intervalId);\r\n reject(BrowserAuthError.createMonitorPopupTimeoutError());\r\n }\r\n }, this.config.system.pollIntervalMilliseconds);\r\n });\r\n }\r\n\r\n /**\r\n * Waits for user interaction in logout popup window\r\n * @param popupWindow\r\n * @returns\r\n */\r\n waitForLogoutPopup(popupWindow: Window): Promise<void> {\r\n return new Promise((resolve) => {\r\n this.logger.verbose(\"PopupHandler.waitForLogoutPopup - polling started\");\r\n\r\n const intervalId = setInterval(() => {\r\n // Window is closed\r\n if (popupWindow.closed) {\r\n this.logger.error(\"PopupHandler.waitForLogoutPopup - window closed\");\r\n this.cleanPopup();\r\n clearInterval(intervalId);\r\n resolve();\r\n }\r\n\r\n let href: string = Constants.EMPTY_STRING;\r\n try {\r\n /*\r\n * Will throw if cross origin,\r\n * which should be caught and ignored\r\n * since we need the interval to keep running while on STS UI.\r\n */\r\n href = popupWindow.location.href;\r\n } catch (e) {}\r\n\r\n // Don't process blank pages or cross domain\r\n if (StringUtils.isEmpty(href) || href === \"about:blank\") {\r\n return;\r\n }\r\n\r\n this.logger.verbose(\"PopupHandler.waitForLogoutPopup - popup window is on same origin as caller, closing.\");\r\n\r\n clearInterval(intervalId);\r\n this.cleanPopup(popupWindow);\r\n resolve();\r\n }, this.config.system.pollIntervalMilliseconds);\r\n });\r\n }\r\n\r\n /**\r\n * @hidden\r\n *\r\n * Configures popup window for login.\r\n *\r\n * @param urlNavigate\r\n * @param title\r\n * @param popUpWidth\r\n * @param popUpHeight\r\n * @param popupWindowAttributes\r\n * @ignore\r\n * @hidden\r\n */\r\n openPopup(urlNavigate: string, popupParams: PopupParams): Window {\r\n try {\r\n let popupWindow;\r\n // Popup window passed in, setting url to navigate to\r\n if (popupParams.popup) {\r\n popupWindow = popupParams.popup;\r\n this.logger.verbosePii(`Navigating popup window to: ${urlNavigate}`);\r\n popupWindow.location.assign(urlNavigate);\r\n } else if (typeof popupParams.popup === \"undefined\") {\r\n // Popup will be undefined if it was not passed in\r\n this.logger.verbosePii(`Opening popup window to: ${urlNavigate}`);\r\n popupWindow = this.openSizedPopup(urlNavigate, popupParams.popupName, popupParams.popupWindowAttributes);\r\n }\r\n\r\n // Popup will be null if popups are blocked\r\n if (!popupWindow) {\r\n throw BrowserAuthError.createEmptyWindowCreatedError();\r\n }\r\n if (popupWindow.focus) {\r\n popupWindow.focus();\r\n }\r\n this.currentWindow = popupWindow;\r\n window.addEventListener(\"beforeunload\", this.unloadWindow);\r\n\r\n return popupWindow;\r\n } catch (e) {\r\n this.logger.error(\"error opening popup \" + (e as AuthError).message);\r\n this.browserStorage.setInteractionInProgress(false);\r\n throw BrowserAuthError.createPopupWindowError((e as AuthError).toString());\r\n }\r\n }\r\n\r\n /**\r\n * Helper function to set popup window dimensions and position\r\n * @param urlNavigate\r\n * @param popupName\r\n * @param popupWindowAttributes\r\n * @returns\r\n */\r\n openSizedPopup(urlNavigate: string, popupName: string, popupWindowAttributes: PopupWindowAttributes): Window|null {\r\n /**\r\n * adding winLeft and winTop to account for dual monitor\r\n * using screenLeft and screenTop for IE8 and earlier\r\n */\r\n const winLeft = window.screenLeft ? window.screenLeft : window.screenX;\r\n const winTop = window.screenTop ? window.screenTop : window.screenY;\r\n /**\r\n * window.innerWidth displays browser window\"s height and width excluding toolbars\r\n * using document.documentElement.clientWidth for IE8 and earlier\r\n */\r\n const winWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;\r\n const winHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;\r\n\r\n let width = popupWindowAttributes.popupSize?.width;\r\n let height = popupWindowAttributes.popupSize?.height;\r\n let top = popupWindowAttributes.popupPosition?.top;\r\n let left = popupWindowAttributes.popupPosition?.left;\r\n\r\n if (!width || width < 0 || width > winWidth) {\r\n this.logger.verbose(\"Default popup window width used. Window width not configured or invalid.\");\r\n width = BrowserConstants.POPUP_WIDTH;\r\n }\r\n\r\n if (!height || height < 0 || height > winHeight) {\r\n this.logger.verbose(\"Default popup window height used. Window height not configured or invalid.\");\r\n height = BrowserConstants.POPUP_HEIGHT;\r\n }\r\n\r\n if (!top || top < 0 || top > winHeight) {\r\n this.logger.verbose(\"Default popup window top position used. Window top not configured or invalid.\");\r\n top = Math.max(0, ((winHeight / 2) - (BrowserConstants.POPUP_HEIGHT / 2)) + winTop);\r\n }\r\n\r\n if (!left || left < 0 || left > winWidth) {\r\n this.logger.verbose(\"Default popup window left position used. Window left not configured or invalid.\");\r\n left = Math.max(0, ((winWidth / 2) - (BrowserConstants.POPUP_WIDTH / 2)) + winLeft);\r\n }\r\n\r\n return window.open(urlNavigate, popupName, `width=${width}, height=${height}, top=${top}, left=${left}, scrollbars=yes`);\r\n }\r\n\r\n /**\r\n * Event callback to unload main window.\r\n */\r\n unloadWindow(e: Event): void {\r\n this.browserStorage.cleanRequestByInteractionType(InteractionType.Popup);\r\n if (this.currentWindow) {\r\n this.currentWindow.close();\r\n }\r\n // Guarantees browser unload will happen, so no other errors will be thrown.\r\n e.preventDefault();\r\n }\r\n\r\n /**\r\n * Closes popup, removes any state vars created during popup calls.\r\n * @param popupWindow\r\n */\r\n cleanPopup(popupWindow?: Window): void {\r\n if (popupWindow) {\r\n // Close window.\r\n popupWindow.close();\r\n }\r\n // Remove window unload function\r\n window.removeEventListener(\"beforeunload\", this.unloadWindow);\r\n\r\n // Interaction is completed - remove interaction status.\r\n this.browserStorage.setInteractionInProgress(false);\r\n }\r\n\r\n /**\r\n * Generates the name for the popup based on the client id and request\r\n * @param clientId\r\n * @param request\r\n */\r\n generatePopupName(scopes: Array<string>, authority: string): string {\r\n return `${BrowserConstants.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${scopes.join(\"-\")}.${authority}.${this.correlationId}`;\r\n }\r\n\r\n /**\r\n * Generates the name for the popup based on the client id and request for logouts\r\n * @param clientId\r\n * @param request\r\n */\r\n generateLogoutPopupName(request: CommonEndSessionRequest): string {\r\n const homeAccountId = request.account && request.account.homeAccountId;\r\n return `${BrowserConstants.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${homeAccountId}.${this.correlationId}`;\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;;;;;;;;;;AAAA;;;;;IA6BiC,+BAAyB;IAItD,qBAAY,MAA4B,EAAE,WAAgC,EAAE,aAAsB,EAAE,MAAc,EAAE,YAA0B,EAAE,gBAAmC,EAAE,iBAAqC,EAAE,iBAAsC,EAAE,oBAA2C,EAAE,aAAsB;QAAvU,YACI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BAAiB,SAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,SAAI,aAAa,SAAI,IAAI,CAAC,aAAe,CAAC;KACtH;IACL,kBAAC;AAAD,CAhgBA,CAAiC,yBAAyB;;;;"}
|
|
1
|
+
{"version":3,"file":"PopupClient.js","sources":["../../src/interaction_client/PopupClient.ts"],"sourcesContent":["/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { AuthenticationResult, CommonAuthorizationCodeRequest, AuthorizationCodeClient, ThrottlingUtils, CommonEndSessionRequest, UrlString, AuthError, OIDC_DEFAULT_SCOPES, Constants, ProtocolUtils, ServerAuthorizationCodeResponse, PerformanceEvents, StringUtils, IPerformanceClient, Logger, ICrypto } from \"@azure/msal-common\";\r\nimport { StandardInteractionClient } from \"./StandardInteractionClient\";\r\nimport { EventType } from \"../event/EventType\";\r\nimport { InteractionType, ApiId, BrowserConstants } from \"../utils/BrowserConstants\";\r\nimport { EndSessionPopupRequest } from \"../request/EndSessionPopupRequest\";\r\nimport { NavigationOptions } from \"../navigation/NavigationOptions\";\r\nimport { BrowserUtils } from \"../utils/BrowserUtils\";\r\nimport { PopupRequest } from \"../request/PopupRequest\";\r\nimport { NativeInteractionClient } from \"./NativeInteractionClient\";\r\nimport { NativeMessageHandler } from \"../broker/nativeBroker/NativeMessageHandler\";\r\nimport { BrowserAuthError } from \"../error/BrowserAuthError\";\r\nimport { INavigationClient } from \"../navigation/INavigationClient\";\r\nimport { EventHandler } from \"../event/EventHandler\";\r\nimport { BrowserCacheManager } from \"../cache/BrowserCacheManager\";\r\nimport { BrowserConfiguration } from \"../config/Configuration\";\r\nimport { InteractionHandler, InteractionParams } from \"../interaction_handler/InteractionHandler\";\r\nimport { PopupWindowAttributes } from \"../request/PopupWindowAttributes\";\r\n\r\nexport type PopupParams = InteractionParams & {\r\n popup?: Window|null;\r\n popupName: string;\r\n popupWindowAttributes: PopupWindowAttributes\r\n};\r\n\r\nexport class PopupClient extends StandardInteractionClient {\r\n private currentWindow: Window | undefined;\r\n protected nativeStorage: BrowserCacheManager;\r\n\r\n constructor(config: BrowserConfiguration, storageImpl: BrowserCacheManager, browserCrypto: ICrypto, logger: Logger, eventHandler: EventHandler, navigationClient: INavigationClient, performanceClient: IPerformanceClient, nativeStorageImpl: BrowserCacheManager, nativeMessageHandler?: NativeMessageHandler, correlationId?: string) {\r\n super(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, nativeMessageHandler, correlationId);\r\n // Properly sets this reference for the unload event.\r\n this.unloadWindow = this.unloadWindow.bind(this);\r\n this.nativeStorage = nativeStorageImpl;\r\n }\r\n\r\n /**\r\n * Acquires tokens by opening a popup window to the /authorize endpoint of the authority\r\n * @param request\r\n */\r\n acquireToken(request: PopupRequest): Promise<AuthenticationResult> {\r\n try {\r\n const popupName = this.generatePopupName(request.scopes || OIDC_DEFAULT_SCOPES, request.authority || this.config.auth.authority);\r\n const popupWindowAttributes = request.popupWindowAttributes || {};\r\n\r\n // asyncPopups flag is true. Acquires token without first opening popup. Popup will be opened later asynchronously.\r\n if (this.config.system.asyncPopups) {\r\n this.logger.verbose(\"asyncPopups set to true, acquiring token\");\r\n // Passes on popup position and dimensions if in request\r\n return this.acquireTokenPopupAsync(request, popupName, popupWindowAttributes);\r\n } else {\r\n // asyncPopups flag is set to false. Opens popup before acquiring token.\r\n this.logger.verbose(\"asyncPopup set to false, opening popup before acquiring token\");\r\n const popup = this.openSizedPopup(\"about:blank\", popupName, popupWindowAttributes);\r\n return this.acquireTokenPopupAsync(request, popupName, popupWindowAttributes, popup);\r\n }\r\n } catch (e) {\r\n return Promise.reject(e);\r\n }\r\n }\r\n\r\n /**\r\n * Clears local cache for the current user then opens a popup window prompting the user to sign-out of the server\r\n * @param logoutRequest\r\n */\r\n logout(logoutRequest?: EndSessionPopupRequest): Promise<void> {\r\n try {\r\n this.logger.verbose(\"logoutPopup called\");\r\n const validLogoutRequest = this.initializeLogoutRequest(logoutRequest);\r\n\r\n const popupName = this.generateLogoutPopupName(validLogoutRequest);\r\n const authority = logoutRequest && logoutRequest.authority;\r\n const mainWindowRedirectUri = logoutRequest && logoutRequest.mainWindowRedirectUri;\r\n const popupWindowAttributes = logoutRequest?.popupWindowAttributes || {};\r\n\r\n // asyncPopups flag is true. Acquires token without first opening popup. Popup will be opened later asynchronously.\r\n if (this.config.system.asyncPopups) {\r\n this.logger.verbose(\"asyncPopups set to true\");\r\n // Passes on popup position and dimensions if in request\r\n return this.logoutPopupAsync(validLogoutRequest, popupName, popupWindowAttributes, authority, undefined, mainWindowRedirectUri);\r\n } else {\r\n // asyncPopups flag is set to false. Opens popup before logging out.\r\n this.logger.verbose(\"asyncPopup set to false, opening popup\");\r\n const popup = this.openSizedPopup(\"about:blank\", popupName, popupWindowAttributes);\r\n return this.logoutPopupAsync(validLogoutRequest, popupName, popupWindowAttributes, authority, popup, mainWindowRedirectUri);\r\n }\r\n } catch (e) {\r\n // Since this function is synchronous we need to reject\r\n return Promise.reject(e);\r\n }\r\n }\r\n\r\n /**\r\n * Helper which obtains an access_token for your API via opening a popup window in the user's browser\r\n * @param validRequest\r\n * @param popupName\r\n * @param popup\r\n * @param popupWindowAttributes\r\n *\r\n * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.\r\n */\r\n protected async acquireTokenPopupAsync(request: PopupRequest, popupName: string, popupWindowAttributes: PopupWindowAttributes, popup?: Window|null): Promise<AuthenticationResult> {\r\n this.logger.verbose(\"acquireTokenPopupAsync called\");\r\n const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenPopup);\r\n\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, request.correlationId);\r\n const validRequest = await this.initializeAuthorizationRequest(request, InteractionType.Popup);\r\n this.browserStorage.updateCacheEntries(validRequest.state, validRequest.nonce, validRequest.authority, validRequest.loginHint || Constants.EMPTY_STRING, validRequest.account || null);\r\n\r\n try {\r\n // Create auth code request and generate PKCE params\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientInitializeAuthorizationCodeRequest, request.correlationId);\r\n const authCodeRequest: CommonAuthorizationCodeRequest = await this.initializeAuthorizationCodeRequest(validRequest);\r\n\r\n // Initialize the client\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, request.correlationId);\r\n const authClient: AuthorizationCodeClient = await this.createAuthCodeClient(serverTelemetryManager, validRequest.authority, validRequest.azureCloudOptions);\r\n this.logger.verbose(\"Auth code client created\");\r\n\r\n const isNativeBroker = NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeMessageHandler, request.authenticationScheme);\r\n // Start measurement for server calls with native brokering enabled\r\n let fetchNativeAccountIdMeasurement;\r\n if (isNativeBroker) {\r\n fetchNativeAccountIdMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.FetchAccountIdWithNativeBroker, request.correlationId);\r\n }\r\n\r\n // Create acquire token url.\r\n const navigateUrl = await authClient.getAuthCodeUrl({\r\n ...validRequest,\r\n nativeBroker: isNativeBroker\r\n });\r\n\r\n // Create popup interaction handler.\r\n const interactionHandler = new InteractionHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.performanceClient);\r\n\r\n // Show the UI once the url has been created. Get the window handle for the popup.\r\n const popupParameters: PopupParams = {\r\n popup,\r\n popupName,\r\n popupWindowAttributes\r\n };\r\n const popupWindow: Window = this.initiateAuthRequest(navigateUrl, popupParameters);\r\n this.eventHandler.emitEvent(EventType.POPUP_OPENED, InteractionType.Popup, {popupWindow}, null);\r\n\r\n // Monitor the window for the hash. Return the string value and close the popup when the hash is received. Default timeout is 60 seconds.\r\n const hash = await this.monitorPopupForHash(popupWindow);\r\n // Deserialize hash fragment response parameters.\r\n const serverParams: ServerAuthorizationCodeResponse = UrlString.getDeserializedHash(hash);\r\n const state = this.validateAndExtractStateFromHash(serverParams, InteractionType.Popup, validRequest.correlationId);\r\n // Remove throttle if it exists\r\n ThrottlingUtils.removeThrottle(this.browserStorage, this.config.auth.clientId, authCodeRequest);\r\n\r\n if (serverParams.accountId) {\r\n this.logger.verbose(\"Account id found in hash, calling WAM for token\");\r\n // end measurement for server call with native brokering enabled\r\n if (fetchNativeAccountIdMeasurement) {\r\n fetchNativeAccountIdMeasurement.endMeasurement({\r\n success: true,\r\n isNativeBroker: true\r\n });\r\n }\r\n\r\n if (!this.nativeMessageHandler) {\r\n throw BrowserAuthError.createNativeConnectionNotEstablishedError();\r\n }\r\n const nativeInteractionClient = new NativeInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.acquireTokenPopup, this.performanceClient, this.nativeMessageHandler, serverParams.accountId, this.nativeStorage, validRequest.correlationId);\r\n const { userRequestState } = ProtocolUtils.parseRequestState(this.browserCrypto, state);\r\n return nativeInteractionClient.acquireToken({\r\n ...validRequest,\r\n state: userRequestState,\r\n prompt: undefined // Server should handle the prompt, ideally native broker can do this part silently\r\n }).finally(() => {\r\n this.browserStorage.cleanRequestByState(state);\r\n });\r\n }\r\n\r\n // Handle response from hash string.\r\n const result = await interactionHandler.handleCodeResponseFromHash(hash, state, authClient.authority, this.networkClient);\r\n\r\n return result;\r\n } catch (e) {\r\n if (popup) {\r\n // Close the synchronous popup if an error is thrown before the window unload event is registered\r\n popup.close();\r\n }\r\n\r\n if (e instanceof AuthError) {\r\n (e as AuthError).setCorrelationId(this.correlationId);\r\n }\r\n\r\n serverTelemetryManager.cacheFailedRequest(e);\r\n this.browserStorage.cleanRequestByState(validRequest.state);\r\n throw e;\r\n }\r\n }\r\n\r\n /**\r\n *\r\n * @param validRequest\r\n * @param popupName\r\n * @param requestAuthority\r\n * @param popup\r\n * @param mainWindowRedirectUri\r\n * @param popupWindowAttributes\r\n */\r\n protected async logoutPopupAsync(validRequest: CommonEndSessionRequest, popupName: string, popupWindowAttributes: PopupWindowAttributes, requestAuthority?: string, popup?: Window|null, mainWindowRedirectUri?: string): Promise<void> {\r\n this.logger.verbose(\"logoutPopupAsync called\");\r\n this.eventHandler.emitEvent(EventType.LOGOUT_START, InteractionType.Popup, validRequest);\r\n\r\n const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.logoutPopup);\r\n\r\n try {\r\n // Clear cache on logout\r\n await this.clearCacheOnLogout(validRequest.account);\r\n\r\n // Initialize the client\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, validRequest.correlationId);\r\n const authClient = await this.createAuthCodeClient(serverTelemetryManager, requestAuthority);\r\n this.logger.verbose(\"Auth code client created\");\r\n\r\n // Create logout string and navigate user window to logout.\r\n const logoutUri: string = authClient.getLogoutUri(validRequest);\r\n\r\n this.eventHandler.emitEvent(EventType.LOGOUT_SUCCESS, InteractionType.Popup, validRequest);\r\n\r\n // Open the popup window to requestUrl.\r\n const popupWindow = this.openPopup(logoutUri, {popupName, popupWindowAttributes, popup});\r\n this.eventHandler.emitEvent(EventType.POPUP_OPENED, InteractionType.Popup, {popupWindow}, null);\r\n\r\n await this.waitForLogoutPopup(popupWindow);\r\n\r\n if (mainWindowRedirectUri) {\r\n const navigationOptions: NavigationOptions = {\r\n apiId: ApiId.logoutPopup,\r\n timeout: this.config.system.redirectNavigationTimeout,\r\n noHistory: false\r\n };\r\n const absoluteUrl = UrlString.getAbsoluteUrl(mainWindowRedirectUri, BrowserUtils.getCurrentUri());\r\n\r\n this.logger.verbose(\"Redirecting main window to url specified in the request\");\r\n this.logger.verbosePii(`Redirecting main window to: ${absoluteUrl}`);\r\n this.navigationClient.navigateInternal(absoluteUrl, navigationOptions);\r\n } else {\r\n this.logger.verbose(\"No main window navigation requested\");\r\n }\r\n } catch (e) {\r\n if (popup) {\r\n // Close the synchronous popup if an error is thrown before the window unload event is registered\r\n popup.close();\r\n }\r\n\r\n if (e instanceof AuthError) {\r\n (e as AuthError).setCorrelationId(this.correlationId);\r\n }\r\n\r\n this.browserStorage.setInteractionInProgress(false);\r\n this.eventHandler.emitEvent(EventType.LOGOUT_FAILURE, InteractionType.Popup, null, e);\r\n this.eventHandler.emitEvent(EventType.LOGOUT_END, InteractionType.Popup);\r\n serverTelemetryManager.cacheFailedRequest(e);\r\n throw e;\r\n }\r\n\r\n this.eventHandler.emitEvent(EventType.LOGOUT_END, InteractionType.Popup);\r\n }\r\n\r\n /**\r\n * Opens a popup window with given request Url.\r\n * @param requestUrl\r\n */\r\n initiateAuthRequest(requestUrl: string, params: PopupParams): Window {\r\n // Check that request url is not empty.\r\n if (!StringUtils.isEmpty(requestUrl)) {\r\n this.logger.infoPii(`Navigate to: ${requestUrl}`);\r\n // Open the popup window to requestUrl.\r\n return this.openPopup(requestUrl, params);\r\n } else {\r\n // Throw error if request URL is empty.\r\n this.logger.error(\"Navigate url is empty\");\r\n throw BrowserAuthError.createEmptyNavigationUriError();\r\n }\r\n }\r\n\r\n /**\r\n * Monitors a window until it loads a url with the same origin.\r\n * @param popupWindow - window that is being monitored\r\n * @param timeout - timeout for processing hash once popup is redirected back to application\r\n */\r\n monitorPopupForHash(popupWindow: Window): Promise<string> {\r\n return new Promise((resolve, reject) => {\r\n /*\r\n * Polling for popups needs to be tick-based,\r\n * since a non-trivial amount of time can be spent on interaction (which should not count against the timeout).\r\n */\r\n const maxTicks = this.config.system.windowHashTimeout / this.config.system.pollIntervalMilliseconds;\r\n let ticks = 0;\r\n\r\n this.logger.verbose(\"PopupHandler.monitorPopupForHash - polling started\");\r\n\r\n const intervalId = setInterval(() => {\r\n // Window is closed\r\n if (popupWindow.closed) {\r\n this.logger.error(\"PopupHandler.monitorPopupForHash - window closed\");\r\n this.cleanPopup();\r\n clearInterval(intervalId);\r\n reject(BrowserAuthError.createUserCancelledError());\r\n return;\r\n }\r\n\r\n let href: string = Constants.EMPTY_STRING;\r\n let hash: string = Constants.EMPTY_STRING;\r\n try {\r\n /*\r\n * Will throw if cross origin,\r\n * which should be caught and ignored\r\n * since we need the interval to keep running while on STS UI.\r\n */\r\n href = popupWindow.location.href;\r\n hash = popupWindow.location.hash;\r\n } catch (e) {}\r\n\r\n // Don't process blank pages or cross domain\r\n if (StringUtils.isEmpty(href) || href === \"about:blank\") {\r\n return;\r\n }\r\n\r\n this.logger.verbose(\"PopupHandler.monitorPopupForHash - popup window is on same origin as caller\");\r\n\r\n /*\r\n * Only run clock when we are on same domain for popups\r\n * as popup operations can take a long time.\r\n */\r\n ticks++;\r\n\r\n if (hash) {\r\n this.logger.verbose(\"PopupHandler.monitorPopupForHash - found hash in url\");\r\n clearInterval(intervalId);\r\n this.cleanPopup(popupWindow);\r\n\r\n if (UrlString.hashContainsKnownProperties(hash)) {\r\n this.logger.verbose(\"PopupHandler.monitorPopupForHash - hash contains known properties, returning.\");\r\n resolve(hash);\r\n } else {\r\n this.logger.error(\"PopupHandler.monitorPopupForHash - found hash in url but it does not contain known properties. Check that your router is not changing the hash prematurely.\");\r\n this.logger.errorPii(`PopupHandler.monitorPopupForHash - hash found: ${hash}`);\r\n reject(BrowserAuthError.createHashDoesNotContainKnownPropertiesError());\r\n }\r\n } else if (ticks > maxTicks) {\r\n this.logger.error(\"PopupHandler.monitorPopupForHash - unable to find hash in url, timing out\");\r\n clearInterval(intervalId);\r\n reject(BrowserAuthError.createMonitorPopupTimeoutError());\r\n }\r\n }, this.config.system.pollIntervalMilliseconds);\r\n });\r\n }\r\n\r\n /**\r\n * Waits for user interaction in logout popup window\r\n * @param popupWindow\r\n * @returns\r\n */\r\n waitForLogoutPopup(popupWindow: Window): Promise<void> {\r\n return new Promise((resolve) => {\r\n this.logger.verbose(\"PopupHandler.waitForLogoutPopup - polling started\");\r\n\r\n const intervalId = setInterval(() => {\r\n // Window is closed\r\n if (popupWindow.closed) {\r\n this.logger.error(\"PopupHandler.waitForLogoutPopup - window closed\");\r\n this.cleanPopup();\r\n clearInterval(intervalId);\r\n resolve();\r\n }\r\n\r\n let href: string = Constants.EMPTY_STRING;\r\n try {\r\n /*\r\n * Will throw if cross origin,\r\n * which should be caught and ignored\r\n * since we need the interval to keep running while on STS UI.\r\n */\r\n href = popupWindow.location.href;\r\n } catch (e) {}\r\n\r\n // Don't process blank pages or cross domain\r\n if (StringUtils.isEmpty(href) || href === \"about:blank\") {\r\n return;\r\n }\r\n\r\n this.logger.verbose(\"PopupHandler.waitForLogoutPopup - popup window is on same origin as caller, closing.\");\r\n\r\n clearInterval(intervalId);\r\n this.cleanPopup(popupWindow);\r\n resolve();\r\n }, this.config.system.pollIntervalMilliseconds);\r\n });\r\n }\r\n\r\n /**\r\n * @hidden\r\n *\r\n * Configures popup window for login.\r\n *\r\n * @param urlNavigate\r\n * @param title\r\n * @param popUpWidth\r\n * @param popUpHeight\r\n * @param popupWindowAttributes\r\n * @ignore\r\n * @hidden\r\n */\r\n openPopup(urlNavigate: string, popupParams: PopupParams): Window {\r\n try {\r\n let popupWindow;\r\n // Popup window passed in, setting url to navigate to\r\n if (popupParams.popup) {\r\n popupWindow = popupParams.popup;\r\n this.logger.verbosePii(`Navigating popup window to: ${urlNavigate}`);\r\n popupWindow.location.assign(urlNavigate);\r\n } else if (typeof popupParams.popup === \"undefined\") {\r\n // Popup will be undefined if it was not passed in\r\n this.logger.verbosePii(`Opening popup window to: ${urlNavigate}`);\r\n popupWindow = this.openSizedPopup(urlNavigate, popupParams.popupName, popupParams.popupWindowAttributes);\r\n }\r\n\r\n // Popup will be null if popups are blocked\r\n if (!popupWindow) {\r\n throw BrowserAuthError.createEmptyWindowCreatedError();\r\n }\r\n if (popupWindow.focus) {\r\n popupWindow.focus();\r\n }\r\n this.currentWindow = popupWindow;\r\n window.addEventListener(\"beforeunload\", this.unloadWindow);\r\n\r\n return popupWindow;\r\n } catch (e) {\r\n this.logger.error(\"error opening popup \" + (e as AuthError).message);\r\n this.browserStorage.setInteractionInProgress(false);\r\n throw BrowserAuthError.createPopupWindowError((e as AuthError).toString());\r\n }\r\n }\r\n\r\n /**\r\n * Helper function to set popup window dimensions and position\r\n * @param urlNavigate\r\n * @param popupName\r\n * @param popupWindowAttributes\r\n * @returns\r\n */\r\n openSizedPopup(urlNavigate: string, popupName: string, popupWindowAttributes: PopupWindowAttributes): Window|null {\r\n /**\r\n * adding winLeft and winTop to account for dual monitor\r\n * using screenLeft and screenTop for IE8 and earlier\r\n */\r\n const winLeft = window.screenLeft ? window.screenLeft : window.screenX;\r\n const winTop = window.screenTop ? window.screenTop : window.screenY;\r\n /**\r\n * window.innerWidth displays browser window\"s height and width excluding toolbars\r\n * using document.documentElement.clientWidth for IE8 and earlier\r\n */\r\n const winWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;\r\n const winHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;\r\n\r\n let width = popupWindowAttributes.popupSize?.width;\r\n let height = popupWindowAttributes.popupSize?.height;\r\n let top = popupWindowAttributes.popupPosition?.top;\r\n let left = popupWindowAttributes.popupPosition?.left;\r\n\r\n if (!width || width < 0 || width > winWidth) {\r\n this.logger.verbose(\"Default popup window width used. Window width not configured or invalid.\");\r\n width = BrowserConstants.POPUP_WIDTH;\r\n }\r\n\r\n if (!height || height < 0 || height > winHeight) {\r\n this.logger.verbose(\"Default popup window height used. Window height not configured or invalid.\");\r\n height = BrowserConstants.POPUP_HEIGHT;\r\n }\r\n\r\n if (!top || top < 0 || top > winHeight) {\r\n this.logger.verbose(\"Default popup window top position used. Window top not configured or invalid.\");\r\n top = Math.max(0, ((winHeight / 2) - (BrowserConstants.POPUP_HEIGHT / 2)) + winTop);\r\n }\r\n\r\n if (!left || left < 0 || left > winWidth) {\r\n this.logger.verbose(\"Default popup window left position used. Window left not configured or invalid.\");\r\n left = Math.max(0, ((winWidth / 2) - (BrowserConstants.POPUP_WIDTH / 2)) + winLeft);\r\n }\r\n\r\n return window.open(urlNavigate, popupName, `width=${width}, height=${height}, top=${top}, left=${left}, scrollbars=yes`);\r\n }\r\n\r\n /**\r\n * Event callback to unload main window.\r\n */\r\n unloadWindow(e: Event): void {\r\n this.browserStorage.cleanRequestByInteractionType(InteractionType.Popup);\r\n if (this.currentWindow) {\r\n this.currentWindow.close();\r\n }\r\n // Guarantees browser unload will happen, so no other errors will be thrown.\r\n e.preventDefault();\r\n }\r\n\r\n /**\r\n * Closes popup, removes any state vars created during popup calls.\r\n * @param popupWindow\r\n */\r\n cleanPopup(popupWindow?: Window): void {\r\n if (popupWindow) {\r\n // Close window.\r\n popupWindow.close();\r\n }\r\n // Remove window unload function\r\n window.removeEventListener(\"beforeunload\", this.unloadWindow);\r\n\r\n // Interaction is completed - remove interaction status.\r\n this.browserStorage.setInteractionInProgress(false);\r\n }\r\n\r\n /**\r\n * Generates the name for the popup based on the client id and request\r\n * @param clientId\r\n * @param request\r\n */\r\n generatePopupName(scopes: Array<string>, authority: string): string {\r\n return `${BrowserConstants.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${scopes.join(\"-\")}.${authority}.${this.correlationId}`;\r\n }\r\n\r\n /**\r\n * Generates the name for the popup based on the client id and request for logouts\r\n * @param clientId\r\n * @param request\r\n */\r\n generateLogoutPopupName(request: CommonEndSessionRequest): string {\r\n const homeAccountId = request.account && request.account.homeAccountId;\r\n return `${BrowserConstants.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${homeAccountId}.${this.correlationId}`;\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;;;;;;;;;;AAAA;;;AAGG;AA0BH,IAAA,WAAA,kBAAA,UAAA,MAAA,EAAA;IAAiC,SAAyB,CAAA,WAAA,EAAA,MAAA,CAAA,CAAA;AAItD,IAAA,SAAA,WAAA,CAAY,MAA4B,EAAE,WAAgC,EAAE,aAAsB,EAAE,MAAc,EAAE,YAA0B,EAAE,gBAAmC,EAAE,iBAAqC,EAAE,iBAAsC,EAAE,oBAA2C,EAAE,aAAsB,EAAA;AAAvU,QAAA,IAAA,KAAA,GACI,kBAAM,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,EAAE,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,aAAa,CAAC,IAI5I,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GAAjB,UAAkB,MAAqB,EAAE,SAAiB,EAAA;QACtD,OAAU,gBAAgB,CAAC,iBAAiB,GAAI,GAAA,GAAA,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,GAAA,GAAA,GAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,GAAA,GAAA,GAAI,SAAS,GAAI,GAAA,GAAA,IAAI,CAAC,aAAe,CAAC;KACtI,CAAA;AAED;;;;AAIG;IACH,WAAuB,CAAA,SAAA,CAAA,uBAAA,GAAvB,UAAwB,OAAgC,EAAA;QACpD,IAAM,aAAa,GAAG,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC;AACvE,QAAA,OAAU,gBAAgB,CAAC,iBAAiB,GAAI,GAAA,GAAA,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,GAAI,GAAA,GAAA,aAAa,SAAI,IAAI,CAAC,aAAe,CAAC;KACtH,CAAA;IACL,OAAC,WAAA,CAAA;AAAD,CAhgBA,CAAiC,yBAAyB,CAggBzD;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-browser v2.
|
|
1
|
+
/*! @azure/msal-browser v2.39.0 2024-06-06 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { __extends, __awaiter, __generator, __assign } from '../_virtual/_tslib.js';
|
|
4
4
|
import { UrlString, AuthError, PerformanceEvents, Constants, ThrottlingUtils, ProtocolUtils } from '@azure/msal-common';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RedirectClient.js","sources":["../../src/interaction_client/RedirectClient.ts"],"sourcesContent":["/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { AuthenticationResult, CommonAuthorizationCodeRequest, AuthorizationCodeClient, UrlString, AuthError, ServerTelemetryManager, Constants, ProtocolUtils, ServerAuthorizationCodeResponse, ThrottlingUtils, ICrypto, Logger, IPerformanceClient, PerformanceEvents } from \"@azure/msal-common\";\r\nimport { StandardInteractionClient } from \"./StandardInteractionClient\";\r\nimport { ApiId, InteractionType, TemporaryCacheKeys } from \"../utils/BrowserConstants\";\r\nimport { RedirectHandler } from \"../interaction_handler/RedirectHandler\";\r\nimport { BrowserUtils } from \"../utils/BrowserUtils\";\r\nimport { EndSessionRequest } from \"../request/EndSessionRequest\";\r\nimport { EventType } from \"../event/EventType\";\r\nimport { NavigationOptions } from \"../navigation/NavigationOptions\";\r\nimport { BrowserAuthError } from \"../error/BrowserAuthError\";\r\nimport { RedirectRequest } from \"../request/RedirectRequest\";\r\nimport { NativeInteractionClient } from \"./NativeInteractionClient\";\r\nimport { NativeMessageHandler } from \"../broker/nativeBroker/NativeMessageHandler\";\r\nimport { BrowserConfiguration } from \"../config/Configuration\";\r\nimport { BrowserCacheManager } from \"../cache/BrowserCacheManager\";\r\nimport { EventHandler } from \"../event/EventHandler\";\r\nimport { INavigationClient } from \"../navigation/INavigationClient\";\r\n\r\nexport class RedirectClient extends StandardInteractionClient {\r\n protected nativeStorage: BrowserCacheManager;\r\n\r\n constructor(config: BrowserConfiguration, storageImpl: BrowserCacheManager, browserCrypto: ICrypto, logger: Logger, eventHandler: EventHandler, navigationClient: INavigationClient, performanceClient: IPerformanceClient, nativeStorageImpl: BrowserCacheManager, nativeMessageHandler?: NativeMessageHandler, correlationId?: string) {\r\n super(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, nativeMessageHandler, correlationId);\r\n this.nativeStorage = nativeStorageImpl;\r\n }\r\n\r\n /**\r\n * Redirects the page to the /authorize endpoint of the IDP\r\n * @param request\r\n */\r\n async acquireToken(request: RedirectRequest): Promise<void> {\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, request.correlationId);\r\n const validRequest = await this.initializeAuthorizationRequest(request, InteractionType.Redirect);\r\n this.browserStorage.updateCacheEntries(validRequest.state, validRequest.nonce, validRequest.authority, validRequest.loginHint || Constants.EMPTY_STRING, validRequest.account || null);\r\n const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenRedirect);\r\n\r\n const handleBackButton = (event: PageTransitionEvent) => {\r\n // Clear temporary cache if the back button is clicked during the redirect flow.\r\n if (event.persisted) {\r\n this.logger.verbose(\"Page was restored from back/forward cache. Clearing temporary cache.\");\r\n this.browserStorage.cleanRequestByState(validRequest.state);\r\n this.eventHandler.emitEvent(EventType.RESTORE_FROM_BFCACHE, InteractionType.Redirect);\r\n }\r\n };\r\n\r\n try {\r\n // Create auth code request and generate PKCE params\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientInitializeAuthorizationCodeRequest, request.correlationId);\r\n const authCodeRequest: CommonAuthorizationCodeRequest = await this.initializeAuthorizationCodeRequest(validRequest);\r\n\r\n // Initialize the client\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, request.correlationId);\r\n const authClient: AuthorizationCodeClient = await this.createAuthCodeClient(serverTelemetryManager, validRequest.authority, validRequest.azureCloudOptions);\r\n this.logger.verbose(\"Auth code client created\");\r\n\r\n // Create redirect interaction handler.\r\n const interactionHandler = new RedirectHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.browserCrypto, this.performanceClient);\r\n\r\n // Create acquire token url.\r\n const navigateUrl = await authClient.getAuthCodeUrl({\r\n ...validRequest,\r\n nativeBroker: NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeMessageHandler, request.authenticationScheme)\r\n });\r\n\r\n const redirectStartPage = this.getRedirectStartPage(request.redirectStartPage);\r\n this.logger.verbosePii(`Redirect start page: ${redirectStartPage}`);\r\n\r\n // Clear temporary cache if the back button is clicked during the redirect flow.\r\n window.addEventListener(\"pageshow\", handleBackButton);\r\n\r\n // Show the UI once the url has been created. Response will come back in the hash, which will be handled in the handleRedirectCallback function.\r\n return await interactionHandler.initiateAuthRequest(navigateUrl, {\r\n navigationClient: this.navigationClient,\r\n redirectTimeout: this.config.system.redirectNavigationTimeout,\r\n redirectStartPage: redirectStartPage,\r\n onRedirectNavigate: request.onRedirectNavigate\r\n });\r\n } catch (e) {\r\n if (e instanceof AuthError) {\r\n e.setCorrelationId(this.correlationId);\r\n }\r\n window.removeEventListener(\"pageshow\", handleBackButton);\r\n serverTelemetryManager.cacheFailedRequest(e);\r\n this.browserStorage.cleanRequestByState(validRequest.state);\r\n throw e;\r\n }\r\n }\r\n\r\n /**\r\n * Checks if navigateToLoginRequestUrl is set, and:\r\n * - if true, performs logic to cache and navigate\r\n * - if false, handles hash string and parses response\r\n * @param hash\r\n */\r\n async handleRedirectPromise(hash?: string): Promise<AuthenticationResult | null> {\r\n const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.handleRedirectPromise);\r\n try {\r\n if (!this.browserStorage.isInteractionInProgress(true)) {\r\n this.logger.info(\"handleRedirectPromise called but there is no interaction in progress, returning null.\");\r\n return null;\r\n }\r\n\r\n const responseHash = this.getRedirectResponseHash(hash || window.location.hash);\r\n if (!responseHash) {\r\n // Not a recognized server response hash or hash not associated with a redirect request\r\n this.logger.info(\"handleRedirectPromise did not detect a response hash as a result of a redirect. Cleaning temporary cache.\");\r\n this.browserStorage.cleanRequestByInteractionType(InteractionType.Redirect);\r\n return null;\r\n }\r\n\r\n let state: string;\r\n try {\r\n // Deserialize hash fragment response parameters.\r\n const serverParams: ServerAuthorizationCodeResponse = UrlString.getDeserializedHash(responseHash);\r\n state = this.validateAndExtractStateFromHash(serverParams, InteractionType.Redirect);\r\n this.logger.verbose(\"State extracted from hash\");\r\n } catch (e) {\r\n this.logger.info(`handleRedirectPromise was unable to extract state due to: ${e}`);\r\n this.browserStorage.cleanRequestByInteractionType(InteractionType.Redirect);\r\n return null;\r\n }\r\n\r\n // If navigateToLoginRequestUrl is true, get the url where the redirect request was initiated\r\n const loginRequestUrl = this.browserStorage.getTemporaryCache(TemporaryCacheKeys.ORIGIN_URI, true) || Constants.EMPTY_STRING;\r\n const loginRequestUrlNormalized = UrlString.removeHashFromUrl(loginRequestUrl);\r\n const currentUrlNormalized = UrlString.removeHashFromUrl(window.location.href);\r\n\r\n if (loginRequestUrlNormalized === currentUrlNormalized && this.config.auth.navigateToLoginRequestUrl) {\r\n // We are on the page we need to navigate to - handle hash\r\n this.logger.verbose(\"Current page is loginRequestUrl, handling hash\");\r\n const handleHashResult = await this.handleHash(responseHash, state, serverTelemetryManager);\r\n\r\n if (loginRequestUrl.indexOf(\"#\") > -1) {\r\n // Replace current hash with non-msal hash, if present\r\n BrowserUtils.replaceHash(loginRequestUrl);\r\n }\r\n\r\n return handleHashResult;\r\n } else if (!this.config.auth.navigateToLoginRequestUrl) {\r\n this.logger.verbose(\"NavigateToLoginRequestUrl set to false, handling hash\");\r\n return this.handleHash(responseHash, state, serverTelemetryManager);\r\n } else if (!BrowserUtils.isInIframe() || this.config.system.allowRedirectInIframe) {\r\n /*\r\n * Returned from authority using redirect - need to perform navigation before processing response\r\n * Cache the hash to be retrieved after the next redirect\r\n */\r\n this.browserStorage.setTemporaryCache(TemporaryCacheKeys.URL_HASH, responseHash, true);\r\n const navigationOptions: NavigationOptions = {\r\n apiId: ApiId.handleRedirectPromise,\r\n timeout: this.config.system.redirectNavigationTimeout,\r\n noHistory: true\r\n };\r\n\r\n /**\r\n * Default behavior is to redirect to the start page and not process the hash now.\r\n * The start page is expected to also call handleRedirectPromise which will process the hash in one of the checks above.\r\n */\r\n let processHashOnRedirect: boolean = true;\r\n if (!loginRequestUrl || loginRequestUrl === \"null\") {\r\n // Redirect to home page if login request url is null (real null or the string null)\r\n const homepage = BrowserUtils.getHomepage();\r\n // Cache the homepage under ORIGIN_URI to ensure cached hash is processed on homepage\r\n this.browserStorage.setTemporaryCache(TemporaryCacheKeys.ORIGIN_URI, homepage, true);\r\n this.logger.warning(\"Unable to get valid login request url from cache, redirecting to home page\");\r\n processHashOnRedirect = await this.navigationClient.navigateInternal(homepage, navigationOptions);\r\n } else {\r\n // Navigate to page that initiated the redirect request\r\n this.logger.verbose(`Navigating to loginRequestUrl: ${loginRequestUrl}`);\r\n processHashOnRedirect = await this.navigationClient.navigateInternal(loginRequestUrl, navigationOptions);\r\n }\r\n\r\n // If navigateInternal implementation returns false, handle the hash now\r\n if (!processHashOnRedirect) {\r\n return this.handleHash(responseHash, state, serverTelemetryManager);\r\n }\r\n }\r\n\r\n return null;\r\n } catch (e) {\r\n if (e instanceof AuthError) {\r\n (e as AuthError).setCorrelationId(this.correlationId);\r\n }\r\n serverTelemetryManager.cacheFailedRequest(e);\r\n this.browserStorage.cleanRequestByInteractionType(InteractionType.Redirect);\r\n throw e;\r\n }\r\n }\r\n\r\n /**\r\n * Gets the response hash for a redirect request\r\n * Returns null if interactionType in the state value is not \"redirect\" or the hash does not contain known properties\r\n * @param hash\r\n */\r\n protected getRedirectResponseHash(hash: string): string | null {\r\n this.logger.verbose(\"getRedirectResponseHash called\");\r\n // Get current location hash from window or cache.\r\n const isResponseHash: boolean = UrlString.hashContainsKnownProperties(hash);\r\n\r\n if (isResponseHash) {\r\n BrowserUtils.clearHash(window);\r\n this.logger.verbose(\"Hash contains known properties, returning response hash\");\r\n return hash;\r\n }\r\n\r\n const cachedHash = this.browserStorage.getTemporaryCache(TemporaryCacheKeys.URL_HASH, true);\r\n this.browserStorage.removeItem(this.browserStorage.generateCacheKey(TemporaryCacheKeys.URL_HASH));\r\n\r\n this.logger.verbose(\"Hash does not contain known properties, returning cached hash\");\r\n return cachedHash;\r\n }\r\n\r\n /**\r\n * Checks if hash exists and handles in window.\r\n * @param hash\r\n * @param state\r\n */\r\n protected async handleHash(hash: string, state: string, serverTelemetryManager: ServerTelemetryManager): Promise<AuthenticationResult> {\r\n const cachedRequest = this.browserStorage.getCachedRequest(state, this.browserCrypto);\r\n this.logger.verbose(\"handleHash called, retrieved cached request\");\r\n\r\n const serverParams: ServerAuthorizationCodeResponse = UrlString.getDeserializedHash(hash);\r\n\r\n if (serverParams.accountId) {\r\n this.logger.verbose(\"Account id found in hash, calling WAM for token\");\r\n if (!this.nativeMessageHandler) {\r\n throw BrowserAuthError.createNativeConnectionNotEstablishedError();\r\n }\r\n const nativeInteractionClient = new NativeInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.acquireTokenPopup, this.performanceClient, this.nativeMessageHandler, serverParams.accountId, this.nativeStorage, cachedRequest.correlationId);\r\n const { userRequestState } = ProtocolUtils.parseRequestState(this.browserCrypto, state);\r\n return nativeInteractionClient.acquireToken({\r\n ...cachedRequest,\r\n state: userRequestState,\r\n prompt: undefined // Server should handle the prompt, ideally native broker can do this part silently\r\n }).finally(() => {\r\n this.browserStorage.cleanRequestByState(state);\r\n });\r\n }\r\n\r\n // Hash contains known properties - handle and return in callback\r\n const currentAuthority = this.browserStorage.getCachedAuthority(state);\r\n if (!currentAuthority) {\r\n throw BrowserAuthError.createNoCachedAuthorityError();\r\n }\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, cachedRequest.correlationId);\r\n const authClient = await this.createAuthCodeClient(serverTelemetryManager, currentAuthority);\r\n this.logger.verbose(\"Auth code client created\");\r\n ThrottlingUtils.removeThrottle(this.browserStorage, this.config.auth.clientId, cachedRequest);\r\n const interactionHandler = new RedirectHandler(authClient, this.browserStorage, cachedRequest, this.logger, this.browserCrypto, this.performanceClient);\r\n return await interactionHandler.handleCodeResponseFromHash(hash, state, authClient.authority, this.networkClient);\r\n }\r\n\r\n /**\r\n * Use to log out the current user, and redirect the user to the postLogoutRedirectUri.\r\n * Default behaviour is to redirect the user to `window.location.href`.\r\n * @param logoutRequest\r\n */\r\n async logout(logoutRequest?: EndSessionRequest): Promise<void> {\r\n this.logger.verbose(\"logoutRedirect called\");\r\n const validLogoutRequest = this.initializeLogoutRequest(logoutRequest);\r\n const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.logout);\r\n\r\n try {\r\n this.eventHandler.emitEvent(EventType.LOGOUT_START, InteractionType.Redirect, logoutRequest);\r\n\r\n // Clear cache on logout\r\n await this.clearCacheOnLogout(validLogoutRequest.account);\r\n\r\n const navigationOptions: NavigationOptions = {\r\n apiId: ApiId.logout,\r\n timeout: this.config.system.redirectNavigationTimeout,\r\n noHistory: false\r\n };\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, validLogoutRequest.correlationId);\r\n const authClient = await this.createAuthCodeClient(serverTelemetryManager, logoutRequest && logoutRequest.authority);\r\n this.logger.verbose(\"Auth code client created\");\r\n\r\n // Create logout string and navigate user window to logout.\r\n const logoutUri: string = authClient.getLogoutUri(validLogoutRequest);\r\n\r\n this.eventHandler.emitEvent(EventType.LOGOUT_SUCCESS, InteractionType.Redirect, validLogoutRequest);\r\n // Check if onRedirectNavigate is implemented, and invoke it if so\r\n if (logoutRequest && typeof logoutRequest.onRedirectNavigate === \"function\") {\r\n const navigate = logoutRequest.onRedirectNavigate(logoutUri);\r\n\r\n if (navigate !== false) {\r\n this.logger.verbose(\"Logout onRedirectNavigate did not return false, navigating\");\r\n // Ensure interaction is in progress\r\n if (!this.browserStorage.getInteractionInProgress()) {\r\n this.browserStorage.setInteractionInProgress(true);\r\n }\r\n await this.navigationClient.navigateExternal(logoutUri, navigationOptions);\r\n return;\r\n } else {\r\n // Ensure interaction is not in progress\r\n this.browserStorage.setInteractionInProgress(false);\r\n this.logger.verbose(\"Logout onRedirectNavigate returned false, stopping navigation\");\r\n }\r\n } else {\r\n // Ensure interaction is in progress\r\n if (!this.browserStorage.getInteractionInProgress()) {\r\n this.browserStorage.setInteractionInProgress(true);\r\n }\r\n await this.navigationClient.navigateExternal(logoutUri, navigationOptions);\r\n return;\r\n }\r\n } catch(e) {\r\n if (e instanceof AuthError) {\r\n (e as AuthError).setCorrelationId(this.correlationId);\r\n }\r\n serverTelemetryManager.cacheFailedRequest(e);\r\n this.eventHandler.emitEvent(EventType.LOGOUT_FAILURE, InteractionType.Redirect, null, e);\r\n this.eventHandler.emitEvent(EventType.LOGOUT_END, InteractionType.Redirect);\r\n throw e;\r\n }\r\n\r\n this.eventHandler.emitEvent(EventType.LOGOUT_END, InteractionType.Redirect);\r\n }\r\n\r\n /**\r\n * Use to get the redirectStartPage either from request or use current window\r\n * @param requestStartPage\r\n */\r\n protected getRedirectStartPage(requestStartPage?: string): string {\r\n const redirectStartPage = requestStartPage || window.location.href;\r\n return UrlString.getAbsoluteUrl(redirectStartPage, BrowserUtils.getCurrentUri());\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;;;;;;;;;;AAAA;;;;;IAsBoC,kCAAyB;IAGzD,wBAAY,MAA4B,EAAE,WAAgC,EAAE,aAAsB,EAAE,MAAc,EAAE,YAA0B,EAAE,gBAAmC,EAAE,iBAAqC,EAAE,iBAAsC,EAAE,oBAA2C,EAAE,aAAsB;QAAvU,YACI,kBAAM,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,EAAE,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,aAAa,CAAC,SAE5I;QADG,KAAI,CAAC,aAAa,GAAG,iBAAiB,CAAC;;KAC1C;;;;;IAMK,qCAAY,GAAlB,UAAmB,OAAwB;;;;;;;wBACvC,IAAI,CAAC,iBAAiB,CAAC,eAAe,CAAC,iBAAiB,CAAC,uDAAuD,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;wBACpH,qBAAM,IAAI,CAAC,8BAA8B,CAAC,OAAO,EAAE,eAAe,CAAC,QAAQ,CAAC,EAAA;;wBAA3F,YAAY,GAAG,SAA4E;wBACjG,IAAI,CAAC,cAAc,CAAC,kBAAkB,CAAC,YAAY,CAAC,KAAK,EAAE,YAAY,CAAC,KAAK,EAAE,YAAY,CAAC,SAAS,EAAE,YAAY,CAAC,SAAS,IAAI,SAAS,CAAC,YAAY,EAAE,YAAY,CAAC,OAAO,IAAI,IAAI,CAAC,CAAC;wBACjL,sBAAsB,GAAG,IAAI,CAAC,gCAAgC,CAAC,KAAK,CA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AY,CAAC,aAAa,EAAE,CAAC,CAAC;KACpF;IACL,qBAAC;AAAD,CApTA,CAAoC,yBAAyB;;;;"}
|
|
1
|
+
{"version":3,"file":"RedirectClient.js","sources":["../../src/interaction_client/RedirectClient.ts"],"sourcesContent":["/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { AuthenticationResult, CommonAuthorizationCodeRequest, AuthorizationCodeClient, UrlString, AuthError, ServerTelemetryManager, Constants, ProtocolUtils, ServerAuthorizationCodeResponse, ThrottlingUtils, ICrypto, Logger, IPerformanceClient, PerformanceEvents } from \"@azure/msal-common\";\r\nimport { StandardInteractionClient } from \"./StandardInteractionClient\";\r\nimport { ApiId, InteractionType, TemporaryCacheKeys } from \"../utils/BrowserConstants\";\r\nimport { RedirectHandler } from \"../interaction_handler/RedirectHandler\";\r\nimport { BrowserUtils } from \"../utils/BrowserUtils\";\r\nimport { EndSessionRequest } from \"../request/EndSessionRequest\";\r\nimport { EventType } from \"../event/EventType\";\r\nimport { NavigationOptions } from \"../navigation/NavigationOptions\";\r\nimport { BrowserAuthError } from \"../error/BrowserAuthError\";\r\nimport { RedirectRequest } from \"../request/RedirectRequest\";\r\nimport { NativeInteractionClient } from \"./NativeInteractionClient\";\r\nimport { NativeMessageHandler } from \"../broker/nativeBroker/NativeMessageHandler\";\r\nimport { BrowserConfiguration } from \"../config/Configuration\";\r\nimport { BrowserCacheManager } from \"../cache/BrowserCacheManager\";\r\nimport { EventHandler } from \"../event/EventHandler\";\r\nimport { INavigationClient } from \"../navigation/INavigationClient\";\r\n\r\nexport class RedirectClient extends StandardInteractionClient {\r\n protected nativeStorage: BrowserCacheManager;\r\n\r\n constructor(config: BrowserConfiguration, storageImpl: BrowserCacheManager, browserCrypto: ICrypto, logger: Logger, eventHandler: EventHandler, navigationClient: INavigationClient, performanceClient: IPerformanceClient, nativeStorageImpl: BrowserCacheManager, nativeMessageHandler?: NativeMessageHandler, correlationId?: string) {\r\n super(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, nativeMessageHandler, correlationId);\r\n this.nativeStorage = nativeStorageImpl;\r\n }\r\n\r\n /**\r\n * Redirects the page to the /authorize endpoint of the IDP\r\n * @param request\r\n */\r\n async acquireToken(request: RedirectRequest): Promise<void> {\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, request.correlationId);\r\n const validRequest = await this.initializeAuthorizationRequest(request, InteractionType.Redirect);\r\n this.browserStorage.updateCacheEntries(validRequest.state, validRequest.nonce, validRequest.authority, validRequest.loginHint || Constants.EMPTY_STRING, validRequest.account || null);\r\n const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenRedirect);\r\n\r\n const handleBackButton = (event: PageTransitionEvent) => {\r\n // Clear temporary cache if the back button is clicked during the redirect flow.\r\n if (event.persisted) {\r\n this.logger.verbose(\"Page was restored from back/forward cache. Clearing temporary cache.\");\r\n this.browserStorage.cleanRequestByState(validRequest.state);\r\n this.eventHandler.emitEvent(EventType.RESTORE_FROM_BFCACHE, InteractionType.Redirect);\r\n }\r\n };\r\n\r\n try {\r\n // Create auth code request and generate PKCE params\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientInitializeAuthorizationCodeRequest, request.correlationId);\r\n const authCodeRequest: CommonAuthorizationCodeRequest = await this.initializeAuthorizationCodeRequest(validRequest);\r\n\r\n // Initialize the client\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, request.correlationId);\r\n const authClient: AuthorizationCodeClient = await this.createAuthCodeClient(serverTelemetryManager, validRequest.authority, validRequest.azureCloudOptions);\r\n this.logger.verbose(\"Auth code client created\");\r\n\r\n // Create redirect interaction handler.\r\n const interactionHandler = new RedirectHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.browserCrypto, this.performanceClient);\r\n\r\n // Create acquire token url.\r\n const navigateUrl = await authClient.getAuthCodeUrl({\r\n ...validRequest,\r\n nativeBroker: NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeMessageHandler, request.authenticationScheme)\r\n });\r\n\r\n const redirectStartPage = this.getRedirectStartPage(request.redirectStartPage);\r\n this.logger.verbosePii(`Redirect start page: ${redirectStartPage}`);\r\n\r\n // Clear temporary cache if the back button is clicked during the redirect flow.\r\n window.addEventListener(\"pageshow\", handleBackButton);\r\n\r\n // Show the UI once the url has been created. Response will come back in the hash, which will be handled in the handleRedirectCallback function.\r\n return await interactionHandler.initiateAuthRequest(navigateUrl, {\r\n navigationClient: this.navigationClient,\r\n redirectTimeout: this.config.system.redirectNavigationTimeout,\r\n redirectStartPage: redirectStartPage,\r\n onRedirectNavigate: request.onRedirectNavigate\r\n });\r\n } catch (e) {\r\n if (e instanceof AuthError) {\r\n e.setCorrelationId(this.correlationId);\r\n }\r\n window.removeEventListener(\"pageshow\", handleBackButton);\r\n serverTelemetryManager.cacheFailedRequest(e);\r\n this.browserStorage.cleanRequestByState(validRequest.state);\r\n throw e;\r\n }\r\n }\r\n\r\n /**\r\n * Checks if navigateToLoginRequestUrl is set, and:\r\n * - if true, performs logic to cache and navigate\r\n * - if false, handles hash string and parses response\r\n * @param hash\r\n */\r\n async handleRedirectPromise(hash?: string): Promise<AuthenticationResult | null> {\r\n const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.handleRedirectPromise);\r\n try {\r\n if (!this.browserStorage.isInteractionInProgress(true)) {\r\n this.logger.info(\"handleRedirectPromise called but there is no interaction in progress, returning null.\");\r\n return null;\r\n }\r\n\r\n const responseHash = this.getRedirectResponseHash(hash || window.location.hash);\r\n if (!responseHash) {\r\n // Not a recognized server response hash or hash not associated with a redirect request\r\n this.logger.info(\"handleRedirectPromise did not detect a response hash as a result of a redirect. Cleaning temporary cache.\");\r\n this.browserStorage.cleanRequestByInteractionType(InteractionType.Redirect);\r\n return null;\r\n }\r\n\r\n let state: string;\r\n try {\r\n // Deserialize hash fragment response parameters.\r\n const serverParams: ServerAuthorizationCodeResponse = UrlString.getDeserializedHash(responseHash);\r\n state = this.validateAndExtractStateFromHash(serverParams, InteractionType.Redirect);\r\n this.logger.verbose(\"State extracted from hash\");\r\n } catch (e) {\r\n this.logger.info(`handleRedirectPromise was unable to extract state due to: ${e}`);\r\n this.browserStorage.cleanRequestByInteractionType(InteractionType.Redirect);\r\n return null;\r\n }\r\n\r\n // If navigateToLoginRequestUrl is true, get the url where the redirect request was initiated\r\n const loginRequestUrl = this.browserStorage.getTemporaryCache(TemporaryCacheKeys.ORIGIN_URI, true) || Constants.EMPTY_STRING;\r\n const loginRequestUrlNormalized = UrlString.removeHashFromUrl(loginRequestUrl);\r\n const currentUrlNormalized = UrlString.removeHashFromUrl(window.location.href);\r\n\r\n if (loginRequestUrlNormalized === currentUrlNormalized && this.config.auth.navigateToLoginRequestUrl) {\r\n // We are on the page we need to navigate to - handle hash\r\n this.logger.verbose(\"Current page is loginRequestUrl, handling hash\");\r\n const handleHashResult = await this.handleHash(responseHash, state, serverTelemetryManager);\r\n\r\n if (loginRequestUrl.indexOf(\"#\") > -1) {\r\n // Replace current hash with non-msal hash, if present\r\n BrowserUtils.replaceHash(loginRequestUrl);\r\n }\r\n\r\n return handleHashResult;\r\n } else if (!this.config.auth.navigateToLoginRequestUrl) {\r\n this.logger.verbose(\"NavigateToLoginRequestUrl set to false, handling hash\");\r\n return this.handleHash(responseHash, state, serverTelemetryManager);\r\n } else if (!BrowserUtils.isInIframe() || this.config.system.allowRedirectInIframe) {\r\n /*\r\n * Returned from authority using redirect - need to perform navigation before processing response\r\n * Cache the hash to be retrieved after the next redirect\r\n */\r\n this.browserStorage.setTemporaryCache(TemporaryCacheKeys.URL_HASH, responseHash, true);\r\n const navigationOptions: NavigationOptions = {\r\n apiId: ApiId.handleRedirectPromise,\r\n timeout: this.config.system.redirectNavigationTimeout,\r\n noHistory: true\r\n };\r\n\r\n /**\r\n * Default behavior is to redirect to the start page and not process the hash now.\r\n * The start page is expected to also call handleRedirectPromise which will process the hash in one of the checks above.\r\n */\r\n let processHashOnRedirect: boolean = true;\r\n if (!loginRequestUrl || loginRequestUrl === \"null\") {\r\n // Redirect to home page if login request url is null (real null or the string null)\r\n const homepage = BrowserUtils.getHomepage();\r\n // Cache the homepage under ORIGIN_URI to ensure cached hash is processed on homepage\r\n this.browserStorage.setTemporaryCache(TemporaryCacheKeys.ORIGIN_URI, homepage, true);\r\n this.logger.warning(\"Unable to get valid login request url from cache, redirecting to home page\");\r\n processHashOnRedirect = await this.navigationClient.navigateInternal(homepage, navigationOptions);\r\n } else {\r\n // Navigate to page that initiated the redirect request\r\n this.logger.verbose(`Navigating to loginRequestUrl: ${loginRequestUrl}`);\r\n processHashOnRedirect = await this.navigationClient.navigateInternal(loginRequestUrl, navigationOptions);\r\n }\r\n\r\n // If navigateInternal implementation returns false, handle the hash now\r\n if (!processHashOnRedirect) {\r\n return this.handleHash(responseHash, state, serverTelemetryManager);\r\n }\r\n }\r\n\r\n return null;\r\n } catch (e) {\r\n if (e instanceof AuthError) {\r\n (e as AuthError).setCorrelationId(this.correlationId);\r\n }\r\n serverTelemetryManager.cacheFailedRequest(e);\r\n this.browserStorage.cleanRequestByInteractionType(InteractionType.Redirect);\r\n throw e;\r\n }\r\n }\r\n\r\n /**\r\n * Gets the response hash for a redirect request\r\n * Returns null if interactionType in the state value is not \"redirect\" or the hash does not contain known properties\r\n * @param hash\r\n */\r\n protected getRedirectResponseHash(hash: string): string | null {\r\n this.logger.verbose(\"getRedirectResponseHash called\");\r\n // Get current location hash from window or cache.\r\n const isResponseHash: boolean = UrlString.hashContainsKnownProperties(hash);\r\n\r\n if (isResponseHash) {\r\n BrowserUtils.clearHash(window);\r\n this.logger.verbose(\"Hash contains known properties, returning response hash\");\r\n return hash;\r\n }\r\n\r\n const cachedHash = this.browserStorage.getTemporaryCache(TemporaryCacheKeys.URL_HASH, true);\r\n this.browserStorage.removeItem(this.browserStorage.generateCacheKey(TemporaryCacheKeys.URL_HASH));\r\n\r\n this.logger.verbose(\"Hash does not contain known properties, returning cached hash\");\r\n return cachedHash;\r\n }\r\n\r\n /**\r\n * Checks if hash exists and handles in window.\r\n * @param hash\r\n * @param state\r\n */\r\n protected async handleHash(hash: string, state: string, serverTelemetryManager: ServerTelemetryManager): Promise<AuthenticationResult> {\r\n const cachedRequest = this.browserStorage.getCachedRequest(state, this.browserCrypto);\r\n this.logger.verbose(\"handleHash called, retrieved cached request\");\r\n\r\n const serverParams: ServerAuthorizationCodeResponse = UrlString.getDeserializedHash(hash);\r\n\r\n if (serverParams.accountId) {\r\n this.logger.verbose(\"Account id found in hash, calling WAM for token\");\r\n if (!this.nativeMessageHandler) {\r\n throw BrowserAuthError.createNativeConnectionNotEstablishedError();\r\n }\r\n const nativeInteractionClient = new NativeInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.acquireTokenPopup, this.performanceClient, this.nativeMessageHandler, serverParams.accountId, this.nativeStorage, cachedRequest.correlationId);\r\n const { userRequestState } = ProtocolUtils.parseRequestState(this.browserCrypto, state);\r\n return nativeInteractionClient.acquireToken({\r\n ...cachedRequest,\r\n state: userRequestState,\r\n prompt: undefined // Server should handle the prompt, ideally native broker can do this part silently\r\n }).finally(() => {\r\n this.browserStorage.cleanRequestByState(state);\r\n });\r\n }\r\n\r\n // Hash contains known properties - handle and return in callback\r\n const currentAuthority = this.browserStorage.getCachedAuthority(state);\r\n if (!currentAuthority) {\r\n throw BrowserAuthError.createNoCachedAuthorityError();\r\n }\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, cachedRequest.correlationId);\r\n const authClient = await this.createAuthCodeClient(serverTelemetryManager, currentAuthority);\r\n this.logger.verbose(\"Auth code client created\");\r\n ThrottlingUtils.removeThrottle(this.browserStorage, this.config.auth.clientId, cachedRequest);\r\n const interactionHandler = new RedirectHandler(authClient, this.browserStorage, cachedRequest, this.logger, this.browserCrypto, this.performanceClient);\r\n return await interactionHandler.handleCodeResponseFromHash(hash, state, authClient.authority, this.networkClient);\r\n }\r\n\r\n /**\r\n * Use to log out the current user, and redirect the user to the postLogoutRedirectUri.\r\n * Default behaviour is to redirect the user to `window.location.href`.\r\n * @param logoutRequest\r\n */\r\n async logout(logoutRequest?: EndSessionRequest): Promise<void> {\r\n this.logger.verbose(\"logoutRedirect called\");\r\n const validLogoutRequest = this.initializeLogoutRequest(logoutRequest);\r\n const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.logout);\r\n\r\n try {\r\n this.eventHandler.emitEvent(EventType.LOGOUT_START, InteractionType.Redirect, logoutRequest);\r\n\r\n // Clear cache on logout\r\n await this.clearCacheOnLogout(validLogoutRequest.account);\r\n\r\n const navigationOptions: NavigationOptions = {\r\n apiId: ApiId.logout,\r\n timeout: this.config.system.redirectNavigationTimeout,\r\n noHistory: false\r\n };\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, validLogoutRequest.correlationId);\r\n const authClient = await this.createAuthCodeClient(serverTelemetryManager, logoutRequest && logoutRequest.authority);\r\n this.logger.verbose(\"Auth code client created\");\r\n\r\n // Create logout string and navigate user window to logout.\r\n const logoutUri: string = authClient.getLogoutUri(validLogoutRequest);\r\n\r\n this.eventHandler.emitEvent(EventType.LOGOUT_SUCCESS, InteractionType.Redirect, validLogoutRequest);\r\n // Check if onRedirectNavigate is implemented, and invoke it if so\r\n if (logoutRequest && typeof logoutRequest.onRedirectNavigate === \"function\") {\r\n const navigate = logoutRequest.onRedirectNavigate(logoutUri);\r\n\r\n if (navigate !== false) {\r\n this.logger.verbose(\"Logout onRedirectNavigate did not return false, navigating\");\r\n // Ensure interaction is in progress\r\n if (!this.browserStorage.getInteractionInProgress()) {\r\n this.browserStorage.setInteractionInProgress(true);\r\n }\r\n await this.navigationClient.navigateExternal(logoutUri, navigationOptions);\r\n return;\r\n } else {\r\n // Ensure interaction is not in progress\r\n this.browserStorage.setInteractionInProgress(false);\r\n this.logger.verbose(\"Logout onRedirectNavigate returned false, stopping navigation\");\r\n }\r\n } else {\r\n // Ensure interaction is in progress\r\n if (!this.browserStorage.getInteractionInProgress()) {\r\n this.browserStorage.setInteractionInProgress(true);\r\n }\r\n await this.navigationClient.navigateExternal(logoutUri, navigationOptions);\r\n return;\r\n }\r\n } catch(e) {\r\n if (e instanceof AuthError) {\r\n (e as AuthError).setCorrelationId(this.correlationId);\r\n }\r\n serverTelemetryManager.cacheFailedRequest(e);\r\n this.eventHandler.emitEvent(EventType.LOGOUT_FAILURE, InteractionType.Redirect, null, e);\r\n this.eventHandler.emitEvent(EventType.LOGOUT_END, InteractionType.Redirect);\r\n throw e;\r\n }\r\n\r\n this.eventHandler.emitEvent(EventType.LOGOUT_END, InteractionType.Redirect);\r\n }\r\n\r\n /**\r\n * Use to get the redirectStartPage either from request or use current window\r\n * @param requestStartPage\r\n */\r\n protected getRedirectStartPage(requestStartPage?: string): string {\r\n const redirectStartPage = requestStartPage || window.location.href;\r\n return UrlString.getAbsoluteUrl(redirectStartPage, BrowserUtils.getCurrentUri());\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;;;;;;;;;;AAAA;;;AAGG;AAmBH,IAAA,cAAA,kBAAA,UAAA,MAAA,EAAA;IAAoC,SAAyB,CAAA,cAAA,EAAA,MAAA,CAAA,CAAA;AAGzD,IAAA,SAAA,cAAA,CAAY,MAA4B,EAAE,WAAgC,EAAE,aAAsB,EAAE,MAAc,EAAE,YAA0B,EAAE,gBAAmC,EAAE,iBAAqC,EAAE,iBAAsC,EAAE,oBAA2C,EAAE,aAAsB,EAAA;AAAvU,QAAA,IAAA,KAAA,GACI,kBAAM,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,EAAE,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,aAAa,CAAC,IAE5I,IAAA,CAAA;AADG,QAAA,KAAI,CAAC,aAAa,GAAG,iBAAiB,CAAC;;KAC1C;AAED;;;AAGG;IACG,c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C;;AAGZ,wBAAA,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,SAAS,CAAC,UAAU,EAAE,eAAe,CAAC,QAAQ,CAAC,CAAC;;;;;AAC/E,KAAA,CAAA;AAED;;;AAGG;IACO,cAAoB,CAAA,SAAA,CAAA,oBAAA,GAA9B,UAA+B,gBAAyB,EAAA;QACpD,IAAM,iBAAiB,GAAG,gBAAgB,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;QACnE,OAAO,SAAS,CAAC,cAAc,CAAC,iBAAiB,EAAE,YAAY,CAAC,aAAa,EAAE,CAAC,CAAC;KACpF,CAAA;IACL,OAAC,cAAA,CAAA;AAAD,CApTA,CAAoC,yBAAyB,CAoT5D;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-browser v2.
|
|
1
|
+
/*! @azure/msal-browser v2.39.0 2024-06-06 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { __extends, __awaiter, __generator, __assign } from '../_virtual/_tslib.js';
|
|
4
4
|
import { AuthError, PerformanceEvents, Constants } from '@azure/msal-common';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SilentAuthCodeClient.js","sources":["../../src/interaction_client/SilentAuthCodeClient.ts"],"sourcesContent":["/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { AuthenticationResult, ICrypto, Logger, CommonAuthorizationCodeRequest, AuthError, Constants, IPerformanceClient, PerformanceEvents } from \"@azure/msal-common\";\r\nimport { StandardInteractionClient } from \"./StandardInteractionClient\";\r\nimport { AuthorizationUrlRequest } from \"../request/AuthorizationUrlRequest\";\r\nimport { BrowserConfiguration } from \"../config/Configuration\";\r\nimport { BrowserCacheManager } from \"../cache/BrowserCacheManager\";\r\nimport { EventHandler } from \"../event/EventHandler\";\r\nimport { INavigationClient } from \"../navigation/INavigationClient\";\r\nimport { BrowserAuthError } from \"../error/BrowserAuthError\";\r\nimport { InteractionType, ApiId } from \"../utils/BrowserConstants\";\r\nimport { SilentHandler } from \"../interaction_handler/SilentHandler\";\r\nimport { AuthorizationCodeRequest } from \"../request/AuthorizationCodeRequest\";\r\nimport { HybridSpaAuthorizationCodeClient } from \"./HybridSpaAuthorizationCodeClient\";\r\nimport { NativeMessageHandler } from \"../broker/nativeBroker/NativeMessageHandler\";\r\n\r\nexport class SilentAuthCodeClient extends StandardInteractionClient {\r\n private apiId: ApiId;\r\n\r\n constructor(config: BrowserConfiguration, storageImpl: BrowserCacheManager, browserCrypto: ICrypto, logger: Logger, eventHandler: EventHandler, navigationClient: INavigationClient, apiId: ApiId, performanceClient: IPerformanceClient, nativeMessageHandler?: NativeMessageHandler, correlationId?: string) {\r\n super(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, nativeMessageHandler, correlationId);\r\n this.apiId = apiId;\r\n }\r\n\r\n /**\r\n * Acquires a token silently by redeeming an authorization code against the /token endpoint\r\n * @param request\r\n */\r\n async acquireToken(request: AuthorizationCodeRequest): Promise<AuthenticationResult> {\r\n this.logger.trace(\"SilentAuthCodeClient.acquireToken called\");\r\n\r\n // Auth code payload is required\r\n if (!request.code) {\r\n throw BrowserAuthError.createAuthCodeRequiredError();\r\n\r\n }\r\n\r\n // Create silent request\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, request.correlationId);\r\n const silentRequest: AuthorizationUrlRequest = await this.initializeAuthorizationRequest(request, InteractionType.Silent);\r\n this.browserStorage.updateCacheEntries(silentRequest.state, silentRequest.nonce, silentRequest.authority, silentRequest.loginHint || Constants.EMPTY_STRING, silentRequest.account || null);\r\n\r\n const serverTelemetryManager = this.initializeServerTelemetryManager(this.apiId);\r\n\r\n try {\r\n\r\n // Create auth code request (PKCE not needed)\r\n const authCodeRequest: CommonAuthorizationCodeRequest = {\r\n ...silentRequest,\r\n code: request.code\r\n };\r\n\r\n // Initialize the client\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientGetClientConfiguration, request.correlationId);\r\n const clientConfig = await this.getClientConfiguration(serverTelemetryManager, silentRequest.authority);\r\n const authClient: HybridSpaAuthorizationCodeClient = new HybridSpaAuthorizationCodeClient(clientConfig);\r\n this.logger.verbose(\"Auth code client created\");\r\n\r\n // Create silent handler\r\n const silentHandler = new SilentHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.config.system, this.performanceClient);\r\n\r\n // Handle auth code parameters from request\r\n return silentHandler.handleCodeResponseFromServer(\r\n {\r\n code: request.code,\r\n msgraph_host: request.msGraphHost,\r\n cloud_graph_host_name: request.cloudGraphHostName,\r\n cloud_instance_host_name: request.cloudInstanceHostName\r\n },\r\n silentRequest.state,\r\n authClient.authority,\r\n this.networkClient,\r\n false\r\n );\r\n } catch (e) {\r\n if (e instanceof AuthError) {\r\n (e as AuthError).setCorrelationId(this.correlationId);\r\n }\r\n serverTelemetryManager.cacheFailedRequest(e);\r\n this.browserStorage.cleanRequestByState(silentRequest.state);\r\n throw e;\r\n }\r\n }\r\n\r\n /**\r\n * Currently Unsupported\r\n */\r\n logout(): Promise<void> {\r\n // Synchronous so we must reject\r\n return Promise.reject(BrowserAuthError.createSilentLogoutUnsupportedError());\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;;;;;;;AAAA
|
|
1
|
+
{"version":3,"file":"SilentAuthCodeClient.js","sources":["../../src/interaction_client/SilentAuthCodeClient.ts"],"sourcesContent":["/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { AuthenticationResult, ICrypto, Logger, CommonAuthorizationCodeRequest, AuthError, Constants, IPerformanceClient, PerformanceEvents } from \"@azure/msal-common\";\r\nimport { StandardInteractionClient } from \"./StandardInteractionClient\";\r\nimport { AuthorizationUrlRequest } from \"../request/AuthorizationUrlRequest\";\r\nimport { BrowserConfiguration } from \"../config/Configuration\";\r\nimport { BrowserCacheManager } from \"../cache/BrowserCacheManager\";\r\nimport { EventHandler } from \"../event/EventHandler\";\r\nimport { INavigationClient } from \"../navigation/INavigationClient\";\r\nimport { BrowserAuthError } from \"../error/BrowserAuthError\";\r\nimport { InteractionType, ApiId } from \"../utils/BrowserConstants\";\r\nimport { SilentHandler } from \"../interaction_handler/SilentHandler\";\r\nimport { AuthorizationCodeRequest } from \"../request/AuthorizationCodeRequest\";\r\nimport { HybridSpaAuthorizationCodeClient } from \"./HybridSpaAuthorizationCodeClient\";\r\nimport { NativeMessageHandler } from \"../broker/nativeBroker/NativeMessageHandler\";\r\n\r\nexport class SilentAuthCodeClient extends StandardInteractionClient {\r\n private apiId: ApiId;\r\n\r\n constructor(config: BrowserConfiguration, storageImpl: BrowserCacheManager, browserCrypto: ICrypto, logger: Logger, eventHandler: EventHandler, navigationClient: INavigationClient, apiId: ApiId, performanceClient: IPerformanceClient, nativeMessageHandler?: NativeMessageHandler, correlationId?: string) {\r\n super(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, nativeMessageHandler, correlationId);\r\n this.apiId = apiId;\r\n }\r\n\r\n /**\r\n * Acquires a token silently by redeeming an authorization code against the /token endpoint\r\n * @param request\r\n */\r\n async acquireToken(request: AuthorizationCodeRequest): Promise<AuthenticationResult> {\r\n this.logger.trace(\"SilentAuthCodeClient.acquireToken called\");\r\n\r\n // Auth code payload is required\r\n if (!request.code) {\r\n throw BrowserAuthError.createAuthCodeRequiredError();\r\n\r\n }\r\n\r\n // Create silent request\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, request.correlationId);\r\n const silentRequest: AuthorizationUrlRequest = await this.initializeAuthorizationRequest(request, InteractionType.Silent);\r\n this.browserStorage.updateCacheEntries(silentRequest.state, silentRequest.nonce, silentRequest.authority, silentRequest.loginHint || Constants.EMPTY_STRING, silentRequest.account || null);\r\n\r\n const serverTelemetryManager = this.initializeServerTelemetryManager(this.apiId);\r\n\r\n try {\r\n\r\n // Create auth code request (PKCE not needed)\r\n const authCodeRequest: CommonAuthorizationCodeRequest = {\r\n ...silentRequest,\r\n code: request.code\r\n };\r\n\r\n // Initialize the client\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientGetClientConfiguration, request.correlationId);\r\n const clientConfig = await this.getClientConfiguration(serverTelemetryManager, silentRequest.authority);\r\n const authClient: HybridSpaAuthorizationCodeClient = new HybridSpaAuthorizationCodeClient(clientConfig);\r\n this.logger.verbose(\"Auth code client created\");\r\n\r\n // Create silent handler\r\n const silentHandler = new SilentHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.config.system, this.performanceClient);\r\n\r\n // Handle auth code parameters from request\r\n return silentHandler.handleCodeResponseFromServer(\r\n {\r\n code: request.code,\r\n msgraph_host: request.msGraphHost,\r\n cloud_graph_host_name: request.cloudGraphHostName,\r\n cloud_instance_host_name: request.cloudInstanceHostName\r\n },\r\n silentRequest.state,\r\n authClient.authority,\r\n this.networkClient,\r\n false\r\n );\r\n } catch (e) {\r\n if (e instanceof AuthError) {\r\n (e as AuthError).setCorrelationId(this.correlationId);\r\n }\r\n serverTelemetryManager.cacheFailedRequest(e);\r\n this.browserStorage.cleanRequestByState(silentRequest.state);\r\n throw e;\r\n }\r\n }\r\n\r\n /**\r\n * Currently Unsupported\r\n */\r\n logout(): Promise<void> {\r\n // Synchronous so we must reject\r\n return Promise.reject(BrowserAuthError.createSilentLogoutUnsupportedError());\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;;;;;;;AAAA;;;AAGG;AAgBH,IAAA,oBAAA,kBAAA,UAAA,MAAA,EAAA;IAA0C,SAAyB,CAAA,oBAAA,EAAA,MAAA,CAAA,CAAA;AAG/D,IAAA,SAAA,oBAAA,CAAY,MAA4B,EAAE,WAAgC,EAAE,aAAsB,EAAE,MAAc,EAAE,YAA0B,EAAE,gBAAmC,EAAE,KAAY,EAAE,iBAAqC,EAAE,oBAA2C,EAAE,aAAsB,EAAA;AAA7S,QAAA,IAAA,KAAA,GACI,kB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,GAAN,YAAA;;QAEI,OAAO,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAC,kCAAkC,EAAE,CAAC,CAAC;KAChF,CAAA;IACL,OAAC,oBAAA,CAAA;AAAD,CA3EA,CAA0C,yBAAyB,CA2ElE;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-browser v2.
|
|
1
|
+
/*! @azure/msal-browser v2.39.0 2024-06-06 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { __extends, __awaiter, __generator, __assign } from '../_virtual/_tslib.js';
|
|
4
4
|
import { StandardInteractionClient } from './StandardInteractionClient.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SilentCacheClient.js","sources":["../../src/interaction_client/SilentCacheClient.ts"],"sourcesContent":["/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { StandardInteractionClient } from \"./StandardInteractionClient\";\r\nimport { CommonSilentFlowRequest, AuthenticationResult, SilentFlowClient, ServerTelemetryManager, AccountInfo, AzureCloudOptions, PerformanceEvents, AuthError } from \"@azure/msal-common\";\r\nimport { SilentRequest } from \"../request/SilentRequest\";\r\nimport { ApiId } from \"../utils/BrowserConstants\";\r\nimport { BrowserAuthError, BrowserAuthErrorMessage } from \"../error/BrowserAuthError\";\r\n\r\nexport class SilentCacheClient extends StandardInteractionClient {\r\n /**\r\n * Returns unexpired tokens from the cache, if available\r\n * @param silentRequest\r\n */\r\n async acquireToken(silentRequest: CommonSilentFlowRequest): Promise<AuthenticationResult> {\r\n const acquireTokenMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.SilentCacheClientAcquireToken, silentRequest.correlationId);\r\n // Telemetry manager only used to increment cacheHits here\r\n const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenSilent_silentFlow);\r\n\r\n const silentAuthClient = await this.createSilentFlowClient(serverTelemetryManager, silentRequest.authority, silentRequest.azureCloudOptions);\r\n this.logger.verbose(\"Silent auth client created\");\r\n\r\n try {\r\n const cachedToken = await silentAuthClient.acquireCachedToken(silentRequest);\r\n\r\n acquireTokenMeasurement.endMeasurement({\r\n success: true,\r\n fromCache: true\r\n });\r\n return cachedToken;\r\n } catch (error) {\r\n if (error instanceof BrowserAuthError && error.errorCode === BrowserAuthErrorMessage.signingKeyNotFoundInStorage.code) {\r\n this.logger.verbose(\"Signing keypair for bound access token not found. Refreshing bound access token and generating a new crypto keypair.\");\r\n }\r\n acquireTokenMeasurement.endMeasurement({\r\n errorCode: error instanceof AuthError && error.errorCode || undefined,\r\n subErrorCode: error instanceof AuthError && error.subError || undefined,\r\n success: false\r\n });\r\n throw error;\r\n }\r\n }\r\n\r\n /**\r\n * Currently Unsupported\r\n */\r\n logout(): Promise<void> {\r\n // Synchronous so we must reject\r\n return Promise.reject(BrowserAuthError.createSilentLogoutUnsupportedError());\r\n }\r\n\r\n /**\r\n * Creates an Silent Flow Client with the given authority, or the default authority.\r\n * @param serverTelemetryManager\r\n * @param authorityUrl\r\n */\r\n protected async createSilentFlowClient(serverTelemetryManager: ServerTelemetryManager, authorityUrl?: string, azureCloudOptions?: AzureCloudOptions): Promise<SilentFlowClient> {\r\n // Create auth module.\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientGetClientConfiguration, this.correlationId);\r\n const clientConfig = await this.getClientConfiguration(serverTelemetryManager, authorityUrl, azureCloudOptions);\r\n return new SilentFlowClient(clientConfig, this.performanceClient);\r\n }\r\n\r\n async initializeSilentRequest(request: SilentRequest, account: AccountInfo): Promise<CommonSilentFlowRequest> {\r\n this.performanceClient.addQueueMeasurement(PerformanceEvents.InitializeSilentRequest, this.correlationId);\r\n\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.InitializeBaseRequest, this.correlationId);\r\n return {\r\n ...request,\r\n ...await this.initializeBaseRequest(request, account),\r\n account: account,\r\n forceRefresh: request.forceRefresh || false\r\n };\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;;;;;AAAA
|
|
1
|
+
{"version":3,"file":"SilentCacheClient.js","sources":["../../src/interaction_client/SilentCacheClient.ts"],"sourcesContent":["/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { StandardInteractionClient } from \"./StandardInteractionClient\";\r\nimport { CommonSilentFlowRequest, AuthenticationResult, SilentFlowClient, ServerTelemetryManager, AccountInfo, AzureCloudOptions, PerformanceEvents, AuthError } from \"@azure/msal-common\";\r\nimport { SilentRequest } from \"../request/SilentRequest\";\r\nimport { ApiId } from \"../utils/BrowserConstants\";\r\nimport { BrowserAuthError, BrowserAuthErrorMessage } from \"../error/BrowserAuthError\";\r\n\r\nexport class SilentCacheClient extends StandardInteractionClient {\r\n /**\r\n * Returns unexpired tokens from the cache, if available\r\n * @param silentRequest\r\n */\r\n async acquireToken(silentRequest: CommonSilentFlowRequest): Promise<AuthenticationResult> {\r\n const acquireTokenMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.SilentCacheClientAcquireToken, silentRequest.correlationId);\r\n // Telemetry manager only used to increment cacheHits here\r\n const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenSilent_silentFlow);\r\n\r\n const silentAuthClient = await this.createSilentFlowClient(serverTelemetryManager, silentRequest.authority, silentRequest.azureCloudOptions);\r\n this.logger.verbose(\"Silent auth client created\");\r\n\r\n try {\r\n const cachedToken = await silentAuthClient.acquireCachedToken(silentRequest);\r\n\r\n acquireTokenMeasurement.endMeasurement({\r\n success: true,\r\n fromCache: true\r\n });\r\n return cachedToken;\r\n } catch (error) {\r\n if (error instanceof BrowserAuthError && error.errorCode === BrowserAuthErrorMessage.signingKeyNotFoundInStorage.code) {\r\n this.logger.verbose(\"Signing keypair for bound access token not found. Refreshing bound access token and generating a new crypto keypair.\");\r\n }\r\n acquireTokenMeasurement.endMeasurement({\r\n errorCode: error instanceof AuthError && error.errorCode || undefined,\r\n subErrorCode: error instanceof AuthError && error.subError || undefined,\r\n success: false\r\n });\r\n throw error;\r\n }\r\n }\r\n\r\n /**\r\n * Currently Unsupported\r\n */\r\n logout(): Promise<void> {\r\n // Synchronous so we must reject\r\n return Promise.reject(BrowserAuthError.createSilentLogoutUnsupportedError());\r\n }\r\n\r\n /**\r\n * Creates an Silent Flow Client with the given authority, or the default authority.\r\n * @param serverTelemetryManager\r\n * @param authorityUrl\r\n */\r\n protected async createSilentFlowClient(serverTelemetryManager: ServerTelemetryManager, authorityUrl?: string, azureCloudOptions?: AzureCloudOptions): Promise<SilentFlowClient> {\r\n // Create auth module.\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientGetClientConfiguration, this.correlationId);\r\n const clientConfig = await this.getClientConfiguration(serverTelemetryManager, authorityUrl, azureCloudOptions);\r\n return new SilentFlowClient(clientConfig, this.performanceClient);\r\n }\r\n\r\n async initializeSilentRequest(request: SilentRequest, account: AccountInfo): Promise<CommonSilentFlowRequest> {\r\n this.performanceClient.addQueueMeasurement(PerformanceEvents.InitializeSilentRequest, this.correlationId);\r\n\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.InitializeBaseRequest, this.correlationId);\r\n return {\r\n ...request,\r\n ...await this.initializeBaseRequest(request, account),\r\n account: account,\r\n forceRefresh: request.forceRefresh || false\r\n };\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;;;;;AAAA;;;AAGG;AAQH,IAAA,iBAAA,kBAAA,UAAA,MAAA,EAAA;IAAuC,SAAyB,CAAA,iBAAA,EAAA,MAAA,CAAA,CAAA;AAAhE,IAAA,SAAA,iBAAA,GAAA;;KAiEC;AAhEG;;;AAGG;IACG,iBAAY,CAAA,SAAA,CAAA,YAAA,GAAlB,UAAmB,aAAsC,EAAA;;;;;;AAC/C,wBAAA,uBAAuB,GAAG,IAAI,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,6BAA6B,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC;wBAEhJ,sBAAsB,GAAG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D,CAAA,IAAA,EAAA,CAAA,CAAA,CAAA,EAAA,EACrD,OAAO,EAAE,OAAO,EAChB,YAAY,EAAE,OAAO,CAAC,YAAY,IAAI,KAAK,EAC7C,CAAA,CAAA,CAAA,CAAA;;;;AACL,KAAA,CAAA;IACL,OAAC,iBAAA,CAAA;AAAD,CAjEA,CAAuC,yBAAyB,CAiE/D;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-browser v2.
|
|
1
|
+
/*! @azure/msal-browser v2.39.0 2024-06-06 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { __extends, __awaiter, __generator, __assign } from '../_virtual/_tslib.js';
|
|
4
4
|
import { AuthError, PerformanceEvents, Constants, StringUtils, PromptValue, UrlString, ProtocolUtils } from '@azure/msal-common';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SilentIframeClient.js","sources":["../../src/interaction_client/SilentIframeClient.ts"],"sourcesContent":["/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { AuthenticationResult, ICrypto, Logger, StringUtils, PromptValue, CommonAuthorizationCodeRequest, AuthorizationCodeClient, AuthError, Constants, UrlString, ServerAuthorizationCodeResponse, ProtocolUtils, IPerformanceClient, PerformanceEvents } from \"@azure/msal-common\";\r\nimport { StandardInteractionClient } from \"./StandardInteractionClient\";\r\nimport { AuthorizationUrlRequest } from \"../request/AuthorizationUrlRequest\";\r\nimport { BrowserConfiguration } from \"../config/Configuration\";\r\nimport { BrowserCacheManager } from \"../cache/BrowserCacheManager\";\r\nimport { EventHandler } from \"../event/EventHandler\";\r\nimport { INavigationClient } from \"../navigation/INavigationClient\";\r\nimport { BrowserAuthError } from \"../error/BrowserAuthError\";\r\nimport { InteractionType, ApiId } from \"../utils/BrowserConstants\";\r\nimport { SilentHandler } from \"../interaction_handler/SilentHandler\";\r\nimport { SsoSilentRequest } from \"../request/SsoSilentRequest\";\r\nimport { NativeMessageHandler } from \"../broker/nativeBroker/NativeMessageHandler\";\r\nimport { NativeInteractionClient } from \"./NativeInteractionClient\";\r\n\r\nexport class SilentIframeClient extends StandardInteractionClient {\r\n protected apiId: ApiId;\r\n protected nativeStorage: BrowserCacheManager;\r\n\r\n constructor(config: BrowserConfiguration, storageImpl: BrowserCacheManager, browserCrypto: ICrypto, logger: Logger, eventHandler: EventHandler, navigationClient: INavigationClient, apiId: ApiId, performanceClient: IPerformanceClient, nativeStorageImpl: BrowserCacheManager, nativeMessageHandler?: NativeMessageHandler, correlationId?: string) {\r\n super(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, nativeMessageHandler, correlationId);\r\n this.apiId = apiId;\r\n this.nativeStorage = nativeStorageImpl;\r\n }\r\n\r\n /**\r\n * Acquires a token silently by opening a hidden iframe to the /authorize endpoint with prompt=none or prompt=no_session\r\n * @param request\r\n */\r\n async acquireToken(request: SsoSilentRequest): Promise<AuthenticationResult> {\r\n this.performanceClient.addQueueMeasurement(PerformanceEvents.SilentIframeClientAcquireToken, request.correlationId);\r\n this.logger.verbose(\"acquireTokenByIframe called\");\r\n const acquireTokenMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.SilentIframeClientAcquireToken, request.correlationId);\r\n // Check that we have some SSO data\r\n if (StringUtils.isEmpty(request.loginHint) && StringUtils.isEmpty(request.sid) && (!request.account || StringUtils.isEmpty(request.account.username))) {\r\n this.logger.warning(\"No user hint provided. The authorization server may need more information to complete this request.\");\r\n }\r\n\r\n // Check that prompt is set to none or no_session, throw error if it is set to anything else.\r\n if (request.prompt && (request.prompt !== PromptValue.NONE) && (request.prompt !== PromptValue.NO_SESSION)) {\r\n acquireTokenMeasurement.endMeasurement({\r\n success: false\r\n });\r\n throw BrowserAuthError.createSilentPromptValueError(request.prompt);\r\n }\r\n\r\n // Create silent request\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, request.correlationId);\r\n const silentRequest: AuthorizationUrlRequest = await this.initializeAuthorizationRequest({\r\n ...request,\r\n prompt: request.prompt || PromptValue.NONE\r\n }, InteractionType.Silent);\r\n this.browserStorage.updateCacheEntries(silentRequest.state, silentRequest.nonce, silentRequest.authority, silentRequest.loginHint || Constants.EMPTY_STRING, silentRequest.account || null);\r\n\r\n const serverTelemetryManager = this.initializeServerTelemetryManager(this.apiId);\r\n\r\n try {\r\n // Initialize the client\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, request.correlationId);\r\n const authClient: AuthorizationCodeClient = await this.createAuthCodeClient(serverTelemetryManager, silentRequest.authority, silentRequest.azureCloudOptions);\r\n this.logger.verbose(\"Auth code client created\");\r\n\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.SilentIframeClientTokenHelper, request.correlationId);\r\n return await this.silentTokenHelper(authClient, silentRequest).then((result: AuthenticationResult) => {\r\n acquireTokenMeasurement.endMeasurement({\r\n success: true,\r\n fromCache: false,\r\n requestId: result.requestId\r\n });\r\n return result;\r\n });\r\n } catch (e) {\r\n if (e instanceof AuthError) {\r\n (e as AuthError).setCorrelationId(this.correlationId);\r\n }\r\n serverTelemetryManager.cacheFailedRequest(e);\r\n this.browserStorage.cleanRequestByState(silentRequest.state);\r\n acquireTokenMeasurement.endMeasurement({\r\n errorCode: e instanceof AuthError && e.errorCode || undefined,\r\n subErrorCode: e instanceof AuthError && e.subError || undefined,\r\n success: false\r\n });\r\n throw e;\r\n }\r\n }\r\n\r\n /**\r\n * Currently Unsupported\r\n */\r\n logout(): Promise<void> {\r\n // Synchronous so we must reject\r\n return Promise.reject(BrowserAuthError.createSilentLogoutUnsupportedError());\r\n }\r\n\r\n /**\r\n * Helper which acquires an authorization code silently using a hidden iframe from given url\r\n * using the scopes requested as part of the id, and exchanges the code for a set of OAuth tokens.\r\n * @param navigateUrl\r\n * @param userRequestScopes\r\n */\r\n protected async silentTokenHelper(authClient: AuthorizationCodeClient, silentRequest: AuthorizationUrlRequest): Promise<AuthenticationResult> {\r\n this.performanceClient.addQueueMeasurement(PerformanceEvents.SilentIframeClientTokenHelper, silentRequest.correlationId);\r\n\r\n // Create auth code request and generate PKCE params\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientInitializeAuthorizationCodeRequest, silentRequest.correlationId);\r\n const authCodeRequest: CommonAuthorizationCodeRequest = await this.initializeAuthorizationCodeRequest(silentRequest);\r\n // Create authorize request url\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.GetAuthCodeUrl, silentRequest.correlationId);\r\n const navigateUrl = await authClient.getAuthCodeUrl({\r\n ...silentRequest,\r\n nativeBroker: NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeMessageHandler, silentRequest.authenticationScheme)\r\n });\r\n\r\n // Create silent handler\r\n const silentHandler = new SilentHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.config.system, this.performanceClient);\r\n // Get the frame handle for the silent request\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.SilentHandlerInitiateAuthRequest, silentRequest.correlationId);\r\n const msalFrame = await silentHandler.initiateAuthRequest(navigateUrl);\r\n // Monitor the window for the hash. Return the string value and close the popup when the hash is received. Default timeout is 60 seconds.\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.SilentHandlerMonitorIframeForHash, silentRequest.correlationId);\r\n const hash = await silentHandler.monitorIframeForHash(msalFrame, this.config.system.iframeHashTimeout);\r\n // Deserialize hash fragment response parameters.\r\n const serverParams: ServerAuthorizationCodeResponse = UrlString.getDeserializedHash(hash);\r\n const state = this.validateAndExtractStateFromHash(serverParams, InteractionType.Silent, authCodeRequest.correlationId);\r\n\r\n if (serverParams.accountId) {\r\n this.logger.verbose(\"Account id found in hash, calling WAM for token\");\r\n if (!this.nativeMessageHandler) {\r\n throw BrowserAuthError.createNativeConnectionNotEstablishedError();\r\n }\r\n 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);\r\n const { userRequestState } = ProtocolUtils.parseRequestState(this.browserCrypto, state);\r\n return nativeInteractionClient.acquireToken({\r\n ...silentRequest,\r\n state: userRequestState,\r\n prompt: silentRequest.prompt || PromptValue.NONE\r\n }).finally(() => {\r\n this.browserStorage.cleanRequestByState(state);\r\n });\r\n }\r\n\r\n // Handle response from hash string\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.HandleCodeResponseFromHash, silentRequest.correlationId);\r\n return silentHandler.handleCodeResponseFromHash(hash, state, authClient.authority, this.networkClient);\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;;;;;IAmBwC,sCAAyB;IAI7D,4BAAY,MAA4B,EAAE,WAAgC,EAAE,aAAsB,EAAE,MAAc,EAAE,YAA0B,EAAE,gBAAmC,EAAE,KAAY,EAAE,iBAAqC,EAAE,iBAAsC,EAAE,oBAA2C,EAAE,aAAsB;QAArV,YACI,kBAAM,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,EAAE,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,aAAa,CAAC,SAG5I;QAFG,KAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,KAAI,CAAC,aAAa,GAAG,iBAAiB,CAAC;;KAC1C;;;;;IAMK,yCAAY,GAAlB,UAAmB,OAAyB;;;;;;wBACxC,IAAI,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,iBAAiB,CAAC,8BAA8B,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;wBACpH,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,6BAA6B,CAAC,CAAC;wBAC7C,uBAAuB,GAAG,IAAI,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,8BAA8B,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;;wBAEjJ,IAAI,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC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C,0BAA0B,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC;wBAClH,sBAAO,aAAa,CAAC,0BAA0B,CAAC,IAAI,EAAE,KAAK,EAAE,UAAU,CAAC,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,EAAC;;;;KAC1G;IACL,yBAAC;AAAD,CAlIA,CAAwC,yBAAyB;;;;"}
|
|
1
|
+
{"version":3,"file":"SilentIframeClient.js","sources":["../../src/interaction_client/SilentIframeClient.ts"],"sourcesContent":["/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { AuthenticationResult, ICrypto, Logger, StringUtils, PromptValue, CommonAuthorizationCodeRequest, AuthorizationCodeClient, AuthError, Constants, UrlString, ServerAuthorizationCodeResponse, ProtocolUtils, IPerformanceClient, PerformanceEvents } from \"@azure/msal-common\";\r\nimport { StandardInteractionClient } from \"./StandardInteractionClient\";\r\nimport { AuthorizationUrlRequest } from \"../request/AuthorizationUrlRequest\";\r\nimport { BrowserConfiguration } from \"../config/Configuration\";\r\nimport { BrowserCacheManager } from \"../cache/BrowserCacheManager\";\r\nimport { EventHandler } from \"../event/EventHandler\";\r\nimport { INavigationClient } from \"../navigation/INavigationClient\";\r\nimport { BrowserAuthError } from \"../error/BrowserAuthError\";\r\nimport { InteractionType, ApiId } from \"../utils/BrowserConstants\";\r\nimport { SilentHandler } from \"../interaction_handler/SilentHandler\";\r\nimport { SsoSilentRequest } from \"../request/SsoSilentRequest\";\r\nimport { NativeMessageHandler } from \"../broker/nativeBroker/NativeMessageHandler\";\r\nimport { NativeInteractionClient } from \"./NativeInteractionClient\";\r\n\r\nexport class SilentIframeClient extends StandardInteractionClient {\r\n protected apiId: ApiId;\r\n protected nativeStorage: BrowserCacheManager;\r\n\r\n constructor(config: BrowserConfiguration, storageImpl: BrowserCacheManager, browserCrypto: ICrypto, logger: Logger, eventHandler: EventHandler, navigationClient: INavigationClient, apiId: ApiId, performanceClient: IPerformanceClient, nativeStorageImpl: BrowserCacheManager, nativeMessageHandler?: NativeMessageHandler, correlationId?: string) {\r\n super(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, nativeMessageHandler, correlationId);\r\n this.apiId = apiId;\r\n this.nativeStorage = nativeStorageImpl;\r\n }\r\n\r\n /**\r\n * Acquires a token silently by opening a hidden iframe to the /authorize endpoint with prompt=none or prompt=no_session\r\n * @param request\r\n */\r\n async acquireToken(request: SsoSilentRequest): Promise<AuthenticationResult> {\r\n this.performanceClient.addQueueMeasurement(PerformanceEvents.SilentIframeClientAcquireToken, request.correlationId);\r\n this.logger.verbose(\"acquireTokenByIframe called\");\r\n const acquireTokenMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.SilentIframeClientAcquireToken, request.correlationId);\r\n // Check that we have some SSO data\r\n if (StringUtils.isEmpty(request.loginHint) && StringUtils.isEmpty(request.sid) && (!request.account || StringUtils.isEmpty(request.account.username))) {\r\n this.logger.warning(\"No user hint provided. The authorization server may need more information to complete this request.\");\r\n }\r\n\r\n // Check that prompt is set to none or no_session, throw error if it is set to anything else.\r\n if (request.prompt && (request.prompt !== PromptValue.NONE) && (request.prompt !== PromptValue.NO_SESSION)) {\r\n acquireTokenMeasurement.endMeasurement({\r\n success: false\r\n });\r\n throw BrowserAuthError.createSilentPromptValueError(request.prompt);\r\n }\r\n\r\n // Create silent request\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, request.correlationId);\r\n const silentRequest: AuthorizationUrlRequest = await this.initializeAuthorizationRequest({\r\n ...request,\r\n prompt: request.prompt || PromptValue.NONE\r\n }, InteractionType.Silent);\r\n this.browserStorage.updateCacheEntries(silentRequest.state, silentRequest.nonce, silentRequest.authority, silentRequest.loginHint || Constants.EMPTY_STRING, silentRequest.account || null);\r\n\r\n const serverTelemetryManager = this.initializeServerTelemetryManager(this.apiId);\r\n\r\n try {\r\n // Initialize the client\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, request.correlationId);\r\n const authClient: AuthorizationCodeClient = await this.createAuthCodeClient(serverTelemetryManager, silentRequest.authority, silentRequest.azureCloudOptions);\r\n this.logger.verbose(\"Auth code client created\");\r\n\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.SilentIframeClientTokenHelper, request.correlationId);\r\n return await this.silentTokenHelper(authClient, silentRequest).then((result: AuthenticationResult) => {\r\n acquireTokenMeasurement.endMeasurement({\r\n success: true,\r\n fromCache: false,\r\n requestId: result.requestId\r\n });\r\n return result;\r\n });\r\n } catch (e) {\r\n if (e instanceof AuthError) {\r\n (e as AuthError).setCorrelationId(this.correlationId);\r\n }\r\n serverTelemetryManager.cacheFailedRequest(e);\r\n this.browserStorage.cleanRequestByState(silentRequest.state);\r\n acquireTokenMeasurement.endMeasurement({\r\n errorCode: e instanceof AuthError && e.errorCode || undefined,\r\n subErrorCode: e instanceof AuthError && e.subError || undefined,\r\n success: false\r\n });\r\n throw e;\r\n }\r\n }\r\n\r\n /**\r\n * Currently Unsupported\r\n */\r\n logout(): Promise<void> {\r\n // Synchronous so we must reject\r\n return Promise.reject(BrowserAuthError.createSilentLogoutUnsupportedError());\r\n }\r\n\r\n /**\r\n * Helper which acquires an authorization code silently using a hidden iframe from given url\r\n * using the scopes requested as part of the id, and exchanges the code for a set of OAuth tokens.\r\n * @param navigateUrl\r\n * @param userRequestScopes\r\n */\r\n protected async silentTokenHelper(authClient: AuthorizationCodeClient, silentRequest: AuthorizationUrlRequest): Promise<AuthenticationResult> {\r\n this.performanceClient.addQueueMeasurement(PerformanceEvents.SilentIframeClientTokenHelper, silentRequest.correlationId);\r\n\r\n // Create auth code request and generate PKCE params\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientInitializeAuthorizationCodeRequest, silentRequest.correlationId);\r\n const authCodeRequest: CommonAuthorizationCodeRequest = await this.initializeAuthorizationCodeRequest(silentRequest);\r\n // Create authorize request url\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.GetAuthCodeUrl, silentRequest.correlationId);\r\n const navigateUrl = await authClient.getAuthCodeUrl({\r\n ...silentRequest,\r\n nativeBroker: NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeMessageHandler, silentRequest.authenticationScheme)\r\n });\r\n\r\n // Create silent handler\r\n const silentHandler = new SilentHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.config.system, this.performanceClient);\r\n // Get the frame handle for the silent request\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.SilentHandlerInitiateAuthRequest, silentRequest.correlationId);\r\n const msalFrame = await silentHandler.initiateAuthRequest(navigateUrl);\r\n // Monitor the window for the hash. Return the string value and close the popup when the hash is received. Default timeout is 60 seconds.\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.SilentHandlerMonitorIframeForHash, silentRequest.correlationId);\r\n const hash = await silentHandler.monitorIframeForHash(msalFrame, this.config.system.iframeHashTimeout);\r\n // Deserialize hash fragment response parameters.\r\n const serverParams: ServerAuthorizationCodeResponse = UrlString.getDeserializedHash(hash);\r\n const state = this.validateAndExtractStateFromHash(serverParams, InteractionType.Silent, authCodeRequest.correlationId);\r\n\r\n if (serverParams.accountId) {\r\n this.logger.verbose(\"Account id found in hash, calling WAM for token\");\r\n if (!this.nativeMessageHandler) {\r\n throw BrowserAuthError.createNativeConnectionNotEstablishedError();\r\n }\r\n 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);\r\n const { userRequestState } = ProtocolUtils.parseRequestState(this.browserCrypto, state);\r\n return nativeInteractionClient.acquireToken({\r\n ...silentRequest,\r\n state: userRequestState,\r\n prompt: silentRequest.prompt || PromptValue.NONE\r\n }).finally(() => {\r\n this.browserStorage.cleanRequestByState(state);\r\n });\r\n }\r\n\r\n // Handle response from hash string\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.HandleCodeResponseFromHash, silentRequest.correlationId);\r\n return silentHandler.handleCodeResponseFromHash(hash, state, authClient.authority, this.networkClient);\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;;;AAGG;AAgBH,IAAA,kBAAA,kBAAA,UAAA,MAAA,EAAA;IAAwC,SAAyB,CAAA,kBAAA,EAAA,MAAA,CAAA,CAAA;IAI7D,SAAY,kBAAA,CAAA,MAA4B,EAAE,WAAgC,EAAE,aAAsB,EAAE,MAAc,EAAE,YAA0B,EAAE,gBAAmC,EAAE,KAAY,EAAE,iBAAqC,EAAE,iBAAsC,EAAE,oBAA2C,EAAE,aAAsB,EAAA;AAArV,QAAA,IAAA,KAAA,GACI,kBAAM,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,EAAE,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,aAAa,CAAC,IAG5I,IAAA,CAAA;AAFG,QAAA,KAAI,CAAC,KAAK,GAAG,KAAK,CAAC;AACnB,QAAA,KAAI,CAAC,aAAa,GAAG,iBAAiB,CAAC;;KAC1C;AAED;;;AAGG;IACG,kBAAY,CAAA,SAAA,CAAA,YAAA,GAAlB,UAAmB,OAAyB,EAAA;;;;;;AACxC,wBAAA,IAAI,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,iBAAiB,CAAC,8BAA8B,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;AACpH,wBAAA,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,6BAA6B,CAAC,CAAC;AAC7C,wBAAA,uBAAuB,GAAG,IAAI,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,8BAA8B,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;;AAEjJ,wBAAA,IAAI,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CA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ure/msal-browser v2.39.0 2024-06-06 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { __extends, __awaiter, __generator, __assign } from '../_virtual/_tslib.js';
|
|
4
4
|
import { StandardInteractionClient } from './StandardInteractionClient.js';
|