Socket
Socket
Sign inDemoInstall

@azure/msal-browser

Package Overview
Dependencies
1
Maintainers
3
Versions
110
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.28.3 to 2.29.0

dist/crypto/ISubtleCrypto.d.ts

2

dist/_virtual/_tslib.js

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

/*! @azure/msal-browser v2.28.3 2022-09-12 */
/*! @azure/msal-browser v2.29.0 2022-10-03 */
'use strict';

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

@@ -125,14 +125,23 @@ import { AccountInfo, INetworkModule, AuthenticationResult, Logger, CommonSilentFlowRequest, ICrypto, PerformanceCallbackFunction, IPerformanceClient, BaseAuthRequest } from "@azure/msal-common";

/**
* Use this function to obtain a token before every call to the API / resource provider
*
* MSAL return's a cached token when available
* Or it send's a request to the STS to obtain a new token using a refresh token.
*
* @param {@link SilentRequest}
*
* To renew idToken, please pass clientId as the only scope in the Authentication Parameters
* @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.
* Attempt to acquire an access token from the cache
* @param silentCacheClient SilentCacheClient
* @param commonRequest CommonSilentFlowRequest
* @param silentRequest SilentRequest
* @returns A promise that, when resolved, returns the access token
*/
protected acquireTokenByRefreshToken(request: CommonSilentFlowRequest): Promise<AuthenticationResult>;
protected acquireTokenFromCache(silentCacheClient: SilentCacheClient, commonRequest: CommonSilentFlowRequest, silentRequest: SilentRequest): Promise<AuthenticationResult>;
/**
* Attempt to acquire an access token via a refresh token
* @param commonRequest CommonSilentFlowRequest
* @param silentRequest SilentRequest
* @returns A promise that, when resolved, returns the access token
*/
protected acquireTokenByRefreshToken(commonRequest: CommonSilentFlowRequest, silentRequest: SilentRequest): Promise<AuthenticationResult>;
/**
* Attempt to acquire an access token via an iframe
* @param request CommonSilentFlowRequest
* @returns A promise that, when resolved, returns the access token
*/
protected acquireTokenBySilentIframe(request: CommonSilentFlowRequest): Promise<AuthenticationResult>;
/**
* Deprecated logout function. Use logoutRedirect or logoutPopup instead

@@ -139,0 +148,0 @@ * @param logoutRequest

@@ -1,9 +0,9 @@

/*! @azure/msal-browser v2.28.3 2022-09-12 */
/*! @azure/msal-browser v2.29.0 2022-10-03 */
'use strict';
import { __awaiter, __generator, __assign } from '../_virtual/_tslib.js';
import { CryptoOps } from '../crypto/CryptoOps.js';
import { Constants, InteractionRequiredAuthError, PerformanceEvents, PromptValue, AuthError, StringUtils, Logger, StubPerformanceClient, DEFAULT_CRYPTO_IMPLEMENTATION, ServerError } from '@azure/msal-common';
import { Constants, InteractionRequiredAuthError, PerformanceEvents, AuthError, ClientAuthError, StringUtils, PromptValue, Logger, StubPerformanceClient, DEFAULT_CRYPTO_IMPLEMENTATION } from '@azure/msal-common';
import { BrowserCacheManager, DEFAULT_BROWSER_CACHE_MANAGER } from '../cache/BrowserCacheManager.js';
import { buildConfiguration } from '../config/Configuration.js';
import { InteractionType, ApiId, TemporaryCacheKeys, BrowserCacheLocation, BrowserConstants } from '../utils/BrowserConstants.js';
import { InteractionType, ApiId, TemporaryCacheKeys, CacheLookupPolicy, BrowserCacheLocation } from '../utils/BrowserConstants.js';
import { BrowserUtils } from '../utils/BrowserUtils.js';

@@ -75,6 +75,6 @@ import { name, version } from '../packageMetadata.js';

this.performanceClient = this.isBrowserEnvironment ?
new BrowserPerformanceClient(this.config.auth.clientId, this.config.auth.authority, this.logger, name, version, this.config.telemetry.application) :
new BrowserPerformanceClient(this.config.auth.clientId, this.config.auth.authority, this.logger, name, version, this.config.telemetry.application, this.config.system.cryptoOptions) :
new StubPerformanceClient(this.config.auth.clientId, this.config.auth.authority, this.logger, name, version, this.config.telemetry.application);
// Initialize the crypto class.
this.browserCrypto = this.isBrowserEnvironment ? new CryptoOps(this.logger, this.performanceClient) : DEFAULT_CRYPTO_IMPLEMENTATION;
this.browserCrypto = this.isBrowserEnvironment ? new CryptoOps(this.logger, this.performanceClient, this.config.system.cryptoOptions) : DEFAULT_CRYPTO_IMPLEMENTATION;
this.eventHandler = new EventHandler(this.logger, this.browserCrypto);

@@ -301,2 +301,3 @@ // Initialize the browser storage class.

idTokenSize: response.idToken.length,
requestId: response.requestId
});

@@ -339,2 +340,3 @@ atPopupMeasurement.flushMeasurement();

idTokenSize: result.idToken.length,
requestId: result.requestId
});

@@ -383,3 +385,5 @@ atPopupMeasurement.flushMeasurement();

correlationId = this.getRequestCorrelationId(request);
validRequest = __assign(__assign({}, request), { prompt: PromptValue.NONE, correlationId: correlationId });
validRequest = __assign(__assign({}, request), {
// will be PromptValue.NONE or PromptValue.NO_SESSION
prompt: request.prompt, correlationId: correlationId });
this.preflightBrowserEnvironmentCheck(InteractionType.Silent);

@@ -410,3 +414,4 @@ ssoSilentMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.SsoSilent, correlationId);

accessTokenSize: response.accessToken.length,
idTokenSize: response.idToken.length
idTokenSize: response.idToken.length,
requestId: response.requestId
});

@@ -462,3 +467,4 @@ ssoSilentMeasurement.flushMeasurement();

idTokenSize: result.idToken.length,
isNativeBroker: result.fromNativeBroker
isNativeBroker: result.fromNativeBroker,
requestId: result.requestId
});

@@ -543,66 +549,61 @@ atbcMeasurement.flushMeasurement();

/**
* Use this function to obtain a token before every call to the API / resource provider
*
* MSAL return's a cached token when available
* Or it send's a request to the STS to obtain a new token using a refresh token.
*
* @param {@link SilentRequest}
*
* To renew idToken, please pass clientId as the only scope in the Authentication Parameters
* @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.
* Attempt to acquire an access token from the cache
* @param silentCacheClient SilentCacheClient
* @param commonRequest CommonSilentFlowRequest
* @param silentRequest SilentRequest
* @returns A promise that, when resolved, returns the access token
*/
ClientApplication.prototype.acquireTokenByRefreshToken = function (request) {
ClientApplication.prototype.acquireTokenFromCache = function (silentCacheClient, commonRequest, silentRequest) {
return __awaiter(this, void 0, void 0, function () {
var atbrtMeasurement, silentRefreshClient;
var _this = this;
return __generator(this, function (_a) {
// block the reload if it occurred inside a hidden iframe
BrowserUtils.blockReloadInHiddenIframes();
atbrtMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenByRefreshToken, request.correlationId);
this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_NETWORK_START, InteractionType.Silent, request);
silentRefreshClient = this.createSilentRefreshClient(request.correlationId);
return [2 /*return*/, silentRefreshClient.acquireToken(request)
.then(function (result) {
atbrtMeasurement.endMeasurement({
success: true,
fromCache: result.fromCache,
accessTokenSize: result.accessToken.length,
idTokenSize: result.idToken.length,
});
return result;
})
.catch(function (e) {
var isServerError = e instanceof ServerError;
var isInteractionRequiredError = e instanceof InteractionRequiredAuthError;
var isInvalidGrantError = (e.errorCode === BrowserConstants.INVALID_GRANT_ERROR);
if (isServerError && isInvalidGrantError && !isInteractionRequiredError) {
_this.logger.verbose("Refresh token expired or invalid, attempting acquire token by iframe", request.correlationId);
var silentIframeClient = _this.createSilentIframeClient(request.correlationId);
return silentIframeClient.acquireToken(request)
.then(function (result) {
atbrtMeasurement.endMeasurement({
success: true,
fromCache: result.fromCache,
accessTokenSize: result.accessToken.length,
idTokenSize: result.idToken.length,
});
return result;
})
.catch(function (error) {
atbrtMeasurement.endMeasurement({
errorCode: error.errorCode,
subErrorCode: error.subError,
success: false
});
throw error;
});
}
atbrtMeasurement.endMeasurement({
success: false
});
throw e;
})];
switch (silentRequest.cacheLookupPolicy) {
case CacheLookupPolicy.Default:
case CacheLookupPolicy.AccessToken:
case CacheLookupPolicy.AccessTokenAndRefreshToken:
return [2 /*return*/, silentCacheClient.acquireToken(commonRequest)];
default:
throw ClientAuthError.createRefreshRequiredError();
}
return [2 /*return*/];
});
});
};
/**
* Attempt to acquire an access token via a refresh token
* @param commonRequest CommonSilentFlowRequest
* @param silentRequest SilentRequest
* @returns A promise that, when resolved, returns the access token
*/
ClientApplication.prototype.acquireTokenByRefreshToken = function (commonRequest, silentRequest) {
return __awaiter(this, void 0, void 0, function () {
var silentRefreshClient;
return __generator(this, function (_a) {
switch (silentRequest.cacheLookupPolicy) {
case CacheLookupPolicy.Default:
case CacheLookupPolicy.AccessTokenAndRefreshToken:
case CacheLookupPolicy.RefreshToken:
case CacheLookupPolicy.RefreshTokenAndNetwork:
silentRefreshClient = this.createSilentRefreshClient(commonRequest.correlationId);
return [2 /*return*/, silentRefreshClient.acquireToken(commonRequest)];
default:
throw ClientAuthError.createRefreshRequiredError();
}
return [2 /*return*/];
});
});
};
/**
* Attempt to acquire an access token via an iframe
* @param request CommonSilentFlowRequest
* @returns A promise that, when resolved, returns the access token
*/
ClientApplication.prototype.acquireTokenBySilentIframe = function (request) {
return __awaiter(this, void 0, void 0, function () {
var silentIframeClient;
return __generator(this, function (_a) {
silentIframeClient = this.createSilentIframeClient(request.correlationId);
return [2 /*return*/, silentIframeClient.acquireToken(request)];
});
});
};
// #endregion

@@ -609,0 +610,0 @@ // #region Logout

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

/*! @azure/msal-browser v2.28.3 2022-09-12 */
/*! @azure/msal-browser v2.29.0 2022-10-03 */
'use strict';

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

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

/*! @azure/msal-browser v2.28.3 2022-09-12 */
/*! @azure/msal-browser v2.29.0 2022-10-03 */
'use strict';
import { __extends, __awaiter, __generator, __assign } from '../_virtual/_tslib.js';
import { PerformanceEvents, Constants } from '@azure/msal-common';
import { DEFAULT_REQUEST, InteractionType, ApiId } from '../utils/BrowserConstants.js';
import { PerformanceEvents, Constants, ServerError, InteractionRequiredAuthError } from '@azure/msal-common';
import { DEFAULT_REQUEST, InteractionType, CacheLookupPolicy, ApiId, BrowserConstants } from '../utils/BrowserConstants.js';
import { ClientApplication } from './ClientApplication.js';

@@ -11,2 +11,3 @@ import { EventType } from '../event/EventType.js';

import { NativeMessageHandler } from '../broker/nativeBroker/NativeMessageHandler.js';
import { BrowserUtils } from '../utils/BrowserUtils.js';

@@ -123,3 +124,5 @@ /*

idTokenSize: result.idToken.length,
isNativeBroker: result.fromNativeBroker
isNativeBroker: result.fromNativeBroker,
cacheLookupPolicy: request.cacheLookupPolicy,
requestId: result.requestId
});

@@ -162,3 +165,3 @@ atsMeasurement.flushMeasurement();

return __awaiter(this, void 0, void 0, function () {
var astsAsyncMeasurement, result, silentRequest, silentCacheClient, silentRequest_1;
var astsAsyncMeasurement, result, silentRequest, silentCacheClient, silentRequest_1, requestWithCLP_1;
var _this = this;

@@ -193,7 +196,28 @@ return __generator(this, function (_a) {

silentRequest_1 = _a.sent();
result = silentCacheClient.acquireToken(silentRequest_1).catch(function () { return __awaiter(_this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this.acquireTokenByRefreshToken(silentRequest_1)];
requestWithCLP_1 = __assign(__assign({}, request), {
// set the request's CacheLookupPolicy to Default if it was not optionally passed in
cacheLookupPolicy: request.cacheLookupPolicy || CacheLookupPolicy.Default });
result = this.acquireTokenFromCache(silentCacheClient, silentRequest_1, requestWithCLP_1).catch(function (cacheError) {
if (requestWithCLP_1.cacheLookupPolicy === CacheLookupPolicy.AccessToken) {
throw cacheError;
}
// block the reload if it occurred inside a hidden iframe
BrowserUtils.blockReloadInHiddenIframes();
_this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_NETWORK_START, InteractionType.Silent, silentRequest_1);
return _this.acquireTokenByRefreshToken(silentRequest_1, requestWithCLP_1).catch(function (refreshTokenError) {
var isServerError = refreshTokenError instanceof ServerError;
var isInteractionRequiredError = refreshTokenError instanceof InteractionRequiredAuthError;
var isInvalidGrantError = (refreshTokenError.errorCode === BrowserConstants.INVALID_GRANT_ERROR);
if ((!isServerError ||
!isInvalidGrantError ||
isInteractionRequiredError ||
requestWithCLP_1.cacheLookupPolicy === CacheLookupPolicy.AccessTokenAndRefreshToken ||
requestWithCLP_1.cacheLookupPolicy === CacheLookupPolicy.RefreshToken)
&& (requestWithCLP_1.cacheLookupPolicy !== CacheLookupPolicy.Skip)) {
throw refreshTokenError;
}
_this.logger.verbose("Refresh token expired/invalid or CacheLookupPolicy is set to Skip, attempting acquire token by iframe.", request.correlationId);
return _this.acquireTokenBySilentIframe(silentRequest_1);
});
}); });
});
_a.label = 3;

@@ -207,3 +231,4 @@ case 3: return [2 /*return*/, result.then(function (response) {

idTokenSize: response.idToken.length,
isNativeBroker: response.fromNativeBroker
isNativeBroker: response.fromNativeBroker,
requestId: response.requestId
});

@@ -210,0 +235,0 @@ return response;

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

/*! @azure/msal-browser v2.28.3 2022-09-12 */
/*! @azure/msal-browser v2.29.0 2022-10-03 */
'use strict';

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

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

/*! @azure/msal-browser v2.28.3 2022-09-12 */
/*! @azure/msal-browser v2.29.0 2022-10-03 */
'use strict';

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

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

/*! @azure/msal-browser v2.28.3 2022-09-12 */
/*! @azure/msal-browser v2.29.0 2022-10-03 */
'use strict';

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

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

/*! @azure/msal-browser v2.28.3 2022-09-12 */
/*! @azure/msal-browser v2.29.0 2022-10-03 */
'use strict';

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

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

/*! @azure/msal-browser v2.28.3 2022-09-12 */
/*! @azure/msal-browser v2.29.0 2022-10-03 */
'use strict';

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

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

/*! @azure/msal-browser v2.28.3 2022-09-12 */
/*! @azure/msal-browser v2.29.0 2022-10-03 */
'use strict';

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

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

/*! @azure/msal-browser v2.28.3 2022-09-12 */
/*! @azure/msal-browser v2.29.0 2022-10-03 */
'use strict';

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

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

/*! @azure/msal-browser v2.28.3 2022-09-12 */
/*! @azure/msal-browser v2.29.0 2022-10-03 */
'use strict';

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

@@ -127,3 +127,19 @@ import { SystemOptions, LoggerOptions, INetworkModule, ProtocolMode, AzureCloudOptions, ApplicationTelemetry } from "@azure/msal-common";

nativeBrokerHandshakeTimeout?: number;
/**
* Options related to browser crypto APIs
*/
cryptoOptions?: CryptoOptions;
};
export declare type CryptoOptions = {
/**
* Enables the application to use the MSR Crypto interface, if available (and other interfaces are not)
* @type {?boolean}
*/
useMsrCrypto?: boolean;
/**
* Entropy to seed browser crypto API (needed for MSR Crypto). Must be cryptographically strong random numbers (e.g. crypto.randomBytes(48) from Node)
* @type {?Uint8Array}
*/
entropy?: Uint8Array;
};
/**

@@ -130,0 +146,0 @@ * Telemetry Options

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

/*! @azure/msal-browser v2.28.3 2022-09-12 */
/*! @azure/msal-browser v2.29.0 2022-10-03 */
'use strict';

@@ -63,3 +63,6 @@ import { __assign } from '../_virtual/_tslib.js';

// If loadFrameTimeout is provided, use that as default.
windowHashTimeout: (userInputSystem === null || userInputSystem === void 0 ? void 0 : userInputSystem.loadFrameTimeout) || DEFAULT_POPUP_TIMEOUT_MS, iframeHashTimeout: (userInputSystem === null || userInputSystem === void 0 ? void 0 : userInputSystem.loadFrameTimeout) || DEFAULT_IFRAME_TIMEOUT_MS, navigateFrameWait: isBrowserEnvironment && BrowserUtils.detectIEOrEdge() ? 500 : 0, redirectNavigationTimeout: DEFAULT_REDIRECT_TIMEOUT_MS, asyncPopups: false, allowRedirectInIframe: false, allowNativeBroker: false, nativeBrokerHandshakeTimeout: (userInputSystem === null || userInputSystem === void 0 ? void 0 : userInputSystem.nativeBrokerHandshakeTimeout) || DEFAULT_NATIVE_BROKER_HANDSHAKE_TIMEOUT_MS });
windowHashTimeout: (userInputSystem === null || userInputSystem === void 0 ? void 0 : userInputSystem.loadFrameTimeout) || DEFAULT_POPUP_TIMEOUT_MS, iframeHashTimeout: (userInputSystem === null || userInputSystem === void 0 ? void 0 : userInputSystem.loadFrameTimeout) || DEFAULT_IFRAME_TIMEOUT_MS, navigateFrameWait: isBrowserEnvironment && BrowserUtils.detectIEOrEdge() ? 500 : 0, redirectNavigationTimeout: DEFAULT_REDIRECT_TIMEOUT_MS, asyncPopups: false, allowRedirectInIframe: false, allowNativeBroker: false, nativeBrokerHandshakeTimeout: (userInputSystem === null || userInputSystem === void 0 ? void 0 : userInputSystem.nativeBrokerHandshakeTimeout) || DEFAULT_NATIVE_BROKER_HANDSHAKE_TIMEOUT_MS, cryptoOptions: {
useMsrCrypto: false,
entropy: undefined
} });
var DEFAULT_TELEMETRY_OPTIONS = {

@@ -66,0 +69,0 @@ application: {

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

import { Logger } from "..";
import { Logger } from "@azure/msal-common";
import { CryptoOptions } from "../config/Configuration";
/**

@@ -7,6 +8,20 @@ * This class implements functions used by the browser library to perform cryptography operations such as

export declare class BrowserCrypto {
private _keygenAlgorithmOptions;
private keygenAlgorithmOptions;
private subtleCrypto;
private logger;
constructor(logger: Logger);
private cryptoOptions?;
constructor(logger: Logger, cryptoOptions?: CryptoOptions);
/**
* Check whether IE crypto or other browser cryptography is available.
*/
private hasIECrypto;
/**
* Check whether browser crypto is available.
*/
private hasBrowserCrypto;
/**
* Check whether MSR crypto polyfill is available
*/
private hasMsrCrypto;
/**
* Returns a sha-256 hash of the given dataString as an ArrayBuffer.

@@ -20,3 +35,3 @@ * @param dataString

*/
getRandomValues(dataBuffer: Uint8Array): void;
getRandomValues(dataBuffer: Uint8Array): Uint8Array;
/**

@@ -48,58 +63,3 @@ * Generates a keypair based on current keygen algorithm config.

sign(key: CryptoKey, data: ArrayBuffer): Promise<ArrayBuffer>;
/**
* Check whether IE crypto or other browser cryptography is available.
*/
private hasCryptoAPI;
/**
* Checks whether IE crypto (AKA msCrypto) is available.
*/
private hasIECrypto;
/**
* Check whether browser crypto is available.
*/
private hasBrowserCrypto;
/**
* Helper function for SHA digest.
* @param algorithm
* @param data
*/
private getSubtleCryptoDigest;
/**
* IE Helper function for SHA digest.
* @param algorithm
* @param data
*/
private getMSCryptoDigest;
/**
* IE Helper function for generating a keypair
* @param extractable
* @param usages
*/
private msCryptoGenerateKey;
/**
* IE Helper function for exportKey
* @param key
* @param format
*/
private msCryptoExportJwk;
/**
* IE Helper function for importKey
* @param key
* @param format
* @param extractable
* @param usages
*/
private msCryptoImportKey;
/**
* IE Helper function for sign JWT
* @param key
* @param data
*/
private msCryptoSign;
/**
* Returns stringified jwk.
* @param jwk
*/
static getJwkString(jwk: JsonWebKey): string;
}
//# sourceMappingURL=BrowserCrypto.d.ts.map

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

/*! @azure/msal-browser v2.28.3 2022-09-12 */
/*! @azure/msal-browser v2.29.0 2022-10-03 */
'use strict';

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

import { BrowserAuthError } from '../error/BrowserAuthError.js';
import { KEY_FORMAT_JWK } from '../utils/BrowserConstants.js';
import { Constants } from '@azure/msal-common';
import { ModernBrowserCrypto } from './ModernBrowserCrypto.js';
import { MsrBrowserCrypto } from './MsrBrowserCrypto.js';
import { MsBrowserCrypto } from './MsBrowserCrypto.js';
import { BrowserConfigurationAuthError } from '../error/BrowserConfigurationAuthError.js';

@@ -30,8 +32,39 @@ /*

var BrowserCrypto = /** @class */ (function () {
function BrowserCrypto(logger) {
function BrowserCrypto(logger, cryptoOptions) {
var _a, _b;
this.logger = logger;
if (!(this.hasCryptoAPI())) {
throw BrowserAuthError.createCryptoNotAvailableError("Browser crypto or msCrypto object not available.");
this.cryptoOptions = cryptoOptions;
if (this.hasBrowserCrypto()) {
// Use standard modern web crypto if available
this.logger.verbose("BrowserCrypto: modern crypto interface available");
this.subtleCrypto = new ModernBrowserCrypto();
}
this._keygenAlgorithmOptions = {
else if (this.hasIECrypto()) {
// For IE11, use msCrypto interface
this.logger.verbose("BrowserCrypto: MS crypto interface available");
this.subtleCrypto = new MsBrowserCrypto();
}
else if (this.hasMsrCrypto() && ((_a = this.cryptoOptions) === null || _a === void 0 ? void 0 : _a.useMsrCrypto)) {
// For other browsers, use MSR Crypto if found
this.logger.verbose("BrowserCrypto: MSR crypto interface available");
this.subtleCrypto = new MsrBrowserCrypto();
}
else {
if (this.hasMsrCrypto()) {
this.logger.info("BrowserCrypto: MSR Crypto interface available but system.cryptoOptions.useMsrCrypto not enabled");
}
this.logger.error("BrowserCrypto: No crypto interfaces available.");
throw BrowserAuthError.createCryptoNotAvailableError("Browser crypto, msCrypto, or msrCrypto interfaces not available.");
}
// Mainly needed for MSR Crypto: https://github.com/microsoft/MSR-JavaScript-Crypto#random-number-generator-prng
if (this.subtleCrypto.initPrng) {
this.logger.verbose("BrowserCrypto: Interface requires entropy");
if (!((_b = this.cryptoOptions) === null || _b === void 0 ? void 0 : _b.entropy)) {
this.logger.error("BrowserCrypto: Interface requires entropy but none provided.");
throw BrowserConfigurationAuthError.createEntropyNotProvided();
}
this.logger.verbose("BrowserCrypto: Entropy provided");
this.subtleCrypto.initPrng(this.cryptoOptions.entropy);
}
this.keygenAlgorithmOptions = {
name: PKCS1_V15_KEYGEN_ALG,

@@ -44,2 +77,20 @@ hash: S256_HASH_ALG,

/**
* Check whether IE crypto or other browser cryptography is available.
*/
BrowserCrypto.prototype.hasIECrypto = function () {
return "msCrypto" in window;
};
/**
* Check whether browser crypto is available.
*/
BrowserCrypto.prototype.hasBrowserCrypto = function () {
return "crypto" in window;
};
/**
* Check whether MSR crypto polyfill is available
*/
BrowserCrypto.prototype.hasMsrCrypto = function () {
return "msrCrypto" in window;
};
/**
* Returns a sha-256 hash of the given dataString as an ArrayBuffer.

@@ -53,3 +104,4 @@ * @param dataString

data = BrowserStringUtils.stringToUtf8Arr(dataString);
return [2 /*return*/, this.hasIECrypto() ? this.getMSCryptoDigest(S256_HASH_ALG, data) : this.getSubtleCryptoDigest(S256_HASH_ALG, data)];
// MSR Crypto wants object with name property, instead of string
return [2 /*return*/, this.subtleCrypto.digest({ name: S256_HASH_ALG }, data)];
});

@@ -63,7 +115,3 @@ });

BrowserCrypto.prototype.getRandomValues = function (dataBuffer) {
var cryptoObj = window["msCrypto"] || window.crypto;
if (!cryptoObj.getRandomValues) {
throw BrowserAuthError.createCryptoNotAvailableError("getRandomValues does not exist.");
}
cryptoObj.getRandomValues(dataBuffer);
return this.subtleCrypto.getRandomValues(dataBuffer);
};

@@ -78,5 +126,3 @@ /**

return __generator(this, function (_a) {
return [2 /*return*/, (this.hasIECrypto() ?
this.msCryptoGenerateKey(extractable, usages)
: window.crypto.subtle.generateKey(this._keygenAlgorithmOptions, extractable, usages))];
return [2 /*return*/, this.subtleCrypto.generateKey(this.keygenAlgorithmOptions, extractable, usages)];
});

@@ -93,3 +139,3 @@ });

return __generator(this, function (_a) {
return [2 /*return*/, this.hasIECrypto() ? this.msCryptoExportJwk(key) : window.crypto.subtle.exportKey(KEY_FORMAT_JWK, key)];
return [2 /*return*/, this.subtleCrypto.exportKey(key)];
});

@@ -107,9 +153,4 @@ });

return __awaiter(this, void 0, void 0, function () {
var keyString, keyBuffer;
return __generator(this, function (_a) {
keyString = BrowserCrypto.getJwkString(key);
keyBuffer = BrowserStringUtils.stringToArrayBuffer(keyString);
return [2 /*return*/, this.hasIECrypto() ?
this.msCryptoImportKey(keyBuffer, extractable, usages)
: window.crypto.subtle.importKey(KEY_FORMAT_JWK, key, this._keygenAlgorithmOptions, extractable, usages)];
return [2 /*return*/, this.subtleCrypto.importKey(key, this.keygenAlgorithmOptions, extractable, usages)];
});

@@ -126,162 +167,6 @@ });

return __generator(this, function (_a) {
return [2 /*return*/, this.hasIECrypto() ?
this.msCryptoSign(key, data)
: window.crypto.subtle.sign(this._keygenAlgorithmOptions, key, data)];
return [2 /*return*/, this.subtleCrypto.sign(this.keygenAlgorithmOptions, key, data)];
});
});
};
/**
* Check whether IE crypto or other browser cryptography is available.
*/
BrowserCrypto.prototype.hasCryptoAPI = function () {
return this.hasIECrypto() || this.hasBrowserCrypto();
};
/**
* Checks whether IE crypto (AKA msCrypto) is available.
*/
BrowserCrypto.prototype.hasIECrypto = function () {
return "msCrypto" in window;
};
/**
* Check whether browser crypto is available.
*/
BrowserCrypto.prototype.hasBrowserCrypto = function () {
return "crypto" in window;
};
/**
* Helper function for SHA digest.
* @param algorithm
* @param data
*/
BrowserCrypto.prototype.getSubtleCryptoDigest = function (algorithm, data) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, window.crypto.subtle.digest(algorithm, data)];
});
});
};
/**
* IE Helper function for SHA digest.
* @param algorithm
* @param data
*/
BrowserCrypto.prototype.getMSCryptoDigest = function (algorithm, data) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, new Promise(function (resolve, reject) {
var digestOperation = window["msCrypto"].subtle.digest(algorithm, data.buffer);
digestOperation.addEventListener("complete", function (e) {
resolve(e.target.result);
});
digestOperation.addEventListener("error", function (error) {
reject(error);
});
})];
});
});
};
/**
* IE Helper function for generating a keypair
* @param extractable
* @param usages
*/
BrowserCrypto.prototype.msCryptoGenerateKey = function (extractable, usages) {
return __awaiter(this, void 0, void 0, function () {
var _this = this;
return __generator(this, function (_a) {
return [2 /*return*/, new Promise(function (resolve, reject) {
var msGenerateKey = window["msCrypto"].subtle.generateKey(_this._keygenAlgorithmOptions, extractable, usages);
msGenerateKey.addEventListener("complete", function (e) {
resolve(e.target.result);
});
msGenerateKey.addEventListener("error", function (error) {
reject(error);
});
})];
});
});
};
/**
* IE Helper function for exportKey
* @param key
* @param format
*/
BrowserCrypto.prototype.msCryptoExportJwk = function (key) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, new Promise(function (resolve, reject) {
var msExportKey = window["msCrypto"].subtle.exportKey(KEY_FORMAT_JWK, key);
msExportKey.addEventListener("complete", function (e) {
var resultBuffer = e.target.result;
var resultString = BrowserStringUtils.utf8ArrToString(new Uint8Array(resultBuffer))
.replace(/\r/g, Constants.EMPTY_STRING)
.replace(/\n/g, Constants.EMPTY_STRING)
.replace(/\t/g, Constants.EMPTY_STRING)
.split(" ").join(Constants.EMPTY_STRING)
.replace("\u0000", Constants.EMPTY_STRING);
try {
resolve(JSON.parse(resultString));
}
catch (e) {
reject(e);
}
});
msExportKey.addEventListener("error", function (error) {
reject(error);
});
})];
});
});
};
/**
* IE Helper function for importKey
* @param key
* @param format
* @param extractable
* @param usages
*/
BrowserCrypto.prototype.msCryptoImportKey = function (keyBuffer, extractable, usages) {
return __awaiter(this, void 0, void 0, function () {
var _this = this;
return __generator(this, function (_a) {
return [2 /*return*/, new Promise(function (resolve, reject) {
var msImportKey = window["msCrypto"].subtle.importKey(KEY_FORMAT_JWK, keyBuffer, _this._keygenAlgorithmOptions, extractable, usages);
msImportKey.addEventListener("complete", function (e) {
resolve(e.target.result);
});
msImportKey.addEventListener("error", function (error) {
reject(error);
});
})];
});
});
};
/**
* IE Helper function for sign JWT
* @param key
* @param data
*/
BrowserCrypto.prototype.msCryptoSign = function (key, data) {
return __awaiter(this, void 0, void 0, function () {
var _this = this;
return __generator(this, function (_a) {
return [2 /*return*/, new Promise(function (resolve, reject) {
var msSign = window["msCrypto"].subtle.sign(_this._keygenAlgorithmOptions, key, data);
msSign.addEventListener("complete", function (e) {
resolve(e.target.result);
});
msSign.addEventListener("error", function (error) {
reject(error);
});
})];
});
});
};
/**
* Returns stringified jwk.
* @param jwk
*/
BrowserCrypto.getJwkString = function (jwk) {
return JSON.stringify(jwk, Object.keys(jwk).sort());
};
return BrowserCrypto;

@@ -288,0 +173,0 @@ }());

import { ICrypto, IPerformanceClient, Logger, PkceCodes, SignedHttpRequest, SignedHttpRequestParameters } from "@azure/msal-common";
import { CryptoOptions } from "../config/Configuration";
export declare type CachedKeyPair = {

@@ -27,3 +28,3 @@ publicKey: CryptoKey;

private cache;
constructor(logger: Logger, performanceClient?: IPerformanceClient);
constructor(logger: Logger, performanceClient?: IPerformanceClient, cryptoConfig?: CryptoOptions);
/**

@@ -30,0 +31,0 @@ * Creates a new random GUID - used to populate state and nonce.

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

/*! @azure/msal-browser v2.28.3 2022-09-12 */
/*! @azure/msal-browser v2.29.0 2022-10-03 */
'use strict';

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

var CryptoOps = /** @class */ (function () {
function CryptoOps(logger, performanceClient) {
function CryptoOps(logger, performanceClient, cryptoConfig) {
this.logger = logger;
// Browser crypto needs to be validated first before any other classes can be set.
this.browserCrypto = new BrowserCrypto(this.logger);
this.browserCrypto = new BrowserCrypto(this.logger, cryptoConfig);
this.b64Encode = new Base64Encode();

@@ -89,3 +89,3 @@ this.b64Decode = new Base64Decode();

};
publicJwkString = BrowserCrypto.getJwkString(pubKeyThumprintObj);
publicJwkString = BrowserStringUtils.getSortedObjectString(pubKeyThumprintObj);
return [4 /*yield*/, this.hashString(publicJwkString)];

@@ -175,3 +175,3 @@ case 3:

publicKeyJwk = _b.sent();
publicKeyJwkString = BrowserCrypto.getJwkString(publicKeyJwk);
publicKeyJwkString = BrowserStringUtils.getSortedObjectString(publicKeyJwk);
encodedKeyIdThumbprint = this.b64Encode.urlEncode(JSON.stringify({ kid: kid }));

@@ -178,0 +178,0 @@ shrHeader = JoseHeader.getShrHeaderString({ kid: encodedKeyIdThumbprint, alg: publicKeyJwk.alg });

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

/*! @azure/msal-browser v2.28.3 2022-09-12 */
/*! @azure/msal-browser v2.29.0 2022-10-03 */
'use strict';

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

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

/*! @azure/msal-browser v2.28.3 2022-09-12 */
/*! @azure/msal-browser v2.29.0 2022-10-03 */
'use strict';

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

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

/*! @azure/msal-browser v2.28.3 2022-09-12 */
/*! @azure/msal-browser v2.29.0 2022-10-03 */
'use strict';

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

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

/*! @azure/msal-browser v2.28.3 2022-09-12 */
/*! @azure/msal-browser v2.29.0 2022-10-03 */
'use strict';

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

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

/*! @azure/msal-browser v2.28.3 2022-09-12 */
/*! @azure/msal-browser v2.29.0 2022-10-03 */
'use strict';

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

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

/*! @azure/msal-browser v2.28.3 2022-09-12 */
/*! @azure/msal-browser v2.29.0 2022-10-03 */
'use strict';

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

code: "silent_prompt_value_error",
desc: "The value given for the prompt value is not valid for silent requests - must be set to 'none'."
desc: "The value given for the prompt value is not valid for silent requests - must be set to 'none' or 'no_session'."
},

@@ -103,0 +103,0 @@ noTokenRequestCacheError: {

@@ -34,2 +34,6 @@ import { AuthError } from "@azure/msal-common";

};
entropyNotProvided: {
code: string;
desc: string;
};
};

@@ -63,3 +67,7 @@ /**

static createInMemoryRedirectUnavailableError(): BrowserConfigurationAuthError;
/**
* Creates an error thrown when a crypto interface that requires entropy is initialized without entropy
*/
static createEntropyNotProvided(): BrowserConfigurationAuthError;
}
//# sourceMappingURL=BrowserConfigurationAuthError.d.ts.map

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

/*! @azure/msal-browser v2.28.3 2022-09-12 */
/*! @azure/msal-browser v2.29.0 2022-10-03 */
'use strict';

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

desc: "Redirect cannot be supported. In-memory storage was selected and storeAuthStateInCookie=false, which would cause the library to be unable to handle the incoming hash. If you would like to use the redirect API, please use session/localStorage or set storeAuthStateInCookie=true."
},
entropyNotProvided: {
code: "entropy_not_provided",
desc: "The available browser crypto interface requires entropy set via system.cryptoOptions.entropy configuration option."
}

@@ -94,2 +98,8 @@ };

};
/**
* Creates an error thrown when a crypto interface that requires entropy is initialized without entropy
*/
BrowserConfigurationAuthError.createEntropyNotProvided = function () {
return new BrowserConfigurationAuthError(BrowserConfigurationAuthErrorMessage.entropyNotProvided.code, BrowserConfigurationAuthErrorMessage.entropyNotProvided.desc);
};
return BrowserConfigurationAuthError;

@@ -96,0 +106,0 @@ }(AuthError));

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

/*! @azure/msal-browser v2.28.3 2022-09-12 */
/*! @azure/msal-browser v2.29.0 2022-10-03 */
'use strict';

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

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

/*! @azure/msal-browser v2.28.3 2022-09-12 */
/*! @azure/msal-browser v2.29.0 2022-10-03 */
'use strict';

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

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

/*! @azure/msal-browser v2.28.3 2022-09-12 */
/*! @azure/msal-browser v2.29.0 2022-10-03 */
'use strict';

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

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

/*! @azure/msal-browser v2.28.3 2022-09-12 */
/*! @azure/msal-browser v2.29.0 2022-10-03 */
'use strict';

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

@@ -13,3 +13,3 @@ /**

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

@@ -16,0 +16,0 @@ export { BrowserAuthError, BrowserAuthErrorMessage } from "./error/BrowserAuthError";

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

/*! @azure/msal-browser v2.28.3 2022-09-12 */
/*! @azure/msal-browser v2.29.0 2022-10-03 */
'use strict';

@@ -7,3 +7,3 @@ import * as internals from './internals.js';

export { DEFAULT_IFRAME_TIMEOUT_MS } from './config/Configuration.js';
export { ApiId, BrowserCacheLocation, InteractionStatus, InteractionType, WrapperSKU } from './utils/BrowserConstants.js';
export { ApiId, BrowserCacheLocation, CacheLookupPolicy, InteractionStatus, InteractionType, WrapperSKU } from './utils/BrowserConstants.js';
export { BrowserUtils } from './utils/BrowserUtils.js';

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

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

/*! @azure/msal-browser v2.28.3 2022-09-12 */
/*! @azure/msal-browser v2.29.0 2022-10-03 */
'use strict';

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

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

/*! @azure/msal-browser v2.28.3 2022-09-12 */
/*! @azure/msal-browser v2.29.0 2022-10-03 */
'use strict';

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

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

/*! @azure/msal-browser v2.28.3 2022-09-12 */
/*! @azure/msal-browser v2.29.0 2022-10-03 */
'use strict';

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

success: true,
isNativeBroker: true
isNativeBroker: true,
requestId: result.requestId
});

@@ -75,0 +76,0 @@ return result;

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

/*! @azure/msal-browser v2.28.3 2022-09-12 */
/*! @azure/msal-browser v2.29.0 2022-10-03 */
'use strict';

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

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

/*! @azure/msal-browser v2.28.3 2022-09-12 */
/*! @azure/msal-browser v2.29.0 2022-10-03 */
'use strict';

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

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

/*! @azure/msal-browser v2.28.3 2022-09-12 */
/*! @azure/msal-browser v2.29.0 2022-10-03 */
'use strict';

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

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

/*! @azure/msal-browser v2.28.3 2022-09-12 */
/*! @azure/msal-browser v2.29.0 2022-10-03 */
'use strict';

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

@@ -16,3 +16,3 @@ import { AuthenticationResult, ICrypto, Logger, AuthorizationCodeClient, IPerformanceClient } from "@azure/msal-common";

/**
* Acquires a token silently by opening a hidden iframe to the /authorize endpoint with prompt=none
* Acquires a token silently by opening a hidden iframe to the /authorize endpoint with prompt=none or prompt=no_session
* @param request

@@ -19,0 +19,0 @@ */

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

/*! @azure/msal-browser v2.28.3 2022-09-12 */
/*! @azure/msal-browser v2.29.0 2022-10-03 */
'use strict';

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

/**
* Acquires a token silently by opening a hidden iframe to the /authorize endpoint with prompt=none
* Acquires a token silently by opening a hidden iframe to the /authorize endpoint with prompt=none or prompt=no_session
* @param request

@@ -41,4 +41,4 @@ */

}
// Check that prompt is set to none, throw error if it is set to anything else.
if (request.prompt && request.prompt !== PromptValue.NONE) {
// Check that prompt is set to none or no_session, throw error if it is set to anything else.
if (request.prompt && (request.prompt !== PromptValue.NONE) && (request.prompt !== PromptValue.NO_SESSION)) {
acquireTokenMeasurement.endMeasurement({

@@ -49,3 +49,3 @@ success: false

}
return [4 /*yield*/, this.initializeAuthorizationRequest(__assign(__assign({}, request), { prompt: PromptValue.NONE }), InteractionType.Silent)];
return [4 /*yield*/, this.initializeAuthorizationRequest(__assign(__assign({}, request), { prompt: request.prompt || PromptValue.NONE }), InteractionType.Silent)];
case 1:

@@ -65,3 +65,4 @@ silentRequest = _a.sent();

success: true,
fromCache: false
fromCache: false,
requestId: result.requestId
});

@@ -130,3 +131,3 @@ return result;

userRequestState = ProtocolUtils.parseRequestState(this.browserCrypto, state).userRequestState;
return [2 /*return*/, nativeInteractionClient.acquireToken(__assign(__assign({}, silentRequest), { state: userRequestState, prompt: PromptValue.NONE })).finally(function () {
return [2 /*return*/, nativeInteractionClient.acquireToken(__assign(__assign({}, silentRequest), { state: userRequestState, prompt: silentRequest.prompt || PromptValue.NONE })).finally(function () {
_this.browserStorage.cleanRequestByState(state);

@@ -133,0 +134,0 @@ })];

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

/*! @azure/msal-browser v2.28.3 2022-09-12 */
/*! @azure/msal-browser v2.29.0 2022-10-03 */
'use strict';

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

success: true,
fromCache: result.fromCache
fromCache: result.fromCache,
requestId: result.requestId
});

@@ -47,0 +48,0 @@ return result;

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

/*! @azure/msal-browser v2.28.3 2022-09-12 */
/*! @azure/msal-browser v2.29.0 2022-10-03 */
'use strict';

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

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

/*! @azure/msal-browser v2.28.3 2022-09-12 */
/*! @azure/msal-browser v2.29.0 2022-10-03 */
'use strict';

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

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

/*! @azure/msal-browser v2.28.3 2022-09-12 */
/*! @azure/msal-browser v2.29.0 2022-10-03 */
'use strict';

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

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

/*! @azure/msal-browser v2.28.3 2022-09-12 */
/*! @azure/msal-browser v2.29.0 2022-10-03 */
'use strict';

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

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

/*! @azure/msal-browser v2.28.3 2022-09-12 */
/*! @azure/msal-browser v2.29.0 2022-10-03 */
'use strict';

@@ -3,0 +3,0 @@ export { BrowserCacheManager } from './cache/BrowserCacheManager.js';

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

/*! @azure/msal-browser v2.28.3 2022-09-12 */
/*! @azure/msal-browser v2.29.0 2022-10-03 */
'use strict';

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

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

/*! @azure/msal-browser v2.28.3 2022-09-12 */
/*! @azure/msal-browser v2.29.0 2022-10-03 */
'use strict';

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

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

/*! @azure/msal-browser v2.28.3 2022-09-12 */
/*! @azure/msal-browser v2.29.0 2022-10-03 */
'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.28.3";
export declare const version = "2.29.0";
//# sourceMappingURL=packageMetadata.d.ts.map

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

/*! @azure/msal-browser v2.28.3 2022-09-12 */
/*! @azure/msal-browser v2.29.0 2022-10-03 */
'use strict';
/* eslint-disable header/header */
var name = "@azure/msal-browser";
var version = "2.28.3";
var version = "2.29.0";
export { name, version };
//# sourceMappingURL=packageMetadata.js.map

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

* create: will direct the user to the account creation experience instead of the log in experience
* no_session: will not read existing session token when authenticating the user. Upon user being successfully authenticated, EVO won’t create a new session for the user. FOR INTERNAL USE ONLY.
* - loginHint - Can be used to pre-fill the username/email address field of the sign-in page for the user, if you know the username/email address ahead of time. Often apps use this parameter during re-authentication, having already extracted the username from a previous sign-in using the login_hint or preferred_username claim.

@@ -21,0 +22,0 @@ * - sid - Session ID, unique identifier for the session. Available as an optional claim on ID tokens.

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

* create: will direct the user to the account creation experience instead of the log in experience
* no_session: will not read existing session token when authenticating the user. Upon user being successfully authenticated, EVO won’t create a new session for the user. FOR INTERNAL USE ONLY.
* - loginHint - Can be used to pre-fill the username/email address field of the sign-in page for the user, if you know the username/email address ahead of time. Often apps use this parameter during re-authentication, having already extracted the username from a previous sign-in using the login_hint or preferred_username claim.

@@ -20,0 +21,0 @@ * - sid - Session ID, unique identifier for the session. Available as an optional claim on ID tokens.

import { AccountInfo, CommonSilentFlowRequest, StringDict } from "@azure/msal-common";
import { CacheLookupPolicy } from "../utils/BrowserConstants";
/**

@@ -12,5 +13,9 @@ * SilentRequest: Request object passed by user to retrieve tokens from the

* - forceRefresh - Forces silent requests to make network calls if true.
* - extraQueryParameters - String to string map of custom query parameters added to the /authorize call. Only used when renewing the refresh token.
* - tokenQueryParameters - String to string map of custom query parameters added to the /token call. Only used when renewing access tokens.
* - extraQueryParameters - String to string map of custom query parameters added to the /authorize call. Only used when renewing the refresh token.
* - tokenQueryParameters - String to string map of custom query parameters added to the /token call. Only used when renewing access tokens.
* - 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. Only used for cases where refresh token is expired.
* - cacheLookupPolicy - Enum of different ways the silent token can be retrieved.
* - prompt - Indicates the type of user interaction that is required.
* none: will ensure that the user isn't presented with any interactive prompt. if request can't be completed via single-sign on, the endpoint will return an interaction_required error
* no_session: will not read existing session token when authenticating the user. Upon user being successfully authenticated, EVO won’t create a new session for the user. FOR INTERNAL USE ONLY.
*/

@@ -24,3 +29,5 @@ export declare type SilentRequest = Omit<CommonSilentFlowRequest, "authority" | "correlationId" | "forceRefresh" | "account" | "requestedClaimsHash"> & {

forceRefresh?: boolean;
cacheLookupPolicy?: CacheLookupPolicy;
prompt?: string;
};
//# sourceMappingURL=SilentRequest.d.ts.map

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

* create: will direct the user to the account creation experience instead of the log in experience
* no_session: will not read existing session token when authenticating the user. Upon user being successfully authenticated, EVO won’t create a new session for the user. FOR INTERNAL USE ONLY.
* - loginHint - Can be used to pre-fill the username/email address field of the sign-in page for the user, if you know the username/email address ahead of time. Often apps use this parameter during re-authentication, having already extracted the username from a previous sign-in using the login_hint or preferred_username claim.

@@ -20,0 +21,0 @@ * - sid - Session ID, unique identifier for the session. Available as an optional claim on ID tokens.

import { Logger, PerformanceEvents, IPerformanceClient, PerformanceClient, IPerformanceMeasurement, InProgressPerformanceEvent, ApplicationTelemetry } from "@azure/msal-common";
import { CryptoOptions } from "../config/Configuration";
export declare class BrowserPerformanceClient extends PerformanceClient implements IPerformanceClient {
private browserCrypto;
private guidGenerator;
constructor(clientId: string, authority: string, logger: Logger, libraryName: string, libraryVersion: string, applicationTelemetry: ApplicationTelemetry);
constructor(clientId: string, authority: string, logger: Logger, libraryName: string, libraryVersion: string, applicationTelemetry: ApplicationTelemetry, cryptoOptions: CryptoOptions);
startPerformanceMeasuremeant(measureName: string, correlationId: string): IPerformanceMeasurement;

@@ -7,0 +8,0 @@ generateId(): string;

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

/*! @azure/msal-browser v2.28.3 2022-09-12 */
/*! @azure/msal-browser v2.29.0 2022-10-03 */
'use strict';

@@ -15,5 +15,5 @@ import { __extends, __assign } from '../_virtual/_tslib.js';

__extends(BrowserPerformanceClient, _super);
function BrowserPerformanceClient(clientId, authority, logger, libraryName, libraryVersion, applicationTelemetry) {
function BrowserPerformanceClient(clientId, authority, logger, libraryName, libraryVersion, applicationTelemetry, cryptoOptions) {
var _this = _super.call(this, clientId, authority, logger, libraryName, libraryVersion, applicationTelemetry) || this;
_this.browserCrypto = new BrowserCrypto(_this.logger);
_this.browserCrypto = new BrowserCrypto(_this.logger, cryptoOptions);
_this.guidGenerator = new GuidGenerator(_this.browserCrypto);

@@ -20,0 +20,0 @@ return _this;

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

/*! @azure/msal-browser v2.28.3 2022-09-12 */
/*! @azure/msal-browser v2.29.0 2022-10-03 */
'use strict';

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

@@ -154,2 +154,10 @@ import { PopupRequest } from "../request/PopupRequest";

export declare const DB_TABLE_NAME: string;
export declare enum CacheLookupPolicy {
Default = 0,
AccessToken = 1,
AccessTokenAndRefreshToken = 2,
RefreshToken = 3,
RefreshTokenAndNetwork = 4,
Skip = 5
}
//# sourceMappingURL=BrowserConstants.d.ts.map

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

/*! @azure/msal-browser v2.28.3 2022-09-12 */
/*! @azure/msal-browser v2.29.0 2022-10-03 */
'use strict';

@@ -176,4 +176,41 @@ import { OIDC_DEFAULT_SCOPES } from '@azure/msal-common';

var DB_TABLE_NAME = DB_NAME + ".keys";
var CacheLookupPolicy;
(function (CacheLookupPolicy) {
/*
* acquireTokenSilent will attempt to retrieve an access token from the cache. If the access token is expired
* or cannot be found the refresh token will be used to acquire a new one. Finally, if the refresh token
* is expired acquireTokenSilent will attempt to acquire new access and refresh tokens.
*/
CacheLookupPolicy[CacheLookupPolicy["Default"] = 0] = "Default";
/*
* acquireTokenSilent will only look for access tokens in the cache. It will not attempt to renew access or
* refresh tokens.
*/
CacheLookupPolicy[CacheLookupPolicy["AccessToken"] = 1] = "AccessToken";
/*
* acquireTokenSilent will attempt to retrieve an access token from the cache. If the access token is expired or
* cannot be found, the refresh token will be used to acquire a new one. If the refresh token is expired, it
* will not be renewed and acquireTokenSilent will fail.
*/
CacheLookupPolicy[CacheLookupPolicy["AccessTokenAndRefreshToken"] = 2] = "AccessTokenAndRefreshToken";
/*
* acquireTokenSilent will not attempt to retrieve access tokens from the cache and will instead attempt to
* exchange the cached refresh token for a new access token. If the refresh token is expired, it will not be
* renewed and acquireTokenSilent will fail.
*/
CacheLookupPolicy[CacheLookupPolicy["RefreshToken"] = 3] = "RefreshToken";
/*
* acquireTokenSilent will not look in the cache for the access token. It will go directly to network with the
* cached refresh token. If the refresh token is expired an attempt will be made to renew it. This is equivalent to
* setting "forceRefresh: true".
*/
CacheLookupPolicy[CacheLookupPolicy["RefreshTokenAndNetwork"] = 4] = "RefreshTokenAndNetwork";
/*
* acquireTokenSilent will attempt to renew both access and refresh tokens. It will not look in the cache. This will
* always fail if 3rd party cookies are blocked by the browser.
*/
CacheLookupPolicy[CacheLookupPolicy["Skip"] = 5] = "Skip";
})(CacheLookupPolicy || (CacheLookupPolicy = {}));
export { ApiId, BrowserCacheLocation, BrowserConstants, DB_NAME, DB_TABLE_NAME, DB_VERSION, DEFAULT_REQUEST, HTTP_REQUEST_TYPE, InMemoryCacheKeys, InteractionStatus, InteractionType, KEY_FORMAT_JWK, NativeConstants, NativeExtensionMethod, TemporaryCacheKeys, WrapperSKU };
export { ApiId, BrowserCacheLocation, BrowserConstants, CacheLookupPolicy, DB_NAME, DB_TABLE_NAME, DB_VERSION, DEFAULT_REQUEST, HTTP_REQUEST_TYPE, InMemoryCacheKeys, InteractionStatus, InteractionType, KEY_FORMAT_JWK, NativeConstants, NativeExtensionMethod, TemporaryCacheKeys, WrapperSKU };
//# sourceMappingURL=BrowserConstants.js.map

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

/*! @azure/msal-browser v2.28.3 2022-09-12 */
/*! @azure/msal-browser v2.29.0 2022-10-03 */
'use strict';

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

@@ -21,3 +21,8 @@ /**

static utf8ArrToString(aBytes: Uint8Array): string;
/**
* Returns stringified jwk.
* @param jwk
*/
static getSortedObjectString(obj: object): string;
}
//# sourceMappingURL=BrowserStringUtils.d.ts.map

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

/*! @azure/msal-browser v2.28.3 2022-09-12 */
/*! @azure/msal-browser v2.29.0 2022-10-03 */
'use strict';

@@ -111,2 +111,9 @@ import { Constants } from '@azure/msal-common';

};
/**
* Returns stringified jwk.
* @param jwk
*/
BrowserStringUtils.getSortedObjectString = function (obj) {
return JSON.stringify(obj, Object.keys(obj).sort());
};
return BrowserStringUtils;

@@ -113,0 +120,0 @@ }());

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

/*! @azure/msal-browser v2.28.3 2022-09-12 */
/*! @azure/msal-browser v2.29.0 2022-10-03 */
'use strict';

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

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

/*! @azure/msal-browser v2.28.3 2022-09-12 */
/*! @azure/msal-browser v2.29.0 2022-10-03 */
'use strict';

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

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

},
"version": "2.28.3",
"version": "2.29.0",
"description": "Microsoft Authentication Library for js",

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

"dependencies": {
"@azure/msal-common": "^7.4.1"
"@azure/msal-common": "^7.5.0"
}
}

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 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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc