@azure/msal-browser 2.31.0 → 2.32.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/_virtual/_tslib.js +1 -1
- package/dist/app/ClientApplication.js +1 -1
- package/dist/app/IPublicClientApplication.js +1 -1
- package/dist/app/PublicClientApplication.js +1 -1
- package/dist/broker/nativeBroker/NativeMessageHandler.js +1 -1
- package/dist/cache/AsyncMemoryStorage.js +1 -1
- package/dist/cache/BrowserCacheManager.d.ts +9 -0
- package/dist/cache/BrowserCacheManager.d.ts.map +1 -1
- package/dist/cache/BrowserCacheManager.js +14 -1
- package/dist/cache/BrowserCacheManager.js.map +1 -1
- package/dist/cache/BrowserStorage.js +1 -1
- package/dist/cache/CryptoKeyStore.js +1 -1
- package/dist/cache/DatabaseStorage.js +1 -1
- package/dist/cache/MemoryStorage.js +1 -1
- package/dist/cache/TokenCache.js +2 -2
- package/dist/cache/TokenCache.js.map +1 -1
- package/dist/config/Configuration.js +1 -1
- package/dist/crypto/BrowserCrypto.js +1 -1
- package/dist/crypto/CryptoOps.js +1 -1
- package/dist/crypto/GuidGenerator.js +1 -1
- package/dist/crypto/ModernBrowserCrypto.js +1 -1
- package/dist/crypto/MsBrowserCrypto.js +1 -1
- package/dist/crypto/MsrBrowserCrypto.js +1 -1
- package/dist/crypto/PkceGenerator.js +1 -1
- package/dist/crypto/SignedHttpRequest.js +1 -1
- package/dist/encode/Base64Decode.js +1 -1
- package/dist/encode/Base64Encode.js +1 -1
- package/dist/error/BrowserAuthError.js +1 -1
- package/dist/error/BrowserConfigurationAuthError.js +1 -1
- package/dist/error/NativeAuthError.js +1 -1
- package/dist/event/EventHandler.js +1 -1
- package/dist/event/EventMessage.js +1 -1
- package/dist/event/EventType.js +1 -1
- package/dist/index.cjs.js +164 -88
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/interaction_client/BaseInteractionClient.js +3 -3
- package/dist/interaction_client/BaseInteractionClient.js.map +1 -1
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.js +1 -1
- package/dist/interaction_client/NativeInteractionClient.js +1 -1
- package/dist/interaction_client/PopupClient.js +1 -1
- package/dist/interaction_client/RedirectClient.js +1 -1
- package/dist/interaction_client/SilentAuthCodeClient.js +1 -1
- package/dist/interaction_client/SilentCacheClient.js +1 -1
- package/dist/interaction_client/SilentIframeClient.js +1 -1
- package/dist/interaction_client/SilentRefreshClient.js +1 -1
- package/dist/interaction_client/StandardInteractionClient.js +2 -2
- package/dist/interaction_client/StandardInteractionClient.js.map +1 -1
- package/dist/interaction_handler/InteractionHandler.js +2 -2
- package/dist/interaction_handler/InteractionHandler.js.map +1 -1
- package/dist/interaction_handler/RedirectHandler.js +1 -1
- package/dist/interaction_handler/SilentHandler.js +1 -1
- package/dist/internals.js +1 -1
- package/dist/navigation/NavigationClient.js +1 -1
- package/dist/network/FetchClient.js +1 -1
- package/dist/network/XhrClient.js +1 -1
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/packageMetadata.js +2 -2
- package/dist/packageMetadata.js.map +1 -1
- package/dist/telemetry/BrowserPerformanceClient.js +1 -1
- package/dist/telemetry/BrowserPerformanceMeasurement.js +1 -1
- package/dist/utils/BrowserConstants.d.ts +2 -1
- package/dist/utils/BrowserConstants.d.ts.map +1 -1
- package/dist/utils/BrowserConstants.js +2 -1
- package/dist/utils/BrowserConstants.js.map +1 -1
- package/dist/utils/BrowserProtocolUtils.js +1 -1
- package/dist/utils/BrowserStringUtils.js +1 -1
- package/dist/utils/BrowserUtils.js +1 -1
- package/dist/utils/MathUtils.js +1 -1
- package/lib/msal-browser.js +164 -88
- package/lib/msal-browser.js.map +1 -1
- package/lib/msal-browser.min.js +41 -40
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ export { LoadTokenOptions } from "./cache/TokenCache";
|
|
|
30
30
|
export { EventMessage, EventPayload, EventError, EventCallbackFunction, EventMessageUtils, PopupEvent } from "./event/EventMessage";
|
|
31
31
|
export { EventType } from "./event/EventType";
|
|
32
32
|
export { SignedHttpRequest, SignedHttpRequestOptions } from "./crypto/SignedHttpRequest";
|
|
33
|
+
export { PopupWindowAttributes } from "./request/PopupWindowAttributes";
|
|
33
34
|
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";
|
|
34
35
|
export { version } from "./packageMetadata";
|
|
35
36
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"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;AAGp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YAAY,EAAE,UAAU,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACpI,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEzF,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAGxE,OAAO,EACH,oBAAoB,EAEpB,WAAW,EACX,aAAa,EAEb,oBAAoB,EAEpB,SAAS,EACT,gBAAgB,EAChB,eAAe,EACf,sBAAsB,EACtB,wBAAwB,EACxB,+BAA+B,EAC/B,4BAA4B,EAC5B,mCAAmC,EACnC,WAAW,EAEX,cAAc,EACd,eAAe,EACf,qBAAqB,EAErB,eAAe,EACf,MAAM,EACN,QAAQ,EAER,YAAY,EAEZ,qBAAqB,EAErB,WAAW,EACX,SAAS,EAET,kBAAkB,EAClB,iBAAiB,EACjB,0BAA0B,EAC1B,mBAAmB,EACnB,2BAA2B,EAC3B,gBAAgB,EAChB,iBAAiB,EACpB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-browser v2.
|
|
1
|
+
/*! @azure/msal-browser v2.32.1 2022-12-07 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { __awaiter, __generator, __spread, __assign } from '../_virtual/_tslib.js';
|
|
4
4
|
import { AccountEntity, AuthenticationScheme, ClientConfigurationError, StringUtils, UrlString, ServerTelemetryManager, AuthorityFactory } from '@azure/msal-common';
|
|
@@ -161,11 +161,11 @@ var BaseInteractionClient = /** @class */ (function () {
|
|
|
161
161
|
};
|
|
162
162
|
if (!requestAuthority) return [3 /*break*/, 2];
|
|
163
163
|
this.logger.verbose("Creating discovered authority with request authority");
|
|
164
|
-
return [4 /*yield*/, AuthorityFactory.createDiscoveredInstance(requestAuthority, this.config.system.networkClient, this.browserStorage, authorityOptions)];
|
|
164
|
+
return [4 /*yield*/, AuthorityFactory.createDiscoveredInstance(requestAuthority, this.config.system.networkClient, this.browserStorage, authorityOptions, this.logger)];
|
|
165
165
|
case 1: return [2 /*return*/, _a.sent()];
|
|
166
166
|
case 2:
|
|
167
167
|
this.logger.verbose("Creating discovered authority with configured authority");
|
|
168
|
-
return [4 /*yield*/, AuthorityFactory.createDiscoveredInstance(this.config.auth.authority, this.config.system.networkClient, this.browserStorage, authorityOptions)];
|
|
168
|
+
return [4 /*yield*/, AuthorityFactory.createDiscoveredInstance(this.config.auth.authority, this.config.system.networkClient, this.browserStorage, authorityOptions, this.logger)];
|
|
169
169
|
case 3: return [2 /*return*/, _a.sent()];
|
|
170
170
|
}
|
|
171
171
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"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);\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);\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,gBAAgB,CAAC;QACzC,IAAI,CAAC,oBAAoB,GAAG,oBAAoB,CAAC;QACjD,I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AAiB;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,CAAC,EAAA;4BAAjJ,sBAAO,SAA0I,EAAC;;wBAGtJ,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,CAAC,EAAA;4BAA3J,sBAAO,SAAoJ,EAAC;;;;KAC/J;IACL,4BAAC;AAAD,CAAC;;;;"}
|
|
1
|
+
{"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;QACj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AC,MAAM,CAAC,IAAI,CAAC,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;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-browser v2.
|
|
1
|
+
/*! @azure/msal-browser v2.32.1 2022-12-07 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { __extends, __awaiter, __generator, __rest, __assign } from '../_virtual/_tslib.js';
|
|
4
4
|
import { PerformanceEvents, TimeUtils, ScopeSet, ClientAuthError, IdTokenEntity, Constants, AccessTokenEntity, AuthenticationScheme, PopTokenGenerator, AccountEntity, AuthorityType, AuthToken, UrlString, OIDC_DEFAULT_SCOPES, PromptValue } from '@azure/msal-common';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-browser v2.
|
|
1
|
+
/*! @azure/msal-browser v2.32.1 2022-12-07 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { __extends, __awaiter, __generator, __assign } from '../_virtual/_tslib.js';
|
|
4
4
|
import { OIDC_DEFAULT_SCOPES, StringUtils, UrlString, Constants, AuthError, ThrottlingUtils, ProtocolUtils, PerformanceEvents } from '@azure/msal-common';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-browser v2.
|
|
1
|
+
/*! @azure/msal-browser v2.32.1 2022-12-07 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { __extends, __awaiter, __generator, __assign } from '../_virtual/_tslib.js';
|
|
4
4
|
import { UrlString, AuthError, Constants, ThrottlingUtils, ProtocolUtils } from '@azure/msal-common';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-browser v2.
|
|
1
|
+
/*! @azure/msal-browser v2.32.1 2022-12-07 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { __extends, __awaiter, __generator, __assign } from '../_virtual/_tslib.js';
|
|
4
4
|
import { StandardInteractionClient } from './StandardInteractionClient.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-browser v2.
|
|
1
|
+
/*! @azure/msal-browser v2.32.1 2022-12-07 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { __extends, __awaiter, __generator, __assign } from '../_virtual/_tslib.js';
|
|
4
4
|
import { AuthError, Constants, PerformanceEvents, StringUtils, PromptValue, UrlString, ProtocolUtils } from '@azure/msal-common';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-browser v2.
|
|
1
|
+
/*! @azure/msal-browser v2.32.1 2022-12-07 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { __extends, __awaiter, __generator, __assign } from '../_virtual/_tslib.js';
|
|
4
4
|
import { StandardInteractionClient } from './StandardInteractionClient.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-browser v2.
|
|
1
|
+
/*! @azure/msal-browser v2.32.1 2022-12-07 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { __extends, __awaiter, __generator, __assign } from '../_virtual/_tslib.js';
|
|
4
4
|
import { UrlString, Constants, AuthorizationCodeClient, PerformanceEvents, Authority, AuthorityFactory, ResponseMode, StringUtils, ProtocolUtils } from '@azure/msal-common';
|
|
@@ -229,7 +229,7 @@ var StandardInteractionClient = /** @class */ (function (_super) {
|
|
|
229
229
|
userAuthority = requestAuthority ? requestAuthority : this.config.auth.authority;
|
|
230
230
|
builtAuthority = Authority.generateAuthority(userAuthority, requestAzureCloudOptions || this.config.auth.azureCloudOptions);
|
|
231
231
|
this.logger.verbose("Creating discovered authority with configured authority", this.correlationId);
|
|
232
|
-
return [4 /*yield*/, AuthorityFactory.createDiscoveredInstance(builtAuthority, this.config.system.networkClient, this.browserStorage, authorityOptions)
|
|
232
|
+
return [4 /*yield*/, AuthorityFactory.createDiscoveredInstance(builtAuthority, this.config.system.networkClient, this.browserStorage, authorityOptions, this.logger)
|
|
233
233
|
.then(function (result) {
|
|
234
234
|
getAuthorityMeasurement.endMeasurement({
|
|
235
235
|
success: true
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StandardInteractionClient.js","sources":["../../src/interaction_client/StandardInteractionClient.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ServerTelemetryManager, CommonAuthorizationCodeRequest, Constants, AuthorizationCodeClient, ClientConfiguration, AuthorityOptions, Authority, AuthorityFactory, ServerAuthorizationCodeResponse, UrlString, CommonEndSessionRequest, ProtocolUtils, ResponseMode, StringUtils, IdTokenClaims, AccountInfo, AzureCloudOptions, PerformanceEvents, AuthError } from \"@azure/msal-common\";\nimport { BaseInteractionClient } from \"./BaseInteractionClient\";\nimport { AuthorizationUrlRequest } from \"../request/AuthorizationUrlRequest\";\nimport { BrowserConstants, InteractionType } from \"../utils/BrowserConstants\";\nimport { version } from \"../packageMetadata\";\nimport { BrowserAuthError } from \"../error/BrowserAuthError\";\nimport { BrowserProtocolUtils, BrowserStateObject } from \"../utils/BrowserProtocolUtils\";\nimport { EndSessionRequest } from \"../request/EndSessionRequest\";\nimport { BrowserUtils } from \"../utils/BrowserUtils\";\nimport { RedirectRequest } from \"../request/RedirectRequest\";\nimport { PopupRequest } from \"../request/PopupRequest\";\nimport { SsoSilentRequest } from \"../request/SsoSilentRequest\";\n\n/**\n * Defines the class structure and helper functions used by the \"standard\", non-brokered auth flows (popup, redirect, silent (RT), silent (iframe))\n */\nexport abstract class StandardInteractionClient extends BaseInteractionClient {\n /**\n * Generates an auth code request tied to the url request.\n * @param request\n */\n protected async initializeAuthorizationCodeRequest(request: AuthorizationUrlRequest): Promise<CommonAuthorizationCodeRequest> {\n this.logger.verbose(\"initializeAuthorizationRequest called\", request.correlationId);\n const generatedPkceParams = await this.browserCrypto.generatePkceCodes();\n\n const authCodeRequest: CommonAuthorizationCodeRequest = {\n ...request,\n redirectUri: request.redirectUri,\n code: Constants.EMPTY_STRING,\n codeVerifier: generatedPkceParams.verifier\n };\n\n request.codeChallenge = generatedPkceParams.challenge;\n request.codeChallengeMethod = Constants.S256_CODE_CHALLENGE_METHOD;\n\n return authCodeRequest;\n }\n\n /**\n * Initializer for the logout request.\n * @param logoutRequest\n */\n protected initializeLogoutRequest(logoutRequest?: EndSessionRequest): CommonEndSessionRequest {\n this.logger.verbose(\"initializeLogoutRequest called\", logoutRequest?.correlationId);\n\n const validLogoutRequest: CommonEndSessionRequest = {\n correlationId: this.correlationId || this.browserCrypto.createNewGuid(),\n ...logoutRequest\n };\n\n /**\n * Set logout_hint to be login_hint from ID Token Claims if present\n * and logoutHint attribute wasn't manually set in logout request\n */\n if (logoutRequest) {\n // If logoutHint isn't set and an account was passed in, try to extract logoutHint from ID Token Claims\n if (!logoutRequest.logoutHint) {\n if(logoutRequest.account) {\n const logoutHint = this.getLogoutHintFromIdTokenClaims(logoutRequest.account);\n if (logoutHint) {\n this.logger.verbose(\"Setting logoutHint to login_hint ID Token Claim value for the account provided\");\n validLogoutRequest.logoutHint = logoutHint;\n }\n } else {\n this.logger.verbose(\"logoutHint was not set and account was not passed into logout request, logoutHint will not be set\");\n }\n } else {\n this.logger.verbose(\"logoutHint has already been set in logoutRequest\");\n }\n } else {\n this.logger.verbose(\"logoutHint will not be set since no logout request was configured\");\n }\n\n /*\n * Only set redirect uri if logout request isn't provided or the set uri isn't null.\n * Otherwise, use passed uri, config, or current page.\n */\n if (!logoutRequest || logoutRequest.postLogoutRedirectUri !== null) {\n if (logoutRequest && logoutRequest.postLogoutRedirectUri) {\n this.logger.verbose(\"Setting postLogoutRedirectUri to uri set on logout request\", validLogoutRequest.correlationId);\n validLogoutRequest.postLogoutRedirectUri = UrlString.getAbsoluteUrl(logoutRequest.postLogoutRedirectUri, BrowserUtils.getCurrentUri());\n } else if (this.config.auth.postLogoutRedirectUri === null) {\n this.logger.verbose(\"postLogoutRedirectUri configured as null and no uri set on request, not passing post logout redirect\", validLogoutRequest.correlationId);\n } else if (this.config.auth.postLogoutRedirectUri) {\n this.logger.verbose(\"Setting postLogoutRedirectUri to configured uri\", validLogoutRequest.correlationId);\n validLogoutRequest.postLogoutRedirectUri = UrlString.getAbsoluteUrl(this.config.auth.postLogoutRedirectUri, BrowserUtils.getCurrentUri());\n } else {\n this.logger.verbose(\"Setting postLogoutRedirectUri to current page\", validLogoutRequest.correlationId);\n validLogoutRequest.postLogoutRedirectUri = UrlString.getAbsoluteUrl(BrowserUtils.getCurrentUri(), BrowserUtils.getCurrentUri());\n }\n } else {\n this.logger.verbose(\"postLogoutRedirectUri passed as null, not setting post logout redirect uri\", validLogoutRequest.correlationId);\n }\n\n return validLogoutRequest;\n }\n\n /**\n * Parses login_hint ID Token Claim out of AccountInfo object to be used as\n * logout_hint in end session request.\n * @param account\n */\n protected getLogoutHintFromIdTokenClaims(account: AccountInfo): string | null {\n const idTokenClaims: IdTokenClaims | undefined = account.idTokenClaims;\n if (idTokenClaims) {\n if (idTokenClaims.login_hint) {\n return idTokenClaims.login_hint;\n } else {\n this.logger.verbose(\"The ID Token Claims tied to the provided account do not contain a login_hint claim, logoutHint will not be added to logout request\");\n }\n } else {\n this.logger.verbose(\"The provided account does not contain ID Token Claims, logoutHint will not be added to logout request\");\n }\n\n return null;\n }\n\n /**\n * Creates an Authorization Code Client with the given authority, or the default authority.\n * @param serverTelemetryManager\n * @param authorityUrl\n */\n protected async createAuthCodeClient(serverTelemetryManager: ServerTelemetryManager, authorityUrl?: string, requestAzureCloudOptions?: AzureCloudOptions): Promise<AuthorizationCodeClient> {\n // Create auth module.\n const clientConfig = await this.getClientConfiguration(serverTelemetryManager, authorityUrl, requestAzureCloudOptions);\n return new AuthorizationCodeClient(clientConfig);\n }\n\n /**\n * Creates a Client Configuration object with the given request authority, or the default authority.\n * @param serverTelemetryManager\n * @param requestAuthority\n * @param requestCorrelationId\n */\n protected async getClientConfiguration(serverTelemetryManager: ServerTelemetryManager, requestAuthority?: string, requestAzureCloudOptions?: AzureCloudOptions): Promise<ClientConfiguration> {\n this.logger.verbose(\"getClientConfiguration called\", this.correlationId);\n const discoveredAuthority = await this.getDiscoveredAuthority(requestAuthority, requestAzureCloudOptions);\n\n return {\n authOptions: {\n clientId: this.config.auth.clientId,\n authority: discoveredAuthority,\n clientCapabilities: this.config.auth.clientCapabilities\n },\n systemOptions: {\n tokenRenewalOffsetSeconds: this.config.system.tokenRenewalOffsetSeconds,\n preventCorsPreflight: true\n },\n loggerOptions: {\n loggerCallback: this.config.system.loggerOptions.loggerCallback,\n piiLoggingEnabled: this.config.system.loggerOptions.piiLoggingEnabled,\n logLevel: this.config.system.loggerOptions.logLevel,\n correlationId: this.correlationId\n },\n cryptoInterface: this.browserCrypto,\n networkInterface: this.networkClient,\n storageInterface: this.browserStorage,\n serverTelemetryManager: serverTelemetryManager,\n libraryInfo: {\n sku: BrowserConstants.MSAL_SKU,\n version: version,\n cpu: Constants.EMPTY_STRING,\n os: Constants.EMPTY_STRING\n },\n telemetry: this.config.telemetry\n };\n }\n\n /**\n * @param hash\n * @param interactionType\n */\n protected validateAndExtractStateFromHash(serverParams: ServerAuthorizationCodeResponse, interactionType: InteractionType, requestCorrelationId?: string): string {\n this.logger.verbose(\"validateAndExtractStateFromHash called\", requestCorrelationId);\n if (!serverParams.state) {\n throw BrowserAuthError.createHashDoesNotContainStateError();\n }\n\n const platformStateObj = BrowserProtocolUtils.extractBrowserRequestState(this.browserCrypto, serverParams.state);\n if (!platformStateObj) {\n throw BrowserAuthError.createUnableToParseStateError();\n }\n\n if (platformStateObj.interactionType !== interactionType) {\n throw BrowserAuthError.createStateInteractionTypeMismatchError();\n }\n\n this.logger.verbose(\"Returning state from hash\", requestCorrelationId);\n return serverParams.state;\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, requestAzureCloudOptions?: AzureCloudOptions): Promise<Authority> {\n this.logger.verbose(\"getDiscoveredAuthority called\", this.correlationId);\n const getAuthorityMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.StandardInteractionClientGetDiscoveredAuthority, this.correlationId);\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 skipAuthorityMetadataCache: this.config.auth.skipAuthorityMetadataCache\n };\n\n // build authority string based on auth params, precedence - azureCloudInstance + tenant >> authority\n const userAuthority = requestAuthority ? requestAuthority : this.config.auth.authority;\n\n // fall back to the authority from config\n const builtAuthority = Authority.generateAuthority( userAuthority, requestAzureCloudOptions || this.config.auth.azureCloudOptions);\n this.logger.verbose(\"Creating discovered authority with configured authority\", this.correlationId);\n return await AuthorityFactory.createDiscoveredInstance(builtAuthority, this.config.system.networkClient, this.browserStorage, authorityOptions)\n .then((result: Authority) => {\n getAuthorityMeasurement.endMeasurement({\n success: true\n });\n\n return result;\n })\n .catch((error:AuthError) => {\n getAuthorityMeasurement.endMeasurement({\n errorCode: error.errorCode,\n subErrorCode: error.subError,\n success: false\n });\n\n throw error;\n });\n }\n\n /**\n * Helper to initialize required request parameters for interactive APIs and ssoSilent()\n * @param request\n * @param interactionType\n */\n protected async initializeAuthorizationRequest(request: RedirectRequest|PopupRequest|SsoSilentRequest, interactionType: InteractionType): Promise<AuthorizationUrlRequest> {\n this.logger.verbose(\"initializeAuthorizationRequest called\", this.correlationId);\n const redirectUri = this.getRedirectUri(request.redirectUri);\n const browserState: BrowserStateObject = {\n interactionType: interactionType\n };\n const state = ProtocolUtils.setRequestState(\n this.browserCrypto,\n (request && request.state)|| Constants.EMPTY_STRING,\n browserState\n );\n\n const validatedRequest: AuthorizationUrlRequest = {\n ...await this.initializeBaseRequest(request),\n redirectUri: redirectUri,\n state: state,\n nonce: request.nonce || this.browserCrypto.createNewGuid(),\n responseMode: ResponseMode.FRAGMENT\n };\n\n const account = request.account || this.browserStorage.getActiveAccount();\n if (account) {\n this.logger.verbose(\"Setting validated request account\", this.correlationId);\n this.logger.verbosePii(`Setting validated request account: ${account.homeAccountId}`, this.correlationId);\n validatedRequest.account = account;\n }\n\n // Check for ADAL/MSAL v1 SSO\n if (StringUtils.isEmpty(validatedRequest.loginHint) && !account) {\n const legacyLoginHint = this.browserStorage.getLegacyLoginHint();\n if (legacyLoginHint) {\n validatedRequest.loginHint = legacyLoginHint;\n }\n }\n\n return validatedRequest;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;;;;AAkBA;;;;IAGwD,6CAAqB;IAA7E;;KAkQC;;;;;IA7PmB,sEAAkC,GAAlD,UAAmD,OAAgC;;;;;;wBAC/E,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,uCAAuC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;wBACxD,qBAAM,IAAI,CAAC,aAAa,CAAC,iBAAiB,EAAE,EAAA;;wBAAlE,mBAAmB,GAAG,SAA4C;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,OAAO,CAAC,aAAe,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;4BAC1G,gBAAgB,CAAC,OAAO,GAAG,OAAO,CAAC;yBACtC;;wBAGD,IAAI,WAAW,CAAC,OAAO,CAAC,gBAAgB,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,EAAE;4BACvD,eAAe,GAAG,IAAI,CAAC,cAAc,CAAC,kBAAkB,EAAE,CAAC;4BACjE,IAAI,eAAe,EAAE;gCACjB,gBAAgB,CAAC,SAAS,GAAG,eAAe,CAAC;6BAChD;yBACJ;wBAED,sBAAO,gBAAgB,EAAC;;;;KAC3B;IACL,gCAAC;AAAD,CAlQA,CAAwD,qBAAqB;;;;"}
|
|
1
|
+
{"version":3,"file":"StandardInteractionClient.js","sources":["../../src/interaction_client/StandardInteractionClient.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ServerTelemetryManager, CommonAuthorizationCodeRequest, Constants, AuthorizationCodeClient, ClientConfiguration, AuthorityOptions, Authority, AuthorityFactory, ServerAuthorizationCodeResponse, UrlString, CommonEndSessionRequest, ProtocolUtils, ResponseMode, StringUtils, IdTokenClaims, AccountInfo, AzureCloudOptions, PerformanceEvents, AuthError } from \"@azure/msal-common\";\nimport { BaseInteractionClient } from \"./BaseInteractionClient\";\nimport { AuthorizationUrlRequest } from \"../request/AuthorizationUrlRequest\";\nimport { BrowserConstants, InteractionType } from \"../utils/BrowserConstants\";\nimport { version } from \"../packageMetadata\";\nimport { BrowserAuthError } from \"../error/BrowserAuthError\";\nimport { BrowserProtocolUtils, BrowserStateObject } from \"../utils/BrowserProtocolUtils\";\nimport { EndSessionRequest } from \"../request/EndSessionRequest\";\nimport { BrowserUtils } from \"../utils/BrowserUtils\";\nimport { RedirectRequest } from \"../request/RedirectRequest\";\nimport { PopupRequest } from \"../request/PopupRequest\";\nimport { SsoSilentRequest } from \"../request/SsoSilentRequest\";\n\n/**\n * Defines the class structure and helper functions used by the \"standard\", non-brokered auth flows (popup, redirect, silent (RT), silent (iframe))\n */\nexport abstract class StandardInteractionClient extends BaseInteractionClient {\n /**\n * Generates an auth code request tied to the url request.\n * @param request\n */\n protected async initializeAuthorizationCodeRequest(request: AuthorizationUrlRequest): Promise<CommonAuthorizationCodeRequest> {\n this.logger.verbose(\"initializeAuthorizationRequest called\", request.correlationId);\n const generatedPkceParams = await this.browserCrypto.generatePkceCodes();\n\n const authCodeRequest: CommonAuthorizationCodeRequest = {\n ...request,\n redirectUri: request.redirectUri,\n code: Constants.EMPTY_STRING,\n codeVerifier: generatedPkceParams.verifier\n };\n\n request.codeChallenge = generatedPkceParams.challenge;\n request.codeChallengeMethod = Constants.S256_CODE_CHALLENGE_METHOD;\n\n return authCodeRequest;\n }\n\n /**\n * Initializer for the logout request.\n * @param logoutRequest\n */\n protected initializeLogoutRequest(logoutRequest?: EndSessionRequest): CommonEndSessionRequest {\n this.logger.verbose(\"initializeLogoutRequest called\", logoutRequest?.correlationId);\n\n const validLogoutRequest: CommonEndSessionRequest = {\n correlationId: this.correlationId || this.browserCrypto.createNewGuid(),\n ...logoutRequest\n };\n\n /**\n * Set logout_hint to be login_hint from ID Token Claims if present\n * and logoutHint attribute wasn't manually set in logout request\n */\n if (logoutRequest) {\n // If logoutHint isn't set and an account was passed in, try to extract logoutHint from ID Token Claims\n if (!logoutRequest.logoutHint) {\n if(logoutRequest.account) {\n const logoutHint = this.getLogoutHintFromIdTokenClaims(logoutRequest.account);\n if (logoutHint) {\n this.logger.verbose(\"Setting logoutHint to login_hint ID Token Claim value for the account provided\");\n validLogoutRequest.logoutHint = logoutHint;\n }\n } else {\n this.logger.verbose(\"logoutHint was not set and account was not passed into logout request, logoutHint will not be set\");\n }\n } else {\n this.logger.verbose(\"logoutHint has already been set in logoutRequest\");\n }\n } else {\n this.logger.verbose(\"logoutHint will not be set since no logout request was configured\");\n }\n\n /*\n * Only set redirect uri if logout request isn't provided or the set uri isn't null.\n * Otherwise, use passed uri, config, or current page.\n */\n if (!logoutRequest || logoutRequest.postLogoutRedirectUri !== null) {\n if (logoutRequest && logoutRequest.postLogoutRedirectUri) {\n this.logger.verbose(\"Setting postLogoutRedirectUri to uri set on logout request\", validLogoutRequest.correlationId);\n validLogoutRequest.postLogoutRedirectUri = UrlString.getAbsoluteUrl(logoutRequest.postLogoutRedirectUri, BrowserUtils.getCurrentUri());\n } else if (this.config.auth.postLogoutRedirectUri === null) {\n this.logger.verbose(\"postLogoutRedirectUri configured as null and no uri set on request, not passing post logout redirect\", validLogoutRequest.correlationId);\n } else if (this.config.auth.postLogoutRedirectUri) {\n this.logger.verbose(\"Setting postLogoutRedirectUri to configured uri\", validLogoutRequest.correlationId);\n validLogoutRequest.postLogoutRedirectUri = UrlString.getAbsoluteUrl(this.config.auth.postLogoutRedirectUri, BrowserUtils.getCurrentUri());\n } else {\n this.logger.verbose(\"Setting postLogoutRedirectUri to current page\", validLogoutRequest.correlationId);\n validLogoutRequest.postLogoutRedirectUri = UrlString.getAbsoluteUrl(BrowserUtils.getCurrentUri(), BrowserUtils.getCurrentUri());\n }\n } else {\n this.logger.verbose(\"postLogoutRedirectUri passed as null, not setting post logout redirect uri\", validLogoutRequest.correlationId);\n }\n\n return validLogoutRequest;\n }\n\n /**\n * Parses login_hint ID Token Claim out of AccountInfo object to be used as\n * logout_hint in end session request.\n * @param account\n */\n protected getLogoutHintFromIdTokenClaims(account: AccountInfo): string | null {\n const idTokenClaims: IdTokenClaims | undefined = account.idTokenClaims;\n if (idTokenClaims) {\n if (idTokenClaims.login_hint) {\n return idTokenClaims.login_hint;\n } else {\n this.logger.verbose(\"The ID Token Claims tied to the provided account do not contain a login_hint claim, logoutHint will not be added to logout request\");\n }\n } else {\n this.logger.verbose(\"The provided account does not contain ID Token Claims, logoutHint will not be added to logout request\");\n }\n\n return null;\n }\n\n /**\n * Creates an Authorization Code Client with the given authority, or the default authority.\n * @param serverTelemetryManager\n * @param authorityUrl\n */\n protected async createAuthCodeClient(serverTelemetryManager: ServerTelemetryManager, authorityUrl?: string, requestAzureCloudOptions?: AzureCloudOptions): Promise<AuthorizationCodeClient> {\n // Create auth module.\n const clientConfig = await this.getClientConfiguration(serverTelemetryManager, authorityUrl, requestAzureCloudOptions);\n return new AuthorizationCodeClient(clientConfig);\n }\n\n /**\n * Creates a Client Configuration object with the given request authority, or the default authority.\n * @param serverTelemetryManager\n * @param requestAuthority\n * @param requestCorrelationId\n */\n protected async getClientConfiguration(serverTelemetryManager: ServerTelemetryManager, requestAuthority?: string, requestAzureCloudOptions?: AzureCloudOptions): Promise<ClientConfiguration> {\n this.logger.verbose(\"getClientConfiguration called\", this.correlationId);\n const discoveredAuthority = await this.getDiscoveredAuthority(requestAuthority, requestAzureCloudOptions);\n\n return {\n authOptions: {\n clientId: this.config.auth.clientId,\n authority: discoveredAuthority,\n clientCapabilities: this.config.auth.clientCapabilities\n },\n systemOptions: {\n tokenRenewalOffsetSeconds: this.config.system.tokenRenewalOffsetSeconds,\n preventCorsPreflight: true\n },\n loggerOptions: {\n loggerCallback: this.config.system.loggerOptions.loggerCallback,\n piiLoggingEnabled: this.config.system.loggerOptions.piiLoggingEnabled,\n logLevel: this.config.system.loggerOptions.logLevel,\n correlationId: this.correlationId\n },\n cryptoInterface: this.browserCrypto,\n networkInterface: this.networkClient,\n storageInterface: this.browserStorage,\n serverTelemetryManager: serverTelemetryManager,\n libraryInfo: {\n sku: BrowserConstants.MSAL_SKU,\n version: version,\n cpu: Constants.EMPTY_STRING,\n os: Constants.EMPTY_STRING\n },\n telemetry: this.config.telemetry\n };\n }\n\n /**\n * @param hash\n * @param interactionType\n */\n protected validateAndExtractStateFromHash(serverParams: ServerAuthorizationCodeResponse, interactionType: InteractionType, requestCorrelationId?: string): string {\n this.logger.verbose(\"validateAndExtractStateFromHash called\", requestCorrelationId);\n if (!serverParams.state) {\n throw BrowserAuthError.createHashDoesNotContainStateError();\n }\n\n const platformStateObj = BrowserProtocolUtils.extractBrowserRequestState(this.browserCrypto, serverParams.state);\n if (!platformStateObj) {\n throw BrowserAuthError.createUnableToParseStateError();\n }\n\n if (platformStateObj.interactionType !== interactionType) {\n throw BrowserAuthError.createStateInteractionTypeMismatchError();\n }\n\n this.logger.verbose(\"Returning state from hash\", requestCorrelationId);\n return serverParams.state;\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, requestAzureCloudOptions?: AzureCloudOptions): Promise<Authority> {\n this.logger.verbose(\"getDiscoveredAuthority called\", this.correlationId);\n const getAuthorityMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.StandardInteractionClientGetDiscoveredAuthority, this.correlationId);\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 skipAuthorityMetadataCache: this.config.auth.skipAuthorityMetadataCache\n };\n\n // build authority string based on auth params, precedence - azureCloudInstance + tenant >> authority\n const userAuthority = requestAuthority ? requestAuthority : this.config.auth.authority;\n\n // fall back to the authority from config\n const builtAuthority = Authority.generateAuthority( userAuthority, requestAzureCloudOptions || this.config.auth.azureCloudOptions);\n this.logger.verbose(\"Creating discovered authority with configured authority\", this.correlationId);\n return await AuthorityFactory.createDiscoveredInstance(builtAuthority, this.config.system.networkClient, this.browserStorage, authorityOptions, this.logger)\n .then((result: Authority) => {\n getAuthorityMeasurement.endMeasurement({\n success: true\n });\n\n return result;\n })\n .catch((error:AuthError) => {\n getAuthorityMeasurement.endMeasurement({\n errorCode: error.errorCode,\n subErrorCode: error.subError,\n success: false\n });\n\n throw error;\n });\n }\n\n /**\n * Helper to initialize required request parameters for interactive APIs and ssoSilent()\n * @param request\n * @param interactionType\n */\n protected async initializeAuthorizationRequest(request: RedirectRequest|PopupRequest|SsoSilentRequest, interactionType: InteractionType): Promise<AuthorizationUrlRequest> {\n this.logger.verbose(\"initializeAuthorizationRequest called\", this.correlationId);\n const redirectUri = this.getRedirectUri(request.redirectUri);\n const browserState: BrowserStateObject = {\n interactionType: interactionType\n };\n const state = ProtocolUtils.setRequestState(\n this.browserCrypto,\n (request && request.state)|| Constants.EMPTY_STRING,\n browserState\n );\n\n const validatedRequest: AuthorizationUrlRequest = {\n ...await this.initializeBaseRequest(request),\n redirectUri: redirectUri,\n state: state,\n nonce: request.nonce || this.browserCrypto.createNewGuid(),\n responseMode: ResponseMode.FRAGMENT\n };\n\n const account = request.account || this.browserStorage.getActiveAccount();\n if (account) {\n this.logger.verbose(\"Setting validated request account\", this.correlationId);\n this.logger.verbosePii(`Setting validated request account: ${account.homeAccountId}`, this.correlationId);\n validatedRequest.account = account;\n }\n\n // Check for ADAL/MSAL v1 SSO\n if (StringUtils.isEmpty(validatedRequest.loginHint) && !account) {\n const legacyLoginHint = this.browserStorage.getLegacyLoginHint();\n if (legacyLoginHint) {\n validatedRequest.loginHint = legacyLoginHint;\n }\n }\n\n return validatedRequest;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;;;;AAkBA;;;;IAGwD,6CAAqB;IAA7E;;KAkQC;;;;;IA7PmB,sEAAkC,GAAlD,UAAmD,OAAgC;;;;;;wBAC/E,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,uCAAuC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;wBACxD,qBAAM,IAAI,CAAC,aAAa,CAAC,iBAAiB,EAAE,EAAA;;wBAAlE,mBAAmB,GAAG,SAA4C;wBAElE,eAAe,yBACd,OAAO,KACV,WAAW,EAAE,OAAO,CAAC,WAAW,EAChC,IAAI,EAAE,SAAS,CAAC,YAAY,EAC5B,YAAY,EAAE,mBAAmB,CAAC,QAAQ,GAC7C,CAAC;wBAEF,OAAO,CAAC,aAAa,GAAG,mBAAmB,CAAC,SAAS,CAAC;wBACtD,OAAO,CAAC,mBAAmB,GAAG,SAAS,CAAC,0B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Ac,CAAC,kBAAkB,EAAE,CAAC;4BACjE,IAAI,eAAe,EAAE;gCACjB,gBAAgB,CAAC,SAAS,GAAG,eAAe,CAAC;6BAChD;yBACJ;wBAED,sBAAO,gBAAgB,EAAC;;;;KAC3B;IACL,gCAAC;AAAD,CAlQA,CAAwD,qBAAqB;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-browser v2.
|
|
1
|
+
/*! @azure/msal-browser v2.32.1 2022-12-07 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { __awaiter, __generator } from '../_virtual/_tslib.js';
|
|
4
4
|
import { StringUtils, ClientAuthError, ServerError, AuthorityFactory } from '@azure/msal-common';
|
|
@@ -121,7 +121,7 @@ var InteractionHandler = /** @class */ (function () {
|
|
|
121
121
|
switch (_a.label) {
|
|
122
122
|
case 0:
|
|
123
123
|
cloudInstanceAuthorityUri = "https://" + cloudInstanceHostname + "/" + authority.tenant + "/";
|
|
124
|
-
return [4 /*yield*/, AuthorityFactory.createDiscoveredInstance(cloudInstanceAuthorityUri, networkModule, this.browserStorage, authority.options)];
|
|
124
|
+
return [4 /*yield*/, AuthorityFactory.createDiscoveredInstance(cloudInstanceAuthorityUri, networkModule, this.browserStorage, authority.options, this.logger)];
|
|
125
125
|
case 1:
|
|
126
126
|
cloudInstanceAuthority = _a.sent();
|
|
127
127
|
this.authModule.updateAuthority(cloudInstanceAuthority);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InteractionHandler.js","sources":["../../src/interaction_handler/InteractionHandler.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AuthorizationCodePayload , StringUtils, CommonAuthorizationCodeRequest, AuthenticationResult, AuthorizationCodeClient, AuthorityFactory, Authority, INetworkModule, ClientAuthError, CcsCredential, Logger, ServerError } from \"@azure/msal-common\";\n\nimport { BrowserCacheManager } from \"../cache/BrowserCacheManager\";\nimport { BrowserAuthError, BrowserAuthErrorMessage } from \"../error/BrowserAuthError\";\nimport { TemporaryCacheKeys } from \"../utils/BrowserConstants\";\n\nexport type InteractionParams = {};\n\n/**\n * Abstract class which defines operations for a browser interaction handling class.\n */\nexport class InteractionHandler {\n\n protected authModule: AuthorizationCodeClient;\n protected browserStorage: BrowserCacheManager;\n protected authCodeRequest: CommonAuthorizationCodeRequest;\n protected logger: Logger;\n\n constructor(authCodeModule: AuthorizationCodeClient, storageImpl: BrowserCacheManager, authCodeRequest: CommonAuthorizationCodeRequest, logger: Logger) {\n this.authModule = authCodeModule;\n this.browserStorage = storageImpl;\n this.authCodeRequest = authCodeRequest;\n this.logger = logger;\n }\n\n /**\n * Function to handle response parameters from hash.\n * @param locationHash\n */\n async handleCodeResponseFromHash(locationHash: string, state: string, authority: Authority, networkModule: INetworkModule): Promise<AuthenticationResult> {\n this.logger.verbose(\"InteractionHandler.handleCodeResponse called\");\n // Check that location hash isn't empty.\n if (StringUtils.isEmpty(locationHash)) {\n throw BrowserAuthError.createEmptyHashError(locationHash);\n }\n\n // Handle code response.\n const stateKey = this.browserStorage.generateStateKey(state);\n const requestState = this.browserStorage.getTemporaryCache(stateKey);\n if (!requestState) {\n throw ClientAuthError.createStateNotFoundError(\"Cached State\");\n }\n\n let authCodeResponse;\n try {\n authCodeResponse = this.authModule.handleFragmentResponse(locationHash, requestState);\n } catch (e) {\n if (e instanceof ServerError && e.subError === BrowserAuthErrorMessage.userCancelledError.code) {\n // Translate server error caused by user closing native prompt to corresponding first class MSAL error\n throw BrowserAuthError.createUserCancelledError();\n } else {\n throw e;\n }\n }\n\n return this.handleCodeResponseFromServer(authCodeResponse, state, authority, networkModule);\n }\n\n /**\n * Process auth code response from AAD\n * @param authCodeResponse \n * @param state \n * @param authority \n * @param networkModule \n * @returns \n */\n async handleCodeResponseFromServer(authCodeResponse: AuthorizationCodePayload, state: string, authority: Authority, networkModule: INetworkModule, validateNonce: boolean = true): Promise<AuthenticationResult> {\n this.logger.trace(\"InteractionHandler.handleCodeResponseFromServer called\");\n\n // Handle code response.\n const stateKey = this.browserStorage.generateStateKey(state);\n const requestState = this.browserStorage.getTemporaryCache(stateKey);\n if (!requestState) {\n throw ClientAuthError.createStateNotFoundError(\"Cached State\");\n }\n \n // Get cached items\n const nonceKey = this.browserStorage.generateNonceKey(requestState);\n const cachedNonce = this.browserStorage.getTemporaryCache(nonceKey);\n\n // Assign code to request\n this.authCodeRequest.code = authCodeResponse.code;\n\n // Check for new cloud instance\n if (authCodeResponse.cloud_instance_host_name) {\n await this.updateTokenEndpointAuthority(authCodeResponse.cloud_instance_host_name, authority, networkModule);\n }\n\n // Nonce validation not needed when redirect not involved (e.g. hybrid spa, renewing token via rt)\n if (validateNonce) {\n authCodeResponse.nonce = cachedNonce || undefined;\n }\n \n authCodeResponse.state = requestState;\n\n // Add CCS parameters if available\n if (authCodeResponse.client_info) {\n this.authCodeRequest.clientInfo = authCodeResponse.client_info;\n } else {\n const cachedCcsCred = this.checkCcsCredentials();\n if (cachedCcsCred) {\n this.authCodeRequest.ccsCredential = cachedCcsCred;\n }\n }\n\n // Acquire token with retrieved code.\n const tokenResponse = await this.authModule.acquireToken(this.authCodeRequest, authCodeResponse);\n this.browserStorage.cleanRequestByState(state);\n return tokenResponse;\n }\n\n /**\n * Updates authority based on cloudInstanceHostname\n * @param cloudInstanceHostname \n * @param authority \n * @param networkModule \n */\n protected async updateTokenEndpointAuthority(cloudInstanceHostname: string, authority: Authority, networkModule: INetworkModule): Promise<void> {\n const cloudInstanceAuthorityUri = `https://${cloudInstanceHostname}/${authority.tenant}/`;\n const cloudInstanceAuthority = await AuthorityFactory.createDiscoveredInstance(cloudInstanceAuthorityUri, networkModule, this.browserStorage, authority.options);\n this.authModule.updateAuthority(cloudInstanceAuthority);\n }\n\n /**\n * Looks up ccs creds in the cache\n */\n protected checkCcsCredentials(): CcsCredential | null {\n // Look up ccs credential in temp cache\n const cachedCcsCred = this.browserStorage.getTemporaryCache(TemporaryCacheKeys.CCS_CREDENTIAL, true);\n if (cachedCcsCred) {\n try {\n return JSON.parse(cachedCcsCred) as CcsCredential;\n } catch (e) {\n this.authModule.logger.error(\"Cache credential could not be parsed\");\n this.authModule.logger.errorPii(`Cache credential could not be parsed: ${cachedCcsCred}`);\n }\n }\n return null;\n }\n}\n"],"names":[],"mappings":";;;;;;;AAAA;;;;AAaA;;;;IAUI,4BAAY,cAAuC,EAAE,WAAgC,EAAE,eAA+C,EAAE,MAAc;QAClJ,IAAI,CAAC,UAAU,GAAG,cAAc,CAAC;QACjC,IAAI,CAAC,cAAc,GAAG,WAAW,CAAC;QAClC,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACvC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;KACxB;;;;;IAMK,uDAA0B,GAAhC,UAAiC,YAAoB,EAAE,KAAa,EAAE,SAAoB,EAAE,aAA6B;;;;gBACrH,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,8CAA8C,CAAC,CAAC;;gBAEpE,IAAI,WAAW,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE;oBACnC,MAAM,gBAAgB,CAAC,oBAAoB,CAAC,YAAY,CAAC,CAAC;iBAC7D;gBAGK,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;gBACvD,YAAY,GAAG,IAAI,CAAC,cAAc,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;gBACrE,IAAI,CAAC,YAAY,EAAE;oBACf,MAAM,eAAe,CAAC,wBAAwB,CAAC,cAAc,CAAC,CAAC;iBAClE;gBAGD,IAAI;oBACA,gBAAgB,GAAG,IAAI,CAAC,UAAU,CAAC,sBAAsB,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;iBACzF;gBAAC,OAAO,CAAC,EAAE;oBACR,IAAI,CAAC,YAAY,WAAW,IAAI,CAAC,CAAC,QAAQ,KAAK,uBAAuB,CAAC,kBAAkB,CAAC,IAAI,EAAE;;wBAE5F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B,IAAI,CAAC,eAAe,CAAC,UAAU,GAAG,gBAAgB,CAAC,WAAW,CAAC;yBAClE;6BAAM;4BACG,aAAa,GAAG,IAAI,CAAC,mBAAmB,EAAE,CAAC;4BACjD,IAAI,aAAa,EAAE;gCACf,IAAI,CAAC,eAAe,CAAC,aAAa,GAAG,aAAa,CAAC;6BACtD;yBACJ;wBAGqB,qBAAM,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,CAAC,eAAe,EAAE,gBAAgB,CAAC,EAAA;;wBAA1F,aAAa,GAAG,SAA0E;wBAChG,IAAI,CAAC,cAAc,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC;wBAC/C,sBAAO,aAAa,EAAC;;;;KACxB;;;;;;;IAQe,yDAA4B,GAA5C,UAA6C,qBAA6B,EAAE,SAAoB,EAAE,aAA6B;;;;;;wBACrH,yBAAyB,GAAG,aAAW,qBAAqB,SAAI,SAAS,CAAC,MAAM,MAAG,CAAC;wBAC3D,qBAAM,gBAAgB,CAAC,wBAAwB,CAAC,yBAAyB,EAAE,aAAa,EAAE,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC,OAAO,CAAC,EAAA;;
|
|
1
|
+
{"version":3,"file":"InteractionHandler.js","sources":["../../src/interaction_handler/InteractionHandler.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AuthorizationCodePayload , StringUtils, CommonAuthorizationCodeRequest, AuthenticationResult, AuthorizationCodeClient, AuthorityFactory, Authority, INetworkModule, ClientAuthError, CcsCredential, Logger, ServerError } from \"@azure/msal-common\";\n\nimport { BrowserCacheManager } from \"../cache/BrowserCacheManager\";\nimport { BrowserAuthError, BrowserAuthErrorMessage } from \"../error/BrowserAuthError\";\nimport { TemporaryCacheKeys } from \"../utils/BrowserConstants\";\n\nexport type InteractionParams = {};\n\n/**\n * Abstract class which defines operations for a browser interaction handling class.\n */\nexport class InteractionHandler {\n\n protected authModule: AuthorizationCodeClient;\n protected browserStorage: BrowserCacheManager;\n protected authCodeRequest: CommonAuthorizationCodeRequest;\n protected logger: Logger;\n\n constructor(authCodeModule: AuthorizationCodeClient, storageImpl: BrowserCacheManager, authCodeRequest: CommonAuthorizationCodeRequest, logger: Logger) {\n this.authModule = authCodeModule;\n this.browserStorage = storageImpl;\n this.authCodeRequest = authCodeRequest;\n this.logger = logger;\n }\n\n /**\n * Function to handle response parameters from hash.\n * @param locationHash\n */\n async handleCodeResponseFromHash(locationHash: string, state: string, authority: Authority, networkModule: INetworkModule): Promise<AuthenticationResult> {\n this.logger.verbose(\"InteractionHandler.handleCodeResponse called\");\n // Check that location hash isn't empty.\n if (StringUtils.isEmpty(locationHash)) {\n throw BrowserAuthError.createEmptyHashError(locationHash);\n }\n\n // Handle code response.\n const stateKey = this.browserStorage.generateStateKey(state);\n const requestState = this.browserStorage.getTemporaryCache(stateKey);\n if (!requestState) {\n throw ClientAuthError.createStateNotFoundError(\"Cached State\");\n }\n\n let authCodeResponse;\n try {\n authCodeResponse = this.authModule.handleFragmentResponse(locationHash, requestState);\n } catch (e) {\n if (e instanceof ServerError && e.subError === BrowserAuthErrorMessage.userCancelledError.code) {\n // Translate server error caused by user closing native prompt to corresponding first class MSAL error\n throw BrowserAuthError.createUserCancelledError();\n } else {\n throw e;\n }\n }\n\n return this.handleCodeResponseFromServer(authCodeResponse, state, authority, networkModule);\n }\n\n /**\n * Process auth code response from AAD\n * @param authCodeResponse \n * @param state \n * @param authority \n * @param networkModule \n * @returns \n */\n async handleCodeResponseFromServer(authCodeResponse: AuthorizationCodePayload, state: string, authority: Authority, networkModule: INetworkModule, validateNonce: boolean = true): Promise<AuthenticationResult> {\n this.logger.trace(\"InteractionHandler.handleCodeResponseFromServer called\");\n\n // Handle code response.\n const stateKey = this.browserStorage.generateStateKey(state);\n const requestState = this.browserStorage.getTemporaryCache(stateKey);\n if (!requestState) {\n throw ClientAuthError.createStateNotFoundError(\"Cached State\");\n }\n \n // Get cached items\n const nonceKey = this.browserStorage.generateNonceKey(requestState);\n const cachedNonce = this.browserStorage.getTemporaryCache(nonceKey);\n\n // Assign code to request\n this.authCodeRequest.code = authCodeResponse.code;\n\n // Check for new cloud instance\n if (authCodeResponse.cloud_instance_host_name) {\n await this.updateTokenEndpointAuthority(authCodeResponse.cloud_instance_host_name, authority, networkModule);\n }\n\n // Nonce validation not needed when redirect not involved (e.g. hybrid spa, renewing token via rt)\n if (validateNonce) {\n authCodeResponse.nonce = cachedNonce || undefined;\n }\n \n authCodeResponse.state = requestState;\n\n // Add CCS parameters if available\n if (authCodeResponse.client_info) {\n this.authCodeRequest.clientInfo = authCodeResponse.client_info;\n } else {\n const cachedCcsCred = this.checkCcsCredentials();\n if (cachedCcsCred) {\n this.authCodeRequest.ccsCredential = cachedCcsCred;\n }\n }\n\n // Acquire token with retrieved code.\n const tokenResponse = await this.authModule.acquireToken(this.authCodeRequest, authCodeResponse);\n this.browserStorage.cleanRequestByState(state);\n return tokenResponse;\n }\n\n /**\n * Updates authority based on cloudInstanceHostname\n * @param cloudInstanceHostname \n * @param authority \n * @param networkModule \n */\n protected async updateTokenEndpointAuthority(cloudInstanceHostname: string, authority: Authority, networkModule: INetworkModule): Promise<void> {\n const cloudInstanceAuthorityUri = `https://${cloudInstanceHostname}/${authority.tenant}/`;\n const cloudInstanceAuthority = await AuthorityFactory.createDiscoveredInstance(cloudInstanceAuthorityUri, networkModule, this.browserStorage, authority.options, this.logger);\n this.authModule.updateAuthority(cloudInstanceAuthority);\n }\n\n /**\n * Looks up ccs creds in the cache\n */\n protected checkCcsCredentials(): CcsCredential | null {\n // Look up ccs credential in temp cache\n const cachedCcsCred = this.browserStorage.getTemporaryCache(TemporaryCacheKeys.CCS_CREDENTIAL, true);\n if (cachedCcsCred) {\n try {\n return JSON.parse(cachedCcsCred) as CcsCredential;\n } catch (e) {\n this.authModule.logger.error(\"Cache credential could not be parsed\");\n this.authModule.logger.errorPii(`Cache credential could not be parsed: ${cachedCcsCred}`);\n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*! @azure/msal-browser v2.
|
|
1
|
+
/*! @azure/msal-browser v2.32.1 2022-12-07 */
|
|
2
2
|
'use strict';
|
|
3
3
|
export { BrowserCacheManager } from './cache/BrowserCacheManager.js';
|
|
4
4
|
export { StandardInteractionClient } from './interaction_client/StandardInteractionClient.js';
|
package/dist/packageMetadata.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/*! @azure/msal-browser v2.
|
|
1
|
+
/*! @azure/msal-browser v2.32.1 2022-12-07 */
|
|
2
2
|
'use strict';
|
|
3
3
|
/* eslint-disable header/header */
|
|
4
4
|
var name = "@azure/msal-browser";
|
|
5
|
-
var version = "2.
|
|
5
|
+
var version = "2.32.1";
|
|
6
6
|
|
|
7
7
|
export { name, version };
|
|
8
8
|
//# sourceMappingURL=packageMetadata.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageMetadata.js","sources":["../src/packageMetadata.ts"],"sourcesContent":["/* eslint-disable header/header */\nexport const name = \"@azure/msal-browser\";\nexport const version = \"2.
|
|
1
|
+
{"version":3,"file":"packageMetadata.js","sources":["../src/packageMetadata.ts"],"sourcesContent":["/* eslint-disable header/header */\nexport const name = \"@azure/msal-browser\";\nexport const version = \"2.32.1\";\n"],"names":[],"mappings":";;AAAA;IACa,IAAI,GAAG,sBAAsB;IAC7B,OAAO,GAAG;;;;"}
|
|
@@ -73,7 +73,8 @@ export declare enum TemporaryCacheKeys {
|
|
|
73
73
|
INTERACTION_STATUS_KEY = "interaction.status",
|
|
74
74
|
CCS_CREDENTIAL = "ccs.credential",
|
|
75
75
|
CORRELATION_ID = "request.correlationId",
|
|
76
|
-
NATIVE_REQUEST = "request.native"
|
|
76
|
+
NATIVE_REQUEST = "request.native",
|
|
77
|
+
REDIRECT_CONTEXT = "request.redirect.context"
|
|
77
78
|
}
|
|
78
79
|
/**
|
|
79
80
|
* Cache keys stored in-memory
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BrowserConstants.d.ts","sourceRoot":"","sources":["../../src/utils/BrowserConstants.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D;;GAEG;AACH,eAAO,MAAM,gBAAgB;IACzB;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;CAEN,CAAC;AAEF,eAAO,MAAM,eAAe;;;;CAI3B,CAAC;AAEF,oBAAY,qBAAqB;IAC7B,gBAAgB,cAAc;IAC9B,iBAAiB,sBAAsB;IACvC,QAAQ,aAAa;IACrB,QAAQ,aAAa;CACxB;AAED,oBAAY,oBAAoB;IAC5B,YAAY,iBAAiB;IAC7B,cAAc,mBAAmB;IACjC,aAAa,kBAAkB;CAClC;AAED;;GAEG;AACH,oBAAY,iBAAiB;IACzB,GAAG,QAAQ;IACX,IAAI,SAAS;CAChB;AAED;;GAEG;AACH,oBAAY,kBAAkB;IAC1B,SAAS,cAAc;IACvB,qBAAqB,yBAAyB;IAC9C,aAAa,kBAAkB;IAC/B,aAAa,kBAAkB;IAC/B,aAAa,mBAAmB;IAChC,UAAU,mBAAmB;IAC7B,YAAY,uBAAuB;IACnC,QAAQ,YAAY;IACpB,cAAc,mBAAmB;IACjC,MAAM,WAAW;IACjB,sBAAsB,uBAAuB;IAC7C,cAAc,mBAAmB;IACjC,cAAc,0BAA0B;IACxC,cAAc,mBAAmB;
|
|
1
|
+
{"version":3,"file":"BrowserConstants.d.ts","sourceRoot":"","sources":["../../src/utils/BrowserConstants.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D;;GAEG;AACH,eAAO,MAAM,gBAAgB;IACzB;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;I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;;OAEG;IACH,MAAM,WAAW;IACjB;;OAEG;IACH,YAAY,iBAAiB;IAC7B;;OAEG;IACH,SAAS,cAAc;IACvB;;OAEG;IACH,cAAc,mBAAmB;IACjC;;OAEG;IACH,IAAI,SAAS;CAChB;AAED,eAAO,MAAM,eAAe,EAAE,eAAe,GAAC,YAE7C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,QAAQ,CAAC;AAGpC,oBAAY,UAAU;IAClB,KAAK,sBAAsB;IAC3B,OAAO,wBAAwB;CAClC;AAGD,eAAO,MAAM,OAAO,YAAY,CAAC;AACjC,eAAO,MAAM,UAAU,IAAI,CAAC;AAC5B,eAAO,MAAM,aAAa,QAAoB,CAAC;AAE/C,oBAAY,iBAAiB;IAMzB,OAAO,IAAI;IAKX,WAAW,IAAI;IAMf,0BAA0B,IAAI;IAM9B,YAAY,IAAI;IAMhB,sBAAsB,IAAI;IAK1B,IAAI,IAAI;CACX"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-browser v2.
|
|
1
|
+
/*! @azure/msal-browser v2.32.1 2022-12-07 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { OIDC_DEFAULT_SCOPES } from '@azure/msal-common';
|
|
4
4
|
|
|
@@ -84,6 +84,7 @@ var TemporaryCacheKeys;
|
|
|
84
84
|
TemporaryCacheKeys["CCS_CREDENTIAL"] = "ccs.credential";
|
|
85
85
|
TemporaryCacheKeys["CORRELATION_ID"] = "request.correlationId";
|
|
86
86
|
TemporaryCacheKeys["NATIVE_REQUEST"] = "request.native";
|
|
87
|
+
TemporaryCacheKeys["REDIRECT_CONTEXT"] = "request.redirect.context";
|
|
87
88
|
})(TemporaryCacheKeys || (TemporaryCacheKeys = {}));
|
|
88
89
|
/**
|
|
89
90
|
* Cache keys stored in-memory
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BrowserConstants.js","sources":["../../src/utils/BrowserConstants.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { OIDC_DEFAULT_SCOPES } from \"@azure/msal-common\";\nimport { PopupRequest } from \"../request/PopupRequest\";\nimport { RedirectRequest } from \"../request/RedirectRequest\";\n\n/**\n * Constants\n */\nexport const BrowserConstants = {\n /**\n * Interaction in progress cache value\n */\n INTERACTION_IN_PROGRESS_VALUE: \"interaction_in_progress\",\n /**\n * Invalid grant error code\n */\n INVALID_GRANT_ERROR: \"invalid_grant\",\n /**\n * Default popup window width\n */\n POPUP_WIDTH: 483,\n /**\n * Default popup window height\n */\n POPUP_HEIGHT: 600,\n /**\n * Name of the popup window starts with\n */\n POPUP_NAME_PREFIX: \"msal\",\n /**\n * Default popup monitor poll interval in milliseconds\n */\n DEFAULT_POLL_INTERVAL_MS: 30,\n /**\n * Msal-browser SKU\n */\n MSAL_SKU: \"msal.js.browser\",\n};\n\nexport const NativeConstants = {\n CHANNEL_ID: \"53ee284d-920a-4b59-9d30-a60315b26836\",\n PREFERRED_EXTENSION_ID: \"ppnbnpeolgkicgegkbkbjmhlideopiji\",\n MATS_TELEMETRY: \"MATS\"\n};\n\nexport enum NativeExtensionMethod {\n HandshakeRequest = \"Handshake\",\n HandshakeResponse = \"HandshakeResponse\",\n GetToken = \"GetToken\",\n Response = \"Response\"\n}\n\nexport enum BrowserCacheLocation {\n LocalStorage = \"localStorage\",\n SessionStorage = \"sessionStorage\",\n MemoryStorage = \"memoryStorage\"\n}\n\n/**\n * HTTP Request types supported by MSAL.\n */\nexport enum HTTP_REQUEST_TYPE {\n GET = \"GET\",\n POST = \"POST\"\n}\n\n/**\n * Temporary cache keys for MSAL, deleted after any request.\n */\nexport enum TemporaryCacheKeys {\n AUTHORITY = \"authority\",\n ACQUIRE_TOKEN_ACCOUNT = \"acquireToken.account\",\n SESSION_STATE = \"session.state\",\n REQUEST_STATE = \"request.state\",\n NONCE_IDTOKEN = \"nonce.id_token\",\n ORIGIN_URI = \"request.origin\",\n RENEW_STATUS = \"token.renew.status\",\n URL_HASH = \"urlHash\",\n REQUEST_PARAMS = \"request.params\",\n SCOPES = \"scopes\",\n INTERACTION_STATUS_KEY = \"interaction.status\",\n CCS_CREDENTIAL = \"ccs.credential\",\n CORRELATION_ID = \"request.correlationId\",\n NATIVE_REQUEST = \"request.native\"\n}\n\n/**\n * Cache keys stored in-memory\n */\nexport enum InMemoryCacheKeys {\n WRAPPER_SKU = \"wrapper.sku\",\n WRAPPER_VER = \"wrapper.version\"\n}\n\n/**\n * API Codes for Telemetry purposes. \n * Before adding a new code you must claim it in the MSAL Telemetry tracker as these number spaces are shared across all MSALs\n * 0-99 Silent Flow\n * 800-899 Auth Code Flow\n */\nexport enum ApiId {\n acquireTokenRedirect = 861,\n acquireTokenPopup = 862,\n ssoSilent = 863,\n acquireTokenSilent_authCode = 864,\n handleRedirectPromise = 865,\n acquireTokenByCode = 866,\n acquireTokenSilent_silentFlow = 61,\n logout = 961,\n logoutPopup = 962\n}\n\n/*\n * Interaction type of the API - used for state and telemetry\n */\nexport enum InteractionType {\n Redirect = \"redirect\",\n Popup = \"popup\",\n Silent = \"silent\",\n None = \"none\"\n}\n\n/**\n * Types of interaction currently in progress.\n * Used in events in wrapper libraries to invoke functions when certain interaction is in progress or all interactions are complete.\n */\nexport enum InteractionStatus {\n /**\n * Initial status before interaction occurs\n */\n Startup = \"startup\",\n /**\n * Status set when all login calls occuring\n */\n Login = \"login\",\n /**\n * Status set when logout call occuring\n */ \n Logout = \"logout\",\n /**\n * Status set for acquireToken calls\n */\n AcquireToken = \"acquireToken\",\n /**\n * Status set for ssoSilent calls\n */\n SsoSilent = \"ssoSilent\",\n /**\n * Status set when handleRedirect in progress\n */\n HandleRedirect = \"handleRedirect\",\n /**\n * Status set when interaction is complete\n */\n None = \"none\"\n}\n\nexport const DEFAULT_REQUEST: RedirectRequest|PopupRequest = {\n scopes: OIDC_DEFAULT_SCOPES\n};\n\n/**\n * JWK Key Format string (Type MUST be defined for window crypto APIs)\n */\nexport const KEY_FORMAT_JWK = \"jwk\";\n\n// Supported wrapper SKUs\nexport enum WrapperSKU {\n React = \"@azure/msal-react\",\n Angular = \"@azure/msal-angular\"\n}\n\n// DatabaseStorage Constants\nexport const DB_NAME = \"msal.db\";\nexport const DB_VERSION = 1;\nexport const DB_TABLE_NAME = `${DB_NAME}.keys`;\n\nexport enum CacheLookupPolicy {\n /*\n * acquireTokenSilent will attempt to retrieve an access token from the cache. If the access token is expired\n * or cannot be found the refresh token will be used to acquire a new one. Finally, if the refresh token\n * is expired acquireTokenSilent will attempt to acquire new access and refresh tokens.\n */\n Default = 0, // 0 is falsy, is equivalent to not passing in a CacheLookupPolicy\n /*\n * acquireTokenSilent will only look for access tokens in the cache. It will not attempt to renew access or\n * refresh tokens.\n */\n AccessToken = 1,\n /*\n * acquireTokenSilent will attempt to retrieve an access token from the cache. If the access token is expired or\n * cannot be found, the refresh token will be used to acquire a new one. If the refresh token is expired, it\n * will not be renewed and acquireTokenSilent will fail.\n */\n AccessTokenAndRefreshToken = 2,\n /*\n * acquireTokenSilent will not attempt to retrieve access tokens from the cache and will instead attempt to\n * exchange the cached refresh token for a new access token. If the refresh token is expired, it will not be\n * renewed and acquireTokenSilent will fail.\n */\n RefreshToken = 3,\n /*\n * acquireTokenSilent will not look in the cache for the access token. It will go directly to network with the\n * cached refresh token. If the refresh token is expired an attempt will be made to renew it. This is equivalent to\n * setting \"forceRefresh: true\".\n */\n RefreshTokenAndNetwork = 4,\n /*\n * acquireTokenSilent will attempt to renew both access and refresh tokens. It will not look in the cache. This will\n * always fail if 3rd party cookies are blocked by the browser.\n */\n Skip = 5,\n}\n"],"names":[],"mappings":";;;;AAAA;;;;AASA;;;IAGa,gBAAgB,GAAG;;;;IAI5B,6BAA6B,EAAE,yBAAyB;;;;IAIxD,mBAAmB,EAAE,eAAe;;;;IAIpC,WAAW,EAAE,GAAG;;;;IAIhB,YAAY,EAAE,GAAG;;;;IAIjB,iBAAiB,EAAE,MAAM;;;;IAIzB,wBAAwB,EAAE,EAAE;;;;IAI5B,QAAQ,EAAE,iBAAiB;EAC7B;IAEW,eAAe,GAAG;IAC3B,UAAU,EAAE,sCAAsC;IAClD,sBAAsB,EAAE,kCAAkC;IAC1D,cAAc,EAAE,MAAM;EACxB;IAEU;AAAZ,WAAY,qBAAqB;IAC7B,uDAA8B,CAAA;IAC9B,gEAAuC,CAAA;IACvC,8CAAqB,CAAA;IACrB,8CAAqB,CAAA;AACzB,CAAC,EALW,qBAAqB,KAArB,qBAAqB,QAKhC;IAEW;AAAZ,WAAY,oBAAoB;IAC5B,qDAA6B,CAAA;IAC7B,yDAAiC,CAAA;IACjC,uDAA+B,CAAA;AACnC,CAAC,EAJW,oBAAoB,KAApB,oBAAoB,QAI/B;AAED;;;IAGY;AAAZ,WAAY,iBAAiB;IACzB,gCAAW,CAAA;IACX,kCAAa,CAAA;AACjB,CAAC,EAHW,iBAAiB,KAAjB,iBAAiB,QAG5B;AAED;;;IAGY;AAAZ,WAAY,kBAAkB;IAC1B,6CAAuB,CAAA;IACvB,oEAA8C,CAAA;IAC9C,qDAA+B,CAAA;IAC/B,qDAA+B,CAAA;IAC/B,sDAAgC,CAAA;IAChC,mDAA6B,CAAA;IAC7B,yDAAmC,CAAA;IACnC,0CAAoB,CAAA;IACpB,uDAAiC,CAAA;IACjC,uCAAiB,CAAA;IACjB,mEAA6C,CAAA;IAC7C,uDAAiC,CAAA;IACjC,8DAAwC,CAAA;IACxC,uDAAiC,CAAA;
|
|
1
|
+
{"version":3,"file":"BrowserConstants.js","sources":["../../src/utils/BrowserConstants.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { OIDC_DEFAULT_SCOPES } from \"@azure/msal-common\";\nimport { PopupRequest } from \"../request/PopupRequest\";\nimport { RedirectRequest } from \"../request/RedirectRequest\";\n\n/**\n * Constants\n */\nexport const BrowserConstants = {\n /**\n * Interaction in progress cache value\n */\n INTERACTION_IN_PROGRESS_VALUE: \"interaction_in_progress\",\n /**\n * Invalid grant error code\n */\n INVALID_GRANT_ERROR: \"invalid_grant\",\n /**\n * Default popup window width\n */\n POPUP_WIDTH: 483,\n /**\n * Default popup window height\n */\n POPUP_HEIGHT: 600,\n /**\n * Name of the popup window starts with\n */\n POPUP_NAME_PREFIX: \"msal\",\n /**\n * Default popup monitor poll interval in milliseconds\n */\n DEFAULT_POLL_INTERVAL_MS: 30,\n /**\n * Msal-browser SKU\n */\n MSAL_SKU: \"msal.js.browser\",\n};\n\nexport const NativeConstants = {\n CHANNEL_ID: \"53ee284d-920a-4b59-9d30-a60315b26836\",\n PREFERRED_EXTENSION_ID: \"ppnbnpeolgkicgegkbkbjmhlideopiji\",\n MATS_TELEMETRY: \"MATS\"\n};\n\nexport enum NativeExtensionMethod {\n HandshakeRequest = \"Handshake\",\n HandshakeResponse = \"HandshakeResponse\",\n GetToken = \"GetToken\",\n Response = \"Response\"\n}\n\nexport enum BrowserCacheLocation {\n LocalStorage = \"localStorage\",\n SessionStorage = \"sessionStorage\",\n MemoryStorage = \"memoryStorage\"\n}\n\n/**\n * HTTP Request types supported by MSAL.\n */\nexport enum HTTP_REQUEST_TYPE {\n GET = \"GET\",\n POST = \"POST\"\n}\n\n/**\n * Temporary cache keys for MSAL, deleted after any request.\n */\nexport enum TemporaryCacheKeys {\n AUTHORITY = \"authority\",\n ACQUIRE_TOKEN_ACCOUNT = \"acquireToken.account\",\n SESSION_STATE = \"session.state\",\n REQUEST_STATE = \"request.state\",\n NONCE_IDTOKEN = \"nonce.id_token\",\n ORIGIN_URI = \"request.origin\",\n RENEW_STATUS = \"token.renew.status\",\n URL_HASH = \"urlHash\",\n REQUEST_PARAMS = \"request.params\",\n SCOPES = \"scopes\",\n INTERACTION_STATUS_KEY = \"interaction.status\",\n CCS_CREDENTIAL = \"ccs.credential\",\n CORRELATION_ID = \"request.correlationId\",\n NATIVE_REQUEST = \"request.native\",\n REDIRECT_CONTEXT = \"request.redirect.context\"\n}\n\n/**\n * Cache keys stored in-memory\n */\nexport enum InMemoryCacheKeys {\n WRAPPER_SKU = \"wrapper.sku\",\n WRAPPER_VER = \"wrapper.version\"\n}\n\n/**\n * API Codes for Telemetry purposes. \n * Before adding a new code you must claim it in the MSAL Telemetry tracker as these number spaces are shared across all MSALs\n * 0-99 Silent Flow\n * 800-899 Auth Code Flow\n */\nexport enum ApiId {\n acquireTokenRedirect = 861,\n acquireTokenPopup = 862,\n ssoSilent = 863,\n acquireTokenSilent_authCode = 864,\n handleRedirectPromise = 865,\n acquireTokenByCode = 866,\n acquireTokenSilent_silentFlow = 61,\n logout = 961,\n logoutPopup = 962\n}\n\n/*\n * Interaction type of the API - used for state and telemetry\n */\nexport enum InteractionType {\n Redirect = \"redirect\",\n Popup = \"popup\",\n Silent = \"silent\",\n None = \"none\"\n}\n\n/**\n * Types of interaction currently in progress.\n * Used in events in wrapper libraries to invoke functions when certain interaction is in progress or all interactions are complete.\n */\nexport enum InteractionStatus {\n /**\n * Initial status before interaction occurs\n */\n Startup = \"startup\",\n /**\n * Status set when all login calls occuring\n */\n Login = \"login\",\n /**\n * Status set when logout call occuring\n */ \n Logout = \"logout\",\n /**\n * Status set for acquireToken calls\n */\n AcquireToken = \"acquireToken\",\n /**\n * Status set for ssoSilent calls\n */\n SsoSilent = \"ssoSilent\",\n /**\n * Status set when handleRedirect in progress\n */\n HandleRedirect = \"handleRedirect\",\n /**\n * Status set when interaction is complete\n */\n None = \"none\"\n}\n\nexport const DEFAULT_REQUEST: RedirectRequest|PopupRequest = {\n scopes: OIDC_DEFAULT_SCOPES\n};\n\n/**\n * JWK Key Format string (Type MUST be defined for window crypto APIs)\n */\nexport const KEY_FORMAT_JWK = \"jwk\";\n\n// Supported wrapper SKUs\nexport enum WrapperSKU {\n React = \"@azure/msal-react\",\n Angular = \"@azure/msal-angular\"\n}\n\n// DatabaseStorage Constants\nexport const DB_NAME = \"msal.db\";\nexport const DB_VERSION = 1;\nexport const DB_TABLE_NAME = `${DB_NAME}.keys`;\n\nexport enum CacheLookupPolicy {\n /*\n * acquireTokenSilent will attempt to retrieve an access token from the cache. If the access token is expired\n * or cannot be found the refresh token will be used to acquire a new one. Finally, if the refresh token\n * is expired acquireTokenSilent will attempt to acquire new access and refresh tokens.\n */\n Default = 0, // 0 is falsy, is equivalent to not passing in a CacheLookupPolicy\n /*\n * acquireTokenSilent will only look for access tokens in the cache. It will not attempt to renew access or\n * refresh tokens.\n */\n AccessToken = 1,\n /*\n * acquireTokenSilent will attempt to retrieve an access token from the cache. If the access token is expired or\n * cannot be found, the refresh token will be used to acquire a new one. If the refresh token is expired, it\n * will not be renewed and acquireTokenSilent will fail.\n */\n AccessTokenAndRefreshToken = 2,\n /*\n * acquireTokenSilent will not attempt to retrieve access tokens from the cache and will instead attempt to\n * exchange the cached refresh token for a new access token. If the refresh token is expired, it will not be\n * renewed and acquireTokenSilent will fail.\n */\n RefreshToken = 3,\n /*\n * acquireTokenSilent will not look in the cache for the access token. It will go directly to network with the\n * cached refresh token. If the refresh token is expired an attempt will be made to renew it. This is equivalent to\n * setting \"forceRefresh: true\".\n */\n RefreshTokenAndNetwork = 4,\n /*\n * acquireTokenSilent will attempt to renew both access and refresh tokens. It will not look in the cache. This will\n * always fail if 3rd party cookies are blocked by the browser.\n */\n Skip = 5,\n}\n"],"names":[],"mappings":";;;;AAAA;;;;AASA;;;IAGa,gBAAgB,GAAG;;;;IAI5B,6BAA6B,EAAE,yBAAyB;;;;IAIxD,mBAAmB,EAAE,eAAe;;;;IAIpC,WAAW,EAAE,GAAG;;;;IAIhB,YAAY,EAAE,GAAG;;;;IAIjB,iBAAiB,EAAE,MAAM;;;;IAIzB,wBAAwB,EAAE,EAAE;;;;IAI5B,QAAQ,EAAE,iBAAiB;EAC7B;IAEW,eAAe,GAAG;IAC3B,UAAU,EAAE,sCAAsC;IAClD,sBAAsB,EAAE,kCAAkC;IAC1D,cAAc,EAAE,MAAM;EACxB;IAEU;AAAZ,WAAY,qBAAqB;IAC7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