Commit 3a84cbd5 authored by Ahmet Turan Koçak's avatar Ahmet Turan Koçak
Browse files

Initial commit

parents
This source diff could not be displayed because it is too large. You can view the blob instead.
/**
* @packageDocumentation
* @module @azure/msal-browser
*/
/**
* Warning: This set of exports is purely intended to be used by other MSAL libraries, and should be considered potentially unstable. We strongly discourage using them directly, you do so at your own risk.
* Breaking changes to these APIs will be shipped under a minor version, instead of a major version.
*/
import * as internals from "./internals";
export { internals };
export { PublicClientApplication } from "./app/PublicClientApplication";
export { Configuration, BrowserAuthOptions, CacheOptions, BrowserSystemOptions, BrowserConfiguration, DEFAULT_IFRAME_TIMEOUT_MS } from "./config/Configuration";
export { InteractionType, InteractionStatus, BrowserCacheLocation, WrapperSKU, ApiId, CacheLookupPolicy } from "./utils/BrowserConstants";
export { BrowserUtils } from "./utils/BrowserUtils";
export { BrowserAuthError, BrowserAuthErrorMessage } from "./error/BrowserAuthError";
export { BrowserConfigurationAuthError, BrowserConfigurationAuthErrorMessage } from "./error/BrowserConfigurationAuthError";
export { IPublicClientApplication, stubbedPublicClientApplication } from "./app/IPublicClientApplication";
export { INavigationClient } from "./navigation/INavigationClient";
export { NavigationClient } from "./navigation/NavigationClient";
export { NavigationOptions } from "./navigation/NavigationOptions";
export { PopupRequest } from "./request/PopupRequest";
export { RedirectRequest } from "./request/RedirectRequest";
export { SilentRequest } from "./request/SilentRequest";
export { SsoSilentRequest } from "./request/SsoSilentRequest";
export { EndSessionRequest } from "./request/EndSessionRequest";
export { EndSessionPopupRequest } from "./request/EndSessionPopupRequest";
export { AuthorizationUrlRequest } from "./request/AuthorizationUrlRequest";
export { AuthorizationCodeRequest } from "./request/AuthorizationCodeRequest";
export { LoadTokenOptions } from "./cache/TokenCache";
export { EventMessage, EventPayload, EventError, EventCallbackFunction, EventMessageUtils, PopupEvent } from "./event/EventMessage";
export { EventType } from "./event/EventType";
export { SignedHttpRequest, SignedHttpRequestOptions } from "./crypto/SignedHttpRequest";
export { PopupWindowAttributes } from "./request/PopupWindowAttributes";
export { AuthenticationScheme, AccountInfo, AccountEntity, AuthenticationResult, AuthError, AuthErrorMessage, ClientAuthError, ClientAuthErrorMessage, ClientConfigurationError, ClientConfigurationErrorMessage, InteractionRequiredAuthError, InteractionRequiredAuthErrorMessage, ServerError, INetworkModule, NetworkResponse, NetworkRequestOptions, ILoggerCallback, Logger, LogLevel, ProtocolMode, ExternalTokenResponse, StringUtils, UrlString, AzureCloudInstance, AzureCloudOptions, AuthenticationHeaderParser, OIDC_DEFAULT_SCOPES, PerformanceCallbackFunction, PerformanceEvent, PerformanceEvents } from "@azure/msal-common";
export { version } from "./packageMetadata";
//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA;;;GAGG;AAEH;;;GAGG;AACH,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,CAAC;AAErB,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,YAAY,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAChK,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,UAAU,EAAE,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC1I,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGpD,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACrF,OAAO,EAAE,6BAA6B,EAAE,oCAAoC,EAAE,MAAM,uCAAuC,CAAC;AAG5H,OAAO,EAAE,wBAAwB,EAAE,8BAA8B,EAAE,MAAM,gCAAgC,CAAC;AAC1G,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+B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,iBAAiB,EACpB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC"}
\ No newline at end of file
/*! @azure/msal-browser v2.32.1 2022-12-07 */
'use strict';
import * as internals from './internals.js';
export { internals };
export { PublicClientApplication } from './app/PublicClientApplication.js';
export { DEFAULT_IFRAME_TIMEOUT_MS } from './config/Configuration.js';
export { ApiId, BrowserCacheLocation, CacheLookupPolicy, InteractionStatus, InteractionType, WrapperSKU } from './utils/BrowserConstants.js';
export { BrowserUtils } from './utils/BrowserUtils.js';
export { BrowserAuthError, BrowserAuthErrorMessage } from './error/BrowserAuthError.js';
export { BrowserConfigurationAuthError, BrowserConfigurationAuthErrorMessage } from './error/BrowserConfigurationAuthError.js';
export { stubbedPublicClientApplication } from './app/IPublicClientApplication.js';
export { NavigationClient } from './navigation/NavigationClient.js';
export { EventMessageUtils } from './event/EventMessage.js';
export { EventType } from './event/EventType.js';
export { SignedHttpRequest } from './crypto/SignedHttpRequest.js';
export { AccountEntity, AuthError, AuthErrorMessage, AuthenticationHeaderParser, AuthenticationScheme, AzureCloudInstance, ClientAuthError, ClientAuthErrorMessage, ClientConfigurationError, ClientConfigurationErrorMessage, InteractionRequiredAuthError, InteractionRequiredAuthErrorMessage, LogLevel, Logger, OIDC_DEFAULT_SCOPES, PerformanceEvents, ProtocolMode, ServerError, StringUtils, UrlString } from '@azure/msal-common';
export { version } from './packageMetadata.js';
//# sourceMappingURL=index.js.map
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;"}
\ No newline at end of file
import { ICrypto, INetworkModule, Logger, AuthenticationResult, AccountInfo, BaseAuthRequest, ServerTelemetryManager, Authority, IPerformanceClient } from "@azure/msal-common";
import { BrowserConfiguration } from "../config/Configuration";
import { BrowserCacheManager } from "../cache/BrowserCacheManager";
import { EventHandler } from "../event/EventHandler";
import { EndSessionRequest } from "../request/EndSessionRequest";
import { RedirectRequest } from "../request/RedirectRequest";
import { PopupRequest } from "../request/PopupRequest";
import { SsoSilentRequest } from "../request/SsoSilentRequest";
import { INavigationClient } from "../navigation/INavigationClient";
import { NativeMessageHandler } from "../broker/nativeBroker/NativeMessageHandler";
export declare abstract class BaseInteractionClient {
protected config: BrowserConfiguration;
protected browserStorage: BrowserCacheManager;
protected browserCrypto: ICrypto;
protected networkClient: INetworkModule;
protected logger: Logger;
protected eventHandler: EventHandler;
protected navigationClient: INavigationClient;
protected nativeMessageHandler: NativeMessageHandler | undefined;
protected correlationId: string;
protected performanceClient: IPerformanceClient;
constructor(config: BrowserConfiguration, storageImpl: BrowserCacheManager, browserCrypto: ICrypto, logger: Logger, eventHandler: EventHandler, navigationClient: INavigationClient, performanceClient: IPerformanceClient, nativeMessageHandler?: NativeMessageHandler, correlationId?: string);
abstract acquireToken(request: RedirectRequest | PopupRequest | SsoSilentRequest): Promise<AuthenticationResult | void>;
abstract logout(request: EndSessionRequest): Promise<void>;
protected clearCacheOnLogout(account?: AccountInfo | null): Promise<void>;
/**
* Initializer function for all request APIs
* @param request
*/
protected initializeBaseRequest(request: Partial<BaseAuthRequest>): Promise<BaseAuthRequest>;
/**
*
* Use to get the redirect uri configured in MSAL or null.
* @param requestRedirectUri
* @returns Redirect URL
*
*/
getRedirectUri(requestRedirectUri?: string): string;
/**
*
* @param apiId
* @param correlationId
* @param forceRefresh
*/
protected initializeServerTelemetryManager(apiId: number, forceRefresh?: boolean): ServerTelemetryManager;
/**
* Used to get a discovered version of the default authority.
* @param requestAuthority
* @param requestCorrelationId
*/
protected getDiscoveredAuthority(requestAuthority?: string): Promise<Authority>;
}
//# sourceMappingURL=BaseInteractionClient.d.ts.map
\ No newline at end of file
{"version":3,"file":"BaseInteractionClient.d.ts","sourceRoot":"","sources":["../../src/interaction_client/BaseInteractionClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,oBAAoB,EAAE,WAAW,EAAiB,eAAe,EAA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oBAAoB,EAAE,aAAa,CAAC,EAAE,MAAM;IAa/R,QAAQ,CAAC,YAAY,CAAC,OAAO,EAAE,eAAe,GAAC,YAAY,GAAC,gBAAgB,GAAG,OAAO,CAAC,oBAAoB,GAAC,IAAI,CAAC;IAEjH,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;cAE1C,kBAAkB,CAAC,OAAO,CAAC,EAAE,WAAW,GAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IA0B9E;;;OAGG;cACa,qBAAqB,CAAC,OAAO,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,OAAO,CAAC,eAAe,CAAC;IAqClG;;;;;;OAMG;IACH,cAAc,CAAC,kBAAkB,CAAC,EAAE,MAAM,GAAG,MAAM;IAMnD;;;;;OAKG;IACH,SAAS,CAAC,gCAAgC,CAAC,KAAK,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,OAAO,GAAG,sBAAsB;IAczG;;;;OAIG;cACa,sBAAsB,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;CAiBxF"}
\ No newline at end of file
/*! @azure/msal-browser v2.32.1 2022-12-07 */
'use strict';
import { __awaiter, __generator, __spread, __assign } from '../_virtual/_tslib.js';
import { AccountEntity, AuthenticationScheme, ClientConfigurationError, StringUtils, UrlString, ServerTelemetryManager, AuthorityFactory } from '@azure/msal-common';
import { version } from '../packageMetadata.js';
import { BrowserConstants } from '../utils/BrowserConstants.js';
import { BrowserUtils } from '../utils/BrowserUtils.js';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
var BaseInteractionClient = /** @class */ (function () {
function BaseInteractionClient(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, nativeMessageHandler, correlationId) {
this.config = config;
this.browserStorage = storageImpl;
this.browserCrypto = browserCrypto;
this.networkClient = this.config.system.networkClient;
this.eventHandler = eventHandler;
this.navigationClient = navigationClient;
this.nativeMessageHandler = nativeMessageHandler;
this.correlationId = correlationId || this.browserCrypto.createNewGuid();
this.logger = logger.clone(BrowserConstants.MSAL_SKU, version, this.correlationId);
this.performanceClient = performanceClient;
}
BaseInteractionClient.prototype.clearCacheOnLogout = function (account) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (!account) return [3 /*break*/, 5];
if (AccountEntity.accountInfoIsEqual(account, this.browserStorage.getActiveAccount(), false)) {
this.logger.verbose("Setting active account to null");
this.browserStorage.setActiveAccount(null);
}
_a.label = 1;
case 1:
_a.trys.push([1, 3, , 4]);
return [4 /*yield*/, this.browserStorage.removeAccount(AccountEntity.generateAccountCacheKey(account))];
case 2:
_a.sent();
this.logger.verbose("Cleared cache items belonging to the account provided in the logout request.");
return [3 /*break*/, 4];
case 3:
_a.sent();
this.logger.error("Account provided in logout request was not found. Local cache unchanged.");
return [3 /*break*/, 4];
case 4: return [3 /*break*/, 9];
case 5:
_a.trys.push([5, 8, , 9]);
this.logger.verbose("No account provided in logout request, clearing all cache items.", this.correlationId);
// Clear all accounts and tokens
return [4 /*yield*/, this.browserStorage.clear()];
case 6:
// Clear all accounts and tokens
_a.sent();
// Clear any stray keys from IndexedDB
return [4 /*yield*/, this.browserCrypto.clearKeystore()];
case 7:
// Clear any stray keys from IndexedDB
_a.sent();
return [3 /*break*/, 9];
case 8:
_a.sent();
this.logger.error("Attempted to clear all MSAL cache items and failed. Local cache unchanged.");
return [3 /*break*/, 9];
case 9: return [2 /*return*/];
}
});
});
};
/**
* Initializer function for all request APIs
* @param request
*/
BaseInteractionClient.prototype.initializeBaseRequest = function (request) {
return __awaiter(this, void 0, void 0, function () {
var authority, scopes, validatedRequest, _a;
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
this.logger.verbose("Initializing BaseAuthRequest");
authority = request.authority || this.config.auth.authority;
scopes = __spread(((request && request.scopes) || []));
validatedRequest = __assign(__assign({}, request), { correlationId: this.correlationId, authority: authority,
scopes: scopes });
// Set authenticationScheme to BEARER if not explicitly set in the request
if (!validatedRequest.authenticationScheme) {
validatedRequest.authenticationScheme = AuthenticationScheme.BEARER;
this.logger.verbose("Authentication Scheme wasn't explicitly set in request, defaulting to \"Bearer\" request");
}
else {
if (validatedRequest.authenticationScheme === AuthenticationScheme.SSH) {
if (!request.sshJwk) {
throw ClientConfigurationError.createMissingSshJwkError();
}
if (!request.sshKid) {
throw ClientConfigurationError.createMissingSshKidError();
}
}
this.logger.verbose("Authentication Scheme set to \"" + validatedRequest.authenticationScheme + "\" as configured in Auth request");
}
if (!(request.claims && !StringUtils.isEmpty(request.claims))) return [3 /*break*/, 2];
_a = validatedRequest;
return [4 /*yield*/, this.browserCrypto.hashString(request.claims)];
case 1:
_a.requestedClaimsHash = _b.sent();
_b.label = 2;
case 2: return [2 /*return*/, validatedRequest];
}
});
});
};
/**
*
* Use to get the redirect uri configured in MSAL or null.
* @param requestRedirectUri
* @returns Redirect URL
*
*/
BaseInteractionClient.prototype.getRedirectUri = function (requestRedirectUri) {
this.logger.verbose("getRedirectUri called");
var redirectUri = requestRedirectUri || this.config.auth.redirectUri || BrowserUtils.getCurrentUri();
return UrlString.getAbsoluteUrl(redirectUri, BrowserUtils.getCurrentUri());
};
/**
*
* @param apiId
* @param correlationId
* @param forceRefresh
*/
BaseInteractionClient.prototype.initializeServerTelemetryManager = function (apiId, forceRefresh) {
this.logger.verbose("initializeServerTelemetryManager called");
var telemetryPayload = {
clientId: this.config.auth.clientId,
correlationId: this.correlationId,
apiId: apiId,
forceRefresh: forceRefresh || false,
wrapperSKU: this.browserStorage.getWrapperMetadata()[0],
wrapperVer: this.browserStorage.getWrapperMetadata()[1]
};
return new ServerTelemetryManager(telemetryPayload, this.browserStorage);
};
/**
* Used to get a discovered version of the default authority.
* @param requestAuthority
* @param requestCorrelationId
*/
BaseInteractionClient.prototype.getDiscoveredAuthority = function (requestAuthority) {
return __awaiter(this, void 0, void 0, function () {
var authorityOptions;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
this.logger.verbose("getDiscoveredAuthority called");
authorityOptions = {
protocolMode: this.config.auth.protocolMode,
knownAuthorities: this.config.auth.knownAuthorities,
cloudDiscoveryMetadata: this.config.auth.cloudDiscoveryMetadata,
authorityMetadata: this.config.auth.authorityMetadata
};
if (!requestAuthority) return [3 /*break*/, 2];
this.logger.verbose("Creating discovered authority with request authority");
return [4 /*yield*/, AuthorityFactory.createDiscoveredInstance(requestAuthority, this.config.system.networkClient, this.browserStorage, authorityOptions, this.logger)];
case 1: return [2 /*return*/, _a.sent()];
case 2:
this.logger.verbose("Creating discovered authority with configured authority");
return [4 /*yield*/, AuthorityFactory.createDiscoveredInstance(this.config.auth.authority, this.config.system.networkClient, this.browserStorage, authorityOptions, this.logger)];
case 3: return [2 /*return*/, _a.sent()];
}
});
});
};
return BaseInteractionClient;
}());
export { BaseInteractionClient };
//# sourceMappingURL=BaseInteractionClient.js.map
{"version":3,"file":"BaseInteractionClient.js","sources":["../../src/interaction_client/BaseInteractionClient.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ICrypto, INetworkModule, Logger, AuthenticationResult, AccountInfo, AccountEntity, BaseAuthRequest, AuthenticationScheme, UrlString, ServerTelemetryManager, ServerTelemetryRequest, ClientConfigurationError, StringUtils, Authority, AuthorityOptions, AuthorityFactory, IPerformanceClient } from \"@azure/msal-common\";\nimport { BrowserConfiguration } from \"../config/Configuration\";\nimport { BrowserCacheManager } from \"../cache/BrowserCacheManager\";\nimport { EventHandler } from \"../event/EventHandler\";\nimport { EndSessionRequest } from \"../request/EndSessionRequest\";\nimport { RedirectRequest } from \"../request/RedirectRequest\";\nimport { PopupRequest } from \"../request/PopupRequest\";\nimport { SsoSilentRequest } from \"../request/SsoSilentRequest\";\nimport { version } from \"../packageMetadata\";\nimport { BrowserConstants } from \"../utils/BrowserConstants\";\nimport { BrowserUtils } from \"../utils/BrowserUtils\";\nimport { INavigationClient } from \"../navigation/INavigationClient\";\nimport { NativeMessageHandler } from \"../broker/nativeBroker/NativeMessageHandler\";\n\nexport abstract class BaseInteractionClient {\n\n protected config: BrowserConfiguration;\n protected browserStorage: BrowserCacheManager;\n protected browserCrypto: ICrypto;\n protected networkClient: INetworkModule;\n protected logger: Logger;\n protected eventHandler: EventHandler;\n protected navigationClient: INavigationClient;\n protected nativeMessageHandler: NativeMessageHandler | undefined;\n protected correlationId: string;\n protected performanceClient: IPerformanceClient;\n\n constructor(config: BrowserConfiguration, storageImpl: BrowserCacheManager, browserCrypto: ICrypto, logger: Logger, eventHandler: EventHandler, navigationClient: INavigationClient, performanceClient: IPerformanceClient, nativeMessageHandler?: NativeMessageHandler, correlationId?: string) {\n this.config = config;\n this.browserStorage = storageImpl;\n this.browserCrypto = browserCrypto;\n this.networkClient = this.config.system.networkClient;\n this.eventHandler = eventHandler;\n this.navigationClient = navigationClient;\n this.nativeMessageHandler = nativeMessageHandler;\n this.correlationId = correlationId || this.browserCrypto.createNewGuid();\n this.logger = logger.clone(BrowserConstants.MSAL_SKU, version, this.correlationId);\n this.performanceClient = performanceClient;\n }\n\n abstract acquireToken(request: RedirectRequest|PopupRequest|SsoSilentRequest): Promise<AuthenticationResult|void>;\n\n abstract logout(request: EndSessionRequest): Promise<void>;\n\n protected async clearCacheOnLogout(account?: AccountInfo| null): Promise<void> {\n if (account) {\n if (AccountEntity.accountInfoIsEqual(account, this.browserStorage.getActiveAccount(), false)) {\n this.logger.verbose(\"Setting active account to null\");\n this.browserStorage.setActiveAccount(null);\n }\n // Clear given account.\n try {\n await this.browserStorage.removeAccount(AccountEntity.generateAccountCacheKey(account));\n this.logger.verbose(\"Cleared cache items belonging to the account provided in the logout request.\");\n } catch (error) {\n this.logger.error(\"Account provided in logout request was not found. Local cache unchanged.\");\n }\n } else {\n try {\n this.logger.verbose(\"No account provided in logout request, clearing all cache items.\", this.correlationId);\n // Clear all accounts and tokens\n await this.browserStorage.clear();\n // Clear any stray keys from IndexedDB\n await this.browserCrypto.clearKeystore();\n } catch(e) {\n this.logger.error(\"Attempted to clear all MSAL cache items and failed. Local cache unchanged.\");\n }\n }\n }\n\n /**\n * Initializer function for all request APIs\n * @param request\n */\n protected async initializeBaseRequest(request: Partial<BaseAuthRequest>): Promise<BaseAuthRequest> {\n this.logger.verbose(\"Initializing BaseAuthRequest\");\n const authority = request.authority || this.config.auth.authority;\n\n const scopes = [...((request && request.scopes) || [])];\n\n const validatedRequest: BaseAuthRequest = {\n ...request,\n correlationId: this.correlationId,\n authority,\n scopes\n };\n\n // Set authenticationScheme to BEARER if not explicitly set in the request\n if (!validatedRequest.authenticationScheme) {\n validatedRequest.authenticationScheme = AuthenticationScheme.BEARER;\n this.logger.verbose(\"Authentication Scheme wasn't explicitly set in request, defaulting to \\\"Bearer\\\" request\");\n } else {\n if (validatedRequest.authenticationScheme === AuthenticationScheme.SSH) {\n if (!request.sshJwk) {\n throw ClientConfigurationError.createMissingSshJwkError();\n }\n if(!request.sshKid) {\n throw ClientConfigurationError.createMissingSshKidError();\n }\n }\n this.logger.verbose(`Authentication Scheme set to \"${validatedRequest.authenticationScheme}\" as configured in Auth request`);\n }\n\n // Set requested claims hash if claims were requested\n if (request.claims && !StringUtils.isEmpty(request.claims)) {\n validatedRequest.requestedClaimsHash = await this.browserCrypto.hashString(request.claims);\n }\n\n return validatedRequest;\n }\n\n /**\n *\n * Use to get the redirect uri configured in MSAL or null.\n * @param requestRedirectUri\n * @returns Redirect URL\n *\n */\n getRedirectUri(requestRedirectUri?: string): string {\n this.logger.verbose(\"getRedirectUri called\");\n const redirectUri = requestRedirectUri || this.config.auth.redirectUri || BrowserUtils.getCurrentUri();\n return UrlString.getAbsoluteUrl(redirectUri, BrowserUtils.getCurrentUri());\n }\n\n /**\n *\n * @param apiId\n * @param correlationId\n * @param forceRefresh\n */\n protected initializeServerTelemetryManager(apiId: number, forceRefresh?: boolean): ServerTelemetryManager {\n this.logger.verbose(\"initializeServerTelemetryManager called\");\n const telemetryPayload: ServerTelemetryRequest = {\n clientId: this.config.auth.clientId,\n correlationId: this.correlationId,\n apiId: apiId,\n forceRefresh: forceRefresh || false,\n wrapperSKU: this.browserStorage.getWrapperMetadata()[0],\n wrapperVer: this.browserStorage.getWrapperMetadata()[1]\n };\n\n return new ServerTelemetryManager(telemetryPayload, this.browserStorage);\n }\n\n /**\n * Used to get a discovered version of the default authority.\n * @param requestAuthority\n * @param requestCorrelationId\n */\n protected async getDiscoveredAuthority(requestAuthority?: string): Promise<Authority> {\n this.logger.verbose(\"getDiscoveredAuthority called\");\n const authorityOptions: AuthorityOptions = {\n protocolMode: this.config.auth.protocolMode,\n knownAuthorities: this.config.auth.knownAuthorities,\n cloudDiscoveryMetadata: this.config.auth.cloudDiscoveryMetadata,\n authorityMetadata: this.config.auth.authorityMetadata\n };\n\n if (requestAuthority) {\n this.logger.verbose(\"Creating discovered authority with request authority\");\n return await AuthorityFactory.createDiscoveredInstance(requestAuthority, this.config.system.networkClient, this.browserStorage, authorityOptions, this.logger);\n }\n\n this.logger.verbose(\"Creating discovered authority with configured authority\");\n return await AuthorityFactory.createDiscoveredInstance(this.config.auth.authority, this.config.system.networkClient, this.browserStorage, authorityOptions, this.logger);\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAAA;;;;;IAgCI,+BAAY,MAA4B,EAAE,WAAgC,EAAE,aAAsB,EAAE,MAAc,EAAE,YAA0B,EAAE,gBAAmC,EAAE,iBAAqC,EAAE,oBAA2C,EAAE,aAAsB;QAC3R,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,cAAc,GAAG,WAAW,CAAC;QAClC,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC;QACtD,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,gBAAgB,GAAG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sBAAsB;4BAC/D,iBAAiB,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,iBAAiB;yBACxD,CAAC;6BAEE,gBAAgB,EAAhB,wBAAgB;wBAChB,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,sDAAsD,CAAC,CAAC;wBACrE,qBAAM,gBAAgB,CAAC,wBAAwB,CAAC,gBAAgB,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE,IAAI,CAAC,cAAc,EAAE,gBAAgB,EAAE,IAAI,CAAC,MAAM,CAAC,EAAA;4BAA9J,sBAAO,SAAuJ,EAAC;;wBAGnK,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,yDAAyD,CAAC,CAAC;wBACxE,qBAAM,gBAAgB,CAAC,wBAAwB,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE,IAAI,CAAC,cAAc,EAAE,gBAAgB,EAAE,IAAI,CAAC,MAAM,CAAC,EAAA;4BAAxK,sBAAO,SAAiK,EAAC;;;;KAC5K;IACL,4BAAC;AAAD,CAAC;;;;"}
\ No newline at end of file
import { AuthorizationCodeClient, ClientConfiguration } from "@azure/msal-common";
export declare class HybridSpaAuthorizationCodeClient extends AuthorizationCodeClient {
constructor(config: ClientConfiguration);
}
//# sourceMappingURL=HybridSpaAuthorizationCodeClient.d.ts.map
\ No newline at end of file
{"version":3,"file":"HybridSpaAuthorizationCodeClient.d.ts","sourceRoot":"","sources":["../../src/interaction_client/HybridSpaAuthorizationCodeClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAElF,qBAAa,gCAAiC,SAAQ,uBAAuB;gBAC7D,MAAM,EAAE,mBAAmB;CAI1C"}
\ No newline at end of file
/*! @azure/msal-browser v2.32.1 2022-12-07 */
'use strict';
import { __extends } from '../_virtual/_tslib.js';
import { AuthorizationCodeClient } from '@azure/msal-common';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
var HybridSpaAuthorizationCodeClient = /** @class */ (function (_super) {
__extends(HybridSpaAuthorizationCodeClient, _super);
function HybridSpaAuthorizationCodeClient(config) {
var _this = _super.call(this, config) || this;
_this.includeRedirectUri = false;
return _this;
}
return HybridSpaAuthorizationCodeClient;
}(AuthorizationCodeClient));
export { HybridSpaAuthorizationCodeClient };
//# sourceMappingURL=HybridSpaAuthorizationCodeClient.js.map
{"version":3,"file":"HybridSpaAuthorizationCodeClient.js","sources":["../../src/interaction_client/HybridSpaAuthorizationCodeClient.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AuthorizationCodeClient, ClientConfiguration } from \"@azure/msal-common\";\n\nexport class HybridSpaAuthorizationCodeClient extends AuthorizationCodeClient {\n constructor(config: ClientConfiguration) {\n super(config);\n this.includeRedirectUri = false;\n }\n}\n"],"names":[],"mappings":";;;;;AAAA;;;;;IAOsD,oDAAuB;IACzE,0CAAY,MAA2B;QAAvC,YACI,kBAAM,MAAM,CAAC,SAEhB;QADG,KAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC;;KACnC;IACL,uCAAC;AAAD,CALA,CAAsD,uBAAuB;;;;"}
\ No newline at end of file
{"version":3,"file":"NativeInteractionClient.d.ts","sourceRoot":"","sources":["../../src/interaction_client/NativeInteractionClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,oBAAoB,EAAE,MAAM,EAAE,OAAO,EAA8L,kBAAkB,EAAyH,MAAM,oBAAoB,CAAC;AAClZ,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAA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,CAAC;IAqDvG;;;;;OAKG;IACH,OAAO,CAAC,wBAAwB;IAUhC;;;;;OAKG;cACa,sBAAsB,CAAC,eAAe,EAAE,MAAM,EAAE,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAmB3H;;;OAGG;IACG,oBAAoB,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IA6BnE;;OAEG;IACG,qBAAqB,IAAI,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IAyCnE;;;OAGG;IACH,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAKvB;;;;;OAKG;cACa,oBAAoB,CAAC,QAAQ,EAAE,cAAc,EAAE,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAkJhJ;;;OAGG;IACH,OAAO,CAAC,sBAAsB;IAe9B;;;;OAIG;IACH,OAAO,CAAC,mBAAmB;IAY3B;;;;OAIG;IACH,OAAO,CAAC,mBAAmB;IAS3B;;;OAGG;cACa,uBAAuB,CAAC,OAAO,EAAE,YAAY,GAAC,gBAAgB,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAiF/G"}
\ No newline at end of file
/*! @azure/msal-browser v2.32.1 2022-12-07 */
'use strict';
import { __extends, __awaiter, __generator, __rest, __assign } from '../_virtual/_tslib.js';
import { PerformanceEvents, TimeUtils, ScopeSet, ClientAuthError, IdTokenEntity, Constants, AccessTokenEntity, AuthenticationScheme, PopTokenGenerator, AccountEntity, AuthorityType, AuthToken, UrlString, OIDC_DEFAULT_SCOPES, PromptValue } from '@azure/msal-common';
import { BaseInteractionClient } from './BaseInteractionClient.js';
import { TemporaryCacheKeys, NativeExtensionMethod, NativeConstants, ApiId } from '../utils/BrowserConstants.js';
import { NativeAuthError } from '../error/NativeAuthError.js';
import { BrowserAuthError } from '../error/BrowserAuthError.js';
import { SilentCacheClient } from './SilentCacheClient.js';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
var NativeInteractionClient = /** @class */ (function (_super) {
__extends(NativeInteractionClient, _super);
function NativeInteractionClient(config, browserStorage, browserCrypto, logger, eventHandler, navigationClient, apiId, performanceClient, provider, accountId, nativeStorageImpl, correlationId) {
var _this = _super.call(this, config, browserStorage, browserCrypto, logger, eventHandler, navigationClient, performanceClient, provider, correlationId) || this;
_this.apiId = apiId;
_this.accountId = accountId;
_this.nativeMessageHandler = provider;
_this.nativeStorageManager = nativeStorageImpl;
_this.silentCacheClient = new SilentCacheClient(config, _this.nativeStorageManager, browserCrypto, logger, eventHandler, navigationClient, performanceClient, provider, correlationId);
return _this;
}
/**
* Acquire token from native platform via browser extension
* @param request
*/
NativeInteractionClient.prototype.acquireToken = function (request) {
return __awaiter(this, void 0, void 0, function () {
var nativeATMeasurement, reqTimestamp, nativeRequest, result, messageBody, response, validatedResponse;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
this.logger.trace("NativeInteractionClient - acquireToken called.");
nativeATMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.NativeInteractionClientAcquireToken, request.correlationId);
reqTimestamp = TimeUtils.nowSeconds();
return [4 /*yield*/, this.initializeNativeRequest(request)];
case 1:
nativeRequest = _a.sent();
_a.label = 2;
case 2:
_a.trys.push([2, 4, , 5]);
return [4 /*yield*/, this.acquireTokensFromCache(this.accountId, nativeRequest)];
case 3:
result = _a.sent();
nativeATMeasurement.endMeasurement({
success: true,
isNativeBroker: false,
fromCache: true
});
return [2 /*return*/, result];
case 4:
_a.sent();
// continue with a native call for any and all errors
this.logger.info("MSAL internal Cache does not contain tokens, proceed to make a native call");
return [3 /*break*/, 5];
case 5:
messageBody = {
method: NativeExtensionMethod.GetToken,
request: nativeRequest
};
return [4 /*yield*/, this.nativeMessageHandler.sendMessage(messageBody)];
case 6:
response = _a.sent();
validatedResponse = this.validateNativeResponse(response);
return [2 /*return*/, this.handleNativeResponse(validatedResponse, nativeRequest, reqTimestamp)
.then(function (result) {
nativeATMeasurement.endMeasurement({
success: true,
isNativeBroker: true,
requestId: result.requestId
});
return result;
})
.catch(function (error) {
nativeATMeasurement.endMeasurement({
success: false,
errorCode: error.errorCode,
subErrorCode: error.subError,
isNativeBroker: true
});
throw error;
})];
}
});
});
};
/**
* Creates silent flow request
* @param request
* @param cachedAccount
* @returns CommonSilentFlowRequest
*/
NativeInteractionClient.prototype.createSilentCacheRequest = function (request, cachedAccount) {
return {
authority: request.authority,
correlationId: this.correlationId,
scopes: ScopeSet.fromString(request.scope).asArray(),
account: cachedAccount,
forceRefresh: false,
};
};
/**
* Fetches the tokens from the cache if un-expired
* @param nativeAccountId
* @param request
* @returns authenticationResult
*/
NativeInteractionClient.prototype.acquireTokensFromCache = function (nativeAccountId, request) {
return __awaiter(this, void 0, void 0, function () {
var accountEntity, account, silentRequest, result, e_2;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
accountEntity = this.browserStorage.readAccountFromCacheWithNativeAccountId(nativeAccountId);
if (!accountEntity) {
throw ClientAuthError.createNoAccountFoundError();
}
account = accountEntity.getAccountInfo();
_a.label = 1;
case 1:
_a.trys.push([1, 3, , 4]);
silentRequest = this.createSilentCacheRequest(request, account);
return [4 /*yield*/, this.silentCacheClient.acquireToken(silentRequest)];
case 2:
result = _a.sent();
return [2 /*return*/, result];
case 3:
e_2 = _a.sent();
throw e_2;
case 4: return [2 /*return*/];
}
});
});
};
/**
* Acquires a token from native platform then redirects to the redirectUri instead of returning the response
* @param request
*/
NativeInteractionClient.prototype.acquireTokenRedirect = function (request) {
return __awaiter(this, void 0, void 0, function () {
var nativeRequest, messageBody, response, e_3, navigationOptions, redirectUri;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
this.logger.trace("NativeInteractionClient - acquireTokenRedirect called.");
return [4 /*yield*/, this.initializeNativeRequest(request)];
case 1:
nativeRequest = _a.sent();
messageBody = {
method: NativeExtensionMethod.GetToken,
request: nativeRequest
};
_a.label = 2;
case 2:
_a.trys.push([2, 4, , 5]);
return [4 /*yield*/, this.nativeMessageHandler.sendMessage(messageBody)];
case 3:
response = _a.sent();
this.validateNativeResponse(response);
return [3 /*break*/, 5];
case 4:
e_3 = _a.sent();
// Only throw fatal errors here to allow application to fallback to regular redirect. Otherwise proceed and the error will be thrown in handleRedirectPromise
if (e_3 instanceof NativeAuthError && e_3.isFatal()) {
throw e_3;
}
return [3 /*break*/, 5];
case 5:
this.browserStorage.setTemporaryCache(TemporaryCacheKeys.NATIVE_REQUEST, JSON.stringify(nativeRequest), true);
navigationOptions = {
apiId: ApiId.acquireTokenRedirect,
timeout: this.config.system.redirectNavigationTimeout,
noHistory: false
};
redirectUri = this.config.auth.navigateToLoginRequestUrl ? window.location.href : this.getRedirectUri(request.redirectUri);
return [4 /*yield*/, this.navigationClient.navigateExternal(redirectUri, navigationOptions)];
case 6:
_a.sent(); // Need to treat this as external to ensure handleRedirectPromise is run again
return [2 /*return*/];
}
});
});
};
/**
* If the previous page called native platform for a token using redirect APIs, send the same request again and return the response
*/
NativeInteractionClient.prototype.handleRedirectPromise = function () {
return __awaiter(this, void 0, void 0, function () {
var cachedRequest, prompt, request, messageBody, reqTimestamp, response, result, e_4;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
this.logger.trace("NativeInteractionClient - handleRedirectPromise called.");
if (!this.browserStorage.isInteractionInProgress(true)) {
this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null.");
return [2 /*return*/, null];
}
cachedRequest = this.browserStorage.getCachedNativeRequest();
if (!cachedRequest) {
this.logger.verbose("NativeInteractionClient - handleRedirectPromise called but there is no cached request, returning null.");
return [2 /*return*/, null];
}
prompt = cachedRequest.prompt, request = __rest(cachedRequest, ["prompt"]);
if (prompt) {
this.logger.verbose("NativeInteractionClient - handleRedirectPromise called and prompt was included in the original request, removing prompt from cached request to prevent second interaction with native broker window.");
}
this.browserStorage.removeItem(this.browserStorage.generateCacheKey(TemporaryCacheKeys.NATIVE_REQUEST));
messageBody = {
method: NativeExtensionMethod.GetToken,
request: request
};
reqTimestamp = TimeUtils.nowSeconds();
_a.label = 1;
case 1:
_a.trys.push([1, 3, , 4]);
this.logger.verbose("NativeInteractionClient - handleRedirectPromise sending message to native broker.");
return [4 /*yield*/, this.nativeMessageHandler.sendMessage(messageBody)];
case 2:
response = _a.sent();
this.validateNativeResponse(response);
result = this.handleNativeResponse(response, request, reqTimestamp);
this.browserStorage.setInteractionInProgress(false);
return [2 /*return*/, result];
case 3:
e_4 = _a.sent();
this.browserStorage.setInteractionInProgress(false);
throw e_4;
case 4: return [2 /*return*/];
}
});
});
};
/**
* Logout from native platform via browser extension
* @param request
*/
NativeInteractionClient.prototype.logout = function () {
this.logger.trace("NativeInteractionClient - logout called.");
return Promise.reject("Logout not implemented yet");
};
/**
* Transform response from native platform into AuthenticationResult object which will be returned to the end user
* @param response
* @param request
* @param reqTimestamp
*/
NativeInteractionClient.prototype.handleNativeResponse = function (response, request, reqTimestamp) {
return __awaiter(this, void 0, void 0, function () {
var mats, idTokenObj, authority, authorityPreferredCache, homeAccountIdentifier, accountEntity, responseScopes, accountProperties, uid, tid, responseAccessToken, responseTokenType, _a, popTokenGenerator, shrParameters, result, idTokenEntity, expiresIn, tokenExpirationSeconds, accessTokenEntity;
var _this = this;
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
this.logger.trace("NativeInteractionClient - handleNativeResponse called.");
mats = this.getMATSFromResponse(response);
this.performanceClient.addStaticFields({
extensionId: this.nativeMessageHandler.getExtensionId(),
extensionVersion: this.nativeMessageHandler.getExtensionVersion(),
matsBrokerVersion: mats ? mats.broker_version : undefined,
matsAccountJoinOnStart: mats ? mats.account_join_on_start : undefined,
matsAccountJoinOnEnd: mats ? mats.account_join_on_end : undefined,
matsDeviceJoin: mats ? mats.device_join : undefined,
matsPromptBehavior: mats ? mats.prompt_behavior : undefined,
matsApiErrorCode: mats ? mats.api_error_code : undefined,
matsUiVisible: mats ? mats.ui_visible : undefined,
matsSilentCode: mats ? mats.silent_code : undefined,
matsSilentBiSubCode: mats ? mats.silent_bi_sub_code : undefined,
matsSilentMessage: mats ? mats.silent_message : undefined,
matsSilentStatus: mats ? mats.silent_status : undefined,
matsHttpStatus: mats ? mats.http_status : undefined,
matsHttpEventCount: mats ? mats.http_event_count : undefined
}, this.correlationId);
if (response.account.id !== request.accountId) {
// User switch in native broker prompt is not supported. All users must first sign in through web flow to ensure server state is in sync
throw NativeAuthError.createUserSwitchError();
}
idTokenObj = new AuthToken(response.id_token || Constants.EMPTY_STRING, this.browserCrypto);
return [4 /*yield*/, this.getDiscoveredAuthority(request.authority)];
case 1:
authority = _b.sent();
authorityPreferredCache = authority.getPreferredCache();
homeAccountIdentifier = AccountEntity.generateHomeAccountId(response.client_info || Constants.EMPTY_STRING, AuthorityType.Default, this.logger, this.browserCrypto, idTokenObj);
accountEntity = AccountEntity.createAccount(response.client_info, homeAccountIdentifier, idTokenObj, undefined, undefined, undefined, authorityPreferredCache, response.account.id);
this.browserStorage.setAccount(accountEntity);
responseScopes = response.scope ? ScopeSet.fromString(response.scope) : ScopeSet.fromString(request.scope);
accountProperties = response.account.properties || {};
uid = accountProperties["UID"] || idTokenObj.claims.oid || idTokenObj.claims.sub || Constants.EMPTY_STRING;
tid = accountProperties["TenantId"] || idTokenObj.claims.tid || Constants.EMPTY_STRING;
responseTokenType = AuthenticationScheme.BEARER;
_a = request.tokenType;
switch (_a) {
case AuthenticationScheme.POP: return [3 /*break*/, 2];
}
return [3 /*break*/, 4];
case 2:
// Set the token type to POP in the response
responseTokenType = AuthenticationScheme.POP;
// Check if native layer returned an SHR token
if (response.shr) {
this.logger.trace("handleNativeServerResponse: SHR is enabled in native layer");
responseAccessToken = response.shr;
return [3 /*break*/, 5];
}
popTokenGenerator = new PopTokenGenerator(this.browserCrypto);
shrParameters = {
resourceRequestMethod: request.resourceRequestMethod,
resourceRequestUri: request.resourceRequestUri,
shrClaims: request.shrClaims,
shrNonce: request.shrNonce
};
/**
* KeyID must be present in the native request from when the PoP key was generated in order for
* PopTokenGenerator to query the full key for signing
*/
if (!request.keyId) {
throw ClientAuthError.createKeyIdMissingError();
}
return [4 /*yield*/, popTokenGenerator.signPopToken(response.access_token, request.keyId, shrParameters)];
case 3:
responseAccessToken = _b.sent();
return [3 /*break*/, 5];
case 4:
{
responseAccessToken = response.access_token;
}
_b.label = 5;
case 5:
result = {
authority: authority.canonicalAuthority,
uniqueId: uid,
tenantId: tid,
scopes: responseScopes.asArray(),
account: accountEntity.getAccountInfo(),
idToken: response.id_token,
idTokenClaims: idTokenObj.claims,
accessToken: responseAccessToken,
fromCache: mats ? this.isResponseFromCache(mats) : false,
expiresOn: new Date(Number(reqTimestamp + response.expires_in) * 1000),
tokenType: responseTokenType,
correlationId: this.correlationId,
state: response.state,
fromNativeBroker: true
};
idTokenEntity = IdTokenEntity.createIdTokenEntity(homeAccountIdentifier, request.authority, response.id_token || Constants.EMPTY_STRING, request.clientId, idTokenObj.claims.tid || Constants.EMPTY_STRING);
this.nativeStorageManager.setIdTokenCredential(idTokenEntity);
expiresIn = (responseTokenType === AuthenticationScheme.POP)
? Constants.SHR_NONCE_VALIDITY
: (typeof response.expires_in === "string"
? parseInt(response.expires_in, 10)
: response.expires_in) || 0;
tokenExpirationSeconds = reqTimestamp + expiresIn;
accessTokenEntity = AccessTokenEntity.createAccessTokenEntity(homeAccountIdentifier, request.authority, responseAccessToken, request.clientId, tid, responseScopes.printScopes(), tokenExpirationSeconds, 0, this.browserCrypto);
this.nativeStorageManager.setAccessTokenCredential(accessTokenEntity);
// Remove any existing cached tokens for this account in browser storage
this.browserStorage.removeAccountContext(accountEntity).catch(function (e) {
_this.logger.error("Error occurred while removing account context from browser storage. " + e);
});
return [2 /*return*/, result];
}
});
});
};
/**
* Validates native platform response before processing
* @param response
*/
NativeInteractionClient.prototype.validateNativeResponse = function (response) {
if (response.hasOwnProperty("access_token") &&
response.hasOwnProperty("id_token") &&
response.hasOwnProperty("client_info") &&
response.hasOwnProperty("account") &&
response.hasOwnProperty("scope") &&
response.hasOwnProperty("expires_in")) {
return response;
}
else {
throw NativeAuthError.createUnexpectedError("Response missing expected properties.");
}
};
/**
* Gets MATS telemetry from native response
* @param response
* @returns
*/
NativeInteractionClient.prototype.getMATSFromResponse = function (response) {
if (response.properties.MATS) {
try {
return JSON.parse(response.properties.MATS);
}
catch (e) {
this.logger.error("NativeInteractionClient - Error parsing MATS telemetry, returning null instead");
}
}
return null;
};
/**
* Returns whether or not response came from native cache
* @param response
* @returns
*/
NativeInteractionClient.prototype.isResponseFromCache = function (mats) {
if (typeof mats.is_cached === "undefined") {
this.logger.verbose("NativeInteractionClient - MATS telemetry does not contain field indicating if response was served from cache. Returning false.");
return false;
}
return !!mats.is_cached;
};
/**
* Translates developer provided request object into NativeRequest object
* @param request
*/
NativeInteractionClient.prototype.initializeNativeRequest = function (request) {
return __awaiter(this, void 0, void 0, function () {
var authority, canonicalAuthority, scopes, remainingProperties, scopeSet, getPrompt, validatedRequest, shrParameters, popTokenGenerator, reqCnfData;
var _this = this;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
this.logger.trace("NativeInteractionClient - initializeNativeRequest called");
authority = request.authority || this.config.auth.authority;
canonicalAuthority = new UrlString(authority);
canonicalAuthority.validateAsUri();
scopes = request.scopes, remainingProperties = __rest(request, ["scopes"]);
scopeSet = new ScopeSet(scopes || []);
scopeSet.appendScopes(OIDC_DEFAULT_SCOPES);
getPrompt = function () {
// If request is silent, prompt is always none
switch (_this.apiId) {
case ApiId.ssoSilent:
case ApiId.acquireTokenSilent_silentFlow:
_this.logger.trace("initializeNativeRequest: silent request sets prompt to none");
return PromptValue.NONE;
}
// Prompt not provided, request may proceed and native broker decides if it needs to prompt
if (!request.prompt) {
_this.logger.trace("initializeNativeRequest: prompt was not provided");
return undefined;
}
// If request is interactive, check if prompt provided is allowed to go directly to native broker
switch (request.prompt) {
case PromptValue.NONE:
case PromptValue.CONSENT:
case PromptValue.LOGIN:
_this.logger.trace("initializeNativeRequest: prompt is compatible with native flow");
return request.prompt;
default:
_this.logger.trace("initializeNativeRequest: prompt = " + request.prompt + " is not compatible with native flow");
throw BrowserAuthError.createNativePromptParameterNotSupportedError();
}
};
validatedRequest = __assign(__assign({}, remainingProperties), { accountId: this.accountId, clientId: this.config.auth.clientId, authority: canonicalAuthority.urlString, scope: scopeSet.printScopes(), redirectUri: this.getRedirectUri(request.redirectUri), prompt: getPrompt(), correlationId: this.correlationId, tokenType: request.authenticationScheme, windowTitleSubstring: document.title, extraParameters: __assign(__assign(__assign({}, request.extraQueryParameters), request.tokenQueryParameters), { telemetry: NativeConstants.MATS_TELEMETRY }), extendedExpiryToken: false // Make this configurable?
});
if (!(request.authenticationScheme === AuthenticationScheme.POP)) return [3 /*break*/, 2];
shrParameters = {
resourceRequestUri: request.resourceRequestUri,
resourceRequestMethod: request.resourceRequestMethod,
shrClaims: request.shrClaims,
shrNonce: request.shrNonce
};
popTokenGenerator = new PopTokenGenerator(this.browserCrypto);
return [4 /*yield*/, popTokenGenerator.generateCnf(shrParameters)];
case 1:
reqCnfData = _a.sent();
// to reduce the URL length, it is recommended to send the hash of the req_cnf instead of the whole string
validatedRequest.reqCnf = reqCnfData.reqCnfHash;
validatedRequest.keyId = reqCnfData.kid;
_a.label = 2;
case 2: return [2 /*return*/, validatedRequest];
}
});
});
};
return NativeInteractionClient;
}(BaseInteractionClient));
export { NativeInteractionClient };
//# sourceMappingURL=NativeInteractionClient.js.map
{"version":3,"file":"NativeInteractionClient.js","sources":["../../src/interaction_client/NativeInteractionClient.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AuthenticationResult, Logger, ICrypto, PromptValue, AuthToken, Constants, AccountEntity, AuthorityType, ScopeSet, TimeUtils, AuthenticationScheme, UrlString, OIDC_DEFAULT_SCOPES, PopTokenGenerator, SignedHttpRequestParameters, IPerformanceClient, PerformanceEvents, IdTokenEntity, AccessTokenEntity, ClientAuthError, AuthError, CommonSilentFlowRequest, AccountInfo } from \"@azure/msal-common\";\nimport { BaseInteractionClient } from \"./BaseInteractionClient\";\nimport { BrowserConfiguration } from \"../config/Configuration\";\nimport { BrowserCacheManager } from \"../cache/BrowserCacheManager\";\nimport { EventHandler } from \"../event/EventHandler\";\nimport { PopupRequest } from \"../request/PopupRequest\";\nimport { SilentRequest } from \"../request/SilentRequest\";\nimport { SsoSilentRequest } from \"../request/SsoSilentRequest\";\nimport { NativeMessageHandler } from \"../broker/nativeBroker/NativeMessageHandler\";\nimport { NativeExtensionMethod, ApiId, TemporaryCacheKeys, NativeConstants } from \"../utils/BrowserConstants\";\nimport { NativeExtensionRequestBody, NativeTokenRequest } from \"../broker/nativeBroker/NativeRequest\";\nimport { MATS, NativeResponse } from \"../broker/nativeBroker/NativeResponse\";\nimport { NativeAuthError } from \"../error/NativeAuthError\";\nimport { RedirectRequest } from \"../request/RedirectRequest\";\nimport { NavigationOptions } from \"../navigation/NavigationOptions\";\nimport { INavigationClient } from \"../navigation/INavigationClient\";\nimport { BrowserAuthError } from \"../error/BrowserAuthError\";\nimport { SilentCacheClient } from \"./SilentCacheClient\";\n\nexport class NativeInteractionClient extends BaseInteractionClient {\n protected apiId: ApiId;\n protected accountId: string;\n protected nativeMessageHandler: NativeMessageHandler;\n protected silentCacheClient: SilentCacheClient;\n protected nativeStorageManager: BrowserCacheManager;\n\n constructor(config: BrowserConfiguration, browserStorage: BrowserCacheManager, browserCrypto: ICrypto, logger: Logger, eventHandler: EventHandler, navigationClient: INavigationClient, apiId: ApiId, performanceClient: IPerformanceClient, provider: NativeMessageHandler, accountId: string, nativeStorageImpl: BrowserCacheManager, correlationId?: string) {\n super(config, browserStorage, browserCrypto, logger, eventHandler, navigationClient, performanceClient, provider, correlationId);\n this.apiId = apiId;\n this.accountId = accountId;\n this.nativeMessageHandler = provider;\n this.nativeStorageManager = nativeStorageImpl;\n this.silentCacheClient = new SilentCacheClient(config, this.nativeStorageManager, browserCrypto, logger, eventHandler, navigationClient, performanceClient, provider, correlationId);\n }\n\n /**\n * Acquire token from native platform via browser extension\n * @param request\n */\n async acquireToken(request: PopupRequest|SilentRequest|SsoSilentRequest): Promise<AuthenticationResult> {\n this.logger.trace(\"NativeInteractionClient - acquireToken called.\");\n\n // start the perf measurement\n const nativeATMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.NativeInteractionClientAcquireToken, request.correlationId);\n const reqTimestamp = TimeUtils.nowSeconds();\n\n // initialize native request\n const nativeRequest = await this.initializeNativeRequest(request);\n\n // check if the tokens can be retrieved from internal cache\n try {\n const result = await this.acquireTokensFromCache(this.accountId, nativeRequest);\n nativeATMeasurement.endMeasurement({\n success: true,\n isNativeBroker: false, // Should be true only when the result is coming directly from the broker\n fromCache: true\n });\n return result;\n } catch (e) {\n // continue with a native call for any and all errors\n this.logger.info(\"MSAL internal Cache does not contain tokens, proceed to make a native call\");\n }\n\n // fall back to native calls\n const messageBody: NativeExtensionRequestBody = {\n method: NativeExtensionMethod.GetToken,\n request: nativeRequest\n };\n\n const response: object = await this.nativeMessageHandler.sendMessage(messageBody);\n const validatedResponse: NativeResponse = this.validateNativeResponse(response);\n\n return this.handleNativeResponse(validatedResponse, nativeRequest, reqTimestamp)\n .then((result: AuthenticationResult) => {\n nativeATMeasurement.endMeasurement({\n success: true,\n isNativeBroker: true,\n requestId: result.requestId\n });\n return result;\n })\n .catch((error: AuthError) => {\n nativeATMeasurement.endMeasurement({\n success: false,\n errorCode: error.errorCode,\n subErrorCode: error.subError,\n isNativeBroker: true\n });\n throw error;\n });\n }\n\n /**\n * Creates silent flow request\n * @param request\n * @param cachedAccount\n * @returns CommonSilentFlowRequest\n */\n private createSilentCacheRequest(request: NativeTokenRequest, cachedAccount: AccountInfo): CommonSilentFlowRequest {\n return {\n authority: request.authority,\n correlationId: this.correlationId,\n scopes: ScopeSet.fromString(request.scope).asArray(),\n account: cachedAccount,\n forceRefresh: false,\n };\n }\n\n /**\n * Fetches the tokens from the cache if un-expired\n * @param nativeAccountId\n * @param request\n * @returns authenticationResult\n */\n protected async acquireTokensFromCache(nativeAccountId: string, request: NativeTokenRequest): Promise<AuthenticationResult> {\n\n // fetch the account from in-memory cache\n const accountEntity = this.browserStorage.readAccountFromCacheWithNativeAccountId(nativeAccountId);\n if (!accountEntity) {\n throw ClientAuthError.createNoAccountFoundError();\n }\n const account = accountEntity.getAccountInfo();\n\n // leverage silent flow for cached tokens retrieval\n try {\n const silentRequest = this.createSilentCacheRequest(request, account);\n const result = await this.silentCacheClient.acquireToken(silentRequest);\n return result;\n } catch (e) {\n throw e;\n }\n }\n\n /**\n * Acquires a token from native platform then redirects to the redirectUri instead of returning the response\n * @param request\n */\n async acquireTokenRedirect(request: RedirectRequest): Promise<void> {\n this.logger.trace(\"NativeInteractionClient - acquireTokenRedirect called.\");\n const nativeRequest = await this.initializeNativeRequest(request);\n\n const messageBody: NativeExtensionRequestBody = {\n method: NativeExtensionMethod.GetToken,\n request: nativeRequest\n };\n\n try {\n const response: object = await this.nativeMessageHandler.sendMessage(messageBody);\n this.validateNativeResponse(response);\n } catch (e) {\n // Only throw fatal errors here to allow application to fallback to regular redirect. Otherwise proceed and the error will be thrown in handleRedirectPromise\n if (e instanceof NativeAuthError && e.isFatal()) {\n throw e;\n }\n }\n this.browserStorage.setTemporaryCache(TemporaryCacheKeys.NATIVE_REQUEST, JSON.stringify(nativeRequest), true);\n\n const navigationOptions: NavigationOptions = {\n apiId: ApiId.acquireTokenRedirect,\n timeout: this.config.system.redirectNavigationTimeout,\n noHistory: false\n };\n const redirectUri = this.config.auth.navigateToLoginRequestUrl ? window.location.href : this.getRedirectUri(request.redirectUri);\n await this.navigationClient.navigateExternal(redirectUri, navigationOptions); // Need to treat this as external to ensure handleRedirectPromise is run again\n }\n\n /**\n * If the previous page called native platform for a token using redirect APIs, send the same request again and return the response\n */\n async handleRedirectPromise(): Promise<AuthenticationResult | null> {\n this.logger.trace(\"NativeInteractionClient - handleRedirectPromise called.\");\n if (!this.browserStorage.isInteractionInProgress(true)) {\n this.logger.info(\"handleRedirectPromise called but there is no interaction in progress, returning null.\");\n return null;\n }\n\n // remove prompt from the request to prevent WAM from prompting twice\n const cachedRequest = this.browserStorage.getCachedNativeRequest();\n if (!cachedRequest) {\n this.logger.verbose(\"NativeInteractionClient - handleRedirectPromise called but there is no cached request, returning null.\");\n return null;\n }\n\n const { prompt, ...request} = cachedRequest;\n if (prompt) {\n this.logger.verbose(\"NativeInteractionClient - handleRedirectPromise called and prompt was included in the original request, removing prompt from cached request to prevent second interaction with native broker window.\");\n }\n\n this.browserStorage.removeItem(this.browserStorage.generateCacheKey(TemporaryCacheKeys.NATIVE_REQUEST));\n\n const messageBody: NativeExtensionRequestBody = {\n method: NativeExtensionMethod.GetToken,\n request: request\n };\n\n const reqTimestamp = TimeUtils.nowSeconds();\n\n try {\n this.logger.verbose(\"NativeInteractionClient - handleRedirectPromise sending message to native broker.\");\n const response: object = await this.nativeMessageHandler.sendMessage(messageBody);\n this.validateNativeResponse(response);\n const result = this.handleNativeResponse(response as NativeResponse, request, reqTimestamp);\n this.browserStorage.setInteractionInProgress(false);\n return result;\n } catch (e) {\n this.browserStorage.setInteractionInProgress(false);\n throw e;\n }\n }\n\n /**\n * Logout from native platform via browser extension\n * @param request\n */\n logout(): Promise<void> {\n this.logger.trace(\"NativeInteractionClient - logout called.\");\n return Promise.reject(\"Logout not implemented yet\");\n }\n\n /**\n * Transform response from native platform into AuthenticationResult object which will be returned to the end user\n * @param response\n * @param request\n * @param reqTimestamp\n */\n protected async handleNativeResponse(response: NativeResponse, request: NativeTokenRequest, reqTimestamp: number): Promise<AuthenticationResult> {\n this.logger.trace(\"NativeInteractionClient - handleNativeResponse called.\");\n\n // Add Native Broker fields to Telemetry\n const mats = this.getMATSFromResponse(response);\n this.performanceClient.addStaticFields({\n extensionId: this.nativeMessageHandler.getExtensionId(),\n extensionVersion: this.nativeMessageHandler.getExtensionVersion(),\n matsBrokerVersion: mats ? mats.broker_version : undefined,\n matsAccountJoinOnStart: mats ? mats.account_join_on_start : undefined,\n matsAccountJoinOnEnd: mats ? mats.account_join_on_end : undefined,\n matsDeviceJoin: mats ? mats.device_join : undefined,\n matsPromptBehavior: mats ? mats.prompt_behavior : undefined,\n matsApiErrorCode: mats ? mats.api_error_code : undefined,\n matsUiVisible: mats ? mats.ui_visible : undefined,\n matsSilentCode: mats ? mats.silent_code : undefined,\n matsSilentBiSubCode: mats ? mats.silent_bi_sub_code : undefined,\n matsSilentMessage: mats ? mats.silent_message : undefined,\n matsSilentStatus: mats ? mats.silent_status : undefined,\n matsHttpStatus: mats ? mats.http_status : undefined,\n matsHttpEventCount: mats ? mats.http_event_count : undefined\n }, this.correlationId);\n\n if (response.account.id !== request.accountId) {\n // User switch in native broker prompt is not supported. All users must first sign in through web flow to ensure server state is in sync\n throw NativeAuthError.createUserSwitchError();\n }\n\n // create an idToken object (not entity)\n const idTokenObj = new AuthToken(response.id_token || Constants.EMPTY_STRING, this.browserCrypto);\n\n // Get the preferred_cache domain for the given authority\n const authority = await this.getDiscoveredAuthority(request.authority);\n const authorityPreferredCache = authority.getPreferredCache();\n\n // Save account in browser storage\n const homeAccountIdentifier = AccountEntity.generateHomeAccountId(response.client_info || Constants.EMPTY_STRING, AuthorityType.Default, this.logger, this.browserCrypto, idTokenObj);\n const accountEntity = AccountEntity.createAccount(response.client_info, homeAccountIdentifier, idTokenObj, undefined, undefined, undefined, authorityPreferredCache, response.account.id);\n this.browserStorage.setAccount(accountEntity);\n\n // If scopes not returned in server response, use request scopes\n const responseScopes = response.scope ? ScopeSet.fromString(response.scope) : ScopeSet.fromString(request.scope);\n\n const accountProperties = response.account.properties || {};\n const uid = accountProperties[\"UID\"] || idTokenObj.claims.oid || idTokenObj.claims.sub || Constants.EMPTY_STRING;\n const tid = accountProperties[\"TenantId\"] || idTokenObj.claims.tid || Constants.EMPTY_STRING;\n\n // This code prioritizes SHR returned from the native layer. In case of error/SHR not calculated from WAM and the AT is still received, SHR is calculated locally\n let responseAccessToken;\n let responseTokenType: AuthenticationScheme = AuthenticationScheme.BEARER;\n switch (request.tokenType) {\n case AuthenticationScheme.POP: {\n // Set the token type to POP in the response\n responseTokenType = AuthenticationScheme.POP;\n\n // Check if native layer returned an SHR token\n if (response.shr) {\n this.logger.trace(\"handleNativeServerResponse: SHR is enabled in native layer\");\n responseAccessToken = response.shr;\n break;\n }\n\n // Generate SHR in msal js if WAM does not compute it when POP is enabled\n const popTokenGenerator: PopTokenGenerator = new PopTokenGenerator(this.browserCrypto);\n const shrParameters: SignedHttpRequestParameters = {\n resourceRequestMethod: request.resourceRequestMethod,\n resourceRequestUri: request.resourceRequestUri,\n shrClaims: request.shrClaims,\n shrNonce: request.shrNonce\n };\n\n /**\n * KeyID must be present in the native request from when the PoP key was generated in order for\n * PopTokenGenerator to query the full key for signing\n */\n if (!request.keyId) {\n throw ClientAuthError.createKeyIdMissingError();\n }\n\n responseAccessToken = await popTokenGenerator.signPopToken(response.access_token, request.keyId, shrParameters);\n break;\n\n }\n // assign the access token to the response for all non-POP cases (Should be Bearer only today)\n default: {\n responseAccessToken = response.access_token;\n }\n }\n\n const result: AuthenticationResult = {\n authority: authority.canonicalAuthority,\n uniqueId: uid,\n tenantId: tid,\n scopes: responseScopes.asArray(),\n account: accountEntity.getAccountInfo(),\n idToken: response.id_token,\n idTokenClaims: idTokenObj.claims,\n accessToken: responseAccessToken,\n fromCache: mats ? this.isResponseFromCache(mats) : false,\n expiresOn: new Date(Number(reqTimestamp + response.expires_in) * 1000),\n tokenType: responseTokenType,\n correlationId: this.correlationId,\n state: response.state,\n fromNativeBroker: true\n };\n\n // cache idToken in inmemory storage\n const idTokenEntity = IdTokenEntity.createIdTokenEntity(\n homeAccountIdentifier,\n request.authority,\n response.id_token || Constants.EMPTY_STRING,\n request.clientId,\n idTokenObj.claims.tid || Constants.EMPTY_STRING,\n );\n this.nativeStorageManager.setIdTokenCredential(idTokenEntity);\n\n // cache accessToken in inmemory storage\n const expiresIn: number = (responseTokenType === AuthenticationScheme.POP)\n ? Constants.SHR_NONCE_VALIDITY\n : (\n typeof response.expires_in === \"string\"\n ? parseInt(response.expires_in, 10)\n : response.expires_in\n ) || 0;\n const tokenExpirationSeconds = reqTimestamp + expiresIn;\n const accessTokenEntity = AccessTokenEntity.createAccessTokenEntity(\n homeAccountIdentifier,\n request.authority,\n responseAccessToken,\n request.clientId,\n tid,\n responseScopes.printScopes(),\n tokenExpirationSeconds,\n 0,\n this.browserCrypto\n );\n this.nativeStorageManager.setAccessTokenCredential(accessTokenEntity);\n\n // Remove any existing cached tokens for this account in browser storage\n this.browserStorage.removeAccountContext(accountEntity).catch((e) => {\n this.logger.error(`Error occurred while removing account context from browser storage. ${e}`);\n });\n\n return result;\n }\n\n /**\n * Validates native platform response before processing\n * @param response\n */\n private validateNativeResponse(response: object): NativeResponse {\n if (\n response.hasOwnProperty(\"access_token\") &&\n response.hasOwnProperty(\"id_token\") &&\n response.hasOwnProperty(\"client_info\") &&\n response.hasOwnProperty(\"account\") &&\n response.hasOwnProperty(\"scope\") &&\n response.hasOwnProperty(\"expires_in\")\n ) {\n return response as NativeResponse;\n } else {\n throw NativeAuthError.createUnexpectedError(\"Response missing expected properties.\");\n }\n }\n\n /**\n * Gets MATS telemetry from native response\n * @param response\n * @returns\n */\n private getMATSFromResponse(response: NativeResponse): MATS|null {\n if (response.properties.MATS) {\n try {\n return JSON.parse(response.properties.MATS);\n } catch (e) {\n this.logger.error(\"NativeInteractionClient - Error parsing MATS telemetry, returning null instead\");\n }\n }\n\n return null;\n }\n\n /**\n * Returns whether or not response came from native cache\n * @param response\n * @returns\n */\n private isResponseFromCache(mats: MATS): boolean {\n if (typeof mats.is_cached === \"undefined\") {\n this.logger.verbose(\"NativeInteractionClient - MATS telemetry does not contain field indicating if response was served from cache. Returning false.\");\n return false;\n }\n\n return !!mats.is_cached;\n }\n\n /**\n * Translates developer provided request object into NativeRequest object\n * @param request\n */\n protected async initializeNativeRequest(request: PopupRequest|SsoSilentRequest): Promise<NativeTokenRequest> {\n this.logger.trace(\"NativeInteractionClient - initializeNativeRequest called\");\n\n const authority = request.authority || this.config.auth.authority;\n const canonicalAuthority = new UrlString(authority);\n canonicalAuthority.validateAsUri();\n\n // scopes are expected to be received by the native broker as \"scope\" and will be added to the request below. Other properties that should be dropped from the request to the native broker can be included in the object destructuring here.\n const { scopes, ...remainingProperties } = request; \n const scopeSet = new ScopeSet(scopes || []);\n scopeSet.appendScopes(OIDC_DEFAULT_SCOPES);\n\n const getPrompt = () => {\n // If request is silent, prompt is always none\n switch (this.apiId) {\n case ApiId.ssoSilent:\n case ApiId.acquireTokenSilent_silentFlow:\n this.logger.trace(\"initializeNativeRequest: silent request sets prompt to none\");\n return PromptValue.NONE;\n default:\n break;\n }\n\n // Prompt not provided, request may proceed and native broker decides if it needs to prompt\n if (!request.prompt) {\n this.logger.trace(\"initializeNativeRequest: prompt was not provided\");\n return undefined;\n }\n\n // If request is interactive, check if prompt provided is allowed to go directly to native broker\n switch (request.prompt) {\n case PromptValue.NONE:\n case PromptValue.CONSENT:\n case PromptValue.LOGIN:\n this.logger.trace(\"initializeNativeRequest: prompt is compatible with native flow\");\n return request.prompt;\n default:\n this.logger.trace(`initializeNativeRequest: prompt = ${request.prompt} is not compatible with native flow`);\n throw BrowserAuthError.createNativePromptParameterNotSupportedError();\n }\n };\n \n const validatedRequest: NativeTokenRequest = {\n ...remainingProperties,\n accountId: this.accountId,\n clientId: this.config.auth.clientId,\n authority: canonicalAuthority.urlString,\n scope: scopeSet.printScopes(),\n redirectUri: this.getRedirectUri(request.redirectUri),\n prompt: getPrompt(),\n correlationId: this.correlationId,\n tokenType: request.authenticationScheme,\n windowTitleSubstring: document.title,\n extraParameters: {\n ...request.extraQueryParameters,\n ...request.tokenQueryParameters,\n telemetry: NativeConstants.MATS_TELEMETRY\n },\n extendedExpiryToken: false // Make this configurable?\n };\n\n if (request.authenticationScheme === AuthenticationScheme.POP) {\n\n // add POP request type\n const shrParameters: SignedHttpRequestParameters = {\n resourceRequestUri: request.resourceRequestUri,\n resourceRequestMethod: request.resourceRequestMethod,\n shrClaims: request.shrClaims,\n shrNonce: request.shrNonce\n };\n\n const popTokenGenerator = new PopTokenGenerator(this.browserCrypto);\n const reqCnfData = await popTokenGenerator.generateCnf(shrParameters);\n\n // to reduce the URL length, it is recommended to send the hash of the req_cnf instead of the whole string\n validatedRequest.reqCnf = reqCnfData.reqCnfHash;\n validatedRequest.keyId = reqCnfData.kid;\n }\n\n return validatedRequest;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;AAAA;;;;;IAwB6C,2CAAqB;IAO9D,iCAAY,MAA4B,EAAE,cAAmC,EAAE,aAAsB,EAAE,MAAc,EAAE,YAA0B,EAAE,gBAAmC,EAAE,KAAY,EAAE,iBAAqC,EAAE,QAA8B,EAAE,SAAiB,EAAE,iBAAsC,EAAE,aAAsB;QAA9V,YACI,kBAAM,MAAM,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,EAAE,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,QAAQ,EAAE,aAAa,CAAC,SAMnI;QALG,KAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,KAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,KAAI,CAAC,oBAAoB,GAAG,QAAQ,CAAC;QACrC,KAAI,CAAC,oBAAoB,GAAG,iBAAiB,CAAC;QAC9C,KAAI,CAAC,iBAAiB,GAAG,IAAI,iBAAiB,CAAC,MAAM,EAAE,KAAI,CAAC,oBAAoB,EAAE,aAAa,EAAE,MAAM,EAAE,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,QAAQ,EAAE,aAAa,CAAC,CAAC;;KACxL;;;;;IAMK,8CAAY,GAAlB,UAAmB,OAAoD;;;;;;wBACnE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,gDAAgD,CAAC,CAAC;wBAG9D,mBAAmB,GAAG,IAAI,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,mCAAmC,EAAE,OAAO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;;OAEG;IACH,YAAY,CAAC,CAAC,EAAE,KAAK,GAAG,IAAI;IAS5B;;;OAGG;IACH,UAAU,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI;IAYtC;;;;OAIG;IACH,iBAAiB,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM;IAInE;;;;OAIG;IACH,uBAAuB,CAAC,OAAO,EAAE,uBAAuB,GAAG,MAAM;CAIpE"}
\ No newline at end of file
/*! @azure/msal-browser v2.32.1 2022-12-07 */
'use strict';
import { __extends, __awaiter, __generator, __assign } from '../_virtual/_tslib.js';
import { OIDC_DEFAULT_SCOPES, StringUtils, UrlString, Constants, AuthError, ThrottlingUtils, ProtocolUtils, PerformanceEvents } from '@azure/msal-common';
import { StandardInteractionClient } from './StandardInteractionClient.js';
import { EventType } from '../event/EventType.js';
import { BrowserConstants, InteractionType, ApiId } from '../utils/BrowserConstants.js';
import { BrowserUtils } from '../utils/BrowserUtils.js';
import { NativeInteractionClient } from './NativeInteractionClient.js';
import { NativeMessageHandler } from '../broker/nativeBroker/NativeMessageHandler.js';
import { BrowserAuthError } from '../error/BrowserAuthError.js';
import { InteractionHandler } from '../interaction_handler/InteractionHandler.js';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
var PopupClient = /** @class */ (function (_super) {
__extends(PopupClient, _super);
function PopupClient(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, nativeStorageImpl, nativeMessageHandler, correlationId) {
var _this = _super.call(this, config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, nativeMessageHandler, correlationId) || this;
// Properly sets this reference for the unload event.
_this.unloadWindow = _this.unloadWindow.bind(_this);
_this.nativeStorage = nativeStorageImpl;
return _this;
}
/**
* Acquires tokens by opening a popup window to the /authorize endpoint of the authority
* @param request
*/
PopupClient.prototype.acquireToken = function (request) {
try {
var popupName = this.generatePopupName(request.scopes || OIDC_DEFAULT_SCOPES, request.authority || this.config.auth.authority);
var popupWindowAttributes = request.popupWindowAttributes || {};
// asyncPopups flag is true. Acquires token without first opening popup. Popup will be opened later asynchronously.
if (this.config.system.asyncPopups) {
this.logger.verbose("asyncPopups set to true, acquiring token");
// Passes on popup position and dimensions if in request
return this.acquireTokenPopupAsync(request, popupName, popupWindowAttributes);
}
else {
// asyncPopups flag is set to false. Opens popup before acquiring token.
this.logger.verbose("asyncPopup set to false, opening popup before acquiring token");
var popup = this.openSizedPopup("about:blank", popupName, popupWindowAttributes);
return this.acquireTokenPopupAsync(request, popupName, popupWindowAttributes, popup);
}
}
catch (e) {
return Promise.reject(e);
}
};
/**
* Clears local cache for the current user then opens a popup window prompting the user to sign-out of the server
* @param logoutRequest
*/
PopupClient.prototype.logout = function (logoutRequest) {
try {
this.logger.verbose("logoutPopup called");
var validLogoutRequest = this.initializeLogoutRequest(logoutRequest);
var popupName = this.generateLogoutPopupName(validLogoutRequest);
var authority = logoutRequest && logoutRequest.authority;
var mainWindowRedirectUri = logoutRequest && logoutRequest.mainWindowRedirectUri;
var popupWindowAttributes = (logoutRequest === null || logoutRequest === void 0 ? void 0 : logoutRequest.popupWindowAttributes) || {};
// asyncPopups flag is true. Acquires token without first opening popup. Popup will be opened later asynchronously.
if (this.config.system.asyncPopups) {
this.logger.verbose("asyncPopups set to true");
// Passes on popup position and dimensions if in request
return this.logoutPopupAsync(validLogoutRequest, popupName, popupWindowAttributes, authority, undefined, mainWindowRedirectUri);
}
else {
// asyncPopups flag is set to false. Opens popup before logging out.
this.logger.verbose("asyncPopup set to false, opening popup");
var popup = this.openSizedPopup("about:blank", popupName, popupWindowAttributes);
return this.logoutPopupAsync(validLogoutRequest, popupName, popupWindowAttributes, authority, popup, mainWindowRedirectUri);
}
}
catch (e) {
// Since this function is synchronous we need to reject
return Promise.reject(e);
}
};
/**
* Helper which obtains an access_token for your API via opening a popup window in the user's browser
* @param validRequest
* @param popupName
* @param popup
* @param popupWindowAttributes
*
* @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.
*/
PopupClient.prototype.acquireTokenPopupAsync = function (request, popupName, popupWindowAttributes, popup) {
return __awaiter(this, void 0, void 0, function () {
var serverTelemetryManager, validRequest, authCodeRequest, authClient, isNativeBroker, fetchNativeAccountIdMeasurement, navigateUrl, interactionHandler, popupParameters, popupWindow, hash, serverParams, state_1, nativeInteractionClient, userRequestState, result, e_1;
var _this = this;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
this.logger.verbose("acquireTokenPopupAsync called");
serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenPopup);
return [4 /*yield*/, this.initializeAuthorizationRequest(request, InteractionType.Popup)];
case 1:
validRequest = _a.sent();
this.browserStorage.updateCacheEntries(validRequest.state, validRequest.nonce, validRequest.authority, validRequest.loginHint || Constants.EMPTY_STRING, validRequest.account || null);
_a.label = 2;
case 2:
_a.trys.push([2, 8, , 9]);
return [4 /*yield*/, this.initializeAuthorizationCodeRequest(validRequest)];
case 3:
authCodeRequest = _a.sent();
return [4 /*yield*/, this.createAuthCodeClient(serverTelemetryManager, validRequest.authority, validRequest.azureCloudOptions)];
case 4:
authClient = _a.sent();
this.logger.verbose("Auth code client created");
isNativeBroker = NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeMessageHandler, request.authenticationScheme);
fetchNativeAccountIdMeasurement = void 0;
if (isNativeBroker) {
fetchNativeAccountIdMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.FetchAccountIdWithNativeBroker, request.correlationId);
}
return [4 /*yield*/, authClient.getAuthCodeUrl(__assign(__assign({}, validRequest), { nativeBroker: isNativeBroker }))];
case 5:
navigateUrl = _a.sent();
interactionHandler = new InteractionHandler(authClient, this.browserStorage, authCodeRequest, this.logger);
popupParameters = {
popup: popup,
popupName: popupName,
popupWindowAttributes: popupWindowAttributes
};
popupWindow = this.initiateAuthRequest(navigateUrl, popupParameters);
this.eventHandler.emitEvent(EventType.POPUP_OPENED, InteractionType.Popup, { popupWindow: popupWindow }, null);
return [4 /*yield*/, this.monitorPopupForHash(popupWindow)];
case 6:
hash = _a.sent();
serverParams = UrlString.getDeserializedHash(hash);
state_1 = this.validateAndExtractStateFromHash(serverParams, InteractionType.Popup, validRequest.correlationId);
// Remove throttle if it exists
ThrottlingUtils.removeThrottle(this.browserStorage, this.config.auth.clientId, authCodeRequest);
if (serverParams.accountId) {
this.logger.verbose("Account id found in hash, calling WAM for token");
// end measurement for server call with native brokering enabled
if (fetchNativeAccountIdMeasurement) {
fetchNativeAccountIdMeasurement.endMeasurement({
success: true,
isNativeBroker: true
});
}
if (!this.nativeMessageHandler) {
throw BrowserAuthError.createNativeConnectionNotEstablishedError();
}
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);
userRequestState = ProtocolUtils.parseRequestState(this.browserCrypto, state_1).userRequestState;
return [2 /*return*/, nativeInteractionClient.acquireToken(__assign(__assign({}, validRequest), { state: userRequestState, prompt: undefined // Server should handle the prompt, ideally native broker can do this part silently
})).finally(function () {
_this.browserStorage.cleanRequestByState(state_1);
})];
}
return [4 /*yield*/, interactionHandler.handleCodeResponseFromHash(hash, state_1, authClient.authority, this.networkClient)];
case 7:
result = _a.sent();
return [2 /*return*/, result];
case 8:
e_1 = _a.sent();
if (popup) {
// Close the synchronous popup if an error is thrown before the window unload event is registered
popup.close();
}
if (e_1 instanceof AuthError) {
e_1.setCorrelationId(this.correlationId);
}
serverTelemetryManager.cacheFailedRequest(e_1);
this.browserStorage.cleanRequestByState(validRequest.state);
throw e_1;
case 9: return [2 /*return*/];
}
});
});
};
/**
*
* @param validRequest
* @param popupName
* @param requestAuthority
* @param popup
* @param mainWindowRedirectUri
* @param popupWindowAttributes
*/
PopupClient.prototype.logoutPopupAsync = function (validRequest, popupName, popupWindowAttributes, requestAuthority, popup, mainWindowRedirectUri) {
return __awaiter(this, void 0, void 0, function () {
var serverTelemetryManager, authClient, logoutUri, popupWindow, navigationOptions, absoluteUrl, e_2;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
this.logger.verbose("logoutPopupAsync called");
this.eventHandler.emitEvent(EventType.LOGOUT_START, InteractionType.Popup, validRequest);
serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.logoutPopup);
_a.label = 1;
case 1:
_a.trys.push([1, 5, , 6]);
// Clear cache on logout
return [4 /*yield*/, this.clearCacheOnLogout(validRequest.account)];
case 2:
// Clear cache on logout
_a.sent();
return [4 /*yield*/, this.createAuthCodeClient(serverTelemetryManager, requestAuthority)];
case 3:
authClient = _a.sent();
this.logger.verbose("Auth code client created");
logoutUri = authClient.getLogoutUri(validRequest);
this.eventHandler.emitEvent(EventType.LOGOUT_SUCCESS, InteractionType.Popup, validRequest);
popupWindow = this.openPopup(logoutUri, { popupName: popupName, popupWindowAttributes: popupWindowAttributes, popup: popup });
this.eventHandler.emitEvent(EventType.POPUP_OPENED, InteractionType.Popup, { popupWindow: popupWindow }, null);
return [4 /*yield*/, this.waitForLogoutPopup(popupWindow)];
case 4:
_a.sent();
if (mainWindowRedirectUri) {
navigationOptions = {
apiId: ApiId.logoutPopup,
timeout: this.config.system.redirectNavigationTimeout,
noHistory: false
};
absoluteUrl = UrlString.getAbsoluteUrl(mainWindowRedirectUri, BrowserUtils.getCurrentUri());
this.logger.verbose("Redirecting main window to url specified in the request");
this.logger.verbosePii("Redirecting main window to: " + absoluteUrl);
this.navigationClient.navigateInternal(absoluteUrl, navigationOptions);
}
else {
this.logger.verbose("No main window navigation requested");
}
return [3 /*break*/, 6];
case 5:
e_2 = _a.sent();
if (popup) {
// Close the synchronous popup if an error is thrown before the window unload event is registered
popup.close();
}
if (e_2 instanceof AuthError) {
e_2.setCorrelationId(this.correlationId);
}
this.browserStorage.setInteractionInProgress(false);
this.eventHandler.emitEvent(EventType.LOGOUT_FAILURE, InteractionType.Popup, null, e_2);
this.eventHandler.emitEvent(EventType.LOGOUT_END, InteractionType.Popup);
serverTelemetryManager.cacheFailedRequest(e_2);
throw e_2;
case 6:
this.eventHandler.emitEvent(EventType.LOGOUT_END, InteractionType.Popup);
return [2 /*return*/];
}
});
});
};
/**
* Opens a popup window with given request Url.
* @param requestUrl
*/
PopupClient.prototype.initiateAuthRequest = function (requestUrl, params) {
// Check that request url is not empty.
if (!StringUtils.isEmpty(requestUrl)) {
this.logger.infoPii("Navigate to: " + requestUrl);
// Open the popup window to requestUrl.
return this.openPopup(requestUrl, params);
}
else {
// Throw error if request URL is empty.
this.logger.error("Navigate url is empty");
throw BrowserAuthError.createEmptyNavigationUriError();
}
};
/**
* Monitors a window until it loads a url with the same origin.
* @param popupWindow - window that is being monitored
* @param timeout - timeout for processing hash once popup is redirected back to application
*/
PopupClient.prototype.monitorPopupForHash = function (popupWindow) {
var _this = this;
return new Promise(function (resolve, reject) {
/*
* Polling for popups needs to be tick-based,
* since a non-trivial amount of time can be spent on interaction (which should not count against the timeout).
*/
var maxTicks = _this.config.system.windowHashTimeout / _this.config.system.pollIntervalMilliseconds;
var ticks = 0;
_this.logger.verbose("PopupHandler.monitorPopupForHash - polling started");
var intervalId = setInterval(function () {
// Window is closed
if (popupWindow.closed) {
_this.logger.error("PopupHandler.monitorPopupForHash - window closed");
_this.cleanPopup();
clearInterval(intervalId);
reject(BrowserAuthError.createUserCancelledError());
return;
}
var href = Constants.EMPTY_STRING;
var hash = Constants.EMPTY_STRING;
try {
/*
* Will throw if cross origin,
* which should be caught and ignored
* since we need the interval to keep running while on STS UI.
*/
href = popupWindow.location.href;
hash = popupWindow.location.hash;
}
catch (e) { }
// Don't process blank pages or cross domain
if (StringUtils.isEmpty(href) || href === "about:blank") {
return;
}
_this.logger.verbose("PopupHandler.monitorPopupForHash - popup window is on same origin as caller");
/*
* Only run clock when we are on same domain for popups
* as popup operations can take a long time.
*/
ticks++;
if (hash) {
_this.logger.verbose("PopupHandler.monitorPopupForHash - found hash in url");
clearInterval(intervalId);
_this.cleanPopup(popupWindow);
if (UrlString.hashContainsKnownProperties(hash)) {
_this.logger.verbose("PopupHandler.monitorPopupForHash - hash contains known properties, returning.");
resolve(hash);
}
else {
_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.");
_this.logger.errorPii("PopupHandler.monitorPopupForHash - hash found: " + hash);
reject(BrowserAuthError.createHashDoesNotContainKnownPropertiesError());
}
}
else if (ticks > maxTicks) {
_this.logger.error("PopupHandler.monitorPopupForHash - unable to find hash in url, timing out");
clearInterval(intervalId);
reject(BrowserAuthError.createMonitorPopupTimeoutError());
}
}, _this.config.system.pollIntervalMilliseconds);
});
};
/**
* Waits for user interaction in logout popup window
* @param popupWindow
* @returns
*/
PopupClient.prototype.waitForLogoutPopup = function (popupWindow) {
var _this = this;
return new Promise(function (resolve) {
_this.logger.verbose("PopupHandler.waitForLogoutPopup - polling started");
var intervalId = setInterval(function () {
// Window is closed
if (popupWindow.closed) {
_this.logger.error("PopupHandler.waitForLogoutPopup - window closed");
_this.cleanPopup();
clearInterval(intervalId);
resolve();
}
var href = Constants.EMPTY_STRING;
try {
/*
* Will throw if cross origin,
* which should be caught and ignored
* since we need the interval to keep running while on STS UI.
*/
href = popupWindow.location.href;
}
catch (e) { }
// Don't process blank pages or cross domain
if (StringUtils.isEmpty(href) || href === "about:blank") {
return;
}
_this.logger.verbose("PopupHandler.waitForLogoutPopup - popup window is on same origin as caller, closing.");
clearInterval(intervalId);
_this.cleanPopup(popupWindow);
resolve();
}, _this.config.system.pollIntervalMilliseconds);
});
};
/**
* @hidden
*
* Configures popup window for login.
*
* @param urlNavigate
* @param title
* @param popUpWidth
* @param popUpHeight
* @param popupWindowAttributes
* @ignore
* @hidden
*/
PopupClient.prototype.openPopup = function (urlNavigate, popupParams) {
try {
var popupWindow = void 0;
// Popup window passed in, setting url to navigate to
if (popupParams.popup) {
popupWindow = popupParams.popup;
this.logger.verbosePii("Navigating popup window to: " + urlNavigate);
popupWindow.location.assign(urlNavigate);
}
else if (typeof popupParams.popup === "undefined") {
// Popup will be undefined if it was not passed in
this.logger.verbosePii("Opening popup window to: " + urlNavigate);
popupWindow = this.openSizedPopup(urlNavigate, popupParams.popupName, popupParams.popupWindowAttributes);
}
// Popup will be null if popups are blocked
if (!popupWindow) {
throw BrowserAuthError.createEmptyWindowCreatedError();
}
if (popupWindow.focus) {
popupWindow.focus();
}
this.currentWindow = popupWindow;
window.addEventListener("beforeunload", this.unloadWindow);
return popupWindow;
}
catch (e) {
this.logger.error("error opening popup " + e.message);
this.browserStorage.setInteractionInProgress(false);
throw BrowserAuthError.createPopupWindowError(e.toString());
}
};
/**
* Helper function to set popup window dimensions and position
* @param urlNavigate
* @param popupName
* @param popupWindowAttributes
* @returns
*/
PopupClient.prototype.openSizedPopup = function (urlNavigate, popupName, popupWindowAttributes) {
var _a, _b, _c, _d;
/**
* adding winLeft and winTop to account for dual monitor
* using screenLeft and screenTop for IE8 and earlier
*/
var winLeft = window.screenLeft ? window.screenLeft : window.screenX;
var winTop = window.screenTop ? window.screenTop : window.screenY;
/**
* window.innerWidth displays browser window"s height and width excluding toolbars
* using document.documentElement.clientWidth for IE8 and earlier
*/
var winWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
var winHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
var width = (_a = popupWindowAttributes.popupSize) === null || _a === void 0 ? void 0 : _a.width;
var height = (_b = popupWindowAttributes.popupSize) === null || _b === void 0 ? void 0 : _b.height;
var top = (_c = popupWindowAttributes.popupPosition) === null || _c === void 0 ? void 0 : _c.top;
var left = (_d = popupWindowAttributes.popupPosition) === null || _d === void 0 ? void 0 : _d.left;
if (!width || width < 0 || width > winWidth) {
this.logger.verbose("Default popup window width used. Window width not configured or invalid.");
width = BrowserConstants.POPUP_WIDTH;
}
if (!height || height < 0 || height > winHeight) {
this.logger.verbose("Default popup window height used. Window height not configured or invalid.");
height = BrowserConstants.POPUP_HEIGHT;
}
if (!top || top < 0 || top > winHeight) {
this.logger.verbose("Default popup window top position used. Window top not configured or invalid.");
top = Math.max(0, ((winHeight / 2) - (BrowserConstants.POPUP_HEIGHT / 2)) + winTop);
}
if (!left || left < 0 || left > winWidth) {
this.logger.verbose("Default popup window left position used. Window left not configured or invalid.");
left = Math.max(0, ((winWidth / 2) - (BrowserConstants.POPUP_WIDTH / 2)) + winLeft);
}
return window.open(urlNavigate, popupName, "width=" + width + ", height=" + height + ", top=" + top + ", left=" + left + ", scrollbars=yes");
};
/**
* Event callback to unload main window.
*/
PopupClient.prototype.unloadWindow = function (e) {
this.browserStorage.cleanRequestByInteractionType(InteractionType.Popup);
if (this.currentWindow) {
this.currentWindow.close();
}
// Guarantees browser unload will happen, so no other errors will be thrown.
e.preventDefault();
};
/**
* Closes popup, removes any state vars created during popup calls.
* @param popupWindow
*/
PopupClient.prototype.cleanPopup = function (popupWindow) {
if (popupWindow) {
// Close window.
popupWindow.close();
}
// Remove window unload function
window.removeEventListener("beforeunload", this.unloadWindow);
// Interaction is completed - remove interaction status.
this.browserStorage.setInteractionInProgress(false);
};
/**
* Generates the name for the popup based on the client id and request
* @param clientId
* @param request
*/
PopupClient.prototype.generatePopupName = function (scopes, authority) {
return BrowserConstants.POPUP_NAME_PREFIX + "." + this.config.auth.clientId + "." + scopes.join("-") + "." + authority + "." + this.correlationId;
};
/**
* Generates the name for the popup based on the client id and request for logouts
* @param clientId
* @param request
*/
PopupClient.prototype.generateLogoutPopupName = function (request) {
var homeAccountId = request.account && request.account.homeAccountId;
return BrowserConstants.POPUP_NAME_PREFIX + "." + this.config.auth.clientId + "." + homeAccountId + "." + this.correlationId;
};
return PopupClient;
}(StandardInteractionClient));
export { PopupClient };
//# sourceMappingURL=PopupClient.js.map
{"version":3,"file":"PopupClient.js","sources":["../../src/interaction_client/PopupClient.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AuthenticationResult, CommonAuthorizationCodeRequest, AuthorizationCodeClient, ThrottlingUtils, CommonEndSessionRequest, UrlString, AuthError, OIDC_DEFAULT_SCOPES, Constants, ProtocolUtils, ServerAuthorizationCodeResponse, PerformanceEvents, StringUtils, IPerformanceClient, Logger, ICrypto } from \"@azure/msal-common\";\nimport { StandardInteractionClient } from \"./StandardInteractionClient\";\nimport { EventType } from \"../event/EventType\";\nimport { InteractionType, ApiId, BrowserConstants } from \"../utils/BrowserConstants\";\nimport { EndSessionPopupRequest } from \"../request/EndSessionPopupRequest\";\nimport { NavigationOptions } from \"../navigation/NavigationOptions\";\nimport { BrowserUtils } from \"../utils/BrowserUtils\";\nimport { PopupRequest } from \"../request/PopupRequest\";\nimport { NativeInteractionClient } from \"./NativeInteractionClient\";\nimport { NativeMessageHandler } from \"../broker/nativeBroker/NativeMessageHandler\";\nimport { BrowserAuthError } from \"../error/BrowserAuthError\";\nimport { INavigationClient } from \"../navigation/INavigationClient\";\nimport { EventHandler } from \"../event/EventHandler\";\nimport { BrowserCacheManager } from \"../cache/BrowserCacheManager\";\nimport { BrowserConfiguration } from \"../config/Configuration\";\nimport { InteractionHandler, InteractionParams } from \"../interaction_handler/InteractionHandler\";\nimport { PopupWindowAttributes } from \"../request/PopupWindowAttributes\";\n\nexport type PopupParams = InteractionParams & {\n popup?: Window|null;\n popupName: string;\n popupWindowAttributes: PopupWindowAttributes\n};\n\nexport class PopupClient extends StandardInteractionClient {\n private currentWindow: Window | undefined;\n protected nativeStorage: BrowserCacheManager;\n\n constructor(config: BrowserConfiguration, storageImpl: BrowserCacheManager, browserCrypto: ICrypto, logger: Logger, eventHandler: EventHandler, navigationClient: INavigationClient, performanceClient: IPerformanceClient, nativeStorageImpl: BrowserCacheManager, nativeMessageHandler?: NativeMessageHandler, correlationId?: string) {\n super(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, nativeMessageHandler, correlationId);\n // Properly sets this reference for the unload event.\n this.unloadWindow = this.unloadWindow.bind(this);\n this.nativeStorage = nativeStorageImpl;\n }\n\n /**\n * Acquires tokens by opening a popup window to the /authorize endpoint of the authority\n * @param request\n */\n acquireToken(request: PopupRequest): Promise<AuthenticationResult> {\n try {\n const popupName = this.generatePopupName(request.scopes || OIDC_DEFAULT_SCOPES, request.authority || this.config.auth.authority);\n const popupWindowAttributes = request.popupWindowAttributes || {};\n\n // asyncPopups flag is true. Acquires token without first opening popup. Popup will be opened later asynchronously.\n if (this.config.system.asyncPopups) {\n this.logger.verbose(\"asyncPopups set to true, acquiring token\");\n // Passes on popup position and dimensions if in request\n return this.acquireTokenPopupAsync(request, popupName, popupWindowAttributes);\n } else {\n // asyncPopups flag is set to false. Opens popup before acquiring token.\n this.logger.verbose(\"asyncPopup set to false, opening popup before acquiring token\");\n const popup = this.openSizedPopup(\"about:blank\", popupName, popupWindowAttributes);\n return this.acquireTokenPopupAsync(request, popupName, popupWindowAttributes, popup);\n }\n } catch (e) {\n return Promise.reject(e);\n }\n }\n\n /**\n * Clears local cache for the current user then opens a popup window prompting the user to sign-out of the server\n * @param logoutRequest\n */\n logout(logoutRequest?: EndSessionPopupRequest): Promise<void> {\n try {\n this.logger.verbose(\"logoutPopup called\");\n const validLogoutRequest = this.initializeLogoutRequest(logoutRequest);\n\n const popupName = this.generateLogoutPopupName(validLogoutRequest);\n const authority = logoutRequest && logoutRequest.authority;\n const mainWindowRedirectUri = logoutRequest && logoutRequest.mainWindowRedirectUri;\n const popupWindowAttributes = logoutRequest?.popupWindowAttributes || {};\n\n // asyncPopups flag is true. Acquires token without first opening popup. Popup will be opened later asynchronously.\n if (this.config.system.asyncPopups) {\n this.logger.verbose(\"asyncPopups set to true\");\n // Passes on popup position and dimensions if in request\n return this.logoutPopupAsync(validLogoutRequest, popupName, popupWindowAttributes, authority, undefined, mainWindowRedirectUri);\n } else {\n // asyncPopups flag is set to false. Opens popup before logging out.\n this.logger.verbose(\"asyncPopup set to false, opening popup\");\n const popup = this.openSizedPopup(\"about:blank\", popupName, popupWindowAttributes);\n return this.logoutPopupAsync(validLogoutRequest, popupName, popupWindowAttributes, authority, popup, mainWindowRedirectUri);\n }\n } catch (e) {\n // Since this function is synchronous we need to reject\n return Promise.reject(e);\n }\n }\n\n /**\n * Helper which obtains an access_token for your API via opening a popup window in the user's browser\n * @param validRequest\n * @param popupName\n * @param popup\n * @param popupWindowAttributes\n *\n * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.\n */\n protected async acquireTokenPopupAsync(request: PopupRequest, popupName: string, popupWindowAttributes: PopupWindowAttributes, popup?: Window|null): Promise<AuthenticationResult> {\n this.logger.verbose(\"acquireTokenPopupAsync called\");\n const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenPopup);\n const validRequest = await this.initializeAuthorizationRequest(request, InteractionType.Popup);\n this.browserStorage.updateCacheEntries(validRequest.state, validRequest.nonce, validRequest.authority, validRequest.loginHint || Constants.EMPTY_STRING, validRequest.account || null);\n\n try {\n // Create auth code request and generate PKCE params\n const authCodeRequest: CommonAuthorizationCodeRequest = await this.initializeAuthorizationCodeRequest(validRequest);\n\n // Initialize the client\n const authClient: AuthorizationCodeClient = await this.createAuthCodeClient(serverTelemetryManager, validRequest.authority, validRequest.azureCloudOptions);\n this.logger.verbose(\"Auth code client created\");\n\n const isNativeBroker = NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeMessageHandler, request.authenticationScheme);\n // Start measurement for server calls with native brokering enabled\n let fetchNativeAccountIdMeasurement;\n if (isNativeBroker) {\n fetchNativeAccountIdMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.FetchAccountIdWithNativeBroker, request.correlationId);\n }\n\n // Create acquire token url.\n const navigateUrl = await authClient.getAuthCodeUrl({\n ...validRequest,\n nativeBroker: isNativeBroker\n });\n\n // Create popup interaction handler.\n const interactionHandler = new InteractionHandler(authClient, this.browserStorage, authCodeRequest, this.logger);\n\n // Show the UI once the url has been created. Get the window handle for the popup.\n const popupParameters: PopupParams = {\n popup,\n popupName,\n popupWindowAttributes\n };\n const popupWindow: Window = this.initiateAuthRequest(navigateUrl, popupParameters);\n this.eventHandler.emitEvent(EventType.POPUP_OPENED, InteractionType.Popup, {popupWindow}, null);\n\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.\n const hash = await this.monitorPopupForHash(popupWindow);\n // Deserialize hash fragment response parameters.\n const serverParams: ServerAuthorizationCodeResponse = UrlString.getDeserializedHash(hash);\n const state = this.validateAndExtractStateFromHash(serverParams, InteractionType.Popup, validRequest.correlationId);\n // Remove throttle if it exists\n ThrottlingUtils.removeThrottle(this.browserStorage, this.config.auth.clientId, authCodeRequest);\n\n if (serverParams.accountId) {\n this.logger.verbose(\"Account id found in hash, calling WAM for token\");\n // end measurement for server call with native brokering enabled\n if (fetchNativeAccountIdMeasurement) {\n fetchNativeAccountIdMeasurement.endMeasurement({\n success: true,\n isNativeBroker: true\n });\n }\n\n if (!this.nativeMessageHandler) {\n throw BrowserAuthError.createNativeConnectionNotEstablishedError();\n }\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);\n const { userRequestState } = ProtocolUtils.parseRequestState(this.browserCrypto, state);\n return nativeInteractionClient.acquireToken({\n ...validRequest,\n state: userRequestState,\n prompt: undefined // Server should handle the prompt, ideally native broker can do this part silently\n }).finally(() => {\n this.browserStorage.cleanRequestByState(state);\n });\n }\n\n // Handle response from hash string.\n const result = await interactionHandler.handleCodeResponseFromHash(hash, state, authClient.authority, this.networkClient);\n\n return result;\n } catch (e) {\n if (popup) {\n // Close the synchronous popup if an error is thrown before the window unload event is registered\n popup.close();\n }\n\n if (e instanceof AuthError) {\n (e as AuthError).setCorrelationId(this.correlationId);\n }\n\n serverTelemetryManager.cacheFailedRequest(e);\n this.browserStorage.cleanRequestByState(validRequest.state);\n throw e;\n }\n }\n\n /**\n *\n * @param validRequest\n * @param popupName\n * @param requestAuthority\n * @param popup\n * @param mainWindowRedirectUri\n * @param popupWindowAttributes\n */\n protected async logoutPopupAsync(validRequest: CommonEndSessionRequest, popupName: string, popupWindowAttributes: PopupWindowAttributes, requestAuthority?: string, popup?: Window|null, mainWindowRedirectUri?: string): Promise<void> {\n this.logger.verbose(\"logoutPopupAsync called\");\n this.eventHandler.emitEvent(EventType.LOGOUT_START, InteractionType.Popup, validRequest);\n\n const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.logoutPopup);\n\n try {\n // Clear cache on logout\n await this.clearCacheOnLogout(validRequest.account);\n\n // Initialize the client\n const authClient = await this.createAuthCodeClient(serverTelemetryManager, requestAuthority);\n this.logger.verbose(\"Auth code client created\");\n\n // Create logout string and navigate user window to logout.\n const logoutUri: string = authClient.getLogoutUri(validRequest);\n\n this.eventHandler.emitEvent(EventType.LOGOUT_SUCCESS, InteractionType.Popup, validRequest);\n\n // Open the popup window to requestUrl.\n const popupWindow = this.openPopup(logoutUri, {popupName, popupWindowAttributes, popup});\n this.eventHandler.emitEvent(EventType.POPUP_OPENED, InteractionType.Popup, {popupWindow}, null);\n\n await this.waitForLogoutPopup(popupWindow);\n\n if (mainWindowRedirectUri) {\n const navigationOptions: NavigationOptions = {\n apiId: ApiId.logoutPopup,\n timeout: this.config.system.redirectNavigationTimeout,\n noHistory: false\n };\n const absoluteUrl = UrlString.getAbsoluteUrl(mainWindowRedirectUri, BrowserUtils.getCurrentUri());\n\n this.logger.verbose(\"Redirecting main window to url specified in the request\");\n this.logger.verbosePii(`Redirecting main window to: ${absoluteUrl}`);\n this.navigationClient.navigateInternal(absoluteUrl, navigationOptions);\n } else {\n this.logger.verbose(\"No main window navigation requested\");\n }\n } catch (e) {\n if (popup) {\n // Close the synchronous popup if an error is thrown before the window unload event is registered\n popup.close();\n }\n\n if (e instanceof AuthError) {\n (e as AuthError).setCorrelationId(this.correlationId);\n }\n\n this.browserStorage.setInteractionInProgress(false);\n this.eventHandler.emitEvent(EventType.LOGOUT_FAILURE, InteractionType.Popup, null, e);\n this.eventHandler.emitEvent(EventType.LOGOUT_END, InteractionType.Popup);\n serverTelemetryManager.cacheFailedRequest(e);\n throw e;\n }\n\n this.eventHandler.emitEvent(EventType.LOGOUT_END, InteractionType.Popup);\n }\n\n /**\n * Opens a popup window with given request Url.\n * @param requestUrl\n */\n initiateAuthRequest(requestUrl: string, params: PopupParams): Window {\n // Check that request url is not empty.\n if (!StringUtils.isEmpty(requestUrl)) {\n this.logger.infoPii(`Navigate to: ${requestUrl}`);\n // Open the popup window to requestUrl.\n return this.openPopup(requestUrl, params);\n } else {\n // Throw error if request URL is empty.\n this.logger.error(\"Navigate url is empty\");\n throw BrowserAuthError.createEmptyNavigationUriError();\n }\n }\n\n /**\n * Monitors a window until it loads a url with the same origin.\n * @param popupWindow - window that is being monitored\n * @param timeout - timeout for processing hash once popup is redirected back to application\n */\n monitorPopupForHash(popupWindow: Window): Promise<string> {\n return new Promise((resolve, reject) => {\n /*\n * Polling for popups needs to be tick-based,\n * since a non-trivial amount of time can be spent on interaction (which should not count against the timeout).\n */\n const maxTicks = this.config.system.windowHashTimeout / this.config.system.pollIntervalMilliseconds;\n let ticks = 0;\n\n this.logger.verbose(\"PopupHandler.monitorPopupForHash - polling started\");\n\n const intervalId = setInterval(() => {\n // Window is closed\n if (popupWindow.closed) {\n this.logger.error(\"PopupHandler.monitorPopupForHash - window closed\");\n this.cleanPopup();\n clearInterval(intervalId);\n reject(BrowserAuthError.createUserCancelledError());\n return;\n }\n\n let href: string = Constants.EMPTY_STRING;\n let hash: string = Constants.EMPTY_STRING;\n try {\n /*\n * Will throw if cross origin,\n * which should be caught and ignored\n * since we need the interval to keep running while on STS UI.\n */\n href = popupWindow.location.href;\n hash = popupWindow.location.hash;\n } catch (e) {}\n\n // Don't process blank pages or cross domain\n if (StringUtils.isEmpty(href) || href === \"about:blank\") {\n return;\n }\n\n this.logger.verbose(\"PopupHandler.monitorPopupForHash - popup window is on same origin as caller\");\n\n /*\n * Only run clock when we are on same domain for popups\n * as popup operations can take a long time.\n */\n ticks++;\n\n if (hash) {\n this.logger.verbose(\"PopupHandler.monitorPopupForHash - found hash in url\");\n clearInterval(intervalId);\n this.cleanPopup(popupWindow);\n\n if (UrlString.hashContainsKnownProperties(hash)) {\n this.logger.verbose(\"PopupHandler.monitorPopupForHash - hash contains known properties, returning.\");\n resolve(hash);\n } else {\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.\");\n this.logger.errorPii(`PopupHandler.monitorPopupForHash - hash found: ${hash}`);\n reject(BrowserAuthError.createHashDoesNotContainKnownPropertiesError());\n }\n } else if (ticks > maxTicks) {\n this.logger.error(\"PopupHandler.monitorPopupForHash - unable to find hash in url, timing out\");\n clearInterval(intervalId);\n reject(BrowserAuthError.createMonitorPopupTimeoutError());\n }\n }, this.config.system.pollIntervalMilliseconds);\n });\n }\n\n /**\n * Waits for user interaction in logout popup window\n * @param popupWindow\n * @returns\n */\n waitForLogoutPopup(popupWindow: Window): Promise<void> {\n return new Promise((resolve) => {\n this.logger.verbose(\"PopupHandler.waitForLogoutPopup - polling started\");\n\n const intervalId = setInterval(() => {\n // Window is closed\n if (popupWindow.closed) {\n this.logger.error(\"PopupHandler.waitForLogoutPopup - window closed\");\n this.cleanPopup();\n clearInterval(intervalId);\n resolve();\n }\n\n let href: string = Constants.EMPTY_STRING;\n try {\n /*\n * Will throw if cross origin,\n * which should be caught and ignored\n * since we need the interval to keep running while on STS UI.\n */\n href = popupWindow.location.href;\n } catch (e) {}\n\n // Don't process blank pages or cross domain\n if (StringUtils.isEmpty(href) || href === \"about:blank\") {\n return;\n }\n\n this.logger.verbose(\"PopupHandler.waitForLogoutPopup - popup window is on same origin as caller, closing.\");\n\n clearInterval(intervalId);\n this.cleanPopup(popupWindow);\n resolve();\n }, this.config.system.pollIntervalMilliseconds);\n });\n }\n\n /**\n * @hidden\n *\n * Configures popup window for login.\n *\n * @param urlNavigate\n * @param title\n * @param popUpWidth\n * @param popUpHeight\n * @param popupWindowAttributes\n * @ignore\n * @hidden\n */\n openPopup(urlNavigate: string, popupParams: PopupParams): Window {\n try {\n let popupWindow;\n // Popup window passed in, setting url to navigate to\n if (popupParams.popup) {\n popupWindow = popupParams.popup;\n this.logger.verbosePii(`Navigating popup window to: ${urlNavigate}`);\n popupWindow.location.assign(urlNavigate);\n } else if (typeof popupParams.popup === \"undefined\") {\n // Popup will be undefined if it was not passed in\n this.logger.verbosePii(`Opening popup window to: ${urlNavigate}`);\n popupWindow = this.openSizedPopup(urlNavigate, popupParams.popupName, popupParams.popupWindowAttributes);\n }\n\n // Popup will be null if popups are blocked\n if (!popupWindow) {\n throw BrowserAuthError.createEmptyWindowCreatedError();\n }\n if (popupWindow.focus) {\n popupWindow.focus();\n }\n this.currentWindow = popupWindow;\n window.addEventListener(\"beforeunload\", this.unloadWindow);\n\n return popupWindow;\n } catch (e) {\n this.logger.error(\"error opening popup \" + (e as AuthError).message);\n this.browserStorage.setInteractionInProgress(false);\n throw BrowserAuthError.createPopupWindowError((e as AuthError).toString());\n }\n }\n\n /**\n * Helper function to set popup window dimensions and position\n * @param urlNavigate\n * @param popupName\n * @param popupWindowAttributes\n * @returns\n */\n openSizedPopup(urlNavigate: string, popupName: string, popupWindowAttributes: PopupWindowAttributes): Window|null {\n /**\n * adding winLeft and winTop to account for dual monitor\n * using screenLeft and screenTop for IE8 and earlier\n */\n const winLeft = window.screenLeft ? window.screenLeft : window.screenX;\n const winTop = window.screenTop ? window.screenTop : window.screenY;\n /**\n * window.innerWidth displays browser window\"s height and width excluding toolbars\n * using document.documentElement.clientWidth for IE8 and earlier\n */\n const winWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;\n const winHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;\n\n let width = popupWindowAttributes.popupSize?.width;\n let height = popupWindowAttributes.popupSize?.height;\n let top = popupWindowAttributes.popupPosition?.top;\n let left = popupWindowAttributes.popupPosition?.left;\n\n if (!width || width < 0 || width > winWidth) {\n this.logger.verbose(\"Default popup window width used. Window width not configured or invalid.\");\n width = BrowserConstants.POPUP_WIDTH;\n }\n\n if (!height || height < 0 || height > winHeight) {\n this.logger.verbose(\"Default popup window height used. Window height not configured or invalid.\");\n height = BrowserConstants.POPUP_HEIGHT;\n }\n\n if (!top || top < 0 || top > winHeight) {\n this.logger.verbose(\"Default popup window top position used. Window top not configured or invalid.\");\n top = Math.max(0, ((winHeight / 2) - (BrowserConstants.POPUP_HEIGHT / 2)) + winTop);\n }\n\n if (!left || left < 0 || left > winWidth) {\n this.logger.verbose(\"Default popup window left position used. Window left not configured or invalid.\");\n left = Math.max(0, ((winWidth / 2) - (BrowserConstants.POPUP_WIDTH / 2)) + winLeft);\n }\n\n return window.open(urlNavigate, popupName, `width=${width}, height=${height}, top=${top}, left=${left}, scrollbars=yes`);\n }\n\n /**\n * Event callback to unload main window.\n */\n unloadWindow(e: Event): void {\n this.browserStorage.cleanRequestByInteractionType(InteractionType.Popup);\n if (this.currentWindow) {\n this.currentWindow.close();\n }\n // Guarantees browser unload will happen, so no other errors will be thrown.\n e.preventDefault();\n }\n\n /**\n * Closes popup, removes any state vars created during popup calls.\n * @param popupWindow\n */\n cleanPopup(popupWindow?: Window): void {\n if (popupWindow) {\n // Close window.\n popupWindow.close();\n }\n // Remove window unload function\n window.removeEventListener(\"beforeunload\", this.unloadWindow);\n\n // Interaction is completed - remove interaction status.\n this.browserStorage.setInteractionInProgress(false);\n }\n\n /**\n * Generates the name for the popup based on the client id and request\n * @param clientId\n * @param request\n */\n generatePopupName(scopes: Array<string>, authority: string): string {\n return `${BrowserConstants.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${scopes.join(\"-\")}.${authority}.${this.correlationId}`;\n }\n\n /**\n * Generates the name for the popup based on the client id and request for logouts\n * @param clientId\n * @param request\n */\n generateLogoutPopupName(request: CommonEndSessionRequest): string {\n const homeAccountId = request.account && request.account.homeAccountId;\n return `${BrowserConstants.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${homeAccountId}.${this.correlationId}`;\n }\n}\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,kBAAM,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,EAAE,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,aAAa,CAAC,SAI5I;;QAFG,KAAI,CAAC,YAAY,GAAG,KAAI,CAAC,YAAY,CAAC,IAAI,CAAC,KAAI,CAAC,CAAC;QACjD,KAAI,CAAC,aAAa,GAAG,iBAAiB,CAAC;;KAC1C;;;;;IAMD,kCAAY,GAAZ,UAAa,OAAqB;QAC9B,IAAI;YACA,IAAM,SAAS,GAAG,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,MAAM,IAAI,mBAAmB,EAAE,OAAO,CAAC,SAAS,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YACjI,IAAM,qBAAqB,GAAG,OAAO,CAAC,qBAAqB,IAAI,EAAE,CAAC;;YAGlE,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE;gBAChC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,0CAA0C,CAAC,CAAC;;gBAEhE,OAAO,IAAI,CAAC,sBAAsB,CAAC,OAAO,EAAE,SAAS,EAAE,qBAAqB,CAAC,CAAC;aACjF;iBAAM;;gBAEH,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,+DAA+D,CAAC,CAAC;gBACrF,IAAM,KAAK,GAAG,IAAI,CAAC,cAAc,CAAC,aA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AAC;AAAD,CA3fA,CAAiC,yBAAyB;;;;"}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment