@azure/msal-browser 2.18.0 → 2.22.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/CHANGELOG.json +1758 -1548
- package/CHANGELOG.md +553 -491
- package/LICENSE +21 -21
- package/README.md +5 -3
- package/dist/_virtual/_tslib.js +1 -1
- package/dist/app/ClientApplication.d.ts +30 -1
- package/dist/app/ClientApplication.d.ts.map +1 -1
- package/dist/app/ClientApplication.js +101 -5
- package/dist/app/ClientApplication.js.map +1 -1
- package/dist/app/IPublicClientApplication.d.ts +4 -0
- package/dist/app/IPublicClientApplication.d.ts.map +1 -1
- package/dist/app/IPublicClientApplication.js +7 -1
- package/dist/app/IPublicClientApplication.js.map +1 -1
- package/dist/app/PublicClientApplication.d.ts +2 -2
- package/dist/app/PublicClientApplication.d.ts.map +1 -1
- package/dist/app/PublicClientApplication.js +31 -24
- package/dist/app/PublicClientApplication.js.map +1 -1
- package/dist/cache/AsyncMemoryStorage.d.ts +46 -0
- package/dist/cache/AsyncMemoryStorage.d.ts.map +1 -0
- package/dist/cache/AsyncMemoryStorage.js +195 -0
- package/dist/cache/AsyncMemoryStorage.js.map +1 -0
- package/dist/cache/BrowserCacheManager.d.ts +19 -13
- package/dist/cache/BrowserCacheManager.d.ts.map +1 -1
- package/dist/cache/BrowserCacheManager.js +31 -7
- package/dist/cache/BrowserCacheManager.js.map +1 -1
- package/dist/cache/BrowserStorage.d.ts +1 -1
- package/dist/cache/BrowserStorage.d.ts.map +1 -1
- package/dist/cache/BrowserStorage.js +1 -1
- package/dist/cache/BrowserStorage.js.map +1 -1
- package/dist/cache/DatabaseStorage.d.ts +25 -6
- package/dist/cache/DatabaseStorage.d.ts.map +1 -1
- package/dist/cache/DatabaseStorage.js +127 -81
- package/dist/cache/DatabaseStorage.js.map +1 -1
- package/dist/cache/IAsyncMemoryStorage.d.ts +28 -0
- package/dist/cache/IAsyncMemoryStorage.d.ts.map +1 -0
- package/dist/cache/IWindowStorage.d.ts +3 -3
- package/dist/cache/IWindowStorage.d.ts.map +1 -1
- package/dist/cache/MemoryStorage.d.ts +3 -3
- package/dist/cache/MemoryStorage.d.ts.map +1 -1
- package/dist/cache/MemoryStorage.js +1 -1
- package/dist/cache/MemoryStorage.js.map +1 -1
- package/dist/cache/TokenCache.d.ts.map +1 -1
- package/dist/cache/TokenCache.js +4 -3
- package/dist/cache/TokenCache.js.map +1 -1
- package/dist/config/Configuration.d.ts +10 -9
- package/dist/config/Configuration.d.ts.map +1 -1
- package/dist/config/Configuration.js +7 -3
- package/dist/config/Configuration.js.map +1 -1
- package/dist/crypto/BrowserCrypto.d.ts +3 -1
- package/dist/crypto/BrowserCrypto.d.ts.map +1 -1
- package/dist/crypto/BrowserCrypto.js +3 -2
- package/dist/crypto/BrowserCrypto.js.map +1 -1
- package/dist/crypto/CryptoOps.d.ts +16 -5
- package/dist/crypto/CryptoOps.d.ts.map +1 -1
- package/dist/crypto/CryptoOps.js +58 -17
- package/dist/crypto/CryptoOps.js.map +1 -1
- package/dist/crypto/GuidGenerator.js +1 -1
- package/dist/crypto/GuidGenerator.js.map +1 -1
- package/dist/crypto/PkceGenerator.js +1 -1
- package/dist/crypto/PkceGenerator.js.map +1 -1
- package/dist/crypto/SignedHttpRequest.d.ts +6 -2
- package/dist/crypto/SignedHttpRequest.d.ts.map +1 -1
- package/dist/crypto/SignedHttpRequest.js +11 -5
- package/dist/crypto/SignedHttpRequest.js.map +1 -1
- package/dist/encode/Base64Decode.js +1 -1
- package/dist/encode/Base64Decode.js.map +1 -1
- package/dist/encode/Base64Encode.js +1 -1
- package/dist/encode/Base64Encode.js.map +1 -1
- package/dist/error/BrowserAuthError.d.ts +16 -0
- package/dist/error/BrowserAuthError.d.ts.map +1 -1
- package/dist/error/BrowserAuthError.js +22 -2
- package/dist/error/BrowserAuthError.js.map +1 -1
- package/dist/error/BrowserConfigurationAuthError.js +1 -1
- package/dist/error/BrowserConfigurationAuthError.js.map +1 -1
- package/dist/event/EventHandler.js +1 -1
- package/dist/event/EventHandler.js.map +1 -1
- package/dist/event/EventMessage.js +1 -1
- package/dist/event/EventMessage.js.map +1 -1
- package/dist/event/EventType.d.ts +3 -0
- package/dist/event/EventType.d.ts.map +1 -1
- package/dist/event/EventType.js +4 -1
- package/dist/event/EventType.js.map +1 -1
- package/dist/index.cjs.js +1473 -511
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +16 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -3
- package/dist/index.js.map +1 -1
- package/dist/interaction_client/BaseInteractionClient.d.ts +2 -2
- package/dist/interaction_client/BaseInteractionClient.d.ts.map +1 -1
- package/dist/interaction_client/BaseInteractionClient.js +40 -17
- package/dist/interaction_client/BaseInteractionClient.js.map +1 -1
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.d.ts +5 -0
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.d.ts.map +1 -0
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.js +21 -0
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.js.map +1 -0
- package/dist/interaction_client/PopupClient.d.ts +4 -3
- package/dist/interaction_client/PopupClient.d.ts.map +1 -1
- package/dist/interaction_client/PopupClient.js +23 -21
- package/dist/interaction_client/PopupClient.js.map +1 -1
- package/dist/interaction_client/RedirectClient.d.ts +3 -3
- package/dist/interaction_client/RedirectClient.d.ts.map +1 -1
- package/dist/interaction_client/RedirectClient.js +22 -20
- package/dist/interaction_client/RedirectClient.js.map +1 -1
- package/dist/interaction_client/SilentAuthCodeClient.d.ts +22 -0
- package/dist/interaction_client/SilentAuthCodeClient.d.ts.map +1 -0
- package/dist/interaction_client/SilentAuthCodeClient.js +83 -0
- package/dist/interaction_client/SilentAuthCodeClient.js.map +1 -0
- package/dist/interaction_client/SilentCacheClient.d.ts +3 -3
- package/dist/interaction_client/SilentCacheClient.d.ts.map +1 -1
- package/dist/interaction_client/SilentCacheClient.js +15 -5
- package/dist/interaction_client/SilentCacheClient.js.map +1 -1
- package/dist/interaction_client/SilentIframeClient.d.ts +3 -3
- package/dist/interaction_client/SilentIframeClient.d.ts.map +1 -1
- package/dist/interaction_client/SilentIframeClient.js +16 -13
- package/dist/interaction_client/SilentIframeClient.js.map +1 -1
- package/dist/interaction_client/SilentRefreshClient.d.ts +2 -2
- package/dist/interaction_client/SilentRefreshClient.d.ts.map +1 -1
- package/dist/interaction_client/SilentRefreshClient.js +13 -10
- package/dist/interaction_client/SilentRefreshClient.js.map +1 -1
- package/dist/interaction_client/StandardInteractionClient.d.ts +11 -11
- package/dist/interaction_client/StandardInteractionClient.d.ts.map +1 -1
- package/dist/interaction_client/StandardInteractionClient.js +90 -57
- package/dist/interaction_client/StandardInteractionClient.js.map +1 -1
- package/dist/interaction_handler/InteractionHandler.d.ts +11 -2
- package/dist/interaction_handler/InteractionHandler.d.ts.map +1 -1
- package/dist/interaction_handler/InteractionHandler.js +36 -10
- package/dist/interaction_handler/InteractionHandler.js.map +1 -1
- package/dist/interaction_handler/PopupHandler.d.ts.map +1 -1
- package/dist/interaction_handler/PopupHandler.js +1 -3
- package/dist/interaction_handler/PopupHandler.js.map +1 -1
- package/dist/interaction_handler/RedirectHandler.d.ts +1 -1
- package/dist/interaction_handler/RedirectHandler.d.ts.map +1 -1
- package/dist/interaction_handler/RedirectHandler.js +2 -3
- package/dist/interaction_handler/RedirectHandler.js.map +1 -1
- package/dist/interaction_handler/SilentHandler.js +1 -1
- package/dist/interaction_handler/SilentHandler.js.map +1 -1
- package/dist/navigation/NavigationClient.js +1 -1
- package/dist/navigation/NavigationClient.js.map +1 -1
- package/dist/network/FetchClient.js +1 -1
- package/dist/network/FetchClient.js.map +1 -1
- package/dist/network/XhrClient.js +1 -1
- package/dist/network/XhrClient.js.map +1 -1
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/packageMetadata.js +2 -2
- package/dist/packageMetadata.js.map +1 -1
- package/dist/request/AuthorizationCodeRequest.d.ts +8 -0
- package/dist/request/AuthorizationCodeRequest.d.ts.map +1 -0
- package/dist/request/AuthorizationUrlRequest.d.ts +1 -1
- package/dist/request/AuthorizationUrlRequest.d.ts.map +1 -1
- package/dist/request/EndSessionPopupRequest.d.ts +1 -0
- package/dist/request/EndSessionPopupRequest.d.ts.map +1 -1
- package/dist/request/EndSessionRequest.d.ts +1 -0
- package/dist/request/EndSessionRequest.d.ts.map +1 -1
- package/dist/request/PopupRequest.d.ts +1 -1
- package/dist/request/PopupRequest.d.ts.map +1 -1
- package/dist/request/RedirectRequest.d.ts +1 -1
- package/dist/request/RedirectRequest.d.ts.map +1 -1
- package/dist/request/SilentRequest.d.ts +1 -1
- package/dist/request/SilentRequest.d.ts.map +1 -1
- package/dist/request/SsoSilentRequest.d.ts +1 -1
- package/dist/request/SsoSilentRequest.d.ts.map +1 -1
- package/dist/utils/BrowserConstants.d.ts +6 -1
- package/dist/utils/BrowserConstants.d.ts.map +1 -1
- package/dist/utils/BrowserConstants.js +9 -3
- package/dist/utils/BrowserConstants.js.map +1 -1
- package/dist/utils/BrowserProtocolUtils.js +1 -1
- package/dist/utils/BrowserProtocolUtils.js.map +1 -1
- package/dist/utils/BrowserStringUtils.js +1 -1
- package/dist/utils/BrowserStringUtils.js.map +1 -1
- package/dist/utils/BrowserUtils.js +1 -1
- package/dist/utils/BrowserUtils.js.map +1 -1
- package/dist/utils/MathUtils.js +1 -1
- package/dist/utils/MathUtils.js.map +1 -1
- package/dist/utils/PopupUtils.d.ts +1 -2
- package/dist/utils/PopupUtils.d.ts.map +1 -1
- package/dist/utils/PopupUtils.js +3 -3
- package/dist/utils/PopupUtils.js.map +1 -1
- package/lib/msal-browser.js +1473 -511
- package/lib/msal-browser.js.map +1 -1
- package/lib/msal-browser.min.js +36 -31
- package/package.json +96 -94
|
@@ -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,MAAM,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,EAAE,MAAM,oBAAoB,CAAC;AAI7J,qBAAa,mBAAoB,SAAQ,yBAAyB;IAC9D;;;OAGG;IACG,YAAY,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAoBnF;;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;CAKtL"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-browser v2.
|
|
1
|
+
/*! @azure/msal-browser v2.22.0 2022-02-08 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { __extends, __awaiter, __generator, __assign } from '../_virtual/_tslib.js';
|
|
4
4
|
import { StandardInteractionClient } from './StandardInteractionClient.js';
|
|
@@ -21,16 +21,19 @@ var SilentRefreshClient = /** @class */ (function (_super) {
|
|
|
21
21
|
*/
|
|
22
22
|
SilentRefreshClient.prototype.acquireToken = function (request) {
|
|
23
23
|
return __awaiter(this, void 0, void 0, function () {
|
|
24
|
-
var silentRequest, serverTelemetryManager, refreshTokenClient;
|
|
24
|
+
var silentRequest, _a, serverTelemetryManager, refreshTokenClient;
|
|
25
25
|
var _this = this;
|
|
26
|
-
return __generator(this, function (
|
|
27
|
-
switch (
|
|
26
|
+
return __generator(this, function (_b) {
|
|
27
|
+
switch (_b.label) {
|
|
28
28
|
case 0:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return [4 /*yield*/, this.createRefreshTokenClient(serverTelemetryManager, silentRequest.authority)];
|
|
29
|
+
_a = [__assign({}, request)];
|
|
30
|
+
return [4 /*yield*/, this.initializeBaseRequest(request)];
|
|
32
31
|
case 1:
|
|
33
|
-
|
|
32
|
+
silentRequest = __assign.apply(void 0, _a.concat([_b.sent()]));
|
|
33
|
+
serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenSilent_silentFlow);
|
|
34
|
+
return [4 /*yield*/, this.createRefreshTokenClient(serverTelemetryManager, silentRequest.authority, silentRequest.azureCloudOptions)];
|
|
35
|
+
case 2:
|
|
36
|
+
refreshTokenClient = _b.sent();
|
|
34
37
|
this.logger.verbose("Refresh token client created");
|
|
35
38
|
// Send request to renew token. Auth module will throw errors if token cannot be renewed.
|
|
36
39
|
return [2 /*return*/, refreshTokenClient.acquireTokenByRefreshToken(silentRequest).catch(function (e) {
|
|
@@ -56,12 +59,12 @@ var SilentRefreshClient = /** @class */ (function (_super) {
|
|
|
56
59
|
* @param serverTelemetryManager
|
|
57
60
|
* @param authorityUrl
|
|
58
61
|
*/
|
|
59
|
-
SilentRefreshClient.prototype.createRefreshTokenClient = function (serverTelemetryManager, authorityUrl) {
|
|
62
|
+
SilentRefreshClient.prototype.createRefreshTokenClient = function (serverTelemetryManager, authorityUrl, azureCloudOptions) {
|
|
60
63
|
return __awaiter(this, void 0, void 0, function () {
|
|
61
64
|
var clientConfig;
|
|
62
65
|
return __generator(this, function (_a) {
|
|
63
66
|
switch (_a.label) {
|
|
64
|
-
case 0: return [4 /*yield*/, this.getClientConfiguration(serverTelemetryManager, authorityUrl)];
|
|
67
|
+
case 0: return [4 /*yield*/, this.getClientConfiguration(serverTelemetryManager, authorityUrl, azureCloudOptions)];
|
|
65
68
|
case 1:
|
|
66
69
|
clientConfig = _a.sent();
|
|
67
70
|
return [2 /*return*/, new RefreshTokenClient(clientConfig)];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SilentRefreshClient.js","sources":["../../src/interaction_client/SilentRefreshClient.ts"],"sourcesContent":["/*\
|
|
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 } 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 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\n // Send request to renew token. Auth module will throw errors if token cannot be renewed.\n return refreshTokenClient.acquireTokenByRefreshToken(silentRequest).catch(e => {\n if (e instanceof AuthError) {\n e.setCorrelationId(this.correlationId);\n }\n serverTelemetryManager.cacheFailedRequest(e);\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);\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAAA;;;;;IAUyC,uCAAyB;IAAlE;;KA2CC;;;;;IAtCS,0CAAY,GAAlB,UAAmB,OAAgC;;;;;;;2CAExC,OAAO;wBACP,qBAAM,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,EAAA;;wBAF1C,aAAa,qCAEZ,SAAyC,GAC/C;wBACK,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;;wBAGpD,sBAAO,kBAAkB,CAAC,0BAA0B,CAAC,aAAa,CAAC,CAAC,KAAK,CAAC,UAAA,CAAC;gCACvE,IAAI,CAAC,YAAY,SAAS,EAAE;oCACxB,CAAC,CAAC,gBAAgB,CAAC,KAAI,CAAC,aAAa,CAAC,CAAC;iCAC1C;gCACD,sBAAsB,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC;gCAC7C,MAAM,CAAC,CAAC;6BACX,CAAC,EAAC;;;;KACN;;;;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;;;;;4BAE5H,qBAAM,IAAI,CAAC,sBAAsB,CAAC,sBAAsB,EAAE,YAAY,EAAE,iBAAiB,CAAC,EAAA;;wBAAzG,YAAY,GAAG,SAA0F;wBAC/G,sBAAO,IAAI,kBAAkB,CAAC,YAAY,CAAC,EAAC;;;;KAC/C;IACL,0BAAC;AAAD,CA3CA,CAAyC,yBAAyB;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ICrypto, Logger, ServerTelemetryManager, CommonAuthorizationCodeRequest, AuthorizationCodeClient, ClientConfiguration, Authority, CommonEndSessionRequest } from "@azure/msal-common";
|
|
1
|
+
import { ICrypto, Logger, ServerTelemetryManager, CommonAuthorizationCodeRequest, AuthorizationCodeClient, ClientConfiguration, Authority, CommonEndSessionRequest, AccountInfo, AzureCloudOptions } from "@azure/msal-common";
|
|
2
2
|
import { BaseInteractionClient } from "./BaseInteractionClient";
|
|
3
3
|
import { BrowserConfiguration } from "../config/Configuration";
|
|
4
4
|
import { AuthorizationUrlRequest } from "../request/AuthorizationUrlRequest";
|
|
@@ -26,19 +26,25 @@ export declare abstract class StandardInteractionClient extends BaseInteractionC
|
|
|
26
26
|
* @param logoutRequest
|
|
27
27
|
*/
|
|
28
28
|
protected initializeLogoutRequest(logoutRequest?: EndSessionRequest): CommonEndSessionRequest;
|
|
29
|
+
/**
|
|
30
|
+
* Parses login_hint ID Token Claim out of AccountInfo object to be used as
|
|
31
|
+
* logout_hint in end session request.
|
|
32
|
+
* @param account
|
|
33
|
+
*/
|
|
34
|
+
protected getLogoutHintFromIdTokenClaims(account: AccountInfo): string | null;
|
|
29
35
|
/**
|
|
30
36
|
* Creates an Authorization Code Client with the given authority, or the default authority.
|
|
31
37
|
* @param serverTelemetryManager
|
|
32
38
|
* @param authorityUrl
|
|
33
39
|
*/
|
|
34
|
-
protected createAuthCodeClient(serverTelemetryManager: ServerTelemetryManager, authorityUrl?: string): Promise<AuthorizationCodeClient>;
|
|
40
|
+
protected createAuthCodeClient(serverTelemetryManager: ServerTelemetryManager, authorityUrl?: string, requestAzureCloudOptions?: AzureCloudOptions): Promise<AuthorizationCodeClient>;
|
|
35
41
|
/**
|
|
36
42
|
* Creates a Client Configuration object with the given request authority, or the default authority.
|
|
37
43
|
* @param serverTelemetryManager
|
|
38
44
|
* @param requestAuthority
|
|
39
45
|
* @param requestCorrelationId
|
|
40
46
|
*/
|
|
41
|
-
protected getClientConfiguration(serverTelemetryManager: ServerTelemetryManager, requestAuthority?: string): Promise<ClientConfiguration>;
|
|
47
|
+
protected getClientConfiguration(serverTelemetryManager: ServerTelemetryManager, requestAuthority?: string, requestAzureCloudOptions?: AzureCloudOptions): Promise<ClientConfiguration>;
|
|
42
48
|
/**
|
|
43
49
|
* @param hash
|
|
44
50
|
* @param interactionType
|
|
@@ -49,18 +55,12 @@ export declare abstract class StandardInteractionClient extends BaseInteractionC
|
|
|
49
55
|
* @param requestAuthority
|
|
50
56
|
* @param requestCorrelationId
|
|
51
57
|
*/
|
|
52
|
-
protected getDiscoveredAuthority(requestAuthority?: string): Promise<Authority>;
|
|
53
|
-
/**
|
|
54
|
-
* Helper to validate app environment before making a request.
|
|
55
|
-
* @param request
|
|
56
|
-
* @param interactionType
|
|
57
|
-
*/
|
|
58
|
-
protected preflightInteractiveRequest(request: RedirectRequest | PopupRequest, interactionType: InteractionType): AuthorizationUrlRequest;
|
|
58
|
+
protected getDiscoveredAuthority(requestAuthority?: string, requestAzureCloudOptions?: AzureCloudOptions): Promise<Authority>;
|
|
59
59
|
/**
|
|
60
60
|
* Helper to initialize required request parameters for interactive APIs and ssoSilent()
|
|
61
61
|
* @param request
|
|
62
62
|
* @param interactionType
|
|
63
63
|
*/
|
|
64
|
-
protected initializeAuthorizationRequest(request: RedirectRequest | PopupRequest | SsoSilentRequest, interactionType: InteractionType): AuthorizationUrlRequest
|
|
64
|
+
protected initializeAuthorizationRequest(request: RedirectRequest | PopupRequest | SsoSilentRequest, interactionType: InteractionType): Promise<AuthorizationUrlRequest>;
|
|
65
65
|
}
|
|
66
66
|
//# sourceMappingURL=StandardInteractionClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StandardInteractionClient.d.ts","sourceRoot":"","sources":["../../src/interaction_client/StandardInteractionClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,sBAAsB,EAAE,8BAA8B,EAAa,uBAAuB,EAAE,mBAAmB,EAAoB,SAAS,EAAgE,uBAAuB,
|
|
1
|
+
{"version":3,"file":"StandardInteractionClient.d.ts","sourceRoot":"","sources":["../../src/interaction_client/StandardInteractionClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,sBAAsB,EAAE,8BAA8B,EAAa,uBAAuB,EAAE,mBAAmB,EAAoB,SAAS,EAAgE,uBAAuB,EAA2D,WAAW,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACnX,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAoB,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAI9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D;;GAEG;AACH,8BAAsB,yBAA0B,SAAQ,qBAAqB;IACzE,SAAS,CAAC,gBAAgB,EAAE,iBAAiB,CAAC;gBAElC,MAAM,EAAE,o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/*! @azure/msal-browser v2.22.0 2022-02-08 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { __extends, __awaiter, __generator, __assign } from '../_virtual/_tslib.js';
|
|
4
|
-
import {
|
|
4
|
+
import { UrlString, Constants, 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';
|
|
@@ -51,11 +51,32 @@ var StandardInteractionClient = /** @class */ (function (_super) {
|
|
|
51
51
|
*/
|
|
52
52
|
StandardInteractionClient.prototype.initializeLogoutRequest = function (logoutRequest) {
|
|
53
53
|
this.logger.verbose("initializeLogoutRequest called", logoutRequest === null || logoutRequest === void 0 ? void 0 : logoutRequest.correlationId);
|
|
54
|
-
// Check if interaction is in progress. Throw error if true.
|
|
55
|
-
if (this.browserStorage.isInteractionInProgress()) {
|
|
56
|
-
throw BrowserAuthError.createInteractionInProgressError();
|
|
57
|
-
}
|
|
58
54
|
var validLogoutRequest = __assign({ correlationId: this.browserCrypto.createNewGuid() }, logoutRequest);
|
|
55
|
+
/**
|
|
56
|
+
* Set logout_hint to be login_hint from ID Token Claims if present
|
|
57
|
+
* and logoutHint attribute wasn't manually set in logout request
|
|
58
|
+
*/
|
|
59
|
+
if (logoutRequest) {
|
|
60
|
+
// If logoutHint isn't set and an account was passed in, try to extract logoutHint from ID Token Claims
|
|
61
|
+
if (!logoutRequest.logoutHint) {
|
|
62
|
+
if (logoutRequest.account) {
|
|
63
|
+
var logoutHint = this.getLogoutHintFromIdTokenClaims(logoutRequest.account);
|
|
64
|
+
if (logoutHint) {
|
|
65
|
+
this.logger.verbose("Setting logoutHint to login_hint ID Token Claim value for the account provided");
|
|
66
|
+
validLogoutRequest.logoutHint = logoutHint;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
this.logger.verbose("logoutHint was not set and account was not passed into logout request, logoutHint will not be set");
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
this.logger.verbose("logoutHint has already been set in logoutRequest");
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
this.logger.verbose("logoutHint will not be set since no logout request was configured");
|
|
79
|
+
}
|
|
59
80
|
/*
|
|
60
81
|
* Only set redirect uri if logout request isn't provided or the set uri isn't null.
|
|
61
82
|
* Otherwise, use passed uri, config, or current page.
|
|
@@ -82,17 +103,37 @@ var StandardInteractionClient = /** @class */ (function (_super) {
|
|
|
82
103
|
}
|
|
83
104
|
return validLogoutRequest;
|
|
84
105
|
};
|
|
106
|
+
/**
|
|
107
|
+
* Parses login_hint ID Token Claim out of AccountInfo object to be used as
|
|
108
|
+
* logout_hint in end session request.
|
|
109
|
+
* @param account
|
|
110
|
+
*/
|
|
111
|
+
StandardInteractionClient.prototype.getLogoutHintFromIdTokenClaims = function (account) {
|
|
112
|
+
var idTokenClaims = account.idTokenClaims;
|
|
113
|
+
if (idTokenClaims) {
|
|
114
|
+
if (idTokenClaims.login_hint) {
|
|
115
|
+
return idTokenClaims.login_hint;
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
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");
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
this.logger.verbose("The provided account does not contain ID Token Claims, logoutHint will not be added to logout request");
|
|
123
|
+
}
|
|
124
|
+
return null;
|
|
125
|
+
};
|
|
85
126
|
/**
|
|
86
127
|
* Creates an Authorization Code Client with the given authority, or the default authority.
|
|
87
128
|
* @param serverTelemetryManager
|
|
88
129
|
* @param authorityUrl
|
|
89
130
|
*/
|
|
90
|
-
StandardInteractionClient.prototype.createAuthCodeClient = function (serverTelemetryManager, authorityUrl) {
|
|
131
|
+
StandardInteractionClient.prototype.createAuthCodeClient = function (serverTelemetryManager, authorityUrl, requestAzureCloudOptions) {
|
|
91
132
|
return __awaiter(this, void 0, void 0, function () {
|
|
92
133
|
var clientConfig;
|
|
93
134
|
return __generator(this, function (_a) {
|
|
94
135
|
switch (_a.label) {
|
|
95
|
-
case 0: return [4 /*yield*/, this.getClientConfiguration(serverTelemetryManager, authorityUrl)];
|
|
136
|
+
case 0: return [4 /*yield*/, this.getClientConfiguration(serverTelemetryManager, authorityUrl, requestAzureCloudOptions)];
|
|
96
137
|
case 1:
|
|
97
138
|
clientConfig = _a.sent();
|
|
98
139
|
return [2 /*return*/, new AuthorizationCodeClient(clientConfig)];
|
|
@@ -106,14 +147,14 @@ var StandardInteractionClient = /** @class */ (function (_super) {
|
|
|
106
147
|
* @param requestAuthority
|
|
107
148
|
* @param requestCorrelationId
|
|
108
149
|
*/
|
|
109
|
-
StandardInteractionClient.prototype.getClientConfiguration = function (serverTelemetryManager, requestAuthority) {
|
|
150
|
+
StandardInteractionClient.prototype.getClientConfiguration = function (serverTelemetryManager, requestAuthority, requestAzureCloudOptions) {
|
|
110
151
|
return __awaiter(this, void 0, void 0, function () {
|
|
111
152
|
var discoveredAuthority;
|
|
112
153
|
return __generator(this, function (_a) {
|
|
113
154
|
switch (_a.label) {
|
|
114
155
|
case 0:
|
|
115
156
|
this.logger.verbose("getClientConfiguration called");
|
|
116
|
-
return [4 /*yield*/, this.getDiscoveredAuthority(requestAuthority)];
|
|
157
|
+
return [4 /*yield*/, this.getDiscoveredAuthority(requestAuthority, requestAzureCloudOptions)];
|
|
117
158
|
case 1:
|
|
118
159
|
discoveredAuthority = _a.sent();
|
|
119
160
|
return [2 /*return*/, {
|
|
@@ -173,9 +214,9 @@ var StandardInteractionClient = /** @class */ (function (_super) {
|
|
|
173
214
|
* @param requestAuthority
|
|
174
215
|
* @param requestCorrelationId
|
|
175
216
|
*/
|
|
176
|
-
StandardInteractionClient.prototype.getDiscoveredAuthority = function (requestAuthority) {
|
|
217
|
+
StandardInteractionClient.prototype.getDiscoveredAuthority = function (requestAuthority, requestAzureCloudOptions) {
|
|
177
218
|
return __awaiter(this, void 0, void 0, function () {
|
|
178
|
-
var authorityOptions;
|
|
219
|
+
var authorityOptions, userAuthority, builtAuthority;
|
|
179
220
|
return __generator(this, function (_a) {
|
|
180
221
|
switch (_a.label) {
|
|
181
222
|
case 0:
|
|
@@ -184,63 +225,55 @@ var StandardInteractionClient = /** @class */ (function (_super) {
|
|
|
184
225
|
protocolMode: this.config.auth.protocolMode,
|
|
185
226
|
knownAuthorities: this.config.auth.knownAuthorities,
|
|
186
227
|
cloudDiscoveryMetadata: this.config.auth.cloudDiscoveryMetadata,
|
|
187
|
-
authorityMetadata: this.config.auth.authorityMetadata
|
|
228
|
+
authorityMetadata: this.config.auth.authorityMetadata,
|
|
188
229
|
};
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
return [4 /*yield*/, AuthorityFactory.createDiscoveredInstance(requestAuthority, this.config.system.networkClient, this.browserStorage, authorityOptions)];
|
|
192
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
193
|
-
case 2:
|
|
230
|
+
userAuthority = requestAuthority ? requestAuthority : this.config.auth.authority;
|
|
231
|
+
builtAuthority = Authority.generateAuthority(userAuthority, requestAzureCloudOptions || this.config.auth.azureCloudOptions);
|
|
194
232
|
this.logger.verbose("Creating discovered authority with configured authority");
|
|
195
|
-
return [4 /*yield*/, AuthorityFactory.createDiscoveredInstance(
|
|
196
|
-
case
|
|
233
|
+
return [4 /*yield*/, AuthorityFactory.createDiscoveredInstance(builtAuthority, this.config.system.networkClient, this.browserStorage, authorityOptions)];
|
|
234
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
197
235
|
}
|
|
198
236
|
});
|
|
199
237
|
});
|
|
200
238
|
};
|
|
201
|
-
/**
|
|
202
|
-
* Helper to validate app environment before making a request.
|
|
203
|
-
* @param request
|
|
204
|
-
* @param interactionType
|
|
205
|
-
*/
|
|
206
|
-
StandardInteractionClient.prototype.preflightInteractiveRequest = function (request, interactionType) {
|
|
207
|
-
this.logger.verbose("preflightInteractiveRequest called, validating app environment", request === null || request === void 0 ? void 0 : request.correlationId);
|
|
208
|
-
// block the reload if it occurred inside a hidden iframe
|
|
209
|
-
BrowserUtils.blockReloadInHiddenIframes();
|
|
210
|
-
// Check if interaction is in progress. Throw error if true.
|
|
211
|
-
if (this.browserStorage.isInteractionInProgress(false)) {
|
|
212
|
-
throw BrowserAuthError.createInteractionInProgressError();
|
|
213
|
-
}
|
|
214
|
-
return this.initializeAuthorizationRequest(request, interactionType);
|
|
215
|
-
};
|
|
216
239
|
/**
|
|
217
240
|
* Helper to initialize required request parameters for interactive APIs and ssoSilent()
|
|
218
241
|
* @param request
|
|
219
242
|
* @param interactionType
|
|
220
243
|
*/
|
|
221
244
|
StandardInteractionClient.prototype.initializeAuthorizationRequest = function (request, interactionType) {
|
|
222
|
-
this
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
245
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
246
|
+
var redirectUri, browserState, state, validatedRequest, _a, account, legacyLoginHint;
|
|
247
|
+
return __generator(this, function (_b) {
|
|
248
|
+
switch (_b.label) {
|
|
249
|
+
case 0:
|
|
250
|
+
this.logger.verbose("initializeAuthorizationRequest called");
|
|
251
|
+
redirectUri = this.getRedirectUri(request.redirectUri);
|
|
252
|
+
browserState = {
|
|
253
|
+
interactionType: interactionType
|
|
254
|
+
};
|
|
255
|
+
state = ProtocolUtils.setRequestState(this.browserCrypto, (request && request.state) || Constants.EMPTY_STRING, browserState);
|
|
256
|
+
_a = [{}];
|
|
257
|
+
return [4 /*yield*/, this.initializeBaseRequest(request)];
|
|
258
|
+
case 1:
|
|
259
|
+
validatedRequest = __assign.apply(void 0, [__assign.apply(void 0, _a.concat([_b.sent()])), { redirectUri: redirectUri, state: state, nonce: request.nonce || this.browserCrypto.createNewGuid(), responseMode: ResponseMode.FRAGMENT }]);
|
|
260
|
+
account = request.account || this.browserStorage.getActiveAccount();
|
|
261
|
+
if (account) {
|
|
262
|
+
this.logger.verbose("Setting validated request account");
|
|
263
|
+
this.logger.verbosePii("Setting validated request account: " + account);
|
|
264
|
+
validatedRequest.account = account;
|
|
265
|
+
}
|
|
266
|
+
// Check for ADAL/MSAL v1 SSO
|
|
267
|
+
if (StringUtils.isEmpty(validatedRequest.loginHint) && !account) {
|
|
268
|
+
legacyLoginHint = this.browserStorage.getLegacyLoginHint();
|
|
269
|
+
if (legacyLoginHint) {
|
|
270
|
+
validatedRequest.loginHint = legacyLoginHint;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
return [2 /*return*/, validatedRequest];
|
|
274
|
+
}
|
|
275
|
+
});
|
|
276
|
+
});
|
|
244
277
|
};
|
|
245
278
|
return StandardInteractionClient;
|
|
246
279
|
}(BaseInteractionClient));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StandardInteractionClient.js","sources":["../../src/interaction_client/StandardInteractionClient.ts"],"sourcesContent":["/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { ICrypto, Logger, ServerTelemetryManager, CommonAuthorizationCodeRequest, Constants, AuthorizationCodeClient, ClientConfiguration, AuthorityOptions, Authority, AuthorityFactory, ServerAuthorizationCodeResponse, UrlString, CommonEndSessionRequest, ProtocolUtils, ResponseMode, StringUtils } from \"@azure/msal-common\";\r\nimport { BaseInteractionClient } from \"./BaseInteractionClient\";\r\nimport { BrowserConfiguration } from \"../config/Configuration\";\r\nimport { AuthorizationUrlRequest } from \"../request/AuthorizationUrlRequest\";\r\nimport { BrowserCacheManager } from \"../cache/BrowserCacheManager\";\r\nimport { EventHandler } from \"../event/EventHandler\";\r\nimport { BrowserConstants, InteractionType } from \"../utils/BrowserConstants\";\r\nimport { version } from \"../packageMetadata\";\r\nimport { BrowserAuthError } from \"../error/BrowserAuthError\";\r\nimport { BrowserProtocolUtils, BrowserStateObject } from \"../utils/BrowserProtocolUtils\";\r\nimport { EndSessionRequest } from \"../request/EndSessionRequest\";\r\nimport { BrowserUtils } from \"../utils/BrowserUtils\";\r\nimport { INavigationClient } from \"../navigation/INavigationClient\";\r\nimport { RedirectRequest } from \"../request/RedirectRequest\";\r\nimport { PopupRequest } from \"../request/PopupRequest\";\r\nimport { SsoSilentRequest } from \"../request/SsoSilentRequest\";\r\n\r\n/**\r\n * Defines the class structure and helper functions used by the \"standard\", non-brokered auth flows (popup, redirect, silent (RT), silent (iframe))\r\n */\r\nexport abstract class StandardInteractionClient extends BaseInteractionClient {\r\n protected navigationClient: INavigationClient;\r\n\r\n constructor(config: BrowserConfiguration, storageImpl: BrowserCacheManager, browserCrypto: ICrypto, logger: Logger, eventHandler: EventHandler, navigationClient: INavigationClient, correlationId?: string) {\r\n super(config, storageImpl, browserCrypto, logger, eventHandler, correlationId);\r\n this.navigationClient = navigationClient;\r\n }\r\n \r\n /**\r\n * Generates an auth code request tied to the url request.\r\n * @param request\r\n */\r\n protected async initializeAuthorizationCodeRequest(request: AuthorizationUrlRequest): Promise<CommonAuthorizationCodeRequest> {\r\n this.logger.verbose(\"initializeAuthorizationRequest called\", request.correlationId);\r\n const generatedPkceParams = await this.browserCrypto.generatePkceCodes();\r\n\r\n const authCodeRequest: CommonAuthorizationCodeRequest = {\r\n ...request,\r\n redirectUri: request.redirectUri,\r\n code: \"\",\r\n codeVerifier: generatedPkceParams.verifier\r\n };\r\n\r\n request.codeChallenge = generatedPkceParams.challenge;\r\n request.codeChallengeMethod = Constants.S256_CODE_CHALLENGE_METHOD;\r\n\r\n return authCodeRequest;\r\n }\r\n\r\n /**\r\n * Initializer for the logout request.\r\n * @param logoutRequest\r\n */\r\n protected initializeLogoutRequest(logoutRequest?: EndSessionRequest): CommonEndSessionRequest {\r\n this.logger.verbose(\"initializeLogoutRequest called\", logoutRequest?.correlationId);\r\n\r\n // Check if interaction is in progress. Throw error if true.\r\n if (this.browserStorage.isInteractionInProgress()) {\r\n throw BrowserAuthError.createInteractionInProgressError();\r\n }\r\n\r\n const validLogoutRequest: CommonEndSessionRequest = {\r\n correlationId: this.browserCrypto.createNewGuid(),\r\n ...logoutRequest\r\n };\r\n\r\n /*\r\n * Only set redirect uri if logout request isn't provided or the set uri isn't null.\r\n * Otherwise, use passed uri, config, or current page.\r\n */\r\n if (!logoutRequest || logoutRequest.postLogoutRedirectUri !== null) {\r\n if (logoutRequest && logoutRequest.postLogoutRedirectUri) {\r\n this.logger.verbose(\"Setting postLogoutRedirectUri to uri set on logout request\", validLogoutRequest.correlationId);\r\n validLogoutRequest.postLogoutRedirectUri = UrlString.getAbsoluteUrl(logoutRequest.postLogoutRedirectUri, BrowserUtils.getCurrentUri());\r\n } else if (this.config.auth.postLogoutRedirectUri === null) {\r\n this.logger.verbose(\"postLogoutRedirectUri configured as null and no uri set on request, not passing post logout redirect\", validLogoutRequest.correlationId);\r\n } else if (this.config.auth.postLogoutRedirectUri) {\r\n this.logger.verbose(\"Setting postLogoutRedirectUri to configured uri\", validLogoutRequest.correlationId);\r\n validLogoutRequest.postLogoutRedirectUri = UrlString.getAbsoluteUrl(this.config.auth.postLogoutRedirectUri, BrowserUtils.getCurrentUri());\r\n } else {\r\n this.logger.verbose(\"Setting postLogoutRedirectUri to current page\", validLogoutRequest.correlationId);\r\n validLogoutRequest.postLogoutRedirectUri = UrlString.getAbsoluteUrl(BrowserUtils.getCurrentUri(), BrowserUtils.getCurrentUri());\r\n }\r\n } else {\r\n this.logger.verbose(\"postLogoutRedirectUri passed as null, not setting post logout redirect uri\", validLogoutRequest.correlationId);\r\n }\r\n\r\n return validLogoutRequest;\r\n }\r\n\r\n /**\r\n * Creates an Authorization Code Client with the given authority, or the default authority.\r\n * @param serverTelemetryManager\r\n * @param authorityUrl\r\n */\r\n protected async createAuthCodeClient(serverTelemetryManager: ServerTelemetryManager, authorityUrl?: string): Promise<AuthorizationCodeClient> {\r\n // Create auth module.\r\n const clientConfig = await this.getClientConfiguration(serverTelemetryManager, authorityUrl);\r\n return new AuthorizationCodeClient(clientConfig);\r\n }\r\n\r\n /**\r\n * Creates a Client Configuration object with the given request authority, or the default authority.\r\n * @param serverTelemetryManager\r\n * @param requestAuthority\r\n * @param requestCorrelationId\r\n */\r\n protected async getClientConfiguration(serverTelemetryManager: ServerTelemetryManager, requestAuthority?: string): Promise<ClientConfiguration> {\r\n this.logger.verbose(\"getClientConfiguration called\");\r\n const discoveredAuthority = await this.getDiscoveredAuthority(requestAuthority);\r\n\r\n return {\r\n authOptions: {\r\n clientId: this.config.auth.clientId,\r\n authority: discoveredAuthority,\r\n clientCapabilities: this.config.auth.clientCapabilities\r\n },\r\n systemOptions: {\r\n tokenRenewalOffsetSeconds: this.config.system.tokenRenewalOffsetSeconds,\r\n preventCorsPreflight: true\r\n },\r\n loggerOptions: {\r\n loggerCallback: this.config.system.loggerOptions.loggerCallback,\r\n piiLoggingEnabled: this.config.system.loggerOptions.piiLoggingEnabled,\r\n logLevel: this.config.system.loggerOptions.logLevel,\r\n correlationId: this.correlationId\r\n },\r\n cryptoInterface: this.browserCrypto,\r\n networkInterface: this.networkClient,\r\n storageInterface: this.browserStorage,\r\n serverTelemetryManager: serverTelemetryManager,\r\n libraryInfo: {\r\n sku: BrowserConstants.MSAL_SKU,\r\n version: version,\r\n cpu: \"\",\r\n os: \"\"\r\n }\r\n };\r\n }\r\n\r\n /**\r\n * @param hash\r\n * @param interactionType\r\n */\r\n protected validateAndExtractStateFromHash(hash: string, interactionType: InteractionType, requestCorrelationId?: string): string {\r\n this.logger.verbose(\"validateAndExtractStateFromHash called\", requestCorrelationId);\r\n // Deserialize hash fragment response parameters.\r\n const serverParams: ServerAuthorizationCodeResponse = UrlString.getDeserializedHash(hash);\r\n if (!serverParams.state) {\r\n throw BrowserAuthError.createHashDoesNotContainStateError();\r\n }\r\n\r\n const platformStateObj = BrowserProtocolUtils.extractBrowserRequestState(this.browserCrypto, serverParams.state);\r\n if (!platformStateObj) {\r\n throw BrowserAuthError.createUnableToParseStateError();\r\n }\r\n\r\n if (platformStateObj.interactionType !== interactionType) {\r\n throw BrowserAuthError.createStateInteractionTypeMismatchError();\r\n }\r\n\r\n this.logger.verbose(\"Returning state from hash\", requestCorrelationId);\r\n return serverParams.state;\r\n }\r\n\r\n /**\r\n * Used to get a discovered version of the default authority.\r\n * @param requestAuthority\r\n * @param requestCorrelationId\r\n */\r\n protected async getDiscoveredAuthority(requestAuthority?: string): Promise<Authority> {\r\n this.logger.verbose(\"getDiscoveredAuthority called\");\r\n const authorityOptions: AuthorityOptions = {\r\n protocolMode: this.config.auth.protocolMode,\r\n knownAuthorities: this.config.auth.knownAuthorities,\r\n cloudDiscoveryMetadata: this.config.auth.cloudDiscoveryMetadata,\r\n authorityMetadata: this.config.auth.authorityMetadata\r\n };\r\n\r\n if (requestAuthority) {\r\n this.logger.verbose(\"Creating discovered authority with request authority\");\r\n return await AuthorityFactory.createDiscoveredInstance(requestAuthority, this.config.system.networkClient, this.browserStorage, authorityOptions);\r\n }\r\n\r\n this.logger.verbose(\"Creating discovered authority with configured authority\");\r\n return await AuthorityFactory.createDiscoveredInstance(this.config.auth.authority, this.config.system.networkClient, this.browserStorage, authorityOptions);\r\n }\r\n\r\n /**\r\n * Helper to validate app environment before making a request.\r\n * @param request\r\n * @param interactionType\r\n */\r\n protected preflightInteractiveRequest(request: RedirectRequest|PopupRequest, interactionType: InteractionType): AuthorizationUrlRequest {\r\n this.logger.verbose(\"preflightInteractiveRequest called, validating app environment\", request?.correlationId);\r\n // block the reload if it occurred inside a hidden iframe\r\n BrowserUtils.blockReloadInHiddenIframes();\r\n \r\n // Check if interaction is in progress. Throw error if true.\r\n if (this.browserStorage.isInteractionInProgress(false)) {\r\n throw BrowserAuthError.createInteractionInProgressError();\r\n }\r\n \r\n return this.initializeAuthorizationRequest(request, interactionType);\r\n }\r\n\r\n /**\r\n * Helper to initialize required request parameters for interactive APIs and ssoSilent()\r\n * @param request\r\n * @param interactionType\r\n */\r\n protected initializeAuthorizationRequest(request: RedirectRequest|PopupRequest|SsoSilentRequest, interactionType: InteractionType): AuthorizationUrlRequest {\r\n this.logger.verbose(\"initializeAuthorizationRequest called\");\r\n const redirectUri = this.getRedirectUri(request.redirectUri);\r\n const browserState: BrowserStateObject = {\r\n interactionType: interactionType\r\n };\r\n\r\n const state = ProtocolUtils.setRequestState(\r\n this.browserCrypto,\r\n (request && request.state) || \"\",\r\n browserState\r\n );\r\n\r\n const validatedRequest: AuthorizationUrlRequest = {\r\n ...this.initializeBaseRequest(request),\r\n redirectUri: redirectUri,\r\n state: state,\r\n nonce: request.nonce || this.browserCrypto.createNewGuid(),\r\n responseMode: ResponseMode.FRAGMENT\r\n };\r\n\r\n const account = request.account || this.browserStorage.getActiveAccount();\r\n if (account) {\r\n this.logger.verbose(\"Setting validated request account\");\r\n this.logger.verbosePii(`Setting validated request account: ${account}`);\r\n validatedRequest.account = account;\r\n }\r\n\r\n // Check for ADAL/MSAL v1 SSO\r\n if (StringUtils.isEmpty(validatedRequest.loginHint) && !account) {\r\n const legacyLoginHint = this.browserStorage.getLegacyLoginHint();\r\n if (legacyLoginHint) {\r\n validatedRequest.loginHint = legacyLoginHint;\r\n }\r\n }\r\n\r\n this.browserStorage.updateCacheEntries(validatedRequest.state, validatedRequest.nonce, validatedRequest.authority, validatedRequest.loginHint || \"\", validatedRequest.account || null);\r\n\r\n return validatedRequest;\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;;;;AAsBA;;;;IAGwD,6CAAqB;IAGzE,mCAAY,MAA4B,EAAE,WAAgC,EAAE,aAAsB,EAAE,MAAc,EAAE,YAA0B,EAAE,gBAAmC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,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,KACtC,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE,EAC1D,YAAY,EAAE,YAAY,CAAC,QAAQ,GACtC,CAAC;QAEF,IAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,IAAI,CAAC,cAAc,CAAC,gBAAgB,EAAE,CAAC;QAC1E,IAAI,OAAO,EAAE;YACT,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,mCAAmC,CAAC,CAAC;YACzD,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,wCAAsC,OAAS,CAAC,CAAC;YACxE,gBAAgB,CAAC,OAAO,GAAG,OAAO,CAAC;SACtC;;QAGD,IAAI,WAAW,CAAC,OAAO,CAAC,gBAAgB,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,EAAE;YAC7D,IAAM,eAAe,GAAG,IAAI,CAAC,cAAc,CAAC,kBAAkB,EAAE,CAAC;YACjE,IAAI,eAAe,EAAE;gBACjB,gBAAgB,CAAC,SAAS,GAAG,eAAe,CAAC;aAChD;SACJ;QAED,IAAI,CAAC,cAAc,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,KAAK,EAAE,gBAAgB,CAAC,KAAK,EAAE,gBAAgB,CAAC,SAAS,EAAE,gBAAgB,CAAC,SAAS,IAAI,EAAE,EAAE,gBAAgB,CAAC,OAAO,IAAI,IAAI,CAAC,CAAC;QAEvL,OAAO,gBAAgB,CAAC;KAC3B;IACL,gCAAC;AAAD,CAvOA,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 { ICrypto, Logger, ServerTelemetryManager, CommonAuthorizationCodeRequest, Constants, AuthorizationCodeClient, ClientConfiguration, AuthorityOptions, Authority, AuthorityFactory, ServerAuthorizationCodeResponse, UrlString, CommonEndSessionRequest, ProtocolUtils, ResponseMode, StringUtils, IdTokenClaims, AccountInfo, AzureCloudOptions } from \"@azure/msal-common\";\nimport { BaseInteractionClient } from \"./BaseInteractionClient\";\nimport { BrowserConfiguration } from \"../config/Configuration\";\nimport { AuthorizationUrlRequest } from \"../request/AuthorizationUrlRequest\";\nimport { BrowserCacheManager } from \"../cache/BrowserCacheManager\";\nimport { EventHandler } from \"../event/EventHandler\";\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 { INavigationClient } from \"../navigation/INavigationClient\";\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 protected navigationClient: INavigationClient;\n\n constructor(config: BrowserConfiguration, storageImpl: BrowserCacheManager, browserCrypto: ICrypto, logger: Logger, eventHandler: EventHandler, navigationClient: INavigationClient, correlationId?: string) {\n super(config, storageImpl, browserCrypto, logger, eventHandler, correlationId);\n this.navigationClient = navigationClient;\n }\n\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: \"\",\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.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\");\n const discoveredAuthority = await this.getDiscoveredAuthority(requestAuthority, requestAzureCloudOptions);\n\n return {\n authOptions: {\n clientId: this.config.auth.clientId,\n authority: discoveredAuthority,\n clientCapabilities: this.config.auth.clientCapabilities\n },\n systemOptions: {\n tokenRenewalOffsetSeconds: this.config.system.tokenRenewalOffsetSeconds,\n preventCorsPreflight: true\n },\n loggerOptions: {\n loggerCallback: this.config.system.loggerOptions.loggerCallback,\n piiLoggingEnabled: this.config.system.loggerOptions.piiLoggingEnabled,\n logLevel: this.config.system.loggerOptions.logLevel,\n correlationId: this.correlationId\n },\n cryptoInterface: this.browserCrypto,\n networkInterface: this.networkClient,\n storageInterface: this.browserStorage,\n serverTelemetryManager: serverTelemetryManager,\n libraryInfo: {\n sku: BrowserConstants.MSAL_SKU,\n version: version,\n cpu: \"\",\n os: \"\"\n }\n };\n }\n\n /**\n * @param hash\n * @param interactionType\n */\n protected validateAndExtractStateFromHash(hash: string, interactionType: InteractionType, requestCorrelationId?: string): string {\n this.logger.verbose(\"validateAndExtractStateFromHash called\", requestCorrelationId);\n // Deserialize hash fragment response parameters.\n const serverParams: ServerAuthorizationCodeResponse = UrlString.getDeserializedHash(hash);\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\");\n const authorityOptions: AuthorityOptions = {\n protocolMode: this.config.auth.protocolMode,\n knownAuthorities: this.config.auth.knownAuthorities,\n cloudDiscoveryMetadata: this.config.auth.cloudDiscoveryMetadata,\n authorityMetadata: this.config.auth.authorityMetadata,\n };\n\n // 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\");\n return await AuthorityFactory.createDiscoveredInstance(builtAuthority, this.config.system.networkClient, this.browserStorage, authorityOptions);\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\");\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\");\n this.logger.verbosePii(`Setting validated request account: ${account}`);\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 }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,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,CAxPA,CAAwD,qBAAqB;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CommonAuthorizationCodeRequest, AuthenticationResult, AuthorizationCodeClient, Authority, INetworkModule, CcsCredential, Logger } from "@azure/msal-common";
|
|
1
|
+
import { AuthorizationCodePayload, CommonAuthorizationCodeRequest, AuthenticationResult, AuthorizationCodeClient, Authority, INetworkModule, CcsCredential, Logger } from "@azure/msal-common";
|
|
2
2
|
import { BrowserCacheManager } from "../cache/BrowserCacheManager";
|
|
3
3
|
export declare type InteractionParams = {};
|
|
4
4
|
/**
|
|
@@ -19,7 +19,16 @@ export declare abstract class InteractionHandler {
|
|
|
19
19
|
* Function to handle response parameters from hash.
|
|
20
20
|
* @param locationHash
|
|
21
21
|
*/
|
|
22
|
-
|
|
22
|
+
handleCodeResponseFromHash(locationHash: string, state: string, authority: Authority, networkModule: INetworkModule): Promise<AuthenticationResult>;
|
|
23
|
+
/**
|
|
24
|
+
* Process auth code response from AAD
|
|
25
|
+
* @param authCodeResponse
|
|
26
|
+
* @param state
|
|
27
|
+
* @param authority
|
|
28
|
+
* @param networkModule
|
|
29
|
+
* @returns
|
|
30
|
+
*/
|
|
31
|
+
handleCodeResponseFromServer(authCodeResponse: AuthorizationCodePayload, state: string, authority: Authority, networkModule: INetworkModule, validateNonce?: boolean): Promise<AuthenticationResult>;
|
|
23
32
|
/**
|
|
24
33
|
* Updates authority based on cloudInstanceHostname
|
|
25
34
|
* @param cloudInstanceHostname
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InteractionHandler.d.ts","sourceRoot":"","sources":["../../src/interaction_handler/InteractionHandler.ts"],"names":[],"mappings":"AAKA,O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AqB,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAM/I;;OAEG;IACH,SAAS,CAAC,mBAAmB,IAAI,aAAa,GAAG,IAAI;CAaxD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-browser v2.
|
|
1
|
+
/*! @azure/msal-browser v2.22.0 2022-02-08 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { __awaiter, __generator } from '../_virtual/_tslib.js';
|
|
4
4
|
import { StringUtils, ClientAuthError, AuthorityFactory } from '@azure/msal-common';
|
|
@@ -23,23 +23,46 @@ var InteractionHandler = /** @class */ (function () {
|
|
|
23
23
|
* Function to handle response parameters from hash.
|
|
24
24
|
* @param locationHash
|
|
25
25
|
*/
|
|
26
|
-
InteractionHandler.prototype.
|
|
26
|
+
InteractionHandler.prototype.handleCodeResponseFromHash = function (locationHash, state, authority, networkModule) {
|
|
27
27
|
return __awaiter(this, void 0, void 0, function () {
|
|
28
|
-
var stateKey, requestState, authCodeResponse
|
|
28
|
+
var stateKey, requestState, authCodeResponse;
|
|
29
|
+
return __generator(this, function (_a) {
|
|
30
|
+
this.browserRequestLogger.verbose("InteractionHandler.handleCodeResponse called");
|
|
31
|
+
// Check that location hash isn't empty.
|
|
32
|
+
if (StringUtils.isEmpty(locationHash)) {
|
|
33
|
+
throw BrowserAuthError.createEmptyHashError(locationHash);
|
|
34
|
+
}
|
|
35
|
+
stateKey = this.browserStorage.generateStateKey(state);
|
|
36
|
+
requestState = this.browserStorage.getTemporaryCache(stateKey);
|
|
37
|
+
if (!requestState) {
|
|
38
|
+
throw ClientAuthError.createStateNotFoundError("Cached State");
|
|
39
|
+
}
|
|
40
|
+
authCodeResponse = this.authModule.handleFragmentResponse(locationHash, requestState);
|
|
41
|
+
return [2 /*return*/, this.handleCodeResponseFromServer(authCodeResponse, state, authority, networkModule)];
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Process auth code response from AAD
|
|
47
|
+
* @param authCodeResponse
|
|
48
|
+
* @param state
|
|
49
|
+
* @param authority
|
|
50
|
+
* @param networkModule
|
|
51
|
+
* @returns
|
|
52
|
+
*/
|
|
53
|
+
InteractionHandler.prototype.handleCodeResponseFromServer = function (authCodeResponse, state, authority, networkModule, validateNonce) {
|
|
54
|
+
if (validateNonce === void 0) { validateNonce = true; }
|
|
55
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
56
|
+
var stateKey, requestState, nonceKey, cachedNonce, cachedCcsCred, tokenResponse;
|
|
29
57
|
return __generator(this, function (_a) {
|
|
30
58
|
switch (_a.label) {
|
|
31
59
|
case 0:
|
|
32
|
-
this.browserRequestLogger.
|
|
33
|
-
// Check that location hash isn't empty.
|
|
34
|
-
if (StringUtils.isEmpty(locationHash)) {
|
|
35
|
-
throw BrowserAuthError.createEmptyHashError(locationHash);
|
|
36
|
-
}
|
|
60
|
+
this.browserRequestLogger.trace("InteractionHandler.handleCodeResponseFromServer called");
|
|
37
61
|
stateKey = this.browserStorage.generateStateKey(state);
|
|
38
62
|
requestState = this.browserStorage.getTemporaryCache(stateKey);
|
|
39
63
|
if (!requestState) {
|
|
40
64
|
throw ClientAuthError.createStateNotFoundError("Cached State");
|
|
41
65
|
}
|
|
42
|
-
authCodeResponse = this.authModule.handleFragmentResponse(locationHash, requestState);
|
|
43
66
|
nonceKey = this.browserStorage.generateNonceKey(requestState);
|
|
44
67
|
cachedNonce = this.browserStorage.getTemporaryCache(nonceKey);
|
|
45
68
|
// Assign code to request
|
|
@@ -50,7 +73,10 @@ var InteractionHandler = /** @class */ (function () {
|
|
|
50
73
|
_a.sent();
|
|
51
74
|
_a.label = 2;
|
|
52
75
|
case 2:
|
|
53
|
-
|
|
76
|
+
// Nonce validation not needed when redirect not involved (e.g. hybrid spa, renewing token via rt)
|
|
77
|
+
if (validateNonce) {
|
|
78
|
+
authCodeResponse.nonce = cachedNonce || undefined;
|
|
79
|
+
}
|
|
54
80
|
authCodeResponse.state = requestState;
|
|
55
81
|
// Add CCS parameters if available
|
|
56
82
|
if (authCodeResponse.client_info) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InteractionHandler.js","sources":["../../src/interaction_handler/InteractionHandler.ts"],"sourcesContent":["/*\
|
|
1
|
+
{"version":3,"file":"InteractionHandler.js","sources":["../../src/interaction_handler/InteractionHandler.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AuthorizationCodePayload , StringUtils, CommonAuthorizationCodeRequest, AuthenticationResult, AuthorizationCodeClient, AuthorityFactory, Authority, INetworkModule, ClientAuthError, CcsCredential, Logger } from \"@azure/msal-common\";\n\nimport { BrowserCacheManager } from \"../cache/BrowserCacheManager\";\nimport { BrowserAuthError } from \"../error/BrowserAuthError\";\nimport { TemporaryCacheKeys } from \"../utils/BrowserConstants\";\n\nexport type InteractionParams = {};\n\n/**\n * Abstract class which defines operations for a browser interaction handling class.\n */\nexport abstract class InteractionHandler {\n\n protected authModule: AuthorizationCodeClient;\n protected browserStorage: BrowserCacheManager;\n protected authCodeRequest: CommonAuthorizationCodeRequest;\n protected browserRequestLogger: Logger;\n\n constructor(authCodeModule: AuthorizationCodeClient, storageImpl: BrowserCacheManager, authCodeRequest: CommonAuthorizationCodeRequest, browserRequestLogger: Logger) {\n this.authModule = authCodeModule;\n this.browserStorage = storageImpl;\n this.authCodeRequest = authCodeRequest;\n this.browserRequestLogger = browserRequestLogger;\n }\n\n /**\n * Function to enable user interaction.\n * @param requestUrl\n */\n abstract initiateAuthRequest(requestUrl: string, params: InteractionParams): Window | Promise<HTMLIFrameElement> | Promise<void>;\n\n /**\n * Function to handle response parameters from hash.\n * @param locationHash\n */\n async handleCodeResponseFromHash(locationHash: string, state: string, authority: Authority, networkModule: INetworkModule): Promise<AuthenticationResult> {\n this.browserRequestLogger.verbose(\"InteractionHandler.handleCodeResponse called\");\n // Check that location hash isn't empty.\n if (StringUtils.isEmpty(locationHash)) {\n throw BrowserAuthError.createEmptyHashError(locationHash);\n }\n\n // Handle code response.\n const stateKey = this.browserStorage.generateStateKey(state);\n const requestState = this.browserStorage.getTemporaryCache(stateKey);\n if (!requestState) {\n throw ClientAuthError.createStateNotFoundError(\"Cached State\");\n }\n const authCodeResponse = this.authModule.handleFragmentResponse(locationHash, requestState);\n\n return this.handleCodeResponseFromServer(authCodeResponse, state, authority, networkModule);\n }\n\n /**\n * Process auth code response from AAD\n * @param authCodeResponse \n * @param state \n * @param authority \n * @param networkModule \n * @returns \n */\n async handleCodeResponseFromServer(authCodeResponse: AuthorizationCodePayload, state: string, authority: Authority, networkModule: INetworkModule, validateNonce: boolean = true): Promise<AuthenticationResult> {\n this.browserRequestLogger.trace(\"InteractionHandler.handleCodeResponseFromServer called\");\n\n // Handle code response.\n const stateKey = this.browserStorage.generateStateKey(state);\n const requestState = this.browserStorage.getTemporaryCache(stateKey);\n if (!requestState) {\n throw ClientAuthError.createStateNotFoundError(\"Cached State\");\n }\n \n // Get cached items\n const nonceKey = this.browserStorage.generateNonceKey(requestState);\n const cachedNonce = this.browserStorage.getTemporaryCache(nonceKey);\n\n // Assign code to request\n this.authCodeRequest.code = authCodeResponse.code;\n\n // Check for new cloud instance\n if (authCodeResponse.cloud_instance_host_name) {\n await this.updateTokenEndpointAuthority(authCodeResponse.cloud_instance_host_name, authority, networkModule);\n }\n\n // Nonce validation not needed when redirect not involved (e.g. hybrid spa, renewing token via rt)\n if (validateNonce) {\n authCodeResponse.nonce = cachedNonce || undefined;\n }\n \n authCodeResponse.state = requestState;\n\n // Add CCS parameters if available\n if (authCodeResponse.client_info) {\n this.authCodeRequest.clientInfo = authCodeResponse.client_info;\n } else {\n const cachedCcsCred = this.checkCcsCredentials();\n if (cachedCcsCred) {\n this.authCodeRequest.ccsCredential = cachedCcsCred;\n }\n }\n\n // Acquire token with retrieved code.\n const tokenResponse = await this.authModule.acquireToken(this.authCodeRequest, authCodeResponse);\n this.browserStorage.cleanRequestByState(state);\n return tokenResponse;\n }\n\n /**\n * Updates authority based on cloudInstanceHostname\n * @param cloudInstanceHostname \n * @param authority \n * @param networkModule \n */\n protected async updateTokenEndpointAuthority(cloudInstanceHostname: string, authority: Authority, networkModule: INetworkModule): Promise<void> {\n const cloudInstanceAuthorityUri = `https://${cloudInstanceHostname}/${authority.tenant}/`;\n const cloudInstanceAuthority = await AuthorityFactory.createDiscoveredInstance(cloudInstanceAuthorityUri, networkModule, this.browserStorage, authority.options);\n this.authModule.updateAuthority(cloudInstanceAuthority);\n }\n\n /**\n * Looks up ccs creds in the cache\n */\n protected checkCcsCredentials(): CcsCredential | null {\n // Look up ccs credential in temp cache\n const cachedCcsCred = this.browserStorage.getTemporaryCache(TemporaryCacheKeys.CCS_CREDENTIAL, true);\n if (cachedCcsCred) {\n try {\n return JSON.parse(cachedCcsCred) as CcsCredential;\n } catch (e) {\n this.authModule.logger.error(\"Cache credential could not be parsed\");\n this.authModule.logger.errorPii(`Cache credential could not be parsed: ${cachedCcsCred}`);\n }\n }\n return null;\n }\n}\n"],"names":[],"mappings":";;;;;;;AAAA;;;;AAaA;;;;IAUI,4BAAY,cAAuC,EAAE,WAAgC,EAAE,eAA+C,EAAE,oBAA4B;QAChK,IAAI,CAAC,UAAU,GAAG,cAAc,CAAC;QACjC,IAAI,CAAC,cAAc,GAAG,WAAW,CAAC;QAClC,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACvC,IAAI,CAAC,oBAAoB,GAAG,oBAAoB,CAAC;KACpD;;;;;IAYK,uDAA0B,GAAhC,UAAiC,YAAoB,EAAE,KAAa,EAAE,SAAoB,EAAE,aAA6B;;;;gBACrH,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,8CAA8C,CAAC,CAAC;;gBAElF,IAAI,WAAW,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE;oBACnC,MAAM,gBAAgB,CAAC,oBAAoB,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