@azure/msal-browser 2.32.2 → 2.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/_virtual/_tslib.js +1 -1
- package/dist/app/ClientApplication.d.ts +3 -0
- package/dist/app/ClientApplication.d.ts.map +1 -1
- package/dist/app/ClientApplication.js +65 -13
- package/dist/app/ClientApplication.js.map +1 -1
- package/dist/app/IPublicClientApplication.js +1 -1
- package/dist/app/PublicClientApplication.d.ts +2 -0
- package/dist/app/PublicClientApplication.d.ts.map +1 -1
- package/dist/app/PublicClientApplication.js +37 -10
- package/dist/app/PublicClientApplication.js.map +1 -1
- package/dist/broker/nativeBroker/NativeMessageHandler.js +1 -1
- package/dist/cache/AsyncMemoryStorage.js +1 -1
- package/dist/cache/BrowserCacheManager.js +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 +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 +1345 -761
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/interaction_client/BaseInteractionClient.d.ts.map +1 -1
- package/dist/interaction_client/BaseInteractionClient.js +3 -2
- 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.d.ts.map +1 -1
- package/dist/interaction_client/PopupClient.js +9 -2
- package/dist/interaction_client/PopupClient.js.map +1 -1
- package/dist/interaction_client/RedirectClient.d.ts.map +1 -1
- package/dist/interaction_client/RedirectClient.js +13 -5
- package/dist/interaction_client/RedirectClient.js.map +1 -1
- package/dist/interaction_client/SilentAuthCodeClient.d.ts.map +1 -1
- package/dist/interaction_client/SilentAuthCodeClient.js +7 -3
- package/dist/interaction_client/SilentAuthCodeClient.js.map +1 -1
- package/dist/interaction_client/SilentCacheClient.d.ts.map +1 -1
- package/dist/interaction_client/SilentCacheClient.js +7 -2
- package/dist/interaction_client/SilentCacheClient.js.map +1 -1
- package/dist/interaction_client/SilentIframeClient.d.ts.map +1 -1
- package/dist/interaction_client/SilentIframeClient.js +21 -4
- package/dist/interaction_client/SilentIframeClient.js.map +1 -1
- package/dist/interaction_client/SilentRefreshClient.d.ts.map +1 -1
- package/dist/interaction_client/SilentRefreshClient.js +9 -3
- package/dist/interaction_client/SilentRefreshClient.js.map +1 -1
- package/dist/interaction_client/StandardInteractionClient.d.ts.map +1 -1
- package/dist/interaction_client/StandardInteractionClient.js +16 -5
- package/dist/interaction_client/StandardInteractionClient.js.map +1 -1
- package/dist/interaction_handler/InteractionHandler.d.ts +3 -2
- package/dist/interaction_handler/InteractionHandler.d.ts.map +1 -1
- package/dist/interaction_handler/InteractionHandler.js +12 -4
- package/dist/interaction_handler/InteractionHandler.js.map +1 -1
- package/dist/interaction_handler/RedirectHandler.d.ts +2 -2
- package/dist/interaction_handler/RedirectHandler.d.ts.map +1 -1
- package/dist/interaction_handler/RedirectHandler.js +3 -3
- package/dist/interaction_handler/RedirectHandler.js.map +1 -1
- package/dist/interaction_handler/SilentHandler.d.ts +2 -2
- package/dist/interaction_handler/SilentHandler.d.ts.map +1 -1
- package/dist/interaction_handler/SilentHandler.js +13 -15
- package/dist/interaction_handler/SilentHandler.js.map +1 -1
- package/dist/internals.d.ts +2 -0
- package/dist/internals.d.ts.map +1 -1
- package/dist/internals.js +3 -1
- package/dist/internals.js.map +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/request/EndSessionPopupRequest.d.ts +1 -1
- package/dist/request/EndSessionPopupRequest.d.ts.map +1 -1
- package/dist/request/EndSessionRequest.d.ts +1 -1
- package/dist/request/EndSessionRequest.d.ts.map +1 -1
- package/dist/telemetry/BrowserPerformanceClient.d.ts +18 -1
- package/dist/telemetry/BrowserPerformanceClient.d.ts.map +1 -1
- package/dist/telemetry/BrowserPerformanceClient.js +58 -2
- package/dist/telemetry/BrowserPerformanceClient.js.map +1 -1
- package/dist/telemetry/BrowserPerformanceMeasurement.js +1 -1
- package/dist/utils/BrowserConstants.js +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 +1345 -761
- package/lib/msal-browser.js.map +1 -1
- package/lib/msal-browser.min.js +43 -44
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SilentAuthCodeClient.d.ts","sourceRoot":"","sources":["../../src/interaction_client/SilentAuthCodeClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,oBAAoB,EAAE,OAAO,EAAE,MAAM,EAAwD,kBAAkB,
|
|
1
|
+
{"version":3,"file":"SilentAuthCodeClient.d.ts","sourceRoot":"","sources":["../../src/interaction_client/SilentAuthCodeClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,oBAAoB,EAAE,OAAO,EAAE,MAAM,EAAwD,kBAAkB,EAAqB,MAAM,oBAAoB,CAAC;AACxK,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAExE,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAEpE,OAAO,EAAmB,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAE/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;AAEnF,qBAAa,oBAAqB,SAAQ,yBAAyB;IAC/D,OAAO,CAAC,KAAK,CAAQ;gBAET,MAAM,EAAE,oBAAoB,EAAE,WAAW,EAAE,mBAAmB,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,KAAK,EAAE,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,oBAAoB,CAAC,EAAE,oBAAoB,EAAE,aAAa,CAAC,EAAE,MAAM;IAK7S;;;OAGG;IACG,YAAY,CAAC,OAAO,EAAE,wBAAwB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAwDpF;;OAEG;IACH,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;CAI1B"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! @azure/msal-browser v2.
|
|
1
|
+
/*! @azure/msal-browser v2.33.0 2023-02-06 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { __extends, __awaiter, __generator, __assign } from '../_virtual/_tslib.js';
|
|
4
|
-
import { AuthError, Constants } from '@azure/msal-common';
|
|
4
|
+
import { AuthError, PerformanceEvents, Constants } from '@azure/msal-common';
|
|
5
5
|
import { StandardInteractionClient } from './StandardInteractionClient.js';
|
|
6
6
|
import { BrowserAuthError } from '../error/BrowserAuthError.js';
|
|
7
7
|
import { InteractionType } from '../utils/BrowserConstants.js';
|
|
@@ -34,6 +34,8 @@ var SilentAuthCodeClient = /** @class */ (function (_super) {
|
|
|
34
34
|
if (!request.code) {
|
|
35
35
|
throw BrowserAuthError.createAuthCodeRequiredError();
|
|
36
36
|
}
|
|
37
|
+
// Create silent request
|
|
38
|
+
this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, request.correlationId);
|
|
37
39
|
return [4 /*yield*/, this.initializeAuthorizationRequest(request, InteractionType.Silent)];
|
|
38
40
|
case 1:
|
|
39
41
|
silentRequest = _a.sent();
|
|
@@ -43,12 +45,14 @@ var SilentAuthCodeClient = /** @class */ (function (_super) {
|
|
|
43
45
|
case 2:
|
|
44
46
|
_a.trys.push([2, 4, , 5]);
|
|
45
47
|
authCodeRequest = __assign(__assign({}, silentRequest), { code: request.code });
|
|
48
|
+
// Initialize the client
|
|
49
|
+
this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientGetClientConfiguration, request.correlationId);
|
|
46
50
|
return [4 /*yield*/, this.getClientConfiguration(serverTelemetryManager, silentRequest.authority)];
|
|
47
51
|
case 3:
|
|
48
52
|
clientConfig = _a.sent();
|
|
49
53
|
authClient = new HybridSpaAuthorizationCodeClient(clientConfig);
|
|
50
54
|
this.logger.verbose("Auth code client created");
|
|
51
|
-
silentHandler = new SilentHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.config.system);
|
|
55
|
+
silentHandler = new SilentHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.config.system, this.performanceClient);
|
|
52
56
|
// Handle auth code parameters from request
|
|
53
57
|
return [2 /*return*/, silentHandler.handleCodeResponseFromServer({
|
|
54
58
|
code: request.code,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SilentAuthCodeClient.js","sources":["../../src/interaction_client/SilentAuthCodeClient.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AuthenticationResult, ICrypto, Logger, CommonAuthorizationCodeRequest, AuthError, Constants, IPerformanceClient } from \"@azure/msal-common\";\nimport { StandardInteractionClient } from \"./StandardInteractionClient\";\nimport { AuthorizationUrlRequest } from \"../request/AuthorizationUrlRequest\";\nimport { BrowserConfiguration } from \"../config/Configuration\";\nimport { BrowserCacheManager } from \"../cache/BrowserCacheManager\";\nimport { EventHandler } from \"../event/EventHandler\";\nimport { INavigationClient } from \"../navigation/INavigationClient\";\nimport { BrowserAuthError } from \"../error/BrowserAuthError\";\nimport { InteractionType, ApiId } from \"../utils/BrowserConstants\";\nimport { SilentHandler } from \"../interaction_handler/SilentHandler\";\nimport { AuthorizationCodeRequest } from \"../request/AuthorizationCodeRequest\";\nimport { HybridSpaAuthorizationCodeClient } from \"./HybridSpaAuthorizationCodeClient\";\nimport { NativeMessageHandler } from \"../broker/nativeBroker/NativeMessageHandler\";\n\nexport class SilentAuthCodeClient extends StandardInteractionClient {\n private apiId: ApiId;\n\n constructor(config: BrowserConfiguration, storageImpl: BrowserCacheManager, browserCrypto: ICrypto, logger: Logger, eventHandler: EventHandler, navigationClient: INavigationClient, apiId: ApiId, performanceClient: IPerformanceClient, nativeMessageHandler?: NativeMessageHandler, correlationId?: string) {\n super(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, nativeMessageHandler, correlationId);\n this.apiId = apiId;\n }\n\n /**\n * Acquires a token silently by redeeming an authorization code against the /token endpoint\n * @param request\n */\n async acquireToken(request: AuthorizationCodeRequest): Promise<AuthenticationResult> {\n this.logger.trace(\"SilentAuthCodeClient.acquireToken called\");\n\n // Auth code payload is required\n if (!request.code) {\n throw BrowserAuthError.createAuthCodeRequiredError();\n\n }\n\n // Create silent request\n const silentRequest: AuthorizationUrlRequest = await this.initializeAuthorizationRequest(request, InteractionType.Silent);\n this.browserStorage.updateCacheEntries(silentRequest.state, silentRequest.nonce, silentRequest.authority, silentRequest.loginHint || Constants.EMPTY_STRING, silentRequest.account || null);\n\n const serverTelemetryManager = this.initializeServerTelemetryManager(this.apiId);\n\n try {\n\n // Create auth code request (PKCE not needed)\n const authCodeRequest: CommonAuthorizationCodeRequest = {\n ...silentRequest,\n code: request.code\n };\n\n // Initialize the client\n const clientConfig = await this.getClientConfiguration(serverTelemetryManager, silentRequest.authority);\n const authClient: HybridSpaAuthorizationCodeClient = new HybridSpaAuthorizationCodeClient(clientConfig);\n this.logger.verbose(\"Auth code client created\");\n\n // Create silent handler\n const silentHandler = new SilentHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.config.system);\n\n // Handle auth code parameters from request\n return silentHandler.handleCodeResponseFromServer(\n {\n code: request.code,\n msgraph_host: request.msGraphHost,\n cloud_graph_host_name: request.cloudGraphHostName,\n cloud_instance_host_name: request.cloudInstanceHostName\n },\n silentRequest.state,\n authClient.authority,\n this.networkClient,\n false\n );\n } catch (e) {\n if (e instanceof AuthError) {\n (e as AuthError).setCorrelationId(this.correlationId);\n }\n serverTelemetryManager.cacheFailedRequest(e);\n this.browserStorage.cleanRequestByState(silentRequest.state);\n throw e;\n }\n }\n\n /**\n * Currently Unsupported\n */\n logout(): Promise<void> {\n // Synchronous so we must reject\n return Promise.reject(BrowserAuthError.createSilentLogoutUnsupportedError());\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;AAAA;;;;;IAmB0C,wCAAyB;IAG/D,8BAAY,MAA4B,EAAE,WAAgC,EAAE,aAAsB,EAAE,MAAc,EAAE,YAA0B,EAAE,gBAAmC,EAAE,KAAY,EAAE,iBAAqC,EAAE,oBAA2C,EAAE,aAAsB;QAA7S,YACI,kBAAM,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,EAAE,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,aAAa,CAAC,SAE5I;QADG,KAAI,CAAC,KAAK,GAAG,KAAK,CAAC;;KACtB;;;;;IAMK,2CAAY,GAAlB,UAAmB,OAAiC;;;;;;wBAChD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,0CAA0C,CAAC,CAAC;;wBAG9D,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE;4BACf,MAAM,gBAAgB,CAAC,2BAA2B,EAAE,CAAC;yBAExD;
|
|
1
|
+
{"version":3,"file":"SilentAuthCodeClient.js","sources":["../../src/interaction_client/SilentAuthCodeClient.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AuthenticationResult, ICrypto, Logger, CommonAuthorizationCodeRequest, AuthError, Constants, IPerformanceClient, PerformanceEvents } from \"@azure/msal-common\";\nimport { StandardInteractionClient } from \"./StandardInteractionClient\";\nimport { AuthorizationUrlRequest } from \"../request/AuthorizationUrlRequest\";\nimport { BrowserConfiguration } from \"../config/Configuration\";\nimport { BrowserCacheManager } from \"../cache/BrowserCacheManager\";\nimport { EventHandler } from \"../event/EventHandler\";\nimport { INavigationClient } from \"../navigation/INavigationClient\";\nimport { BrowserAuthError } from \"../error/BrowserAuthError\";\nimport { InteractionType, ApiId } from \"../utils/BrowserConstants\";\nimport { SilentHandler } from \"../interaction_handler/SilentHandler\";\nimport { AuthorizationCodeRequest } from \"../request/AuthorizationCodeRequest\";\nimport { HybridSpaAuthorizationCodeClient } from \"./HybridSpaAuthorizationCodeClient\";\nimport { NativeMessageHandler } from \"../broker/nativeBroker/NativeMessageHandler\";\n\nexport class SilentAuthCodeClient extends StandardInteractionClient {\n private apiId: ApiId;\n\n constructor(config: BrowserConfiguration, storageImpl: BrowserCacheManager, browserCrypto: ICrypto, logger: Logger, eventHandler: EventHandler, navigationClient: INavigationClient, apiId: ApiId, performanceClient: IPerformanceClient, nativeMessageHandler?: NativeMessageHandler, correlationId?: string) {\n super(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, nativeMessageHandler, correlationId);\n this.apiId = apiId;\n }\n\n /**\n * Acquires a token silently by redeeming an authorization code against the /token endpoint\n * @param request\n */\n async acquireToken(request: AuthorizationCodeRequest): Promise<AuthenticationResult> {\n this.logger.trace(\"SilentAuthCodeClient.acquireToken called\");\n\n // Auth code payload is required\n if (!request.code) {\n throw BrowserAuthError.createAuthCodeRequiredError();\n\n }\n\n // Create silent request\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, request.correlationId);\n const silentRequest: AuthorizationUrlRequest = await this.initializeAuthorizationRequest(request, InteractionType.Silent);\n this.browserStorage.updateCacheEntries(silentRequest.state, silentRequest.nonce, silentRequest.authority, silentRequest.loginHint || Constants.EMPTY_STRING, silentRequest.account || null);\n\n const serverTelemetryManager = this.initializeServerTelemetryManager(this.apiId);\n\n try {\n\n // Create auth code request (PKCE not needed)\n const authCodeRequest: CommonAuthorizationCodeRequest = {\n ...silentRequest,\n code: request.code\n };\n\n // Initialize the client\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientGetClientConfiguration, request.correlationId);\n const clientConfig = await this.getClientConfiguration(serverTelemetryManager, silentRequest.authority);\n const authClient: HybridSpaAuthorizationCodeClient = new HybridSpaAuthorizationCodeClient(clientConfig);\n this.logger.verbose(\"Auth code client created\");\n\n // Create silent handler\n const silentHandler = new SilentHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.config.system, this.performanceClient);\n\n // Handle auth code parameters from request\n return silentHandler.handleCodeResponseFromServer(\n {\n code: request.code,\n msgraph_host: request.msGraphHost,\n cloud_graph_host_name: request.cloudGraphHostName,\n cloud_instance_host_name: request.cloudInstanceHostName\n },\n silentRequest.state,\n authClient.authority,\n this.networkClient,\n false\n );\n } catch (e) {\n if (e instanceof AuthError) {\n (e as AuthError).setCorrelationId(this.correlationId);\n }\n serverTelemetryManager.cacheFailedRequest(e);\n this.browserStorage.cleanRequestByState(silentRequest.state);\n throw e;\n }\n }\n\n /**\n * Currently Unsupported\n */\n logout(): Promise<void> {\n // Synchronous so we must reject\n return Promise.reject(BrowserAuthError.createSilentLogoutUnsupportedError());\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;AAAA;;;;;IAmB0C,wCAAyB;IAG/D,8BAAY,MAA4B,EAAE,WAAgC,EAAE,aAAsB,EAAE,MAAc,EAAE,YAA0B,EAAE,gBAAmC,EAAE,KAAY,EAAE,iBAAqC,EAAE,oBAA2C,EAAE,aAAsB;QAA7S,YACI,kBAAM,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,EAAE,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,aAAa,CAAC,SAE5I;QADG,KAAI,CAAC,KAAK,GAAG,KAAK,CAAC;;KACtB;;;;;IAMK,2CAAY,GAAlB,UAAmB,OAAiC;;;;;;wBAChD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,0CAA0C,CAAC,CAAC;;wBAG9D,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE;4BACf,MAAM,gBAAgB,CAAC,2BAA2B,EAAE,CAAC;yBAExD;;wBAGD,IAAI,CAAC,iBAAiB,CAAC,eAAe,CAAC,iBAAiB,CAAC,uDAAuD,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;wBAC1F,qBAAM,IAAI,CAAC,8BAA8B,CAAC,OAAO,EAAE,eAAe,CAAC,MAAM,CAAC,EAAA;;wBAAnH,aAAa,GAA4B,SAA0E;wBACzH,IAAI,CAAC,cAAc,CAAC,kBAAkB,CAAC,aAAa,CAAC,KAAK,EAAE,aAAa,CAAC,KAAK,EAAE,aAAa,CAAC,SAAS,EAAE,aAAa,CAAC,SAAS,IAAI,SAAS,CAAC,YAAY,EAAE,aAAa,CAAC,OAAO,IAAI,IAAI,CAAC,C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wBAC7D,MAAM,GAAC,CAAC;;;;;KAEf;;;;IAKD,qCAAM,GAAN;;QAEI,OAAO,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAC,kCAAkC,EAAE,CAAC,CAAC;KAChF;IACL,2BAAC;AAAD,CA3EA,CAA0C,yBAAyB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SilentCacheClient.d.ts","sourceRoot":"","sources":["../../src/interaction_client/SilentCacheClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,WAAW,EAAE,iBAAiB,EAAgC,MAAM,oBAAoB,CAAC;AAC3L,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAIzD,qBAAa,iBAAkB,SAAQ,yBAAyB;IAC5D;;;OAGG;IACG,YAAY,CAAC,aAAa,EAAE,uBAAuB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IA6BzF;;OAEG;IACH,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAKvB;;;;OAIG;cACa,sBAAsB,CAAC,sBAAsB,EAAE,sBAAsB,EAAE,YAAY,CAAC,EAAE,MAAM,EAAE,iBAAiB,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"SilentCacheClient.d.ts","sourceRoot":"","sources":["../../src/interaction_client/SilentCacheClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,WAAW,EAAE,iBAAiB,EAAgC,MAAM,oBAAoB,CAAC;AAC3L,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAIzD,qBAAa,iBAAkB,SAAQ,yBAAyB;IAC5D;;;OAGG;IACG,YAAY,CAAC,aAAa,EAAE,uBAAuB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IA6BzF;;OAEG;IACH,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAKvB;;;;OAIG;cACa,sBAAsB,CAAC,sBAAsB,EAAE,sBAAsB,EAAE,YAAY,CAAC,EAAE,MAAM,EAAE,iBAAiB,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAOzK,uBAAuB,CAAC,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,uBAAuB,CAAC;CAWhH"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-browser v2.
|
|
1
|
+
/*! @azure/msal-browser v2.33.0 2023-02-06 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { __extends, __awaiter, __generator, __assign } from '../_virtual/_tslib.js';
|
|
4
4
|
import { StandardInteractionClient } from './StandardInteractionClient.js';
|
|
@@ -75,7 +75,10 @@ var SilentCacheClient = /** @class */ (function (_super) {
|
|
|
75
75
|
var clientConfig;
|
|
76
76
|
return __generator(this, function (_a) {
|
|
77
77
|
switch (_a.label) {
|
|
78
|
-
case 0:
|
|
78
|
+
case 0:
|
|
79
|
+
// Create auth module.
|
|
80
|
+
this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientGetClientConfiguration, this.correlationId);
|
|
81
|
+
return [4 /*yield*/, this.getClientConfiguration(serverTelemetryManager, authorityUrl, azureCloudOptions)];
|
|
79
82
|
case 1:
|
|
80
83
|
clientConfig = _a.sent();
|
|
81
84
|
return [2 /*return*/, new SilentFlowClient(clientConfig, this.performanceClient)];
|
|
@@ -89,6 +92,8 @@ var SilentCacheClient = /** @class */ (function (_super) {
|
|
|
89
92
|
return __generator(this, function (_b) {
|
|
90
93
|
switch (_b.label) {
|
|
91
94
|
case 0:
|
|
95
|
+
this.performanceClient.addQueueMeasurement(PerformanceEvents.InitializeSilentRequest, this.correlationId);
|
|
96
|
+
this.performanceClient.setPreQueueTime(PerformanceEvents.InitializeBaseRequest, this.correlationId);
|
|
92
97
|
_a = [__assign({}, request)];
|
|
93
98
|
return [4 /*yield*/, this.initializeBaseRequest(request)];
|
|
94
99
|
case 1: return [2 /*return*/, __assign.apply(void 0, [__assign.apply(void 0, _a.concat([_b.sent()])), { account: account, forceRefresh: request.forceRefresh || false }])];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SilentCacheClient.js","sources":["../../src/interaction_client/SilentCacheClient.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { StandardInteractionClient } from \"./StandardInteractionClient\";\nimport { CommonSilentFlowRequest, AuthenticationResult, SilentFlowClient, ServerTelemetryManager, AccountInfo, AzureCloudOptions, PerformanceEvents, AuthError } from \"@azure/msal-common\";\nimport { SilentRequest } from \"../request/SilentRequest\";\nimport { ApiId } from \"../utils/BrowserConstants\";\nimport { BrowserAuthError, BrowserAuthErrorMessage } from \"../error/BrowserAuthError\";\n\nexport class SilentCacheClient extends StandardInteractionClient {\n /**\n * Returns unexpired tokens from the cache, if available\n * @param silentRequest\n */\n async acquireToken(silentRequest: CommonSilentFlowRequest): Promise<AuthenticationResult> {\n const acquireTokenMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.SilentCacheClientAcquireToken, silentRequest.correlationId);\n // Telemetry manager only used to increment cacheHits here\n const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenSilent_silentFlow);\n\n const silentAuthClient = await this.createSilentFlowClient(serverTelemetryManager, silentRequest.authority, silentRequest.azureCloudOptions);\n this.logger.verbose(\"Silent auth client created\");\n\n try {\n const cachedToken = await silentAuthClient.acquireCachedToken(silentRequest);\n\n acquireTokenMeasurement.endMeasurement({\n success: true,\n fromCache: true\n });\n return cachedToken;\n } catch (error) {\n if (error instanceof BrowserAuthError && error.errorCode === BrowserAuthErrorMessage.signingKeyNotFoundInStorage.code) {\n this.logger.verbose(\"Signing keypair for bound access token not found. Refreshing bound access token and generating a new crypto keypair.\");\n }\n acquireTokenMeasurement.endMeasurement({\n errorCode: error instanceof AuthError && error.errorCode || undefined,\n subErrorCode: error instanceof AuthError && error.subError || undefined,\n success: false\n });\n throw error;\n }\n }\n\n /**\n * Currently Unsupported\n */\n logout(): Promise<void> {\n // Synchronous so we must reject\n return Promise.reject(BrowserAuthError.createSilentLogoutUnsupportedError());\n }\n\n /**\n * Creates an Silent Flow Client with the given authority, or the default authority.\n * @param serverTelemetryManager\n * @param authorityUrl\n */\n protected async createSilentFlowClient(serverTelemetryManager: ServerTelemetryManager, authorityUrl?: string, azureCloudOptions?: AzureCloudOptions): Promise<SilentFlowClient> {\n // Create auth module.\n const clientConfig = await this.getClientConfiguration(serverTelemetryManager, authorityUrl, azureCloudOptions);\n return new SilentFlowClient(clientConfig, this.performanceClient);\n }\n\n async initializeSilentRequest(request: SilentRequest, account: AccountInfo): Promise<CommonSilentFlowRequest> {\n return {\n ...request,\n ...await this.initializeBaseRequest(request),\n account: account,\n forceRefresh: request.forceRefresh || false\n };\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAAA;;;;;IAWuC,qCAAyB;IAAhE;;
|
|
1
|
+
{"version":3,"file":"SilentCacheClient.js","sources":["../../src/interaction_client/SilentCacheClient.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { StandardInteractionClient } from \"./StandardInteractionClient\";\nimport { CommonSilentFlowRequest, AuthenticationResult, SilentFlowClient, ServerTelemetryManager, AccountInfo, AzureCloudOptions, PerformanceEvents, AuthError } from \"@azure/msal-common\";\nimport { SilentRequest } from \"../request/SilentRequest\";\nimport { ApiId } from \"../utils/BrowserConstants\";\nimport { BrowserAuthError, BrowserAuthErrorMessage } from \"../error/BrowserAuthError\";\n\nexport class SilentCacheClient extends StandardInteractionClient {\n /**\n * Returns unexpired tokens from the cache, if available\n * @param silentRequest\n */\n async acquireToken(silentRequest: CommonSilentFlowRequest): Promise<AuthenticationResult> {\n const acquireTokenMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.SilentCacheClientAcquireToken, silentRequest.correlationId);\n // Telemetry manager only used to increment cacheHits here\n const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenSilent_silentFlow);\n\n const silentAuthClient = await this.createSilentFlowClient(serverTelemetryManager, silentRequest.authority, silentRequest.azureCloudOptions);\n this.logger.verbose(\"Silent auth client created\");\n\n try {\n const cachedToken = await silentAuthClient.acquireCachedToken(silentRequest);\n\n acquireTokenMeasurement.endMeasurement({\n success: true,\n fromCache: true\n });\n return cachedToken;\n } catch (error) {\n if (error instanceof BrowserAuthError && error.errorCode === BrowserAuthErrorMessage.signingKeyNotFoundInStorage.code) {\n this.logger.verbose(\"Signing keypair for bound access token not found. Refreshing bound access token and generating a new crypto keypair.\");\n }\n acquireTokenMeasurement.endMeasurement({\n errorCode: error instanceof AuthError && error.errorCode || undefined,\n subErrorCode: error instanceof AuthError && error.subError || undefined,\n success: false\n });\n throw error;\n }\n }\n\n /**\n * Currently Unsupported\n */\n logout(): Promise<void> {\n // Synchronous so we must reject\n return Promise.reject(BrowserAuthError.createSilentLogoutUnsupportedError());\n }\n\n /**\n * Creates an Silent Flow Client with the given authority, or the default authority.\n * @param serverTelemetryManager\n * @param authorityUrl\n */\n protected async createSilentFlowClient(serverTelemetryManager: ServerTelemetryManager, authorityUrl?: string, azureCloudOptions?: AzureCloudOptions): Promise<SilentFlowClient> {\n // Create auth module.\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientGetClientConfiguration, this.correlationId);\n const clientConfig = await this.getClientConfiguration(serverTelemetryManager, authorityUrl, azureCloudOptions);\n return new SilentFlowClient(clientConfig, this.performanceClient);\n }\n\n async initializeSilentRequest(request: SilentRequest, account: AccountInfo): Promise<CommonSilentFlowRequest> {\n this.performanceClient.addQueueMeasurement(PerformanceEvents.InitializeSilentRequest, this.correlationId);\n\n this.performanceClient.setPreQueueTime(PerformanceEvents.InitializeBaseRequest, this.correlationId);\n return {\n ...request,\n ...await this.initializeBaseRequest(request),\n account: account,\n forceRefresh: request.forceRefresh || false\n };\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAAA;;;;;IAWuC,qCAAyB;IAAhE;;KAiEC;;;;;IA5DS,wCAAY,GAAlB,UAAmB,aAAsC;;;;;;wBAC/C,uBAAuB,GAAG,IAAI,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,6BAA6B,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC;wBAEhJ,sBAAsB,GAAG,IAAI,CAAC,gCAAgC,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAC;wBAEjF,qBAAM,IAAI,CAAC,sBAAsB,CAAC,sBAAsB,EAAE,aAAa,CAAC,SAAS,EAAE,aAAa,CAAC,iBAAiB,CAAC,EAAA;;wBAAtI,gBAAgB,GAAG,SAAmH;wBAC5I,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,4BAA4B,CAAC,CAAC;;;;wBAG1B,qBAAM,gBAAgB,CAAC,kBAAkB,CAAC,aAAa,CAAC,EAAA;;wBAAtE,WAAW,GAAG,SAAwD;wBAE5E,uBAAuB,CAAC,cAAc,CAAC;4BACnC,OAAO,EAAE,IAAI;4BACb,SAAS,EAAE,IAAI;yBAClB,CAAC,CAAC;wBACH,sBAAO,WAAW,EAAC;;;wBAEnB,IAAI,OAAK,YAAY,gBAAgB,IAAI,OAAK,CAAC,SAAS,KAAK,uBAAuB,CAAC,2BAA2B,CAAC,IAAI,EAAE;4BACnH,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,sHAAsH,CAAC,CAAC;yBAC/I;wBACD,uBAAuB,CAAC,cAAc,CAAC;4BACnC,SAAS,EAAE,OAAK,YAAY,SAAS,IAAI,OAAK,CAAC,SAAS,IAAI,SAAS;4BACrE,YAAY,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ilentIframeClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,oBAAoB,EAAE,OAAO,EAAE,MAAM,EAA4D,uBAAuB,EAAmF,kBAAkB,EAAqB,MAAM,oBAAoB,CAAC;AACtR,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAEpE,OAAO,EAAmB,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;AAGnF,qBAAa,kBAAmB,SAAQ,yBAAyB;IAC7D,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC;IACvB,SAAS,CAAC,aAAa,EAAE,mBAAmB,CAAC;gBAEjC,MAAM,EAAE,oBAAoB,EAAE,WAAW,EAAE,mBAAmB,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,KAAK,EAAE,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,oBAAoB,CAAC,EAAE,oBAAoB,EAAE,aAAa,CAAC,EAAE,MAAM;IAMrV;;;OAGG;IACG,YAAY,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"SilentIframeClient.d.ts","sourceRoot":"","sources":["../../src/interaction_client/SilentIframeClient.ts"],"names":[],"mappings":"AA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,uBAAuB,GAAG,OAAO,CAAC,oBAAoB,CAAC;CA6ChJ"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! @azure/msal-browser v2.
|
|
1
|
+
/*! @azure/msal-browser v2.33.0 2023-02-06 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { __extends, __awaiter, __generator, __assign } from '../_virtual/_tslib.js';
|
|
4
|
-
import { AuthError,
|
|
4
|
+
import { AuthError, PerformanceEvents, Constants, StringUtils, PromptValue, UrlString, ProtocolUtils } from '@azure/msal-common';
|
|
5
5
|
import { StandardInteractionClient } from './StandardInteractionClient.js';
|
|
6
6
|
import { BrowserAuthError } from '../error/BrowserAuthError.js';
|
|
7
7
|
import { InteractionType } from '../utils/BrowserConstants.js';
|
|
@@ -31,6 +31,7 @@ var SilentIframeClient = /** @class */ (function (_super) {
|
|
|
31
31
|
return __generator(this, function (_a) {
|
|
32
32
|
switch (_a.label) {
|
|
33
33
|
case 0:
|
|
34
|
+
this.performanceClient.addQueueMeasurement(PerformanceEvents.SilentIframeClientAcquireToken, request.correlationId);
|
|
34
35
|
this.logger.verbose("acquireTokenByIframe called");
|
|
35
36
|
acquireTokenMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.SilentIframeClientAcquireToken, request.correlationId);
|
|
36
37
|
// Check that we have some SSO data
|
|
@@ -44,6 +45,8 @@ var SilentIframeClient = /** @class */ (function (_super) {
|
|
|
44
45
|
});
|
|
45
46
|
throw BrowserAuthError.createSilentPromptValueError(request.prompt);
|
|
46
47
|
}
|
|
48
|
+
// Create silent request
|
|
49
|
+
this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, request.correlationId);
|
|
47
50
|
return [4 /*yield*/, this.initializeAuthorizationRequest(__assign(__assign({}, request), { prompt: request.prompt || PromptValue.NONE }), InteractionType.Silent)];
|
|
48
51
|
case 1:
|
|
49
52
|
silentRequest = _a.sent();
|
|
@@ -52,10 +55,13 @@ var SilentIframeClient = /** @class */ (function (_super) {
|
|
|
52
55
|
_a.label = 2;
|
|
53
56
|
case 2:
|
|
54
57
|
_a.trys.push([2, 5, , 6]);
|
|
58
|
+
// Initialize the client
|
|
59
|
+
this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, request.correlationId);
|
|
55
60
|
return [4 /*yield*/, this.createAuthCodeClient(serverTelemetryManager, silentRequest.authority, silentRequest.azureCloudOptions)];
|
|
56
61
|
case 3:
|
|
57
62
|
authClient = _a.sent();
|
|
58
63
|
this.logger.verbose("Auth code client created");
|
|
64
|
+
this.performanceClient.setPreQueueTime(PerformanceEvents.SilentIframeClientTokenHelper, request.correlationId);
|
|
59
65
|
return [4 /*yield*/, this.silentTokenHelper(authClient, silentRequest).then(function (result) {
|
|
60
66
|
acquireTokenMeasurement.endMeasurement({
|
|
61
67
|
success: true,
|
|
@@ -102,16 +108,26 @@ var SilentIframeClient = /** @class */ (function (_super) {
|
|
|
102
108
|
var _this = this;
|
|
103
109
|
return __generator(this, function (_a) {
|
|
104
110
|
switch (_a.label) {
|
|
105
|
-
case 0:
|
|
111
|
+
case 0:
|
|
112
|
+
this.performanceClient.addQueueMeasurement(PerformanceEvents.SilentIframeClientTokenHelper, silentRequest.correlationId);
|
|
113
|
+
// Create auth code request and generate PKCE params
|
|
114
|
+
this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientInitializeAuthorizationCodeRequest, silentRequest.correlationId);
|
|
115
|
+
return [4 /*yield*/, this.initializeAuthorizationCodeRequest(silentRequest)];
|
|
106
116
|
case 1:
|
|
107
117
|
authCodeRequest = _a.sent();
|
|
118
|
+
// Create authorize request url
|
|
119
|
+
this.performanceClient.setPreQueueTime(PerformanceEvents.GetAuthCodeUrl, silentRequest.correlationId);
|
|
108
120
|
return [4 /*yield*/, authClient.getAuthCodeUrl(__assign(__assign({}, silentRequest), { nativeBroker: NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeMessageHandler, silentRequest.authenticationScheme) }))];
|
|
109
121
|
case 2:
|
|
110
122
|
navigateUrl = _a.sent();
|
|
111
|
-
silentHandler = new SilentHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.config.system);
|
|
123
|
+
silentHandler = new SilentHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.config.system, this.performanceClient);
|
|
124
|
+
// Get the frame handle for the silent request
|
|
125
|
+
this.performanceClient.setPreQueueTime(PerformanceEvents.SilentHandlerInitiateAuthRequest, silentRequest.correlationId);
|
|
112
126
|
return [4 /*yield*/, silentHandler.initiateAuthRequest(navigateUrl)];
|
|
113
127
|
case 3:
|
|
114
128
|
msalFrame = _a.sent();
|
|
129
|
+
// Monitor the window for the hash. Return the string value and close the popup when the hash is received. Default timeout is 60 seconds.
|
|
130
|
+
this.performanceClient.setPreQueueTime(PerformanceEvents.SilentHandlerMonitorIframeForHash, silentRequest.correlationId);
|
|
115
131
|
return [4 /*yield*/, silentHandler.monitorIframeForHash(msalFrame, this.config.system.iframeHashTimeout)];
|
|
116
132
|
case 4:
|
|
117
133
|
hash = _a.sent();
|
|
@@ -129,6 +145,7 @@ var SilentIframeClient = /** @class */ (function (_super) {
|
|
|
129
145
|
})];
|
|
130
146
|
}
|
|
131
147
|
// Handle response from hash string
|
|
148
|
+
this.performanceClient.setPreQueueTime(PerformanceEvents.HandleCodeResponseFromHash, silentRequest.correlationId);
|
|
132
149
|
return [2 /*return*/, silentHandler.handleCodeResponseFromHash(hash, state, authClient.authority, this.networkClient)];
|
|
133
150
|
}
|
|
134
151
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SilentIframeClient.js","sources":["../../src/interaction_client/SilentIframeClient.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AuthenticationResult, ICrypto, Logger, StringUtils, PromptValue, CommonAuthorizationCodeRequest, AuthorizationCodeClient, AuthError, Constants, UrlString, ServerAuthorizationCodeResponse, ProtocolUtils, IPerformanceClient, PerformanceEvents } from \"@azure/msal-common\";\nimport { StandardInteractionClient } from \"./StandardInteractionClient\";\nimport { AuthorizationUrlRequest } from \"../request/AuthorizationUrlRequest\";\nimport { BrowserConfiguration } from \"../config/Configuration\";\nimport { BrowserCacheManager } from \"../cache/BrowserCacheManager\";\nimport { EventHandler } from \"../event/EventHandler\";\nimport { INavigationClient } from \"../navigation/INavigationClient\";\nimport { BrowserAuthError } from \"../error/BrowserAuthError\";\nimport { InteractionType, ApiId } from \"../utils/BrowserConstants\";\nimport { SilentHandler } from \"../interaction_handler/SilentHandler\";\nimport { SsoSilentRequest } from \"../request/SsoSilentRequest\";\nimport { NativeMessageHandler } from \"../broker/nativeBroker/NativeMessageHandler\";\nimport { NativeInteractionClient } from \"./NativeInteractionClient\";\n\nexport class SilentIframeClient extends StandardInteractionClient {\n protected apiId: ApiId;\n protected nativeStorage: BrowserCacheManager;\n\n constructor(config: BrowserConfiguration, storageImpl: BrowserCacheManager, browserCrypto: ICrypto, logger: Logger, eventHandler: EventHandler, navigationClient: INavigationClient, apiId: ApiId, performanceClient: IPerformanceClient, nativeStorageImpl: BrowserCacheManager, nativeMessageHandler?: NativeMessageHandler, correlationId?: string) {\n super(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, nativeMessageHandler, correlationId);\n this.apiId = apiId;\n this.nativeStorage = nativeStorageImpl;\n }\n\n /**\n * Acquires a token silently by opening a hidden iframe to the /authorize endpoint with prompt=none or prompt=no_session\n * @param request\n */\n async acquireToken(request: SsoSilentRequest): Promise<AuthenticationResult> {\n this.logger.verbose(\"acquireTokenByIframe called\");\n const acquireTokenMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.SilentIframeClientAcquireToken, request.correlationId);\n // Check that we have some SSO data\n if (StringUtils.isEmpty(request.loginHint) && StringUtils.isEmpty(request.sid) && (!request.account || StringUtils.isEmpty(request.account.username))) {\n this.logger.warning(\"No user hint provided. The authorization server may need more information to complete this request.\");\n }\n\n // Check that prompt is set to none or no_session, throw error if it is set to anything else.\n if (request.prompt && (request.prompt !== PromptValue.NONE) && (request.prompt !== PromptValue.NO_SESSION)) {\n acquireTokenMeasurement.endMeasurement({\n success: false\n });\n throw BrowserAuthError.createSilentPromptValueError(request.prompt);\n }\n\n // Create silent request\n const silentRequest: AuthorizationUrlRequest = await this.initializeAuthorizationRequest({\n ...request,\n prompt: request.prompt || PromptValue.NONE\n }, InteractionType.Silent);\n this.browserStorage.updateCacheEntries(silentRequest.state, silentRequest.nonce, silentRequest.authority, silentRequest.loginHint || Constants.EMPTY_STRING, silentRequest.account || null);\n\n const serverTelemetryManager = this.initializeServerTelemetryManager(this.apiId);\n\n try {\n // Initialize the client\n const authClient: AuthorizationCodeClient = await this.createAuthCodeClient(serverTelemetryManager, silentRequest.authority, silentRequest.azureCloudOptions);\n this.logger.verbose(\"Auth code client created\");\n\n return await this.silentTokenHelper(authClient, silentRequest).then((result: AuthenticationResult) => {\n acquireTokenMeasurement.endMeasurement({\n success: true,\n fromCache: false,\n requestId: result.requestId\n });\n return result;\n });\n } catch (e) {\n if (e instanceof AuthError) {\n (e as AuthError).setCorrelationId(this.correlationId);\n }\n serverTelemetryManager.cacheFailedRequest(e);\n this.browserStorage.cleanRequestByState(silentRequest.state);\n acquireTokenMeasurement.endMeasurement({\n errorCode: e instanceof AuthError && e.errorCode || undefined,\n subErrorCode: e instanceof AuthError && e.subError || undefined,\n success: false\n });\n throw e;\n }\n }\n\n /**\n * Currently Unsupported\n */\n logout(): Promise<void> {\n // Synchronous so we must reject\n return Promise.reject(BrowserAuthError.createSilentLogoutUnsupportedError());\n }\n\n /**\n * Helper which acquires an authorization code silently using a hidden iframe from given url\n * using the scopes requested as part of the id, and exchanges the code for a set of OAuth tokens.\n * @param navigateUrl\n * @param userRequestScopes\n */\n protected async silentTokenHelper(authClient: AuthorizationCodeClient, silentRequest: AuthorizationUrlRequest): Promise<AuthenticationResult> {\n // Create auth code request and generate PKCE params\n const authCodeRequest: CommonAuthorizationCodeRequest = await this.initializeAuthorizationCodeRequest(silentRequest);\n // Create authorize request url\n const navigateUrl = await authClient.getAuthCodeUrl({\n ...silentRequest,\n nativeBroker: NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeMessageHandler, silentRequest.authenticationScheme)\n });\n // Create silent handler\n const silentHandler = new SilentHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.config.system);\n // Get the frame handle for the silent request\n const msalFrame = await silentHandler.initiateAuthRequest(navigateUrl);\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 silentHandler.monitorIframeForHash(msalFrame, this.config.system.iframeHashTimeout);\n // Deserialize hash fragment response parameters.\n const serverParams: ServerAuthorizationCodeResponse = UrlString.getDeserializedHash(hash);\n const state = this.validateAndExtractStateFromHash(serverParams, InteractionType.Silent, authCodeRequest.correlationId);\n\n if (serverParams.accountId) {\n this.logger.verbose(\"Account id found in hash, calling WAM for token\");\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, this.apiId, this.performanceClient, this.nativeMessageHandler, serverParams.accountId, this.browserStorage, this.correlationId);\n const { userRequestState } = ProtocolUtils.parseRequestState(this.browserCrypto, state);\n return nativeInteractionClient.acquireToken({\n ...silentRequest,\n state: userRequestState,\n prompt: silentRequest.prompt || PromptValue.NONE\n }).finally(() => {\n this.browserStorage.cleanRequestByState(state);\n });\n }\n\n // Handle response from hash string\n return silentHandler.handleCodeResponseFromHash(hash, state, authClient.authority, this.networkClient);\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;;;;;IAmBwC,sCAAyB;IAI7D,4BAAY,MAA4B,EAAE,WAAgC,EAAE,aAAsB,EAAE,MAAc,EAAE,YAA0B,EAAE,gBAAmC,EAAE,KAAY,EAAE,iBAAqC,EAAE,iBAAsC,EAAE,oBA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AAM,CAAC,OAAO,CAAC,iDAAiD,CAAC,CAAC;4BACvE,IAAI,CAAC,IAAI,CAAC,oBAAoB,EAAE;gCAC5B,MAAM,gBAAgB,CAAC,yCAAyC,EAAE,CAAC;6BACtE;4BACK,uBAAuB,GAAG,IAAI,uBAAuB,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,iBAAiB,EAAE,IAAI,CAAC,oBAAoB,EAAE,YAAY,CAAC,SAAS,EAAE,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;4BACjS,gBAAgB,GAAK,aAAa,CAAC,iBAAiB,CAAC,IAAI,CAAC,aAAa,EAAE,KAAK,CAAC,iBAA/D,CAAgE;4BACxF,sBAAO,uBAAuB,CAAC,YAAY,uBACpC,aAAa,KAChB,KAAK,EAAE,gBAAgB,EACvB,MAAM,EAAE,aAAa,CAAC,MAAM,IAAI,WAAW,CAAC,IAAI,IAClD,CAAC,OAAO,CAAC;oCACP,KAAI,CAAC,cAAc,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC;iCAClD,CAAC,EAAC;yBACN;;wBAGD,sBAAO,aAAa,CAAC,0BAA0B,CAAC,IAAI,EAAE,KAAK,EAAE,UAAU,CAAC,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,EAAC;;;;KAC1G;IACL,yBAAC;AAAD,CAtHA,CAAwC,yBAAyB;;;;"}
|
|
1
|
+
{"version":3,"file":"SilentIframeClient.js","sources":["../../src/interaction_client/SilentIframeClient.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AuthenticationResult, ICrypto, Logger, StringUtils, PromptValue, CommonAuthorizationCodeRequest, AuthorizationCodeClient, AuthError, Constants, UrlString, ServerAuthorizationCodeResponse, ProtocolUtils, IPerformanceClient, PerformanceEvents } from \"@azure/msal-common\";\nimport { StandardInteractionClient } from \"./StandardInteractionClient\";\nimport { AuthorizationUrlRequest } from \"../request/AuthorizationUrlRequest\";\nimport { BrowserConfiguration } from \"../config/Configuration\";\nimport { BrowserCacheManager } from \"../cache/BrowserCacheManager\";\nimport { EventHandler } from \"../event/EventHandler\";\nimport { INavigationClient } from \"../navigation/INavigationClient\";\nimport { BrowserAuthError } from \"../error/BrowserAuthError\";\nimport { InteractionType, ApiId } from \"../utils/BrowserConstants\";\nimport { SilentHandler } from \"../interaction_handler/SilentHandler\";\nimport { SsoSilentRequest } from \"../request/SsoSilentRequest\";\nimport { NativeMessageHandler } from \"../broker/nativeBroker/NativeMessageHandler\";\nimport { NativeInteractionClient } from \"./NativeInteractionClient\";\n\nexport class SilentIframeClient extends StandardInteractionClient {\n protected apiId: ApiId;\n protected nativeStorage: BrowserCacheManager;\n\n constructor(config: BrowserConfiguration, storageImpl: BrowserCacheManager, browserCrypto: ICrypto, logger: Logger, eventHandler: EventHandler, navigationClient: INavigationClient, apiId: ApiId, performanceClient: IPerformanceClient, nativeStorageImpl: BrowserCacheManager, nativeMessageHandler?: NativeMessageHandler, correlationId?: string) {\n super(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, nativeMessageHandler, correlationId);\n this.apiId = apiId;\n this.nativeStorage = nativeStorageImpl;\n }\n\n /**\n * Acquires a token silently by opening a hidden iframe to the /authorize endpoint with prompt=none or prompt=no_session\n * @param request\n */\n async acquireToken(request: SsoSilentRequest): Promise<AuthenticationResult> {\n this.performanceClient.addQueueMeasurement(PerformanceEvents.SilentIframeClientAcquireToken, request.correlationId);\n this.logger.verbose(\"acquireTokenByIframe called\");\n const acquireTokenMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.SilentIframeClientAcquireToken, request.correlationId);\n // Check that we have some SSO data\n if (StringUtils.isEmpty(request.loginHint) && StringUtils.isEmpty(request.sid) && (!request.account || StringUtils.isEmpty(request.account.username))) {\n this.logger.warning(\"No user hint provided. The authorization server may need more information to complete this request.\");\n }\n\n // Check that prompt is set to none or no_session, throw error if it is set to anything else.\n if (request.prompt && (request.prompt !== PromptValue.NONE) && (request.prompt !== PromptValue.NO_SESSION)) {\n acquireTokenMeasurement.endMeasurement({\n success: false\n });\n throw BrowserAuthError.createSilentPromptValueError(request.prompt);\n }\n\n // Create silent request\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, request.correlationId);\n const silentRequest: AuthorizationUrlRequest = await this.initializeAuthorizationRequest({\n ...request,\n prompt: request.prompt || PromptValue.NONE\n }, InteractionType.Silent);\n this.browserStorage.updateCacheEntries(silentRequest.state, silentRequest.nonce, silentRequest.authority, silentRequest.loginHint || Constants.EMPTY_STRING, silentRequest.account || null);\n\n const serverTelemetryManager = this.initializeServerTelemetryManager(this.apiId);\n\n try {\n // Initialize the client\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, request.correlationId);\n const authClient: AuthorizationCodeClient = await this.createAuthCodeClient(serverTelemetryManager, silentRequest.authority, silentRequest.azureCloudOptions);\n this.logger.verbose(\"Auth code client created\");\n\n this.performanceClient.setPreQueueTime(PerformanceEvents.SilentIframeClientTokenHelper, request.correlationId);\n return await this.silentTokenHelper(authClient, silentRequest).then((result: AuthenticationResult) => {\n acquireTokenMeasurement.endMeasurement({\n success: true,\n fromCache: false,\n requestId: result.requestId\n });\n return result;\n });\n } catch (e) {\n if (e instanceof AuthError) {\n (e as AuthError).setCorrelationId(this.correlationId);\n }\n serverTelemetryManager.cacheFailedRequest(e);\n this.browserStorage.cleanRequestByState(silentRequest.state);\n acquireTokenMeasurement.endMeasurement({\n errorCode: e instanceof AuthError && e.errorCode || undefined,\n subErrorCode: e instanceof AuthError && e.subError || undefined,\n success: false\n });\n throw e;\n }\n }\n\n /**\n * Currently Unsupported\n */\n logout(): Promise<void> {\n // Synchronous so we must reject\n return Promise.reject(BrowserAuthError.createSilentLogoutUnsupportedError());\n }\n\n /**\n * Helper which acquires an authorization code silently using a hidden iframe from given url\n * using the scopes requested as part of the id, and exchanges the code for a set of OAuth tokens.\n * @param navigateUrl\n * @param userRequestScopes\n */\n protected async silentTokenHelper(authClient: AuthorizationCodeClient, silentRequest: AuthorizationUrlRequest): Promise<AuthenticationResult> {\n this.performanceClient.addQueueMeasurement(PerformanceEvents.SilentIframeClientTokenHelper, silentRequest.correlationId);\n\n // Create auth code request and generate PKCE params\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientInitializeAuthorizationCodeRequest, silentRequest.correlationId);\n const authCodeRequest: CommonAuthorizationCodeRequest = await this.initializeAuthorizationCodeRequest(silentRequest);\n // Create authorize request url\n this.performanceClient.setPreQueueTime(PerformanceEvents.GetAuthCodeUrl, silentRequest.correlationId);\n const navigateUrl = await authClient.getAuthCodeUrl({\n ...silentRequest,\n nativeBroker: NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeMessageHandler, silentRequest.authenticationScheme)\n });\n\n // Create silent handler\n const silentHandler = new SilentHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.config.system, this.performanceClient);\n // Get the frame handle for the silent request\n this.performanceClient.setPreQueueTime(PerformanceEvents.SilentHandlerInitiateAuthRequest, silentRequest.correlationId);\n const msalFrame = await silentHandler.initiateAuthRequest(navigateUrl);\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 this.performanceClient.setPreQueueTime(PerformanceEvents.SilentHandlerMonitorIframeForHash, silentRequest.correlationId);\n const hash = await silentHandler.monitorIframeForHash(msalFrame, this.config.system.iframeHashTimeout);\n // Deserialize hash fragment response parameters.\n const serverParams: ServerAuthorizationCodeResponse = UrlString.getDeserializedHash(hash);\n const state = this.validateAndExtractStateFromHash(serverParams, InteractionType.Silent, authCodeRequest.correlationId);\n\n if (serverParams.accountId) {\n this.logger.verbose(\"Account id found in hash, calling WAM for token\");\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, this.apiId, this.performanceClient, this.nativeMessageHandler, serverParams.accountId, this.browserStorage, this.correlationId);\n const { userRequestState } = ProtocolUtils.parseRequestState(this.browserCrypto, state);\n return nativeInteractionClient.acquireToken({\n ...silentRequest,\n state: userRequestState,\n prompt: silentRequest.prompt || PromptValue.NONE\n }).finally(() => {\n this.browserStorage.cleanRequestByState(state);\n });\n }\n\n // Handle response from hash string\n this.performanceClient.setPreQueueTime(PerformanceEvents.HandleCodeResponseFromHash, silentRequest.correlationId);\n return silentHandler.handleCodeResponseFromHash(hash, state, authClient.authority, this.networkClient);\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;;;;;IAmBwC,sCAAyB;IAI7D,4BAAY,MAA4B,EAAE,WAAgC,EAAE,aAAsB,EAAE,MAAc,EAAE,YAA0B,EAAE,gBAAmC,EAAE,KAAY,EAAE,iBAAqC,EAAE,iBAAsC,EAAE,oBAA2C,EAAE,aAAsB;QAArV,YACI,kBAAM,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,EAAE,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,aAAa,CAAC,SAG5I;QAFG,KAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,KAAI,CAAC,aAAa,GAAG,iBAAiB,CAAC;;KAC1C;;;;;IAMK,yCAAY,GAAlB,UAAmB,OAAyB;;;;;;wBACxC,IAAI,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,iBAAiB,CAAC,8BAA8B,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;wBACpH,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,6BAA6B,CAAC,CAAC;wBAC7C,uBAAuB,GAAG,IAAI,CAAC,iBAA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CAAC,cAAc,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC;iCAClD,CAAC,EAAC;yBACN;;wBAGD,IAAI,CAAC,iBAAiB,CAAC,eAAe,CAAC,iBAAiB,CAAC,0BAA0B,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC;wBAClH,sBAAO,aAAa,CAAC,0BAA0B,CAAC,IAAI,EAAE,KAAK,EAAE,UAAU,CAAC,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,EAAC;;;;KAC1G;IACL,yBAAC;AAAD,CAlIA,CAAwC,yBAAyB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SilentRefreshClient.d.ts","sourceRoot":"","sources":["../../src/interaction_client/SilentRefreshClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,kBAAkB,EAAa,iBAAiB,EAAqB,MAAM,oBAAoB,CAAC;AAIhL,qBAAa,mBAAoB,SAAQ,yBAAyB;IAC9D;;;OAGG;IACG,YAAY,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"SilentRefreshClient.d.ts","sourceRoot":"","sources":["../../src/interaction_client/SilentRefreshClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,kBAAkB,EAAa,iBAAiB,EAAqB,MAAM,oBAAoB,CAAC;AAIhL,qBAAa,mBAAoB,SAAQ,yBAAyB;IAC9D;;;OAGG;IACG,YAAY,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAuCnF;;OAEG;IACH,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAKvB;;;;OAIG;cACa,wBAAwB,CAAC,sBAAsB,EAAE,sBAAsB,EAAE,YAAY,CAAC,EAAE,MAAM,EAAE,iBAAiB,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAMtL"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/*! @azure/msal-browser v2.
|
|
1
|
+
/*! @azure/msal-browser v2.33.0 2023-02-06 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { __extends, __awaiter, __generator, __assign } from '../_virtual/_tslib.js';
|
|
4
4
|
import { StandardInteractionClient } from './StandardInteractionClient.js';
|
|
5
|
-
import {
|
|
5
|
+
import { PerformanceEvents, AuthError, RefreshTokenClient } from '@azure/msal-common';
|
|
6
6
|
import { ApiId } from '../utils/BrowserConstants.js';
|
|
7
7
|
import { BrowserAuthError } from '../error/BrowserAuthError.js';
|
|
8
8
|
|
|
@@ -26,6 +26,8 @@ var SilentRefreshClient = /** @class */ (function (_super) {
|
|
|
26
26
|
return __generator(this, function (_b) {
|
|
27
27
|
switch (_b.label) {
|
|
28
28
|
case 0:
|
|
29
|
+
this.performanceClient.addQueueMeasurement(PerformanceEvents.SilentRefreshClientAcquireToken, request.correlationId);
|
|
30
|
+
this.performanceClient.setPreQueueTime(PerformanceEvents.InitializeBaseRequest, request.correlationId);
|
|
29
31
|
_a = [__assign({}, request)];
|
|
30
32
|
return [4 /*yield*/, this.initializeBaseRequest(request)];
|
|
31
33
|
case 1:
|
|
@@ -37,6 +39,7 @@ var SilentRefreshClient = /** @class */ (function (_super) {
|
|
|
37
39
|
refreshTokenClient = _b.sent();
|
|
38
40
|
this.logger.verbose("Refresh token client created");
|
|
39
41
|
// Send request to renew token. Auth module will throw errors if token cannot be renewed.
|
|
42
|
+
this.performanceClient.setPreQueueTime(PerformanceEvents.RefreshTokenClientAcquireTokenByRefreshToken, request.correlationId);
|
|
40
43
|
return [2 /*return*/, refreshTokenClient.acquireTokenByRefreshToken(silentRequest)
|
|
41
44
|
.then(function (result) {
|
|
42
45
|
acquireTokenMeasurement.endMeasurement({
|
|
@@ -79,7 +82,10 @@ var SilentRefreshClient = /** @class */ (function (_super) {
|
|
|
79
82
|
var clientConfig;
|
|
80
83
|
return __generator(this, function (_a) {
|
|
81
84
|
switch (_a.label) {
|
|
82
|
-
case 0:
|
|
85
|
+
case 0:
|
|
86
|
+
// Create auth module.
|
|
87
|
+
this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientGetClientConfiguration, this.correlationId);
|
|
88
|
+
return [4 /*yield*/, this.getClientConfiguration(serverTelemetryManager, authorityUrl, azureCloudOptions)];
|
|
83
89
|
case 1:
|
|
84
90
|
clientConfig = _a.sent();
|
|
85
91
|
return [2 /*return*/, new RefreshTokenClient(clientConfig, this.performanceClient)];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SilentRefreshClient.js","sources":["../../src/interaction_client/SilentRefreshClient.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { StandardInteractionClient } from \"./StandardInteractionClient\";\nimport { CommonSilentFlowRequest, AuthenticationResult, ServerTelemetryManager, RefreshTokenClient, AuthError, AzureCloudOptions, PerformanceEvents } from \"@azure/msal-common\";\nimport { ApiId } from \"../utils/BrowserConstants\";\nimport { BrowserAuthError } from \"../error/BrowserAuthError\";\n\nexport class SilentRefreshClient extends StandardInteractionClient {\n /**\n * Exchanges the refresh token for new tokens\n * @param request\n */\n async acquireToken(request: CommonSilentFlowRequest): Promise<AuthenticationResult> {\n const silentRequest: CommonSilentFlowRequest = {\n ...request,\n ...await this.initializeBaseRequest(request)\n };\n const acquireTokenMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.SilentRefreshClientAcquireToken, silentRequest.correlationId);\n const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenSilent_silentFlow);\n\n const refreshTokenClient = await this.createRefreshTokenClient(serverTelemetryManager, silentRequest.authority, silentRequest.azureCloudOptions);\n this.logger.verbose(\"Refresh token client created\");\n // Send request to renew token. Auth module will throw errors if token cannot be renewed.\n return refreshTokenClient.acquireTokenByRefreshToken(silentRequest)\n .then((result: AuthenticationResult) => {\n acquireTokenMeasurement.endMeasurement({\n success: true,\n fromCache: result.fromCache,\n requestId: result.requestId\n });\n\n return result;\n })\n .catch((e: AuthError) => {\n if (e instanceof AuthError) {\n (e as AuthError).setCorrelationId(this.correlationId);\n }\n serverTelemetryManager.cacheFailedRequest(e);\n acquireTokenMeasurement.endMeasurement({\n errorCode: e.errorCode,\n subErrorCode: e.subError,\n success: false\n });\n throw e;\n });\n }\n\n /**\n * Currently Unsupported\n */\n logout(): Promise<void> {\n // Synchronous so we must reject\n return Promise.reject(BrowserAuthError.createSilentLogoutUnsupportedError());\n }\n\n /**\n * Creates a Refresh Client with the given authority, or the default authority.\n * @param serverTelemetryManager\n * @param authorityUrl\n */\n protected async createRefreshTokenClient(serverTelemetryManager: ServerTelemetryManager, authorityUrl?: string, azureCloudOptions?: AzureCloudOptions): Promise<RefreshTokenClient> {\n // Create auth module.\n const clientConfig = await this.getClientConfiguration(serverTelemetryManager, authorityUrl, azureCloudOptions);\n return new RefreshTokenClient(clientConfig, this.performanceClient);\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAAA;;;;;IAUyC,uCAAyB;IAAlE;;
|
|
1
|
+
{"version":3,"file":"SilentRefreshClient.js","sources":["../../src/interaction_client/SilentRefreshClient.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { StandardInteractionClient } from \"./StandardInteractionClient\";\nimport { CommonSilentFlowRequest, AuthenticationResult, ServerTelemetryManager, RefreshTokenClient, AuthError, AzureCloudOptions, PerformanceEvents } from \"@azure/msal-common\";\nimport { ApiId } from \"../utils/BrowserConstants\";\nimport { BrowserAuthError } from \"../error/BrowserAuthError\";\n\nexport class SilentRefreshClient extends StandardInteractionClient {\n /**\n * Exchanges the refresh token for new tokens\n * @param request\n */\n async acquireToken(request: CommonSilentFlowRequest): Promise<AuthenticationResult> {\n this.performanceClient.addQueueMeasurement(PerformanceEvents.SilentRefreshClientAcquireToken, request.correlationId);\n\n this.performanceClient.setPreQueueTime(PerformanceEvents.InitializeBaseRequest, request.correlationId);\n const silentRequest: CommonSilentFlowRequest = {\n ...request,\n ...await this.initializeBaseRequest(request)\n };\n const acquireTokenMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.SilentRefreshClientAcquireToken, silentRequest.correlationId);\n const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenSilent_silentFlow);\n\n const refreshTokenClient = await this.createRefreshTokenClient(serverTelemetryManager, silentRequest.authority, silentRequest.azureCloudOptions);\n this.logger.verbose(\"Refresh token client created\");\n // Send request to renew token. Auth module will throw errors if token cannot be renewed.\n this.performanceClient.setPreQueueTime(PerformanceEvents.RefreshTokenClientAcquireTokenByRefreshToken, request.correlationId);\n return refreshTokenClient.acquireTokenByRefreshToken(silentRequest)\n .then((result: AuthenticationResult) => {\n acquireTokenMeasurement.endMeasurement({\n success: true,\n fromCache: result.fromCache,\n requestId: result.requestId\n });\n\n return result;\n })\n .catch((e: AuthError) => {\n if (e instanceof AuthError) {\n (e as AuthError).setCorrelationId(this.correlationId);\n }\n serverTelemetryManager.cacheFailedRequest(e);\n acquireTokenMeasurement.endMeasurement({\n errorCode: e.errorCode,\n subErrorCode: e.subError,\n success: false\n });\n throw e;\n });\n }\n\n /**\n * Currently Unsupported\n */\n logout(): Promise<void> {\n // Synchronous so we must reject\n return Promise.reject(BrowserAuthError.createSilentLogoutUnsupportedError());\n }\n\n /**\n * Creates a Refresh Client with the given authority, or the default authority.\n * @param serverTelemetryManager\n * @param authorityUrl\n */\n protected async createRefreshTokenClient(serverTelemetryManager: ServerTelemetryManager, authorityUrl?: string, azureCloudOptions?: AzureCloudOptions): Promise<RefreshTokenClient> {\n // Create auth module.\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientGetClientConfiguration, this.correlationId);\n const clientConfig = await this.getClientConfiguration(serverTelemetryManager, authorityUrl, azureCloudOptions);\n return new RefreshTokenClient(clientConfig, this.performanceClient);\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAAA;;;;;IAUyC,uCAAyB;IAAlE;;KA+DC;;;;;IA1DS,0CAAY,GAAlB,UAAmB,OAAgC;;;;;;;wBAC/C,IAAI,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,iBAAiB,CAAC,+BAA+B,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;wBAErH,IAAI,CAAC,iBAAiB,CAAC,eAAe,CAAC,iBAAiB,CAAC,qBAAqB,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;2CAEhG,OAAO;wBACP,qBAAM,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,EAAA;;wBAF1C,aAAa,qCAEZ,SAAyC,GAC/C;wBACK,uBAAuB,GAAG,IAAI,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,+BAA+B,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC;wBAClJ,sBAAsB,GAAG,IAAI,CAAC,gCAAgC,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAC;wBAE/E,qBAAM,IAAI,CAAC,wBAAwB,CAAC,sBAAsB,EAAE,aAAa,CAAC,SAAS,EAAE,aAAa,CAAC,iBAAiB,CAAC,EAAA;;wBAA1I,kBAAkB,GAAG,SAAqH;wBAChJ,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,8BAA8B,CAAC,CAAC;;wBAEpD,IAAI,CAAC,iBAAiB,CAAC,eAAe,CAAC,iBAAiB,CAAC,4CAA4C,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;wBAC9H,sBAAO,kBAAkB,CAAC,0BAA0B,CAAC,aAAa,CAAC;iCAC9D,IAAI,CAAC,UAAC,MAA4B;gCAC/B,uBAAuB,CAAC,cAAc,CAAC;oCACnC,OAAO,EAAE,IAAI;oCACb,SAAS,EAAE,MAAM,CAAC,SAAS;oCAC3B,SAAS,EAAE,MAAM,CAAC,SAAS;iCAC9B,CAAC,CAAC;gCAEH,OAAO,MAAM,CAAC;6BACjB,CAAC;iCACD,KAAK,CAAC,UAAC,CAAY;gCAChB,IAAI,CAAC,YAAY,SAAS,EAAE;oCACvB,CAAe,CAAC,gBAAgB,CAAC,KAAI,CAAC,aAAa,CAAC,CAAC;iCACzD;gCACD,sBAAsB,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC;gCAC7C,uBAAuB,CAAC,cAAc,CAAC;oCACnC,SAAS,EAAE,CAAC,CAAC,SAAS;oCACtB,YAAY,EAAE,CAAC,CAAC,QAAQ;oCACxB,OAAO,EAAE,KAAK;iCACjB,CAAC,CAAC;gCACH,MAAM,CAAC,CAAC;6BACX,CAAC,EAAC;;;;KACV;;;;IAKD,oCAAM,GAAN;;QAEI,OAAO,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAC,kCAAkC,EAAE,CAAC,CAAC;KAChF;;;;;;IAOe,sDAAwB,GAAxC,UAAyC,sBAA8C,EAAE,YAAqB,EAAE,iBAAqC;;;;;;;wBAEjJ,IAAI,CAAC,iBAAiB,CAAC,eAAe,CAAC,iBAAiB,CAAC,+CAA+C,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;wBACzG,qBAAM,IAAI,CAAC,sBAAsB,CAAC,sBAAsB,EAAE,YAAY,EAAE,iBAAiB,CAAC,EAAA;;wBAAzG,YAAY,GAAG,SAA0F;wBAC/G,sBAAO,IAAI,kBAAkB,CAAC,YAAY,EAAE,IAAI,CAAC,iBAAiB,CAAC,EAAC;;;;KACvE;IACL,0BAAC;AAAD,CA/DA,CAAyC,yBAAyB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StandardInteractionClient.d.ts","sourceRoot":"","sources":["../../src/interaction_client/StandardInteractionClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,sBAAsB,EAAE,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3
3
|
import { __extends, __awaiter, __generator, __assign } from '../_virtual/_tslib.js';
|
|
4
|
-
import { UrlString, Constants,
|
|
4
|
+
import { UrlString, Constants, PerformanceEvents, AuthorizationCodeClient, Authority, AuthorityFactory, ResponseMode, StringUtils, ProtocolUtils } from '@azure/msal-common';
|
|
5
5
|
import { BaseInteractionClient } from './BaseInteractionClient.js';
|
|
6
6
|
import { BrowserConstants } from '../utils/BrowserConstants.js';
|
|
7
7
|
import { version } from '../packageMetadata.js';
|
|
@@ -31,6 +31,7 @@ var StandardInteractionClient = /** @class */ (function (_super) {
|
|
|
31
31
|
return __generator(this, function (_a) {
|
|
32
32
|
switch (_a.label) {
|
|
33
33
|
case 0:
|
|
34
|
+
this.performanceClient.addQueueMeasurement(PerformanceEvents.StandardInteractionClientInitializeAuthorizationCodeRequest, request.correlationId);
|
|
34
35
|
this.logger.verbose("initializeAuthorizationRequest called", request.correlationId);
|
|
35
36
|
return [4 /*yield*/, this.browserCrypto.generatePkceCodes()];
|
|
36
37
|
case 1:
|
|
@@ -131,10 +132,14 @@ var StandardInteractionClient = /** @class */ (function (_super) {
|
|
|
131
132
|
var clientConfig;
|
|
132
133
|
return __generator(this, function (_a) {
|
|
133
134
|
switch (_a.label) {
|
|
134
|
-
case 0:
|
|
135
|
+
case 0:
|
|
136
|
+
this.performanceClient.addQueueMeasurement(PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, this.correlationId);
|
|
137
|
+
// Create auth module.
|
|
138
|
+
this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientGetClientConfiguration, this.correlationId);
|
|
139
|
+
return [4 /*yield*/, this.getClientConfiguration(serverTelemetryManager, authorityUrl, requestAzureCloudOptions)];
|
|
135
140
|
case 1:
|
|
136
141
|
clientConfig = _a.sent();
|
|
137
|
-
return [2 /*return*/, new AuthorizationCodeClient(clientConfig)];
|
|
142
|
+
return [2 /*return*/, new AuthorizationCodeClient(clientConfig, this.performanceClient)];
|
|
138
143
|
}
|
|
139
144
|
});
|
|
140
145
|
});
|
|
@@ -151,7 +156,9 @@ var StandardInteractionClient = /** @class */ (function (_super) {
|
|
|
151
156
|
return __generator(this, function (_a) {
|
|
152
157
|
switch (_a.label) {
|
|
153
158
|
case 0:
|
|
159
|
+
this.performanceClient.addQueueMeasurement(PerformanceEvents.StandardInteractionClientGetClientConfiguration, this.correlationId);
|
|
154
160
|
this.logger.verbose("getClientConfiguration called", this.correlationId);
|
|
161
|
+
this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientGetDiscoveredAuthority, this.correlationId);
|
|
155
162
|
return [4 /*yield*/, this.getDiscoveredAuthority(requestAuthority, requestAzureCloudOptions)];
|
|
156
163
|
case 1:
|
|
157
164
|
discoveredAuthority = _a.sent();
|
|
@@ -219,6 +226,7 @@ var StandardInteractionClient = /** @class */ (function (_super) {
|
|
|
219
226
|
return __generator(this, function (_b) {
|
|
220
227
|
switch (_b.label) {
|
|
221
228
|
case 0:
|
|
229
|
+
this.performanceClient.addQueueMeasurement(PerformanceEvents.StandardInteractionClientGetDiscoveredAuthority, this.correlationId);
|
|
222
230
|
this.logger.verbose("getDiscoveredAuthority called", this.correlationId);
|
|
223
231
|
getAuthorityMeasurement = (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.startMeasurement(PerformanceEvents.StandardInteractionClientGetDiscoveredAuthority, this.correlationId);
|
|
224
232
|
authorityOptions = {
|
|
@@ -231,7 +239,8 @@ var StandardInteractionClient = /** @class */ (function (_super) {
|
|
|
231
239
|
userAuthority = requestAuthority ? requestAuthority : this.config.auth.authority;
|
|
232
240
|
builtAuthority = Authority.generateAuthority(userAuthority, requestAzureCloudOptions || this.config.auth.azureCloudOptions);
|
|
233
241
|
this.logger.verbose("Creating discovered authority with configured authority", this.correlationId);
|
|
234
|
-
|
|
242
|
+
this.performanceClient.setPreQueueTime(PerformanceEvents.AuthorityFactoryCreateDiscoveredInstance, this.correlationId);
|
|
243
|
+
return [4 /*yield*/, AuthorityFactory.createDiscoveredInstance(builtAuthority, this.config.system.networkClient, this.browserStorage, authorityOptions, this.logger, this.performanceClient, this.correlationId)
|
|
235
244
|
.then(function (result) {
|
|
236
245
|
getAuthorityMeasurement.endMeasurement({
|
|
237
246
|
success: true,
|
|
@@ -262,12 +271,14 @@ var StandardInteractionClient = /** @class */ (function (_super) {
|
|
|
262
271
|
return __generator(this, function (_b) {
|
|
263
272
|
switch (_b.label) {
|
|
264
273
|
case 0:
|
|
274
|
+
this.performanceClient.addQueueMeasurement(PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, this.correlationId);
|
|
265
275
|
this.logger.verbose("initializeAuthorizationRequest called", this.correlationId);
|
|
266
276
|
redirectUri = this.getRedirectUri(request.redirectUri);
|
|
267
277
|
browserState = {
|
|
268
278
|
interactionType: interactionType
|
|
269
279
|
};
|
|
270
280
|
state = ProtocolUtils.setRequestState(this.browserCrypto, (request && request.state) || Constants.EMPTY_STRING, browserState);
|
|
281
|
+
this.performanceClient.setPreQueueTime(PerformanceEvents.InitializeBaseRequest, this.correlationId);
|
|
271
282
|
_a = [{}];
|
|
272
283
|
return [4 /*yield*/, this.initializeBaseRequest(request)];
|
|
273
284
|
case 1:
|
|
@@ -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 const logger= this.config.system.loggerOptions;\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: logger.loggerCallback,\n piiLoggingEnabled: logger.piiLoggingEnabled,\n logLevel: logger.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;;KAmQC;;;;;IA9PmB,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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,CAAC,MAAM,CAAC,UAAU,CAAC,wCAAsC,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,CAnQA,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.performanceClient.addQueueMeasurement(PerformanceEvents.StandardInteractionClientInitializeAuthorizationCodeRequest, request.correlationId);\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 this.performanceClient.addQueueMeasurement(PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, this.correlationId);\n // Create auth module.\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientGetClientConfiguration, this.correlationId);\n const clientConfig = await this.getClientConfiguration(serverTelemetryManager, authorityUrl, requestAzureCloudOptions);\n return new AuthorizationCodeClient(clientConfig, this.performanceClient);\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.performanceClient.addQueueMeasurement(PerformanceEvents.StandardInteractionClientGetClientConfiguration, this.correlationId);\n this.logger.verbose(\"getClientConfiguration called\", this.correlationId);\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientGetDiscoveredAuthority, this.correlationId);\n const discoveredAuthority = await this.getDiscoveredAuthority(requestAuthority, requestAzureCloudOptions);\n const logger= this.config.system.loggerOptions;\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: logger.loggerCallback,\n piiLoggingEnabled: logger.piiLoggingEnabled,\n logLevel: logger.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.performanceClient.addQueueMeasurement(PerformanceEvents.StandardInteractionClientGetDiscoveredAuthority, this.correlationId);\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 this.performanceClient.setPreQueueTime(PerformanceEvents.AuthorityFactoryCreateDiscoveredInstance, this.correlationId);\n return await AuthorityFactory.createDiscoveredInstance(builtAuthority, this.config.system.networkClient, this.browserStorage, authorityOptions, this.logger, this.performanceClient, this.correlationId)\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.performanceClient.addQueueMeasurement(PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, this.correlationId);\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 this.performanceClient.setPreQueueTime(PerformanceEvents.InitializeBaseRequest, this.correlationId);\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 =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AAc,CAAC,gBAAgB,EAAE,CAAC;wBAC1E,IAAI,OAAO,EAAE;4BACT,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,mCAAmC,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;4BAC7E,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,wCAAsC,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,CA5QA,CAAwD,qBAAqB;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AuthorizationCodePayload, CommonAuthorizationCodeRequest, AuthenticationResult, AuthorizationCodeClient, Authority, INetworkModule, CcsCredential, Logger } from "@azure/msal-common";
|
|
1
|
+
import { AuthorizationCodePayload, CommonAuthorizationCodeRequest, AuthenticationResult, AuthorizationCodeClient, Authority, INetworkModule, CcsCredential, Logger, IPerformanceClient } from "@azure/msal-common";
|
|
2
2
|
import { BrowserCacheManager } from "../cache/BrowserCacheManager";
|
|
3
3
|
export declare type InteractionParams = {};
|
|
4
4
|
/**
|
|
@@ -9,7 +9,8 @@ export declare class InteractionHandler {
|
|
|
9
9
|
protected browserStorage: BrowserCacheManager;
|
|
10
10
|
protected authCodeRequest: CommonAuthorizationCodeRequest;
|
|
11
11
|
protected logger: Logger;
|
|
12
|
-
|
|
12
|
+
protected performanceClient: IPerformanceClient;
|
|
13
|
+
constructor(authCodeModule: AuthorizationCodeClient, storageImpl: BrowserCacheManager, authCodeRequest: CommonAuthorizationCodeRequest, logger: Logger, performanceClient: IPerformanceClient);
|
|
13
14
|
/**
|
|
14
15
|
* Function to handle response parameters from hash.
|
|
15
16
|
* @param locationHash
|