Socket
Socket
Sign inDemoInstall

@azure/msal-browser

Package Overview
Dependencies
Maintainers
3
Versions
119
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@azure/msal-browser - npm Package Compare versions

Comparing version 2.21.0 to 2.22.0

19

CHANGELOG.md
# Change Log - @azure/msal-browser
This log was last generated on Tue, 04 Jan 2022 00:20:29 GMT and should not be manually modified.
This log was last generated on Tue, 08 Feb 2022 00:41:06 GMT and should not be manually modified.
<!-- Start content -->
## 2.22.0
Tue, 08 Feb 2022 00:41:06 GMT
### Minor changes
- Add support for logout_hint #4450 (hemoral@microsoft.com)
- Add AzureCloudInstance to JS libraries (sameera.gajjarapu@microsoft.com)
- Bump @azure/msal-common to v6.1.0
### Patches
- Expose OIDC_DEFAULT_SCOPES constant #4280 (thomas.norling@microsoft.com)
- Improve reliability of interaction_in_progress #4460 (thomas.norling@microsoft.com)
- Clear hash only if it contains known response properties #4415 (thomas.norling@microsoft.com)
- Adding exports and other changes for extensibility #4459 (prkanher@microsoft.com)
## 2.21.0

@@ -8,0 +25,0 @@

2

dist/_virtual/_tslib.js

@@ -1,2 +0,2 @@

/*! @azure/msal-browser v2.21.0 2022-01-04 */
/*! @azure/msal-browser v2.22.0 2022-02-08 */
'use strict';

@@ -3,0 +3,0 @@ /*! *****************************************************************************

@@ -25,3 +25,3 @@ import { AccountInfo, INetworkModule, AuthenticationResult, Logger, CommonSilentFlowRequest, ICrypto } from "@azure/msal-common";

protected eventHandler: EventHandler;
private redirectResponse;
protected redirectResponse: Map<string, Promise<AuthenticationResult | null>>;
private hybridAuthCodeResponses;

@@ -185,2 +185,8 @@ /**

/**
* Helper to validate app environment before making a request.
* @param request
* @param interactionType
*/
protected preflightInteractiveRequest(): void;
/**
* Adds event callbacks to array

@@ -187,0 +193,0 @@ * @param callback

@@ -1,2 +0,2 @@

/*! @azure/msal-browser v2.21.0 2022-01-04 */
/*! @azure/msal-browser v2.22.0 2022-02-08 */
'use strict';

@@ -155,4 +155,4 @@ import { __awaiter, __generator } from '../_virtual/_tslib.js';

// Preflight request
this.logger.verbose("acquireTokenRedirect called");
this.preflightBrowserEnvironmentCheck(InteractionType.Redirect);
this.logger.verbose("acquireTokenRedirect called");
isLoggedIn = this.getAllAccounts().length > 0;

@@ -191,4 +191,4 @@ if (isLoggedIn) {

try {
this.logger.verbose("acquireTokenPopup called", request.correlationId);
this.preflightBrowserEnvironmentCheck(InteractionType.Popup);
this.logger.verbose("acquireTokenPopup called", request.correlationId);
}

@@ -528,4 +528,19 @@ catch (e) {

}
if (interactionType === InteractionType.Redirect || interactionType === InteractionType.Popup) {
this.preflightInteractiveRequest();
}
};
/**
* Helper to validate app environment before making a request.
* @param request
* @param interactionType
*/
ClientApplication.prototype.preflightInteractiveRequest = function () {
this.logger.verbose("preflightInteractiveRequest called, validating app environment");
// block the reload if it occurred inside a hidden iframe
BrowserUtils.blockReloadInHiddenIframes();
// Set interaction in progress temporary cache or throw if alread set.
this.browserStorage.setInteractionInProgress(true);
};
/**
* Adds event callbacks to array

@@ -532,0 +547,0 @@ * @param callback

@@ -1,2 +0,2 @@

/*! @azure/msal-browser v2.21.0 2022-01-04 */
/*! @azure/msal-browser v2.22.0 2022-02-08 */
'use strict';

@@ -3,0 +3,0 @@ import { BrowserConfigurationAuthError } from '../error/BrowserConfigurationAuthError.js';

@@ -1,2 +0,2 @@

import { AuthenticationResult } from "@azure/msal-common";
import { AccountInfo, AuthenticationResult } from "@azure/msal-common";
import { Configuration } from "../config/Configuration";

@@ -67,4 +67,4 @@ import { IPublicClientApplication } from "./IPublicClientApplication";

*/
private acquireTokenSilentAsync;
protected acquireTokenSilentAsync(request: SilentRequest, account: AccountInfo): Promise<AuthenticationResult>;
}
//# sourceMappingURL=PublicClientApplication.d.ts.map

@@ -1,2 +0,2 @@

/*! @azure/msal-browser v2.21.0 2022-01-04 */
/*! @azure/msal-browser v2.22.0 2022-02-08 */
'use strict';

@@ -3,0 +3,0 @@ import { __extends, __awaiter, __generator } from '../_virtual/_tslib.js';

@@ -1,2 +0,2 @@

/*! @azure/msal-browser v2.21.0 2022-01-04 */
/*! @azure/msal-browser v2.22.0 2022-02-08 */
'use strict';

@@ -3,0 +3,0 @@ import { __awaiter, __generator } from '../_virtual/_tslib.js';

import { CommonAuthorizationCodeRequest, ICrypto, AccountEntity, IdTokenEntity, AccessTokenEntity, RefreshTokenEntity, AppMetadataEntity, CacheManager, ServerTelemetryEntity, ThrottlingEntity, Logger, AuthorityMetadataEntity, AccountInfo, ValidCredentialType } from "@azure/msal-common";
import { CacheOptions } from "../config/Configuration";
import { InteractionType } from "../utils/BrowserConstants";
import { BrowserCacheLocation, InteractionType } from "../utils/BrowserConstants";
import { MemoryStorage } from "./MemoryStorage";
import { IWindowStorage } from "./IWindowStorage";
/**

@@ -10,8 +12,8 @@ * This class implements the cache storage interface for MSAL through browser local or session storage.

export declare class BrowserCacheManager extends CacheManager {
private cacheConfig;
private browserStorage;
private internalStorage;
private temporaryCacheStorage;
private logger;
private readonly COOKIE_LIFE_MULTIPLIER;
protected cacheConfig: Required<CacheOptions>;
protected browserStorage: IWindowStorage<string>;
protected internalStorage: MemoryStorage<string>;
protected temporaryCacheStorage: IWindowStorage<string>;
protected logger: Logger;
protected readonly COOKIE_LIFE_MULTIPLIER: number;
constructor(clientId: string, cacheConfig: Required<CacheOptions>, cryptoImpl: ICrypto, logger: Logger);

@@ -22,3 +24,3 @@ /**

*/
private setupBrowserStorage;
protected setupBrowserStorage(cacheLocation: BrowserCacheLocation | string): IWindowStorage<string>;
/**

@@ -28,3 +30,3 @@ *

*/
private setupTemporaryCacheStorage;
protected setupTemporaryCacheStorage(cacheLocation: BrowserCacheLocation | string): IWindowStorage<string>;
/**

@@ -34,3 +36,3 @@ * Migrate all old cache entries to new schema. No rollback supported.

*/
private migrateCacheEntries;
protected migrateCacheEntries(): void;
/**

@@ -42,3 +44,3 @@ * Utility function to help with migration.

*/
private migrateCacheEntry;
protected migrateCacheEntry(newKey: string, value: string | null): void;
/**

@@ -48,3 +50,3 @@ * Parses passed value as JSON object, JSON.parse() will throw an error.

*/
private validateAndParseJson;
protected validateAndParseJson(jsonValue: string): object | null;
/**

@@ -51,0 +53,0 @@ * fetches the entry from the browser storage based off the key

@@ -1,5 +0,5 @@

/*! @azure/msal-browser v2.21.0 2022-01-04 */
/*! @azure/msal-browser v2.22.0 2022-02-08 */
'use strict';
import { __extends, __spread, __awaiter, __generator } from '../_virtual/_tslib.js';
import { DEFAULT_CRYPTO_IMPLEMENTATION, AccountEntity, CacheManager, IdTokenEntity, AccessTokenEntity, RefreshTokenEntity, AppMetadataEntity, ServerTelemetryEntity, AuthorityMetadataEntity, PersistentCacheKeys, ThrottlingEntity, Constants, StringUtils, ProtocolUtils, CcsCredentialType, IdToken } from '@azure/msal-common';
import { AccountEntity, CacheManager, IdTokenEntity, AccessTokenEntity, RefreshTokenEntity, AppMetadataEntity, ServerTelemetryEntity, AuthorityMetadataEntity, PersistentCacheKeys, ThrottlingEntity, StringUtils, Constants, ProtocolUtils, CcsCredentialType, IdToken, DEFAULT_CRYPTO_IMPLEMENTATION } from '@azure/msal-common';
import { BrowserAuthError } from '../error/BrowserAuthError.js';

@@ -809,10 +809,14 @@ import { BrowserCacheLocation, InMemoryCacheKeys, TemporaryCacheKeys } from '../utils/BrowserConstants.js';

BrowserCacheManager.prototype.setInteractionInProgress = function (inProgress) {
var clientId = this.getInteractionInProgress();
// Ensure we don't overwrite interaction in progress for a different clientId
var key = Constants.CACHE_PREFIX + "." + TemporaryCacheKeys.INTERACTION_STATUS_KEY;
if (inProgress && !clientId) {
// No interaction is in progress
this.setTemporaryCache(key, this.clientId, false);
if (inProgress) {
if (this.getInteractionInProgress()) {
throw BrowserAuthError.createInteractionInProgressError();
}
else {
// No interaction is in progress
this.setTemporaryCache(key, this.clientId, false);
}
}
else if (!inProgress && clientId === this.clientId) {
else if (!inProgress && this.getInteractionInProgress() === this.clientId) {
this.removeItem(key);

@@ -819,0 +823,0 @@ }

@@ -1,2 +0,2 @@

/*! @azure/msal-browser v2.21.0 2022-01-04 */
/*! @azure/msal-browser v2.22.0 2022-02-08 */
'use strict';

@@ -3,0 +3,0 @@ import { BrowserConfigurationAuthError } from '../error/BrowserConfigurationAuthError.js';

@@ -1,2 +0,2 @@

/*! @azure/msal-browser v2.21.0 2022-01-04 */
/*! @azure/msal-browser v2.22.0 2022-02-08 */
'use strict';

@@ -3,0 +3,0 @@ import { __awaiter, __generator } from '../_virtual/_tslib.js';

@@ -1,2 +0,2 @@

/*! @azure/msal-browser v2.21.0 2022-01-04 */
/*! @azure/msal-browser v2.22.0 2022-02-08 */
'use strict';

@@ -3,0 +3,0 @@ /*

@@ -1,2 +0,2 @@

/*! @azure/msal-browser v2.21.0 2022-01-04 */
/*! @azure/msal-browser v2.22.0 2022-02-08 */
'use strict';

@@ -38,2 +38,3 @@ import { Authority, IdTokenEntity, AuthToken, AccountEntity, ScopeSet, AccessTokenEntity } from '@azure/msal-common';

else if (request.authority) {
var authorityUrl = Authority.generateAuthority(request.authority, request.azureCloudOptions);
var authorityOptions = {

@@ -43,5 +44,5 @@ protocolMode: this.config.auth.protocolMode,

cloudDiscoveryMetadata: this.config.auth.cloudDiscoveryMetadata,
authorityMetadata: this.config.auth.authorityMetadata
authorityMetadata: this.config.auth.authorityMetadata,
};
var authority = new Authority(request.authority, this.config.system.networkClient, this.storage, authorityOptions);
var authority = new Authority(authorityUrl, this.config.system.networkClient, this.storage, authorityOptions);
// "clientInfo" from options takes precedence over "clientInfo" in response

@@ -48,0 +49,0 @@ if (options.clientInfo) {

@@ -1,2 +0,2 @@

import { SystemOptions, LoggerOptions, INetworkModule, ProtocolMode } from "@azure/msal-common";
import { SystemOptions, LoggerOptions, INetworkModule, ProtocolMode, AzureCloudOptions } from "@azure/msal-common";
import { BrowserCacheLocation } from "../utils/BrowserConstants";

@@ -14,7 +14,7 @@ import { INavigationClient } from "../navigation/INavigationClient";

* - cloudDiscoveryMetadata - A string containing the cloud discovery response. Used in AAD scenarios.
* - redirectUri - The redirect URI where authentication responses can be received by your application. It must exactly match one of the redirect URIs registered in the Azure portal.
* - postLogoutRedirectUri - The redirect URI where the window navigates after a successful logout.
* - navigateToLoginRequestUrl - Boolean indicating whether to navigate to the original request URL after the auth server navigates to the redirect URL.
* - clientCapabilities - Array of capabilities which will be added to the claims.access_token.xms_cc request property on every network request.
* - protocolMode - Enum that represents the protocol that msal follows. Used for configuring proper endpoints.
* - redirectUri - The redirect URI where authentication responses can be received by your application. It must exactly match one of the redirect URIs registered in the Azure portal.
* - postLogoutRedirectUri - The redirect URI where the window navigates after a successful logout.
* - navigateToLoginRequestUrl - Boolean indicating whether to navigate to the original request URL after the auth server navigates to the redirect URL.
* - clientCapabilities - Array of capabilities which will be added to the claims.access_token.xms_cc request property on every network request.
* - protocolMode - Enum that represents the protocol that msal follows. Used for configuring proper endpoints.
*/

@@ -32,2 +32,3 @@ export declare type BrowserAuthOptions = {

protocolMode?: ProtocolMode;
azureCloudOptions?: AzureCloudOptions;
};

@@ -37,5 +38,5 @@ /**

*
* - cacheLocation - Used to specify the cacheLocation user wants to set. Valid values are "localStorage" and "sessionStorage"
* - storeAuthStateInCookie - If set, MSAL stores the auth request state required for validation of the auth flows in the browser cookies. By default this flag is set to false.
* - secureCookies - If set, MSAL sets the "Secure" flag on cookies so they can only be sent over HTTPS. By default this flag is set to false.
* - cacheLocation - Used to specify the cacheLocation user wants to set. Valid values are "localStorage" and "sessionStorage"
* - storeAuthStateInCookie - If set, MSAL stores the auth request state required for validation of the auth flows in the browser cookies. By default this flag is set to false.
* - secureCookies - If set, MSAL sets the "Secure" flag on cookies so they can only be sent over HTTPS. By default this flag is set to false.
*/

@@ -42,0 +43,0 @@ export declare type CacheOptions = {

@@ -1,5 +0,5 @@

/*! @azure/msal-browser v2.21.0 2022-01-04 */
/*! @azure/msal-browser v2.22.0 2022-02-08 */
'use strict';
import { __assign } from '../_virtual/_tslib.js';
import { DEFAULT_SYSTEM_OPTIONS, StubbedNetworkModule, Constants, ProtocolMode, LogLevel } from '@azure/msal-common';
import { DEFAULT_SYSTEM_OPTIONS, StubbedNetworkModule, Constants, ProtocolMode, AzureCloudInstance, LogLevel } from '@azure/msal-common';
import { BrowserUtils } from '../utils/BrowserUtils.js';

@@ -39,3 +39,7 @@ import { BrowserCacheLocation } from '../utils/BrowserConstants.js';

clientCapabilities: [],
protocolMode: ProtocolMode.AAD
protocolMode: ProtocolMode.AAD,
azureCloudOptions: {
azureCloudInstance: AzureCloudInstance.None,
tenant: ""
},
};

@@ -42,0 +46,0 @@ // Default cache options for browser

@@ -1,2 +0,2 @@

/*! @azure/msal-browser v2.21.0 2022-01-04 */
/*! @azure/msal-browser v2.22.0 2022-02-08 */
'use strict';

@@ -3,0 +3,0 @@ import { __awaiter, __generator } from '../_virtual/_tslib.js';

@@ -1,2 +0,2 @@

/*! @azure/msal-browser v2.21.0 2022-01-04 */
/*! @azure/msal-browser v2.22.0 2022-02-08 */
'use strict';

@@ -3,0 +3,0 @@ import { __awaiter, __generator } from '../_virtual/_tslib.js';

@@ -1,2 +0,2 @@

/*! @azure/msal-browser v2.21.0 2022-01-04 */
/*! @azure/msal-browser v2.22.0 2022-02-08 */
'use strict';

@@ -3,0 +3,0 @@ import { MathUtils } from '../utils/MathUtils.js';

@@ -1,2 +0,2 @@

/*! @azure/msal-browser v2.21.0 2022-01-04 */
/*! @azure/msal-browser v2.22.0 2022-02-08 */
'use strict';

@@ -3,0 +3,0 @@ import { __awaiter, __generator } from '../_virtual/_tslib.js';

@@ -1,2 +0,2 @@

/*! @azure/msal-browser v2.21.0 2022-01-04 */
/*! @azure/msal-browser v2.22.0 2022-02-08 */
'use strict';

@@ -3,0 +3,0 @@ import { __awaiter, __generator } from '../_virtual/_tslib.js';

@@ -1,2 +0,2 @@

/*! @azure/msal-browser v2.21.0 2022-01-04 */
/*! @azure/msal-browser v2.22.0 2022-02-08 */
'use strict';

@@ -3,0 +3,0 @@ import { BrowserStringUtils } from '../utils/BrowserStringUtils.js';

@@ -1,2 +0,2 @@

/*! @azure/msal-browser v2.21.0 2022-01-04 */
/*! @azure/msal-browser v2.22.0 2022-02-08 */
'use strict';

@@ -3,0 +3,0 @@ import { BrowserStringUtils } from '../utils/BrowserStringUtils.js';

@@ -1,2 +0,2 @@

/*! @azure/msal-browser v2.21.0 2022-01-04 */
/*! @azure/msal-browser v2.22.0 2022-02-08 */
'use strict';

@@ -3,0 +3,0 @@ import { __extends } from '../_virtual/_tslib.js';

@@ -1,2 +0,2 @@

/*! @azure/msal-browser v2.21.0 2022-01-04 */
/*! @azure/msal-browser v2.22.0 2022-02-08 */
'use strict';

@@ -3,0 +3,0 @@ import { __extends } from '../_virtual/_tslib.js';

@@ -1,2 +0,2 @@

/*! @azure/msal-browser v2.21.0 2022-01-04 */
/*! @azure/msal-browser v2.22.0 2022-02-08 */
'use strict';

@@ -3,0 +3,0 @@ import { AccountEntity, CacheManager } from '@azure/msal-common';

@@ -1,2 +0,2 @@

/*! @azure/msal-browser v2.21.0 2022-01-04 */
/*! @azure/msal-browser v2.22.0 2022-02-08 */
'use strict';

@@ -3,0 +3,0 @@ import { EventType } from './EventType.js';

@@ -1,2 +0,2 @@

/*! @azure/msal-browser v2.21.0 2022-01-04 */
/*! @azure/msal-browser v2.22.0 2022-02-08 */
'use strict';

@@ -3,0 +3,0 @@ /*

@@ -6,3 +6,3 @@ /**

export { PublicClientApplication } from "./app/PublicClientApplication";
export { Configuration, BrowserAuthOptions, CacheOptions, BrowserSystemOptions, BrowserConfiguration } from "./config/Configuration";
export { Configuration, BrowserAuthOptions, CacheOptions, BrowserSystemOptions, BrowserConfiguration, DEFAULT_IFRAME_TIMEOUT_MS } from "./config/Configuration";
export { InteractionType, InteractionStatus, BrowserCacheLocation, WrapperSKU, ApiId } from "./utils/BrowserConstants";

@@ -25,7 +25,19 @@ export { BrowserUtils } from "./utils/BrowserUtils";

export { LoadTokenOptions } from "./cache/TokenCache";
export { BrowserCacheManager } from "./cache/BrowserCacheManager";
export { StandardInteractionClient } from "./interaction_client/StandardInteractionClient";
export { RedirectClient } from "./interaction_client/RedirectClient";
export { PopupClient } from "./interaction_client/PopupClient";
export { SilentIframeClient } from "./interaction_client/SilentIframeClient";
export { SilentCacheClient } from "./interaction_client/SilentCacheClient";
export { SilentRefreshClient } from "./interaction_client/SilentRefreshClient";
export { RedirectHandler } from "./interaction_handler/RedirectHandler";
export { EventMessage, EventPayload, EventError, EventCallbackFunction, EventMessageUtils, PopupEvent } from "./event/EventMessage";
export { EventType } from "./event/EventType";
export { EventHandler } from "./event/EventHandler";
export { SignedHttpRequest, SignedHttpRequestOptions } from "./crypto/SignedHttpRequest";
export { AuthenticationScheme, AccountInfo, AccountEntity, AuthenticationResult, AuthError, AuthErrorMessage, ClientAuthError, ClientAuthErrorMessage, ClientConfigurationError, ClientConfigurationErrorMessage, InteractionRequiredAuthError, InteractionRequiredAuthErrorMessage, ServerError, INetworkModule, NetworkResponse, NetworkRequestOptions, ILoggerCallback, Logger, LogLevel, ProtocolMode, ExternalTokenResponse, StringUtils, UrlString, AuthenticationHeaderParser } from "@azure/msal-common";
export { BrowserStateObject } from "./utils/BrowserProtocolUtils";
export { BrowserConstants, TemporaryCacheKeys } from "./utils/BrowserConstants";
export { PopupUtils } from "./utils/PopupUtils";
export { AuthenticationScheme, AccountInfo, AccountEntity, AuthenticationResult, AuthError, AuthErrorMessage, ClientAuthError, ClientAuthErrorMessage, ClientConfigurationError, ClientConfigurationErrorMessage, InteractionRequiredAuthError, InteractionRequiredAuthErrorMessage, ServerError, INetworkModule, NetworkResponse, NetworkRequestOptions, ILoggerCallback, Logger, LogLevel, ProtocolMode, ExternalTokenResponse, StringUtils, UrlString, AzureCloudInstance, AzureCloudOptions, AuthenticationHeaderParser, OIDC_DEFAULT_SCOPES } from "@azure/msal-common";
export { version } from "./packageMetadata";
//# sourceMappingURL=index.d.ts.map

@@ -1,5 +0,6 @@

/*! @azure/msal-browser v2.21.0 2022-01-04 */
/*! @azure/msal-browser v2.22.0 2022-02-08 */
'use strict';
export { PublicClientApplication } from './app/PublicClientApplication.js';
export { ApiId, BrowserCacheLocation, InteractionStatus, InteractionType, WrapperSKU } from './utils/BrowserConstants.js';
export { DEFAULT_IFRAME_TIMEOUT_MS } from './config/Configuration.js';
export { ApiId, BrowserCacheLocation, BrowserConstants, InteractionStatus, InteractionType, TemporaryCacheKeys, WrapperSKU } from './utils/BrowserConstants.js';
export { BrowserUtils } from './utils/BrowserUtils.js';

@@ -10,7 +11,17 @@ export { BrowserAuthError, BrowserAuthErrorMessage } from './error/BrowserAuthError.js';

export { NavigationClient } from './navigation/NavigationClient.js';
export { BrowserCacheManager } from './cache/BrowserCacheManager.js';
export { StandardInteractionClient } from './interaction_client/StandardInteractionClient.js';
export { RedirectClient } from './interaction_client/RedirectClient.js';
export { PopupClient } from './interaction_client/PopupClient.js';
export { SilentIframeClient } from './interaction_client/SilentIframeClient.js';
export { SilentCacheClient } from './interaction_client/SilentCacheClient.js';
export { SilentRefreshClient } from './interaction_client/SilentRefreshClient.js';
export { RedirectHandler } from './interaction_handler/RedirectHandler.js';
export { EventMessageUtils } from './event/EventMessage.js';
export { EventType } from './event/EventType.js';
export { EventHandler } from './event/EventHandler.js';
export { SignedHttpRequest } from './crypto/SignedHttpRequest.js';
export { AccountEntity, AuthError, AuthErrorMessage, AuthenticationHeaderParser, AuthenticationScheme, ClientAuthError, ClientAuthErrorMessage, ClientConfigurationError, ClientConfigurationErrorMessage, InteractionRequiredAuthError, InteractionRequiredAuthErrorMessage, LogLevel, Logger, ProtocolMode, ServerError, StringUtils, UrlString } from '@azure/msal-common';
export { PopupUtils } from './utils/PopupUtils.js';
export { AccountEntity, AuthError, AuthErrorMessage, AuthenticationHeaderParser, AuthenticationScheme, AzureCloudInstance, ClientAuthError, ClientAuthErrorMessage, ClientConfigurationError, ClientConfigurationErrorMessage, InteractionRequiredAuthError, InteractionRequiredAuthErrorMessage, LogLevel, Logger, OIDC_DEFAULT_SCOPES, ProtocolMode, ServerError, StringUtils, UrlString } from '@azure/msal-common';
export { version } from './packageMetadata.js';
//# sourceMappingURL=index.js.map

@@ -33,3 +33,3 @@ import { ICrypto, INetworkModule, Logger, AuthenticationResult, AccountInfo, BaseAuthRequest, ServerTelemetryManager } from "@azure/msal-common";

*/
protected getRedirectUri(requestRedirectUri?: string): string;
getRedirectUri(requestRedirectUri?: string): string;
/**

@@ -36,0 +36,0 @@ *

@@ -1,2 +0,2 @@

/*! @azure/msal-browser v2.21.0 2022-01-04 */
/*! @azure/msal-browser v2.22.0 2022-02-08 */
'use strict';

@@ -3,0 +3,0 @@ import { __awaiter, __generator, __assign, __spread } from '../_virtual/_tslib.js';

@@ -1,2 +0,2 @@

/*! @azure/msal-browser v2.21.0 2022-01-04 */
/*! @azure/msal-browser v2.22.0 2022-02-08 */
'use strict';

@@ -3,0 +3,0 @@ import { __extends } from '../_virtual/_tslib.js';

@@ -1,3 +0,4 @@

import { AuthenticationResult } from "@azure/msal-common";
import { AuthenticationResult, CommonEndSessionRequest } from "@azure/msal-common";
import { StandardInteractionClient } from "./StandardInteractionClient";
import { PopupWindowAttributes } from "../utils/PopupUtils";
import { EndSessionPopupRequest } from "../request/EndSessionPopupRequest";

@@ -25,3 +26,3 @@ import { PopupRequest } from "../request/PopupRequest";

*/
private acquireTokenPopupAsync;
protected acquireTokenPopupAsync(request: PopupRequest, popupName: string, popupWindowAttributes: PopupWindowAttributes, popup?: Window | null): Promise<AuthenticationResult>;
/**

@@ -36,4 +37,4 @@ *

*/
private logoutPopupAsync;
protected logoutPopupAsync(validRequest: CommonEndSessionRequest, popupName: string, popupWindowAttributes: PopupWindowAttributes, requestAuthority?: string, popup?: Window | null, mainWindowRedirectUri?: string): Promise<void>;
}
//# sourceMappingURL=PopupClient.d.ts.map

@@ -1,5 +0,5 @@

/*! @azure/msal-browser v2.21.0 2022-01-04 */
/*! @azure/msal-browser v2.22.0 2022-02-08 */
'use strict';
import { __extends, __awaiter, __generator } from '../_virtual/_tslib.js';
import { AuthError, ThrottlingUtils, UrlString } from '@azure/msal-common';
import { OIDC_DEFAULT_SCOPES, AuthError, ThrottlingUtils, UrlString } from '@azure/msal-common';
import { StandardInteractionClient } from './StandardInteractionClient.js';

@@ -26,32 +26,21 @@ import { PopupUtils } from '../utils/PopupUtils.js';

PopupClient.prototype.acquireToken = function (request) {
return __awaiter(this, void 0, void 0, function () {
var validRequest, popupName, popupWindowAttributes, popup, e_1;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
_a.trys.push([0, 2, , 3]);
return [4 /*yield*/, this.preflightInteractiveRequest(request, InteractionType.Popup)];
case 1:
validRequest = _a.sent();
popupName = PopupUtils.generatePopupName(this.config.auth.clientId, validRequest);
popupWindowAttributes = request.popupWindowAttributes || {};
// asyncPopups flag is true. Acquires token without first opening popup. Popup will be opened later asynchronously.
if (this.config.system.asyncPopups) {
this.logger.verbose("asyncPopups set to true, acquiring token");
// Passes on popup position and dimensions if in request
return [2 /*return*/, this.acquireTokenPopupAsync(validRequest, popupName, popupWindowAttributes)];
}
else {
// asyncPopups flag is set to false. Opens popup before acquiring token.
this.logger.verbose("asyncPopup set to false, opening popup before acquiring token");
popup = PopupUtils.openSizedPopup("about:blank", popupName, popupWindowAttributes, this.logger);
return [2 /*return*/, this.acquireTokenPopupAsync(validRequest, popupName, popupWindowAttributes, popup)];
}
case 2:
e_1 = _a.sent();
return [2 /*return*/, Promise.reject(e_1)];
case 3: return [2 /*return*/];
}
});
});
try {
var popupName = PopupUtils.generatePopupName(this.config.auth.clientId, request.scopes || OIDC_DEFAULT_SCOPES, request.authority || this.config.auth.authority, this.correlationId);
var popupWindowAttributes = request.popupWindowAttributes || {};
// asyncPopups flag is true. Acquires token without first opening popup. Popup will be opened later asynchronously.
if (this.config.system.asyncPopups) {
this.logger.verbose("asyncPopups set to true, acquiring token");
// Passes on popup position and dimensions if in request
return this.acquireTokenPopupAsync(request, popupName, popupWindowAttributes);
}
else {
// asyncPopups flag is set to false. Opens popup before acquiring token.
this.logger.verbose("asyncPopup set to false, opening popup before acquiring token");
var popup = PopupUtils.openSizedPopup("about:blank", popupName, popupWindowAttributes, this.logger);
return this.acquireTokenPopupAsync(request, popupName, popupWindowAttributes, popup);
}
}
catch (e) {
return Promise.reject(e);
}
};

@@ -97,5 +86,5 @@ /**

*/
PopupClient.prototype.acquireTokenPopupAsync = function (validRequest, popupName, popupWindowAttributes, popup) {
PopupClient.prototype.acquireTokenPopupAsync = function (request, popupName, popupWindowAttributes, popup) {
return __awaiter(this, void 0, void 0, function () {
var serverTelemetryManager, authCodeRequest, authClient, navigateUrl, interactionHandler, popupParameters, popupWindow, hash, state, result, e_2;
var serverTelemetryManager, validRequest, authCodeRequest, authClient, navigateUrl, interactionHandler, popupParameters, popupWindow, hash, state, result, e_1;
return __generator(this, function (_a) {

@@ -106,14 +95,18 @@ switch (_a.label) {

serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenPopup);
_a.label = 1;
return [4 /*yield*/, this.initializeAuthorizationRequest(request, InteractionType.Popup)];
case 1:
_a.trys.push([1, 7, , 8]);
validRequest = _a.sent();
this.browserStorage.updateCacheEntries(validRequest.state, validRequest.nonce, validRequest.authority, validRequest.loginHint || "", validRequest.account || null);
_a.label = 2;
case 2:
_a.trys.push([2, 8, , 9]);
return [4 /*yield*/, this.initializeAuthorizationCodeRequest(validRequest)];
case 2:
case 3:
authCodeRequest = _a.sent();
return [4 /*yield*/, this.createAuthCodeClient(serverTelemetryManager, validRequest.authority)];
case 3:
return [4 /*yield*/, this.createAuthCodeClient(serverTelemetryManager, validRequest.authority, validRequest.azureCloudOptions)];
case 4:
authClient = _a.sent();
this.logger.verbose("Auth code client created");
return [4 /*yield*/, authClient.getAuthCodeUrl(validRequest)];
case 4:
case 5:
navigateUrl = _a.sent();

@@ -129,3 +122,3 @@ interactionHandler = new PopupHandler(authClient, this.browserStorage, authCodeRequest, this.logger);

return [4 /*yield*/, interactionHandler.monitorPopupForHash(popupWindow)];
case 5:
case 6:
hash = _a.sent();

@@ -136,7 +129,7 @@ state = this.validateAndExtractStateFromHash(hash, InteractionType.Popup, validRequest.correlationId);

return [4 /*yield*/, interactionHandler.handleCodeResponseFromHash(hash, state, authClient.authority, this.networkClient)];
case 6:
case 7:
result = _a.sent();
return [2 /*return*/, result];
case 7:
e_2 = _a.sent();
case 8:
e_1 = _a.sent();
if (popup) {

@@ -146,9 +139,9 @@ // Close the synchronous popup if an error is thrown before the window unload event is registered

}
if (e_2 instanceof AuthError) {
e_2.setCorrelationId(this.correlationId);
if (e_1 instanceof AuthError) {
e_1.setCorrelationId(this.correlationId);
}
serverTelemetryManager.cacheFailedRequest(e_2);
serverTelemetryManager.cacheFailedRequest(e_1);
this.browserStorage.cleanRequestByState(validRequest.state);
throw e_2;
case 8: return [2 /*return*/];
throw e_1;
case 9: return [2 /*return*/];
}

@@ -169,3 +162,3 @@ });

return __awaiter(this, void 0, void 0, function () {
var serverTelemetryManager, authClient, logoutUri, popupUtils, popupWindow, e_3, navigationOptions, absoluteUrl, e_4;
var serverTelemetryManager, authClient, logoutUri, popupUtils, popupWindow, e_2, navigationOptions, absoluteUrl, e_3;
return __generator(this, function (_a) {

@@ -185,3 +178,2 @@ switch (_a.label) {

_a.sent();
this.browserStorage.setInteractionInProgress(true);
return [4 /*yield*/, this.createAuthCodeClient(serverTelemetryManager, requestAuthority)];

@@ -207,4 +199,4 @@ case 3:

case 6:
e_3 = _a.sent();
this.logger.verbose("Error occurred while monitoring popup for same origin. Session on server may remain active. Error: " + e_3);
e_2 = _a.sent();
this.logger.verbose("Error occurred while monitoring popup for same origin. Session on server may remain active. Error: " + e_2);
return [3 /*break*/, 7];

@@ -221,3 +213,3 @@ case 7:

this.logger.verbose("Redirecting main window to url specified in the request");
this.logger.verbosePii("Redirecing main window to: " + absoluteUrl);
this.logger.verbosePii("Redirecting main window to: " + absoluteUrl);
this.navigationClient.navigateInternal(absoluteUrl, navigationOptions);

@@ -230,3 +222,3 @@ }

case 8:
e_4 = _a.sent();
e_3 = _a.sent();
if (popup) {

@@ -236,10 +228,10 @@ // Close the synchronous popup if an error is thrown before the window unload event is registered

}
if (e_4 instanceof AuthError) {
e_4.setCorrelationId(this.correlationId);
if (e_3 instanceof AuthError) {
e_3.setCorrelationId(this.correlationId);
}
this.browserStorage.setInteractionInProgress(false);
this.eventHandler.emitEvent(EventType.LOGOUT_FAILURE, InteractionType.Popup, null, e_4);
this.eventHandler.emitEvent(EventType.LOGOUT_FAILURE, InteractionType.Popup, null, e_3);
this.eventHandler.emitEvent(EventType.LOGOUT_END, InteractionType.Popup);
serverTelemetryManager.cacheFailedRequest(e_4);
throw e_4;
serverTelemetryManager.cacheFailedRequest(e_3);
throw e_3;
case 9:

@@ -246,0 +238,0 @@ this.eventHandler.emitEvent(EventType.LOGOUT_END, InteractionType.Popup);

@@ -1,2 +0,2 @@

import { AuthenticationResult } from "@azure/msal-common";
import { AuthenticationResult, ServerTelemetryManager } from "@azure/msal-common";
import { StandardInteractionClient } from "./StandardInteractionClient";

@@ -23,3 +23,3 @@ import { EndSessionRequest } from "../request/EndSessionRequest";

*/
private getRedirectResponseHash;
protected getRedirectResponseHash(hash: string): string | null;
/**

@@ -30,3 +30,3 @@ * Checks if hash exists and handles in window.

*/
private handleHash;
protected handleHash(hash: string, state: string, serverTelemetryManager: ServerTelemetryManager): Promise<AuthenticationResult>;
/**

@@ -33,0 +33,0 @@ * Use to log out the current user, and redirect the user to the postLogoutRedirectUri.

@@ -1,7 +0,7 @@

/*! @azure/msal-browser v2.21.0 2022-01-04 */
/*! @azure/msal-browser v2.22.0 2022-02-08 */
'use strict';
import { __extends, __awaiter, __generator } from '../_virtual/_tslib.js';
import { AuthError, UrlString } from '@azure/msal-common';
import { UrlString, AuthError } from '@azure/msal-common';
import { StandardInteractionClient } from './StandardInteractionClient.js';
import { ApiId, InteractionType, TemporaryCacheKeys } from '../utils/BrowserConstants.js';
import { TemporaryCacheKeys, ApiId, InteractionType } from '../utils/BrowserConstants.js';
import { RedirectHandler } from '../interaction_handler/RedirectHandler.js';

@@ -30,5 +30,6 @@ import { BrowserUtils } from '../utils/BrowserUtils.js';

switch (_a.label) {
case 0: return [4 /*yield*/, this.preflightInteractiveRequest(request, InteractionType.Redirect)];
case 0: return [4 /*yield*/, this.initializeAuthorizationRequest(request, InteractionType.Redirect)];
case 1:
validRequest = _a.sent();
this.browserStorage.updateCacheEntries(validRequest.state, validRequest.nonce, validRequest.authority, validRequest.loginHint || "", validRequest.account || null);
serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenRedirect);

@@ -41,3 +42,3 @@ _a.label = 2;

authCodeRequest = _a.sent();
return [4 /*yield*/, this.createAuthCodeClient(serverTelemetryManager, validRequest.authority)];
return [4 /*yield*/, this.createAuthCodeClient(serverTelemetryManager, validRequest.authority, validRequest.azureCloudOptions)];
case 4:

@@ -104,3 +105,2 @@ authClient = _a.sent();

state = this.validateAndExtractStateFromHash(responseHash, InteractionType.Redirect);
BrowserUtils.clearHash(window);
this.logger.verbose("State extracted from hash");

@@ -189,8 +189,9 @@ }

var isResponseHash = UrlString.hashContainsKnownProperties(hash);
var cachedHash = this.browserStorage.getTemporaryCache(TemporaryCacheKeys.URL_HASH, true);
this.browserStorage.removeItem(this.browserStorage.generateCacheKey(TemporaryCacheKeys.URL_HASH));
if (isResponseHash) {
BrowserUtils.clearHash(window);
this.logger.verbose("Hash contains known properties, returning response hash");
return hash;
}
var cachedHash = this.browserStorage.getTemporaryCache(TemporaryCacheKeys.URL_HASH, true);
this.browserStorage.removeItem(this.browserStorage.generateCacheKey(TemporaryCacheKeys.URL_HASH));
this.logger.verbose("Hash does not contain known properties, returning cached hash");

@@ -197,0 +198,0 @@ return cachedHash;

@@ -1,2 +0,2 @@

/*! @azure/msal-browser v2.21.0 2022-01-04 */
/*! @azure/msal-browser v2.22.0 2022-02-08 */
'use strict';

@@ -40,2 +40,3 @@ import { __extends, __awaiter, __generator, __assign } from '../_virtual/_tslib.js';

silentRequest = _a.sent();
this.browserStorage.updateCacheEntries(silentRequest.state, silentRequest.nonce, silentRequest.authority, silentRequest.loginHint || "", silentRequest.account || null);
serverTelemetryManager = this.initializeServerTelemetryManager(this.apiId);

@@ -42,0 +43,0 @@ _a.label = 2;

import { StandardInteractionClient } from "./StandardInteractionClient";
import { CommonSilentFlowRequest, AuthenticationResult, SilentFlowClient, ServerTelemetryManager, AccountInfo } from "@azure/msal-common";
import { CommonSilentFlowRequest, AuthenticationResult, SilentFlowClient, ServerTelemetryManager, AccountInfo, AzureCloudOptions } from "@azure/msal-common";
import { SilentRequest } from "../request/SilentRequest";

@@ -19,5 +19,5 @@ export declare class SilentCacheClient extends StandardInteractionClient {

*/
protected createSilentFlowClient(serverTelemetryManager: ServerTelemetryManager, authorityUrl?: string): Promise<SilentFlowClient>;
protected createSilentFlowClient(serverTelemetryManager: ServerTelemetryManager, authorityUrl?: string, azureCloudOptions?: AzureCloudOptions): Promise<SilentFlowClient>;
initializeSilentRequest(request: SilentRequest, account: AccountInfo): Promise<CommonSilentFlowRequest>;
}
//# sourceMappingURL=SilentCacheClient.d.ts.map

@@ -1,2 +0,2 @@

/*! @azure/msal-browser v2.21.0 2022-01-04 */
/*! @azure/msal-browser v2.22.0 2022-02-08 */
'use strict';

@@ -30,3 +30,3 @@ import { __extends, __awaiter, __generator, __assign } from '../_virtual/_tslib.js';

serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenSilent_silentFlow);
return [4 /*yield*/, this.createSilentFlowClient(serverTelemetryManager, silentRequest.authority)];
return [4 /*yield*/, this.createSilentFlowClient(serverTelemetryManager, silentRequest.authority, silentRequest.azureCloudOptions)];
case 1:

@@ -66,3 +66,3 @@ silentAuthClient = _a.sent();

*/
SilentCacheClient.prototype.createSilentFlowClient = function (serverTelemetryManager, authorityUrl) {
SilentCacheClient.prototype.createSilentFlowClient = function (serverTelemetryManager, authorityUrl, azureCloudOptions) {
return __awaiter(this, void 0, void 0, function () {

@@ -72,3 +72,3 @@ var clientConfig;

switch (_a.label) {
case 0: return [4 /*yield*/, this.getClientConfiguration(serverTelemetryManager, authorityUrl)];
case 0: return [4 /*yield*/, this.getClientConfiguration(serverTelemetryManager, authorityUrl, azureCloudOptions)];
case 1:

@@ -75,0 +75,0 @@ clientConfig = _a.sent();

@@ -1,2 +0,2 @@

import { AuthenticationResult, ICrypto, Logger } from "@azure/msal-common";
import { AuthenticationResult, ICrypto, Logger, CommonAuthorizationCodeRequest, AuthorizationCodeClient } from "@azure/msal-common";
import { StandardInteractionClient } from "./StandardInteractionClient";

@@ -10,3 +10,3 @@ import { BrowserConfiguration } from "../config/Configuration";

export declare class SilentIframeClient extends StandardInteractionClient {
private apiId;
protected apiId: ApiId;
constructor(config: BrowserConfiguration, storageImpl: BrowserCacheManager, browserCrypto: ICrypto, logger: Logger, eventHandler: EventHandler, navigationClient: INavigationClient, apiId: ApiId, correlationId?: string);

@@ -28,4 +28,4 @@ /**

*/
private silentTokenHelper;
protected silentTokenHelper(navigateUrl: string, authCodeRequest: CommonAuthorizationCodeRequest, authClient: AuthorizationCodeClient, browserRequestLogger: Logger): Promise<AuthenticationResult>;
}
//# sourceMappingURL=SilentIframeClient.d.ts.map

@@ -1,2 +0,2 @@

/*! @azure/msal-browser v2.21.0 2022-01-04 */
/*! @azure/msal-browser v2.22.0 2022-02-08 */
'use strict';

@@ -43,2 +43,3 @@ import { __extends, __awaiter, __generator, __assign } from '../_virtual/_tslib.js';

silentRequest = _a.sent();
this.browserStorage.updateCacheEntries(silentRequest.state, silentRequest.nonce, silentRequest.authority, silentRequest.loginHint || "", silentRequest.account || null);
serverTelemetryManager = this.initializeServerTelemetryManager(this.apiId);

@@ -51,3 +52,3 @@ _a.label = 2;

authCodeRequest = _a.sent();
return [4 /*yield*/, this.createAuthCodeClient(serverTelemetryManager, silentRequest.authority)];
return [4 /*yield*/, this.createAuthCodeClient(serverTelemetryManager, silentRequest.authority, silentRequest.azureCloudOptions)];
case 4:

@@ -54,0 +55,0 @@ authClient = _a.sent();

import { StandardInteractionClient } from "./StandardInteractionClient";
import { CommonSilentFlowRequest, AuthenticationResult, ServerTelemetryManager, RefreshTokenClient } from "@azure/msal-common";
import { CommonSilentFlowRequest, AuthenticationResult, ServerTelemetryManager, RefreshTokenClient, AzureCloudOptions } from "@azure/msal-common";
export declare class SilentRefreshClient extends StandardInteractionClient {

@@ -18,4 +18,4 @@ /**

*/
protected createRefreshTokenClient(serverTelemetryManager: ServerTelemetryManager, authorityUrl?: string): Promise<RefreshTokenClient>;
protected createRefreshTokenClient(serverTelemetryManager: ServerTelemetryManager, authorityUrl?: string, azureCloudOptions?: AzureCloudOptions): Promise<RefreshTokenClient>;
}
//# sourceMappingURL=SilentRefreshClient.d.ts.map

@@ -1,2 +0,2 @@

/*! @azure/msal-browser v2.21.0 2022-01-04 */
/*! @azure/msal-browser v2.22.0 2022-02-08 */
'use strict';

@@ -34,3 +34,3 @@ import { __extends, __awaiter, __generator, __assign } from '../_virtual/_tslib.js';

serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenSilent_silentFlow);
return [4 /*yield*/, this.createRefreshTokenClient(serverTelemetryManager, silentRequest.authority)];
return [4 /*yield*/, this.createRefreshTokenClient(serverTelemetryManager, silentRequest.authority, silentRequest.azureCloudOptions)];
case 2:

@@ -63,3 +63,3 @@ refreshTokenClient = _b.sent();

*/
SilentRefreshClient.prototype.createRefreshTokenClient = function (serverTelemetryManager, authorityUrl) {
SilentRefreshClient.prototype.createRefreshTokenClient = function (serverTelemetryManager, authorityUrl, azureCloudOptions) {
return __awaiter(this, void 0, void 0, function () {

@@ -69,3 +69,3 @@ var clientConfig;

switch (_a.label) {
case 0: return [4 /*yield*/, this.getClientConfiguration(serverTelemetryManager, authorityUrl)];
case 0: return [4 /*yield*/, this.getClientConfiguration(serverTelemetryManager, authorityUrl, azureCloudOptions)];
case 1:

@@ -72,0 +72,0 @@ clientConfig = _a.sent();

@@ -1,2 +0,2 @@

import { ICrypto, Logger, ServerTelemetryManager, CommonAuthorizationCodeRequest, AuthorizationCodeClient, ClientConfiguration, Authority, CommonEndSessionRequest } from "@azure/msal-common";
import { ICrypto, Logger, ServerTelemetryManager, CommonAuthorizationCodeRequest, AuthorizationCodeClient, ClientConfiguration, Authority, CommonEndSessionRequest, AccountInfo, AzureCloudOptions } from "@azure/msal-common";
import { BaseInteractionClient } from "./BaseInteractionClient";

@@ -30,2 +30,8 @@ import { BrowserConfiguration } from "../config/Configuration";

/**
* Parses login_hint ID Token Claim out of AccountInfo object to be used as
* logout_hint in end session request.
* @param account
*/
protected getLogoutHintFromIdTokenClaims(account: AccountInfo): string | null;
/**
* Creates an Authorization Code Client with the given authority, or the default authority.

@@ -35,3 +41,3 @@ * @param serverTelemetryManager

*/
protected createAuthCodeClient(serverTelemetryManager: ServerTelemetryManager, authorityUrl?: string): Promise<AuthorizationCodeClient>;
protected createAuthCodeClient(serverTelemetryManager: ServerTelemetryManager, authorityUrl?: string, requestAzureCloudOptions?: AzureCloudOptions): Promise<AuthorizationCodeClient>;
/**

@@ -43,3 +49,3 @@ * Creates a Client Configuration object with the given request authority, or the default authority.

*/
protected getClientConfiguration(serverTelemetryManager: ServerTelemetryManager, requestAuthority?: string): Promise<ClientConfiguration>;
protected getClientConfiguration(serverTelemetryManager: ServerTelemetryManager, requestAuthority?: string, requestAzureCloudOptions?: AzureCloudOptions): Promise<ClientConfiguration>;
/**

@@ -55,10 +61,4 @@ * @param hash

*/
protected getDiscoveredAuthority(requestAuthority?: string): Promise<Authority>;
protected getDiscoveredAuthority(requestAuthority?: string, requestAzureCloudOptions?: AzureCloudOptions): Promise<Authority>;
/**
* Helper to validate app environment before making a request.
* @param request
* @param interactionType
*/
protected preflightInteractiveRequest(request: RedirectRequest | PopupRequest, interactionType: InteractionType): Promise<AuthorizationUrlRequest>;
/**
* Helper to initialize required request parameters for interactive APIs and ssoSilent()

@@ -65,0 +65,0 @@ * @param request

@@ -1,5 +0,5 @@

/*! @azure/msal-browser v2.21.0 2022-01-04 */
/*! @azure/msal-browser v2.22.0 2022-02-08 */
'use strict';
import { __extends, __awaiter, __generator, __assign } from '../_virtual/_tslib.js';
import { Constants, UrlString, AuthorizationCodeClient, AuthorityFactory, ResponseMode, StringUtils, ProtocolUtils } from '@azure/msal-common';
import { UrlString, Constants, AuthorizationCodeClient, Authority, AuthorityFactory, ResponseMode, StringUtils, ProtocolUtils } from '@azure/msal-common';
import { BaseInteractionClient } from './BaseInteractionClient.js';

@@ -54,7 +54,28 @@ import { BrowserConstants } from '../utils/BrowserConstants.js';

this.logger.verbose("initializeLogoutRequest called", logoutRequest === null || logoutRequest === void 0 ? void 0 : logoutRequest.correlationId);
// Check if interaction is in progress. Throw error if true.
if (this.browserStorage.isInteractionInProgress()) {
throw BrowserAuthError.createInteractionInProgressError();
var validLogoutRequest = __assign({ correlationId: this.browserCrypto.createNewGuid() }, logoutRequest);
/**
* Set logout_hint to be login_hint from ID Token Claims if present
* and logoutHint attribute wasn't manually set in logout request
*/
if (logoutRequest) {
// If logoutHint isn't set and an account was passed in, try to extract logoutHint from ID Token Claims
if (!logoutRequest.logoutHint) {
if (logoutRequest.account) {
var logoutHint = this.getLogoutHintFromIdTokenClaims(logoutRequest.account);
if (logoutHint) {
this.logger.verbose("Setting logoutHint to login_hint ID Token Claim value for the account provided");
validLogoutRequest.logoutHint = logoutHint;
}
}
else {
this.logger.verbose("logoutHint was not set and account was not passed into logout request, logoutHint will not be set");
}
}
else {
this.logger.verbose("logoutHint has already been set in logoutRequest");
}
}
var validLogoutRequest = __assign({ correlationId: this.browserCrypto.createNewGuid() }, logoutRequest);
else {
this.logger.verbose("logoutHint will not be set since no logout request was configured");
}
/*

@@ -87,2 +108,22 @@ * Only set redirect uri if logout request isn't provided or the set uri isn't null.

/**
* Parses login_hint ID Token Claim out of AccountInfo object to be used as
* logout_hint in end session request.
* @param account
*/
StandardInteractionClient.prototype.getLogoutHintFromIdTokenClaims = function (account) {
var idTokenClaims = account.idTokenClaims;
if (idTokenClaims) {
if (idTokenClaims.login_hint) {
return idTokenClaims.login_hint;
}
else {
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");
}
}
else {
this.logger.verbose("The provided account does not contain ID Token Claims, logoutHint will not be added to logout request");
}
return null;
};
/**
* Creates an Authorization Code Client with the given authority, or the default authority.

@@ -92,3 +133,3 @@ * @param serverTelemetryManager

*/
StandardInteractionClient.prototype.createAuthCodeClient = function (serverTelemetryManager, authorityUrl) {
StandardInteractionClient.prototype.createAuthCodeClient = function (serverTelemetryManager, authorityUrl, requestAzureCloudOptions) {
return __awaiter(this, void 0, void 0, function () {

@@ -98,3 +139,3 @@ var clientConfig;

switch (_a.label) {
case 0: return [4 /*yield*/, this.getClientConfiguration(serverTelemetryManager, authorityUrl)];
case 0: return [4 /*yield*/, this.getClientConfiguration(serverTelemetryManager, authorityUrl, requestAzureCloudOptions)];
case 1:

@@ -113,3 +154,3 @@ clientConfig = _a.sent();

*/
StandardInteractionClient.prototype.getClientConfiguration = function (serverTelemetryManager, requestAuthority) {
StandardInteractionClient.prototype.getClientConfiguration = function (serverTelemetryManager, requestAuthority, requestAzureCloudOptions) {
return __awaiter(this, void 0, void 0, function () {

@@ -121,3 +162,3 @@ var discoveredAuthority;

this.logger.verbose("getClientConfiguration called");
return [4 /*yield*/, this.getDiscoveredAuthority(requestAuthority)];
return [4 /*yield*/, this.getDiscoveredAuthority(requestAuthority, requestAzureCloudOptions)];
case 1:

@@ -182,5 +223,5 @@ discoveredAuthority = _a.sent();

*/
StandardInteractionClient.prototype.getDiscoveredAuthority = function (requestAuthority) {
StandardInteractionClient.prototype.getDiscoveredAuthority = function (requestAuthority, requestAzureCloudOptions) {
return __awaiter(this, void 0, void 0, function () {
var authorityOptions;
var authorityOptions, userAuthority, builtAuthority;
return __generator(this, function (_a) {

@@ -194,34 +235,8 @@ switch (_a.label) {

cloudDiscoveryMetadata: this.config.auth.cloudDiscoveryMetadata,
authorityMetadata: this.config.auth.authorityMetadata
authorityMetadata: this.config.auth.authorityMetadata,
};
if (!requestAuthority) return [3 /*break*/, 2];
this.logger.verbose("Creating discovered authority with request authority");
return [4 /*yield*/, AuthorityFactory.createDiscoveredInstance(requestAuthority, this.config.system.networkClient, this.browserStorage, authorityOptions)];
case 1: return [2 /*return*/, _a.sent()];
case 2:
userAuthority = requestAuthority ? requestAuthority : this.config.auth.authority;
builtAuthority = Authority.generateAuthority(userAuthority, requestAzureCloudOptions || this.config.auth.azureCloudOptions);
this.logger.verbose("Creating discovered authority with configured authority");
return [4 /*yield*/, AuthorityFactory.createDiscoveredInstance(this.config.auth.authority, this.config.system.networkClient, this.browserStorage, authorityOptions)];
case 3: return [2 /*return*/, _a.sent()];
}
});
});
};
/**
* Helper to validate app environment before making a request.
* @param request
* @param interactionType
*/
StandardInteractionClient.prototype.preflightInteractiveRequest = function (request, interactionType) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
this.logger.verbose("preflightInteractiveRequest called, validating app environment", request === null || request === void 0 ? void 0 : request.correlationId);
// block the reload if it occurred inside a hidden iframe
BrowserUtils.blockReloadInHiddenIframes();
// Check if interaction is in progress. Throw error if true.
if (this.browserStorage.isInteractionInProgress(false)) {
throw BrowserAuthError.createInteractionInProgressError();
}
return [4 /*yield*/, this.initializeAuthorizationRequest(request, interactionType)];
return [4 /*yield*/, AuthorityFactory.createDiscoveredInstance(builtAuthority, this.config.system.networkClient, this.browserStorage, authorityOptions)];
case 1: return [2 /*return*/, _a.sent()];

@@ -248,3 +263,3 @@ }

};
state = ProtocolUtils.setRequestState(this.browserCrypto, (request && request.state) || "", browserState);
state = ProtocolUtils.setRequestState(this.browserCrypto, (request && request.state) || Constants.EMPTY_STRING, browserState);
_a = [{}];

@@ -267,3 +282,2 @@ return [4 /*yield*/, this.initializeBaseRequest(request)];

}
this.browserStorage.updateCacheEntries(validatedRequest.state, validatedRequest.nonce, validatedRequest.authority, validatedRequest.loginHint || "", validatedRequest.account || null);
return [2 /*return*/, validatedRequest];

@@ -270,0 +284,0 @@ }

@@ -1,2 +0,2 @@

/*! @azure/msal-browser v2.21.0 2022-01-04 */
/*! @azure/msal-browser v2.22.0 2022-02-08 */
'use strict';

@@ -3,0 +3,0 @@ import { __awaiter, __generator } from '../_virtual/_tslib.js';

@@ -1,2 +0,2 @@

/*! @azure/msal-browser v2.21.0 2022-01-04 */
/*! @azure/msal-browser v2.22.0 2022-02-08 */
'use strict';

@@ -33,4 +33,2 @@ import { __extends } from '../_virtual/_tslib.js';

if (!StringUtils.isEmpty(requestUrl)) {
// Set interaction status in the library.
this.browserStorage.setInteractionInProgress(true);
this.browserRequestLogger.infoPii("Navigate to: " + requestUrl);

@@ -37,0 +35,0 @@ // Open the popup window to requestUrl.

@@ -1,2 +0,2 @@

/*! @azure/msal-browser v2.21.0 2022-01-04 */
/*! @azure/msal-browser v2.22.0 2022-02-08 */
'use strict';

@@ -38,3 +38,2 @@ import { __extends, __awaiter, __generator } from '../_virtual/_tslib.js';

// Set interaction status in the library.
this.browserStorage.setInteractionInProgress(true);
this.browserStorage.setTemporaryCache(TemporaryCacheKeys.CORRELATION_ID, this.authCodeRequest.correlationId, true);

@@ -41,0 +40,0 @@ this.browserStorage.cacheCodeRequest(this.authCodeRequest, this.browserCrypto);

@@ -1,2 +0,2 @@

/*! @azure/msal-browser v2.21.0 2022-01-04 */
/*! @azure/msal-browser v2.22.0 2022-02-08 */
'use strict';

@@ -3,0 +3,0 @@ import { __extends, __awaiter, __generator } from '../_virtual/_tslib.js';

@@ -1,2 +0,2 @@

/*! @azure/msal-browser v2.21.0 2022-01-04 */
/*! @azure/msal-browser v2.22.0 2022-02-08 */
'use strict';

@@ -3,0 +3,0 @@ /*

@@ -1,2 +0,2 @@

/*! @azure/msal-browser v2.21.0 2022-01-04 */
/*! @azure/msal-browser v2.22.0 2022-02-08 */
'use strict';

@@ -3,0 +3,0 @@ import { __awaiter, __generator } from '../_virtual/_tslib.js';

@@ -1,2 +0,2 @@

/*! @azure/msal-browser v2.21.0 2022-01-04 */
/*! @azure/msal-browser v2.22.0 2022-02-08 */
'use strict';

@@ -3,0 +3,0 @@ import { __awaiter, __generator } from '../_virtual/_tslib.js';

export declare const name = "@azure/msal-browser";
export declare const version = "2.21.0";
export declare const version = "2.22.0";
//# sourceMappingURL=packageMetadata.d.ts.map

@@ -1,8 +0,8 @@

/*! @azure/msal-browser v2.21.0 2022-01-04 */
/*! @azure/msal-browser v2.22.0 2022-02-08 */
'use strict';
/* eslint-disable header/header */
var name = "@azure/msal-browser";
var version = "2.21.0";
var version = "2.22.0";
export { name, version };
//# sourceMappingURL=packageMetadata.js.map

@@ -12,2 +12,3 @@ import { CommonEndSessionRequest } from "@azure/msal-common";

* - popupWindowAttributes - Optional popup window attributes. popupSize with height and width, and popupPosition with top and left can be set.
* - logoutHint - A string that specifies the account that is being logged out in order to skip the server account picker on logout
*/

@@ -14,0 +15,0 @@ export declare type EndSessionPopupRequest = Partial<CommonEndSessionRequest> & {

@@ -10,2 +10,3 @@ import { CommonEndSessionRequest } from "@azure/msal-common";

* - onRedirectNavigate - Callback that will be passed the url that MSAL will navigate to. Returning false in the callback will stop navigation.
* - logoutHint - A string that specifies the account that is being logged out in order to skip the server account picker on logout
*/

@@ -12,0 +13,0 @@ export declare type EndSessionRequest = Partial<CommonEndSessionRequest> & {

@@ -93,3 +93,4 @@ import { PopupRequest } from "../request/PopupRequest";

Popup = "popup",
Silent = "silent"
Silent = "silent",
None = "none"
}

@@ -96,0 +97,0 @@ /**

@@ -1,2 +0,2 @@

/*! @azure/msal-browser v2.21.0 2022-01-04 */
/*! @azure/msal-browser v2.22.0 2022-02-08 */
'use strict';

@@ -109,2 +109,3 @@ import { OIDC_DEFAULT_SCOPES } from '@azure/msal-common';

InteractionType["Silent"] = "silent";
InteractionType["None"] = "none";
})(InteractionType || (InteractionType = {}));

@@ -111,0 +112,0 @@ /**

@@ -1,2 +0,2 @@

/*! @azure/msal-browser v2.21.0 2022-01-04 */
/*! @azure/msal-browser v2.22.0 2022-02-08 */
'use strict';

@@ -3,0 +3,0 @@ import { StringUtils, ProtocolUtils, ClientAuthError, UrlString } from '@azure/msal-common';

@@ -1,2 +0,2 @@

/*! @azure/msal-browser v2.21.0 2022-01-04 */
/*! @azure/msal-browser v2.22.0 2022-02-08 */
'use strict';

@@ -3,0 +3,0 @@ /*

@@ -1,2 +0,2 @@

/*! @azure/msal-browser v2.21.0 2022-01-04 */
/*! @azure/msal-browser v2.22.0 2022-02-08 */
'use strict';

@@ -3,0 +3,0 @@ import { Constants, UrlString } from '@azure/msal-common';

@@ -1,2 +0,2 @@

/*! @azure/msal-browser v2.21.0 2022-01-04 */
/*! @azure/msal-browser v2.22.0 2022-02-08 */
'use strict';

@@ -3,0 +3,0 @@ /*

import { CommonEndSessionRequest, Logger } from "@azure/msal-common";
import { BrowserCacheManager } from "../cache/BrowserCacheManager";
import { PopupParams } from "../interaction_handler/PopupHandler";
import { AuthorizationUrlRequest } from "../request/AuthorizationUrlRequest";
/**

@@ -66,3 +65,3 @@ * Popup configurations for setting dimensions and position of popup window

*/
static generatePopupName(clientId: string, request: AuthorizationUrlRequest): string;
static generatePopupName(clientId: string, scopes: Array<string>, authority: string, correlationId: string): string;
/**

@@ -69,0 +68,0 @@ * Generates the name for the popup based on the client id and request for logouts

@@ -1,2 +0,2 @@

/*! @azure/msal-browser v2.21.0 2022-01-04 */
/*! @azure/msal-browser v2.22.0 2022-02-08 */
'use strict';

@@ -169,4 +169,4 @@ import { StringUtils, Constants } from '@azure/msal-common';

*/
PopupUtils.generatePopupName = function (clientId, request) {
return BrowserConstants.POPUP_NAME_PREFIX + "." + clientId + "." + request.scopes.join("-") + "." + request.authority + "." + request.correlationId;
PopupUtils.generatePopupName = function (clientId, scopes, authority, correlationId) {
return BrowserConstants.POPUP_NAME_PREFIX + "." + clientId + "." + scopes.join("-") + "." + authority + "." + correlationId;
};

@@ -173,0 +173,0 @@ /**

@@ -13,3 +13,3 @@ {

},
"version": "2.21.0",
"version": "2.22.0",
"description": "Microsoft Authentication Library for js",

@@ -95,4 +95,4 @@ "keywords": [

"dependencies": {
"@azure/msal-common": "^6.0.0"
"@azure/msal-common": "^6.1.0"
}
}

@@ -62,3 +62,3 @@ # Microsoft Authentication Library for JavaScript (MSAL.js) 2.0 for Browser-Based Single-Page Applications

```html
<script type="text/javascript" src="https://alcdn.msauth.net/browser/2.21.0/js/msal-browser.min.js"></script>
<script type="text/javascript" src="https://alcdn.msauth.net/browser/2.22.0/js/msal-browser.min.js"></script>
```

@@ -65,0 +65,0 @@

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc