{"version":3,"file":"NativeMessageHandler.js","sources":["../../../src/broker/nativeBroker/NativeMessageHandler.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { NativeConstants, NativeExtensionMethod } from \"../../utils/BrowserConstants\";\nimport { Logger, AuthError, AuthenticationScheme } from \"@azure/msal-common\";\nimport { NativeExtensionRequest, NativeExtensionRequestBody } from \"./NativeRequest\";\nimport { NativeAuthError } from \"../../error/NativeAuthError\";\nimport { BrowserAuthError } from \"../../error/BrowserAuthError\";\nimport { BrowserConfiguration } from \"../../config/Configuration\";\n\ntype ResponseResolvers = {\n resolve: (value:T|PromiseLike) => void;\n reject: (value:AuthError|Error|PromiseLike|PromiseLike) => void;\n};\n\nexport class NativeMessageHandler {\n private extensionId: string | undefined;\n private extensionVersion: string | undefined;\n private logger: Logger;\n private handshakeTimeoutMs: number;\n private responseId: number;\n private timeoutId: number | undefined;\n private resolvers: Map>;\n private handshakeResolvers: Map>;\n private messageChannel: MessageChannel;\n private windowListener: (event: MessageEvent) => void;\n\n constructor(logger: Logger, handshakeTimeoutMs: number, extensionId?: string) {\n this.logger = logger;\n this.handshakeTimeoutMs = handshakeTimeoutMs;\n this.extensionId = extensionId;\n this.resolvers = new Map(); // Used for non-handshake messages\n this.handshakeResolvers = new Map(); // Used for handshake messages\n this.responseId = 0;\n this.messageChannel = new MessageChannel();\n this.windowListener = this.onWindowMessage.bind(this); // Window event callback doesn't have access to 'this' unless it's bound\n }\n\n /**\n * Sends a given message to the extension and resolves with the extension response\n * @param body \n */\n async sendMessage(body: NativeExtensionRequestBody): Promise {\n this.logger.trace(\"NativeMessageHandler - sendMessage called.\");\n const req: NativeExtensionRequest = {\n channel: NativeConstants.CHANNEL_ID,\n extensionId: this.extensionId,\n responseId: this.responseId++,\n body: body\n };\n\n this.logger.trace(\"NativeMessageHandler - Sending request to browser extension\");\n this.logger.tracePii(`NativeMessageHandler - Sending request to browser extension: ${JSON.stringify(req)}`);\n this.messageChannel.port1.postMessage(req);\n\n return new Promise((resolve, reject) => {\n this.resolvers.set(req.responseId, {resolve, reject});\n });\n }\n\n /**\n * Returns an instance of the MessageHandler that has successfully established a connection with an extension\n * @param logger \n * @param handshakeTimeoutMs\n */\n static async createProvider(logger: Logger, handshakeTimeoutMs: number): Promise {\n logger.trace(\"NativeMessageHandler - createProvider called.\");\n try {\n const preferredProvider = new NativeMessageHandler(logger, handshakeTimeoutMs, NativeConstants.PREFERRED_EXTENSION_ID);\n await preferredProvider.sendHandshakeRequest();\n return preferredProvider;\n } catch (e) {\n // If preferred extension fails for whatever reason, fallback to using any installed extension\n const backupProvider = new NativeMessageHandler(logger, handshakeTimeoutMs);\n await backupProvider.sendHandshakeRequest();\n return backupProvider;\n }\n }\n\n /**\n * Send handshake request helper.\n */\n private async sendHandshakeRequest(): Promise {\n this.logger.trace(\"NativeMessageHandler - sendHandshakeRequest called.\");\n // Register this event listener before sending handshake\n window.addEventListener(\"message\", this.windowListener, false); // false is important, because content script message processing should work first\n\n const req: NativeExtensionRequest = {\n channel: NativeConstants.CHANNEL_ID,\n extensionId: this.extensionId,\n responseId: this.responseId++,\n\n body: {\n method: NativeExtensionMethod.HandshakeRequest\n }\n };\n\n this.messageChannel.port1.onmessage = (event) => {\n this.onChannelMessage(event);\n };\n\n window.postMessage(req, window.origin, [this.messageChannel.port2]);\n\n return new Promise((resolve, reject) => {\n this.handshakeResolvers.set(req.responseId, {resolve, reject});\n this.timeoutId = window.setTimeout(() => {\n /*\n * Throw an error if neither HandshakeResponse nor original Handshake request are received in a reasonable timeframe.\n * This typically suggests an event handler stopped propagation of the Handshake request but did not respond to it on the MessageChannel port\n */\n window.removeEventListener(\"message\", this.windowListener, false);\n this.messageChannel.port1.close();\n this.messageChannel.port2.close();\n reject(BrowserAuthError.createNativeHandshakeTimeoutError());\n this.handshakeResolvers.delete(req.responseId);\n }, this.handshakeTimeoutMs); // Use a reasonable timeout in milliseconds here\n });\n }\n\n /**\n * Invoked when a message is posted to the window. If a handshake request is received it means the extension is not installed.\n * @param event \n */\n private onWindowMessage(event: MessageEvent): void {\n this.logger.trace(\"NativeMessageHandler - onWindowMessage called\");\n // We only accept messages from ourselves\n if (event.source !== window) {\n return;\n }\n\n const request = event.data;\n\n if (!request.channel || request.channel !== NativeConstants.CHANNEL_ID) {\n return;\n }\n\n if (request.extensionId && request.extensionId !== this.extensionId) {\n return;\n }\n\n if (request.body.method === NativeExtensionMethod.HandshakeRequest) {\n // If we receive this message back it means no extension intercepted the request, meaning no extension supporting handshake protocol is installed\n this.logger.verbose(request.extensionId ? `Extension with id: ${request.extensionId} not installed` : \"No extension installed\");\n clearTimeout(this.timeoutId);\n this.messageChannel.port1.close();\n this.messageChannel.port2.close();\n window.removeEventListener(\"message\", this.windowListener, false);\n const handshakeResolver = this.handshakeResolvers.get(request.responseId);\n if (handshakeResolver) {\n handshakeResolver.reject(BrowserAuthError.createNativeExtensionNotInstalledError());\n }\n }\n }\n\n /**\n * Invoked when a message is received from the extension on the MessageChannel port\n * @param event \n */\n private onChannelMessage(event: MessageEvent): void {\n this.logger.trace(\"NativeMessageHandler - onChannelMessage called.\");\n const request = event.data;\n \n const resolver = this.resolvers.get(request.responseId);\n const handshakeResolver = this.handshakeResolvers.get(request.responseId);\n\n try {\n const method = request.body.method;\n \n if (method === NativeExtensionMethod.Response) {\n if (!resolver) {\n return;\n }\n const response = request.body.response;\n this.logger.trace(\"NativeMessageHandler - Received response from browser extension\");\n this.logger.tracePii(`NativeMessageHandler - Received response from browser extension: ${JSON.stringify(response)}`);\n if (response.status !== \"Success\") {\n resolver.reject(NativeAuthError.createError(response.code, response.description, response.ext));\n } else if (response.result) {\n if (response.result[\"code\"] && response.result[\"description\"]) {\n resolver.reject(NativeAuthError.createError(response.result[\"code\"], response.result[\"description\"], response.result[\"ext\"]));\n } else {\n resolver.resolve(response.result);\n }\n } else {\n throw AuthError.createUnexpectedError(\"Event does not contain result.\");\n }\n this.resolvers.delete(request.responseId);\n } else if (method === NativeExtensionMethod.HandshakeResponse) {\n if (!handshakeResolver) {\n return;\n }\n clearTimeout(this.timeoutId); // Clear setTimeout\n window.removeEventListener(\"message\", this.windowListener, false); // Remove 'No extension' listener\n this.extensionId = request.extensionId;\n this.extensionVersion = request.body.version;\n this.logger.verbose(`NativeMessageHandler - Received HandshakeResponse from extension: ${this.extensionId}`);\n\n handshakeResolver.resolve();\n this.handshakeResolvers.delete(request.responseId);\n } \n // Do nothing if method is not Response or HandshakeResponse\n } catch (err) {\n this.logger.error(\"Error parsing response from WAM Extension\");\n this.logger.errorPii(`Error parsing response from WAM Extension: ${err.toString()}`);\n this.logger.errorPii(`Unable to parse ${event}`);\n\n if (resolver) {\n resolver.reject(err as AuthError);\n } else if (handshakeResolver) {\n handshakeResolver.reject(err as AuthError);\n }\n }\n }\n\n /**\n * Returns the Id for the browser extension this handler is communicating with\n * @returns \n */\n getExtensionId(): string | undefined {\n return this.extensionId;\n }\n\n /**\n * Returns the version for the browser extension this handler is communicating with\n * @returns \n */\n getExtensionVersion(): string | undefined {\n return this.extensionVersion;\n }\n \n /**\n * Returns boolean indicating whether or not the request should attempt to use native broker\n * @param logger\n * @param config\n * @param nativeExtensionProvider\n * @param authenticationScheme \n */\n static isNativeAvailable(config: BrowserConfiguration, logger: Logger, nativeExtensionProvider?: NativeMessageHandler, authenticationScheme?: AuthenticationScheme): boolean {\n logger.trace(\"isNativeAvailable called\");\n if (!config.system.allowNativeBroker) {\n logger.trace(\"isNativeAvailable: allowNativeBroker is not enabled, returning false\");\n // Developer disabled WAM\n return false;\n }\n\n if (!nativeExtensionProvider) {\n logger.trace(\"isNativeAvailable: WAM extension provider is not initialized, returning false\");\n // Extension is not available\n return false;\n }\n\n if (authenticationScheme) {\n switch(authenticationScheme) {\n case AuthenticationScheme.BEARER:\n case AuthenticationScheme.POP:\n logger.trace(\"isNativeAvailable: authenticationScheme is supported, returning true\");\n return true;\n default:\n logger.trace(\"isNativeAvailable: authenticationScheme is not supported, returning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