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.20.0 to 2.21.0

29

CHANGELOG.json

@@ -5,2 +5,31 @@ {

{
"date": "Tue, 04 Jan 2022 00:20:29 GMT",
"tag": "@azure/msal-browser_v2.21.0",
"version": "2.21.0",
"comments": {
"minor": [
{
"author": "hemoral@microsoft.com",
"package": "@azure/msal-browser",
"commit": "60e2cfc0e9daa3c24e994617b4ac42aef6880b74",
"comment": "Add support for requested claims in silent token acquisition #4296"
},
{
"author": "beachball",
"package": "@azure/msal-browser",
"comment": "Bump @azure/msal-common to v6.0.0",
"commit": "bd9b1af91c278926ab2e6943cf90817a7ac4957b"
}
],
"patch": [
{
"author": "janutter@microsoft.com",
"package": "@azure/msal-browser",
"commit": "e3c66105f3bf617dc4fd06905e04b37e865c303c",
"comment": "Clear interaction status even if there is no ongoing request #4314"
}
]
}
},
{
"date": "Tue, 07 Dec 2021 00:17:01 GMT",

@@ -7,0 +36,0 @@ "tag": "@azure/msal-browser_v2.20.0",

15

CHANGELOG.md
# Change Log - @azure/msal-browser
This log was last generated on Tue, 07 Dec 2021 00:17:01 GMT and should not be manually modified.
This log was last generated on Tue, 04 Jan 2022 00:20:29 GMT and should not be manually modified.
<!-- Start content -->
## 2.21.0
Tue, 04 Jan 2022 00:20:29 GMT
### Minor changes
- Add support for requested claims in silent token acquisition #4296 (hemoral@microsoft.com)
- Bump @azure/msal-common to v6.0.0
### Patches
- Clear interaction status even if there is no ongoing request #4314 (janutter@microsoft.com)
## 2.20.0

@@ -8,0 +21,0 @@

2

dist/_virtual/_tslib.js

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

/*! @azure/msal-browser v2.20.0 2021-12-07 */
/*! @azure/msal-browser v2.21.0 2022-01-04 */
'use strict';

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

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

/*! @azure/msal-browser v2.20.0 2021-12-07 */
/*! @azure/msal-browser v2.21.0 2022-01-04 */
'use strict';

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

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

/*! @azure/msal-browser v2.20.0 2021-12-07 */
/*! @azure/msal-browser v2.21.0 2022-01-04 */
'use strict';

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

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

/*! @azure/msal-browser v2.20.0 2021-12-07 */
/*! @azure/msal-browser v2.21.0 2022-01-04 */
'use strict';

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

homeAccountIdentifier: account.homeAccountId,
claims: request.claims,
authenticationScheme: request.authenticationScheme,

@@ -101,3 +102,2 @@ resourceRequestMethod: request.resourceRequestMethod,

shrClaims: request.shrClaims,
sshJwk: request.sshJwk,
sshKid: request.sshKid

@@ -139,24 +139,29 @@ };

return __generator(this, function (_a) {
silentCacheClient = new SilentCacheClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, request.correlationId);
silentRequest = silentCacheClient.initializeSilentRequest(request, account);
this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_START, InteractionType.Silent, request);
return [2 /*return*/, silentCacheClient.acquireToken(silentRequest).catch(function () { return __awaiter(_this, void 0, void 0, function () {
var tokenRenewalResult, tokenRenewalError_1;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
_a.trys.push([0, 2, , 3]);
return [4 /*yield*/, this.acquireTokenByRefreshToken(silentRequest)];
case 1:
tokenRenewalResult = _a.sent();
this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, InteractionType.Silent, tokenRenewalResult);
return [2 /*return*/, tokenRenewalResult];
case 2:
tokenRenewalError_1 = _a.sent();
this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_FAILURE, InteractionType.Silent, null, tokenRenewalError_1);
throw tokenRenewalError_1;
case 3: return [2 /*return*/];
}
});
}); })];
switch (_a.label) {
case 0:
silentCacheClient = new SilentCacheClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, request.correlationId);
return [4 /*yield*/, silentCacheClient.initializeSilentRequest(request, account)];
case 1:
silentRequest = _a.sent();
this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_START, InteractionType.Silent, request);
return [2 /*return*/, silentCacheClient.acquireToken(silentRequest).catch(function () { return __awaiter(_this, void 0, void 0, function () {
var tokenRenewalResult, tokenRenewalError_1;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
_a.trys.push([0, 2, , 3]);
return [4 /*yield*/, this.acquireTokenByRefreshToken(silentRequest)];
case 1:
tokenRenewalResult = _a.sent();
this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, InteractionType.Silent, tokenRenewalResult);
return [2 /*return*/, tokenRenewalResult];
case 2:
tokenRenewalError_1 = _a.sent();
this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_FAILURE, InteractionType.Silent, null, tokenRenewalError_1);
throw tokenRenewalError_1;
case 3: return [2 /*return*/];
}
});
}); })];
}
});

@@ -163,0 +168,0 @@ });

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

/*! @azure/msal-browser v2.20.0 2021-12-07 */
/*! @azure/msal-browser v2.21.0 2022-01-04 */
'use strict';

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

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

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

@@ -291,4 +291,8 @@ import { InteractionType } from "../utils/BrowserConstants";

getLegacyLoginHint(): string | null;
/**
* Updates a credential's cache key if the current cache key is outdated
*/
updateCredentialCacheKey(currentCacheKey: string, credential: ValidCredentialType): string;
}
export declare const DEFAULT_BROWSER_CACHE_MANAGER: (clientId: string, logger: Logger) => BrowserCacheManager;
//# sourceMappingURL=BrowserCacheManager.d.ts.map

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

/*! @azure/msal-browser v2.20.0 2021-12-07 */
/*! @azure/msal-browser v2.21.0 2022-01-04 */
'use strict';

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

this.clearMsalCookies();
this.setInteractionInProgress(false);
};

@@ -853,2 +854,21 @@ BrowserCacheManager.prototype.cacheCodeRequest = function (authCodeRequest, browserCrypto) {

};
/**
* Updates a credential's cache key if the current cache key is outdated
*/
BrowserCacheManager.prototype.updateCredentialCacheKey = function (currentCacheKey, credential) {
var updatedCacheKey = credential.generateCredentialKey();
if (currentCacheKey !== updatedCacheKey) {
var cacheItem = this.getItem(currentCacheKey);
if (cacheItem) {
this.removeItem(currentCacheKey);
this.setItem(updatedCacheKey, cacheItem);
this.logger.verbose("Updated an outdated " + credential.credentialType + " cache key");
return updatedCacheKey;
}
else {
this.logger.error("Attempted to update an outdated " + credential.credentialType + " cache key but no item matching the outdated key was found in storage");
}
}
return currentCacheKey;
};
return BrowserCacheManager;

@@ -855,0 +875,0 @@ }(CacheManager));

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

/*! @azure/msal-browser v2.20.0 2021-12-07 */
/*! @azure/msal-browser v2.21.0 2022-01-04 */
'use strict';

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

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

/*! @azure/msal-browser v2.20.0 2021-12-07 */
/*! @azure/msal-browser v2.21.0 2022-01-04 */
'use strict';

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

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

/*! @azure/msal-browser v2.20.0 2021-12-07 */
/*! @azure/msal-browser v2.21.0 2022-01-04 */
'use strict';

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

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

/*! @azure/msal-browser v2.20.0 2021-12-07 */
/*! @azure/msal-browser v2.21.0 2022-01-04 */
'use strict';

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

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

/*! @azure/msal-browser v2.20.0 2021-12-07 */
/*! @azure/msal-browser v2.21.0 2022-01-04 */
'use strict';

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

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

/*! @azure/msal-browser v2.20.0 2021-12-07 */
/*! @azure/msal-browser v2.21.0 2022-01-04 */
'use strict';

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

@@ -70,3 +70,8 @@ import { ICrypto, Logger, PkceCodes, SignedHttpRequest, SignedHttpRequestParameters } from "@azure/msal-common";

signJwt(payload: SignedHttpRequest, kid: string): Promise<string>;
/**
* Returns the SHA-256 hash of an input string
* @param plainText
*/
hashString(plainText: string): Promise<string>;
}
//# sourceMappingURL=CryptoOps.d.ts.map

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

/*! @azure/msal-browser v2.20.0 2021-12-07 */
/*! @azure/msal-browser v2.21.0 2022-01-04 */
'use strict';

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

return __awaiter(this, void 0, void 0, function () {
var keyPair, publicKeyJwk, pubKeyThumprintObj, publicJwkString, publicJwkBuffer, publicJwkHash, privateKeyJwk, unextractablePrivateKey;
var keyPair, publicKeyJwk, pubKeyThumprintObj, publicJwkString, publicJwkHash, privateKeyJwk, unextractablePrivateKey;
return __generator(this, function (_a) {

@@ -89,6 +89,5 @@ switch (_a.label) {

publicJwkString = BrowserCrypto.getJwkString(pubKeyThumprintObj);
return [4 /*yield*/, this.browserCrypto.sha256Digest(publicJwkString)];
return [4 /*yield*/, this.hashString(publicJwkString)];
case 3:
publicJwkBuffer = _a.sent();
publicJwkHash = this.b64Encode.urlEncodeArr(new Uint8Array(publicJwkBuffer));
publicJwkHash = _a.sent();
return [4 /*yield*/, this.browserCrypto.exportJwk(keyPair.privateKey)];

@@ -200,2 +199,20 @@ case 4:

};
/**
* Returns the SHA-256 hash of an input string
* @param plainText
*/
CryptoOps.prototype.hashString = function (plainText) {
return __awaiter(this, void 0, void 0, function () {
var hashBuffer, hashBytes;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this.browserCrypto.sha256Digest(plainText)];
case 1:
hashBuffer = _a.sent();
hashBytes = new Uint8Array(hashBuffer);
return [2 /*return*/, this.b64Encode.urlEncodeArr(hashBytes)];
}
});
});
};
CryptoOps.POP_KEY_USAGES = ["sign", "verify"];

@@ -202,0 +219,0 @@ CryptoOps.EXTRACTABLE = true;

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

/*! @azure/msal-browser v2.20.0 2021-12-07 */
/*! @azure/msal-browser v2.21.0 2022-01-04 */
'use strict';

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

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

/*! @azure/msal-browser v2.20.0 2021-12-07 */
/*! @azure/msal-browser v2.21.0 2022-01-04 */
'use strict';

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

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

/*! @azure/msal-browser v2.20.0 2021-12-07 */
/*! @azure/msal-browser v2.21.0 2022-01-04 */
'use strict';

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

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

/*! @azure/msal-browser v2.20.0 2021-12-07 */
/*! @azure/msal-browser v2.21.0 2022-01-04 */
'use strict';

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

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

/*! @azure/msal-browser v2.20.0 2021-12-07 */
/*! @azure/msal-browser v2.21.0 2022-01-04 */
'use strict';

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

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

/*! @azure/msal-browser v2.20.0 2021-12-07 */
/*! @azure/msal-browser v2.21.0 2022-01-04 */
'use strict';

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

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

/*! @azure/msal-browser v2.20.0 2021-12-07 */
/*! @azure/msal-browser v2.21.0 2022-01-04 */
'use strict';

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

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

/*! @azure/msal-browser v2.20.0 2021-12-07 */
/*! @azure/msal-browser v2.21.0 2022-01-04 */
'use strict';

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

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

/*! @azure/msal-browser v2.20.0 2021-12-07 */
/*! @azure/msal-browser v2.21.0 2022-01-04 */
'use strict';

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

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

/*! @azure/msal-browser v2.20.0 2021-12-07 */
/*! @azure/msal-browser v2.21.0 2022-01-04 */
'use strict';

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

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

/*! @azure/msal-browser v2.20.0 2021-12-07 */
/*! @azure/msal-browser v2.21.0 2022-01-04 */
'use strict';

@@ -3,0 +3,0 @@ export { PublicClientApplication } from './app/PublicClientApplication.js';

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

*/
protected initializeBaseRequest(request: Partial<BaseAuthRequest>): BaseAuthRequest;
protected initializeBaseRequest(request: Partial<BaseAuthRequest>): Promise<BaseAuthRequest>;
/**

@@ -28,0 +28,0 @@ *

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

/*! @azure/msal-browser v2.20.0 2021-12-07 */
/*! @azure/msal-browser v2.21.0 2022-01-04 */
'use strict';
import { __awaiter, __generator, __spread, __assign } from '../_virtual/_tslib.js';
import { AccountEntity, AuthenticationScheme, ClientConfigurationError, UrlString, ServerTelemetryManager } from '@azure/msal-common';
import { __awaiter, __generator, __assign, __spread } from '../_virtual/_tslib.js';
import { AccountEntity, AuthenticationScheme, ClientConfigurationError, StringUtils, UrlString, ServerTelemetryManager } from '@azure/msal-common';
import { version } from '../packageMetadata.js';

@@ -74,24 +74,39 @@ import { BrowserConstants } from '../utils/BrowserConstants.js';

BaseInteractionClient.prototype.initializeBaseRequest = function (request) {
this.logger.verbose("Initializing BaseAuthRequest");
var authority = request.authority || this.config.auth.authority;
var scopes = __spread(((request && request.scopes) || []));
// Set authenticationScheme to BEARER if not explicitly set in the request
if (!request.authenticationScheme) {
request.authenticationScheme = AuthenticationScheme.BEARER;
this.logger.verbose("Authentication Scheme wasn't explicitly set in request, defaulting to \"Bearer\" request");
}
else {
if (request.authenticationScheme === AuthenticationScheme.SSH) {
if (!request.sshJwk) {
throw ClientConfigurationError.createMissingSshJwkError();
return __awaiter(this, void 0, void 0, function () {
var authority, scopes, _a, validatedRequest;
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
this.logger.verbose("Initializing BaseAuthRequest");
authority = request.authority || this.config.auth.authority;
scopes = __spread(((request && request.scopes) || []));
// Set authenticationScheme to BEARER if not explicitly set in the request
if (!request.authenticationScheme) {
request.authenticationScheme = AuthenticationScheme.BEARER;
this.logger.verbose("Authentication Scheme wasn't explicitly set in request, defaulting to \"Bearer\" request");
}
else {
if (request.authenticationScheme === AuthenticationScheme.SSH) {
if (!request.sshJwk) {
throw ClientConfigurationError.createMissingSshJwkError();
}
if (!request.sshKid) {
throw ClientConfigurationError.createMissingSshKidError();
}
}
this.logger.verbose("Authentication Scheme set to \"" + request.authenticationScheme + "\" as configured in Auth request");
}
if (!(request.claims && !StringUtils.isEmpty(request.claims))) return [3 /*break*/, 2];
_a = request;
return [4 /*yield*/, this.browserCrypto.hashString(request.claims)];
case 1:
_a.requestedClaimsHash = _b.sent();
_b.label = 2;
case 2:
validatedRequest = __assign(__assign({}, request), { correlationId: this.correlationId, authority: authority,
scopes: scopes });
return [2 /*return*/, validatedRequest];
}
if (!request.sshKid) {
throw ClientConfigurationError.createMissingSshKidError();
}
}
this.logger.verbose("Authentication Scheme set to \"" + request.authenticationScheme + "\" as configured in Auth request");
}
var validatedRequest = __assign(__assign({}, request), { correlationId: this.correlationId, authority: authority,
scopes: scopes });
return validatedRequest;
});
});
};

@@ -98,0 +113,0 @@ /**

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

/*! @azure/msal-browser v2.20.0 2021-12-07 */
/*! @azure/msal-browser v2.21.0 2022-01-04 */
'use strict';

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

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

/*! @azure/msal-browser v2.20.0 2021-12-07 */
/*! @azure/msal-browser v2.21.0 2022-01-04 */
'use strict';

@@ -26,22 +26,32 @@ import { __extends, __awaiter, __generator } from '../_virtual/_tslib.js';

PopupClient.prototype.acquireToken = function (request) {
try {
var validRequest = this.preflightInteractiveRequest(request, InteractionType.Popup);
var popupName = PopupUtils.generatePopupName(this.config.auth.clientId, validRequest);
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(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");
var popup = PopupUtils.openSizedPopup("about:blank", popupName, popupWindowAttributes, this.logger);
return this.acquireTokenPopupAsync(validRequest, popupName, popupWindowAttributes, popup);
}
}
catch (e) {
return Promise.reject(e);
}
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*/];
}
});
});
};

@@ -89,3 +99,3 @@ /**

return __awaiter(this, void 0, void 0, function () {
var serverTelemetryManager, authCodeRequest, authClient, navigateUrl, interactionHandler, popupParameters, popupWindow, hash, state, result, e_1;
var serverTelemetryManager, authCodeRequest, authClient, navigateUrl, interactionHandler, popupParameters, popupWindow, hash, state, result, e_2;
return __generator(this, function (_a) {

@@ -128,3 +138,3 @@ switch (_a.label) {

case 7:
e_1 = _a.sent();
e_2 = _a.sent();
if (popup) {

@@ -134,8 +144,8 @@ // Close the synchronous popup if an error is thrown before the window unload event is registered

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

@@ -157,3 +167,3 @@ }

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

@@ -194,4 +204,4 @@ switch (_a.label) {

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

@@ -216,3 +226,3 @@ case 7:

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

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

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

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

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

/*! @azure/msal-browser v2.20.0 2021-12-07 */
/*! @azure/msal-browser v2.21.0 2022-01-04 */
'use strict';

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

import { StandardInteractionClient } from './StandardInteractionClient.js';
import { InteractionType, ApiId, TemporaryCacheKeys } from '../utils/BrowserConstants.js';
import { ApiId, InteractionType, TemporaryCacheKeys } from '../utils/BrowserConstants.js';
import { RedirectHandler } from '../interaction_handler/RedirectHandler.js';

@@ -31,13 +31,14 @@ import { BrowserUtils } from '../utils/BrowserUtils.js';

switch (_a.label) {
case 0:
validRequest = this.preflightInteractiveRequest(request, InteractionType.Redirect);
case 0: return [4 /*yield*/, this.preflightInteractiveRequest(request, InteractionType.Redirect)];
case 1:
validRequest = _a.sent();
serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenRedirect);
_a.label = 1;
case 1:
_a.trys.push([1, 6, , 7]);
_a.label = 2;
case 2:
_a.trys.push([2, 7, , 8]);
return [4 /*yield*/, this.initializeAuthorizationCodeRequest(validRequest)];
case 2:
case 3:
authCodeRequest = _a.sent();
return [4 /*yield*/, this.createAuthCodeClient(serverTelemetryManager, validRequest.authority)];
case 3:
case 4:
authClient = _a.sent();

@@ -47,3 +48,3 @@ this.logger.verbose("Auth code client created");

return [4 /*yield*/, authClient.getAuthCodeUrl(validRequest)];
case 4:
case 5:
navigateUrl = _a.sent();

@@ -58,6 +59,6 @@ redirectStartPage = this.getRedirectStartPage(request.redirectStartPage);

})];
case 5:
case 6:
// Show the UI once the url has been created. Response will come back in the hash, which will be handled in the handleRedirectCallback function.
return [2 /*return*/, _a.sent()];
case 6:
case 7:
e_1 = _a.sent();

@@ -70,3 +71,3 @@ if (e_1 instanceof AuthError) {

throw e_1;
case 7: return [2 /*return*/];
case 8: return [2 /*return*/];
}

@@ -73,0 +74,0 @@ });

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

/*! @azure/msal-browser v2.20.0 2021-12-07 */
/*! @azure/msal-browser v2.21.0 2022-01-04 */
'use strict';

@@ -37,10 +37,12 @@ import { __extends, __awaiter, __generator, __assign } from '../_virtual/_tslib.js';

}
silentRequest = this.initializeAuthorizationRequest(request, InteractionType.Silent);
return [4 /*yield*/, this.initializeAuthorizationRequest(request, InteractionType.Silent)];
case 1:
silentRequest = _a.sent();
serverTelemetryManager = this.initializeServerTelemetryManager(this.apiId);
_a.label = 1;
case 1:
_a.trys.push([1, 3, , 4]);
_a.label = 2;
case 2:
_a.trys.push([2, 4, , 5]);
authCodeRequest = __assign(__assign({}, silentRequest), { code: request.code });
return [4 /*yield*/, this.getClientConfiguration(serverTelemetryManager, silentRequest.authority)];
case 2:
case 3:
clientConfig = _a.sent();

@@ -57,3 +59,3 @@ authClient = new HybridSpaAuthorizationCodeClient(clientConfig);

}, silentRequest.state, authClient.authority, this.networkClient, false)];
case 3:
case 4:
e_1 = _a.sent();

@@ -66,3 +68,3 @@ if (e_1 instanceof AuthError) {

throw e_1;
case 4: return [2 /*return*/];
case 5: return [2 /*return*/];
}

@@ -69,0 +71,0 @@ });

@@ -20,4 +20,4 @@ import { StandardInteractionClient } from "./StandardInteractionClient";

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

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

/*! @azure/msal-browser v2.20.0 2021-12-07 */
/*! @azure/msal-browser v2.21.0 2022-01-04 */
'use strict';

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

SilentCacheClient.prototype.initializeSilentRequest = function (request, account) {
return __assign(__assign(__assign({}, request), this.initializeBaseRequest(request)), { account: account, forceRefresh: request.forceRefresh || false });
return __awaiter(this, void 0, void 0, function () {
var _a;
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_a = [__assign({}, request)];
return [4 /*yield*/, this.initializeBaseRequest(request)];
case 1: return [2 /*return*/, __assign.apply(void 0, [__assign.apply(void 0, _a.concat([_b.sent()])), { account: account, forceRefresh: request.forceRefresh || false }])];
}
});
});
};

@@ -82,0 +92,0 @@ return SilentCacheClient;

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

/*! @azure/msal-browser v2.20.0 2021-12-07 */
/*! @azure/msal-browser v2.21.0 2022-01-04 */
'use strict';

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

}
silentRequest = this.initializeAuthorizationRequest(__assign(__assign({}, request), { prompt: PromptValue.NONE }), InteractionType.Silent);
return [4 /*yield*/, this.initializeAuthorizationRequest(__assign(__assign({}, request), { prompt: PromptValue.NONE }), InteractionType.Silent)];
case 1:
silentRequest = _a.sent();
serverTelemetryManager = this.initializeServerTelemetryManager(this.apiId);
_a.label = 1;
case 1:
_a.trys.push([1, 6, , 7]);
_a.label = 2;
case 2:
_a.trys.push([2, 7, , 8]);
return [4 /*yield*/, this.initializeAuthorizationCodeRequest(silentRequest)];
case 2:
case 3:
authCodeRequest = _a.sent();
return [4 /*yield*/, this.createAuthCodeClient(serverTelemetryManager, silentRequest.authority)];
case 3:
case 4:
authClient = _a.sent();
this.logger.verbose("Auth code client created");
return [4 /*yield*/, authClient.getAuthCodeUrl(silentRequest)];
case 4:
case 5:
navigateUrl = _a.sent();
return [4 /*yield*/, this.silentTokenHelper(navigateUrl, authCodeRequest, authClient, this.logger)];
case 5: return [2 /*return*/, _a.sent()];
case 6:
case 6: return [2 /*return*/, _a.sent()];
case 7:
e_1 = _a.sent();

@@ -66,3 +68,3 @@ if (e_1 instanceof AuthError) {

throw e_1;
case 7: return [2 /*return*/];
case 8: return [2 /*return*/];
}

@@ -69,0 +71,0 @@ });

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

/*! @azure/msal-browser v2.20.0 2021-12-07 */
/*! @azure/msal-browser v2.21.0 2022-01-04 */
'use strict';

@@ -24,12 +24,15 @@ import { __extends, __awaiter, __generator, __assign } from '../_virtual/_tslib.js';

return __awaiter(this, void 0, void 0, function () {
var silentRequest, serverTelemetryManager, refreshTokenClient;
var silentRequest, _a, serverTelemetryManager, refreshTokenClient;
var _this = this;
return __generator(this, function (_a) {
switch (_a.label) {
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
silentRequest = __assign(__assign({}, request), this.initializeBaseRequest(request));
_a = [__assign({}, request)];
return [4 /*yield*/, this.initializeBaseRequest(request)];
case 1:
silentRequest = __assign.apply(void 0, _a.concat([_b.sent()]));
serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenSilent_silentFlow);
return [4 /*yield*/, this.createRefreshTokenClient(serverTelemetryManager, silentRequest.authority)];
case 1:
refreshTokenClient = _a.sent();
case 2:
refreshTokenClient = _b.sent();
this.logger.verbose("Refresh token client created");

@@ -36,0 +39,0 @@ // Send request to renew token. Auth module will throw errors if token cannot be renewed.

@@ -58,3 +58,3 @@ import { ICrypto, Logger, ServerTelemetryManager, CommonAuthorizationCodeRequest, AuthorizationCodeClient, ClientConfiguration, Authority, CommonEndSessionRequest } from "@azure/msal-common";

*/
protected preflightInteractiveRequest(request: RedirectRequest | PopupRequest, interactionType: InteractionType): AuthorizationUrlRequest;
protected preflightInteractiveRequest(request: RedirectRequest | PopupRequest, interactionType: InteractionType): Promise<AuthorizationUrlRequest>;
/**

@@ -65,4 +65,4 @@ * Helper to initialize required request parameters for interactive APIs and ssoSilent()

*/
protected initializeAuthorizationRequest(request: RedirectRequest | PopupRequest | SsoSilentRequest, interactionType: InteractionType): AuthorizationUrlRequest;
protected initializeAuthorizationRequest(request: RedirectRequest | PopupRequest | SsoSilentRequest, interactionType: InteractionType): Promise<AuthorizationUrlRequest>;
}
//# sourceMappingURL=StandardInteractionClient.d.ts.map

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

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

@@ -207,10 +207,18 @@ import { BrowserConstants } from '../utils/BrowserConstants.js';

StandardInteractionClient.prototype.preflightInteractiveRequest = function (request, interactionType) {
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 this.initializeAuthorizationRequest(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)];
case 1: return [2 /*return*/, _a.sent()];
}
});
});
};

@@ -223,24 +231,35 @@ /**

StandardInteractionClient.prototype.initializeAuthorizationRequest = function (request, interactionType) {
this.logger.verbose("initializeAuthorizationRequest called");
var redirectUri = this.getRedirectUri(request.redirectUri);
var browserState = {
interactionType: interactionType
};
var state = ProtocolUtils.setRequestState(this.browserCrypto, (request && request.state) || "", browserState);
var validatedRequest = __assign(__assign({}, this.initializeBaseRequest(request)), { redirectUri: redirectUri, state: state, nonce: request.nonce || this.browserCrypto.createNewGuid(), responseMode: ResponseMode.FRAGMENT });
var account = request.account || this.browserStorage.getActiveAccount();
if (account) {
this.logger.verbose("Setting validated request account");
this.logger.verbosePii("Setting validated request account: " + account);
validatedRequest.account = account;
}
// Check for ADAL/MSAL v1 SSO
if (StringUtils.isEmpty(validatedRequest.loginHint) && !account) {
var legacyLoginHint = this.browserStorage.getLegacyLoginHint();
if (legacyLoginHint) {
validatedRequest.loginHint = legacyLoginHint;
}
}
this.browserStorage.updateCacheEntries(validatedRequest.state, validatedRequest.nonce, validatedRequest.authority, validatedRequest.loginHint || "", validatedRequest.account || null);
return validatedRequest;
return __awaiter(this, void 0, void 0, function () {
var redirectUri, browserState, state, validatedRequest, _a, account, legacyLoginHint;
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
this.logger.verbose("initializeAuthorizationRequest called");
redirectUri = this.getRedirectUri(request.redirectUri);
browserState = {
interactionType: interactionType
};
state = ProtocolUtils.setRequestState(this.browserCrypto, (request && request.state) || "", browserState);
_a = [{}];
return [4 /*yield*/, this.initializeBaseRequest(request)];
case 1:
validatedRequest = __assign.apply(void 0, [__assign.apply(void 0, _a.concat([_b.sent()])), { redirectUri: redirectUri, state: state, nonce: request.nonce || this.browserCrypto.createNewGuid(), responseMode: ResponseMode.FRAGMENT }]);
account = request.account || this.browserStorage.getActiveAccount();
if (account) {
this.logger.verbose("Setting validated request account");
this.logger.verbosePii("Setting validated request account: " + account);
validatedRequest.account = account;
}
// Check for ADAL/MSAL v1 SSO
if (StringUtils.isEmpty(validatedRequest.loginHint) && !account) {
legacyLoginHint = this.browserStorage.getLegacyLoginHint();
if (legacyLoginHint) {
validatedRequest.loginHint = legacyLoginHint;
}
}
this.browserStorage.updateCacheEntries(validatedRequest.state, validatedRequest.nonce, validatedRequest.authority, validatedRequest.loginHint || "", validatedRequest.account || null);
return [2 /*return*/, validatedRequest];
}
});
});
};

@@ -247,0 +266,0 @@ return StandardInteractionClient;

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

/*! @azure/msal-browser v2.20.0 2021-12-07 */
/*! @azure/msal-browser v2.21.0 2022-01-04 */
'use strict';

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

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

/*! @azure/msal-browser v2.20.0 2021-12-07 */
/*! @azure/msal-browser v2.21.0 2022-01-04 */
'use strict';

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

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

/*! @azure/msal-browser v2.20.0 2021-12-07 */
/*! @azure/msal-browser v2.21.0 2022-01-04 */
'use strict';

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

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

/*! @azure/msal-browser v2.20.0 2021-12-07 */
/*! @azure/msal-browser v2.21.0 2022-01-04 */
'use strict';

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

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

/*! @azure/msal-browser v2.20.0 2021-12-07 */
/*! @azure/msal-browser v2.21.0 2022-01-04 */
'use strict';

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

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

/*! @azure/msal-browser v2.20.0 2021-12-07 */
/*! @azure/msal-browser v2.21.0 2022-01-04 */
'use strict';

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

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

/*! @azure/msal-browser v2.20.0 2021-12-07 */
/*! @azure/msal-browser v2.21.0 2022-01-04 */
'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.20.0";
export declare const version = "2.21.0";
//# sourceMappingURL=packageMetadata.d.ts.map

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

/*! @azure/msal-browser v2.20.0 2021-12-07 */
/*! @azure/msal-browser v2.21.0 2022-01-04 */
'use strict';
/* eslint-disable header/header */
var name = "@azure/msal-browser";
var version = "2.20.0";
var version = "2.21.0";
export { name, version };
//# sourceMappingURL=packageMetadata.js.map
import { CommonAuthorizationCodeRequest } from "@azure/msal-common";
export declare type AuthorizationCodeRequest = Partial<Omit<CommonAuthorizationCodeRequest, "code" | "enableSpaAuthorizationCode">> & {
export declare type AuthorizationCodeRequest = Partial<Omit<CommonAuthorizationCodeRequest, "code" | "enableSpaAuthorizationCode" | "requestedClaimsHash">> & {
code: string;

@@ -4,0 +4,0 @@ cloudGraphHostName?: string;

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

*/
export declare type AuthorizationUrlRequest = Omit<CommonAuthorizationUrlRequest, "state" | "nonce"> & {
export declare type AuthorizationUrlRequest = Omit<CommonAuthorizationUrlRequest, "state" | "nonce" | "requestedClaimsHash"> & {
state: string;

@@ -8,0 +8,0 @@ nonce: string;

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

*/
export declare type PopupRequest = Partial<Omit<CommonAuthorizationUrlRequest, "responseMode" | "scopes" | "codeChallenge" | "codeChallengeMethod">> & {
export declare type PopupRequest = Partial<Omit<CommonAuthorizationUrlRequest, "responseMode" | "scopes" | "codeChallenge" | "codeChallengeMethod" | "requestedClaimsHash">> & {
scopes: Array<string>;

@@ -31,0 +31,0 @@ popupWindowAttributes?: PopupWindowAttributes;

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

*/
export declare type RedirectRequest = Partial<Omit<CommonAuthorizationUrlRequest, "responseMode" | "scopes" | "codeChallenge" | "codeChallengeMethod">> & {
export declare type RedirectRequest = Partial<Omit<CommonAuthorizationUrlRequest, "responseMode" | "scopes" | "codeChallenge" | "codeChallengeMethod" | "requestedClaimsHash">> & {
scopes: Array<string>;

@@ -31,0 +31,0 @@ redirectStartPage?: string;

@@ -16,3 +16,3 @@ import { AccountInfo, CommonSilentFlowRequest, StringDict } from "@azure/msal-common";

*/
export declare type SilentRequest = Omit<CommonSilentFlowRequest, "authority" | "correlationId" | "forceRefresh" | "account"> & {
export declare type SilentRequest = Omit<CommonSilentFlowRequest, "authority" | "correlationId" | "forceRefresh" | "account" | "requestedClaimsHash"> & {
redirectUri?: string;

@@ -19,0 +19,0 @@ extraQueryParameters?: StringDict;

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

*/
export declare type SsoSilentRequest = Partial<Omit<CommonAuthorizationUrlRequest, "responseMode" | "codeChallenge" | "codeChallengeMethod">>;
export declare type SsoSilentRequest = Partial<Omit<CommonAuthorizationUrlRequest, "responseMode" | "codeChallenge" | "codeChallengeMethod" | "requestedClaimsHash">>;
//# sourceMappingURL=SsoSilentRequest.d.ts.map

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

/*! @azure/msal-browser v2.20.0 2021-12-07 */
/*! @azure/msal-browser v2.21.0 2022-01-04 */
'use strict';

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

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

/*! @azure/msal-browser v2.20.0 2021-12-07 */
/*! @azure/msal-browser v2.21.0 2022-01-04 */
'use strict';

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

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

/*! @azure/msal-browser v2.20.0 2021-12-07 */
/*! @azure/msal-browser v2.21.0 2022-01-04 */
'use strict';

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

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

/*! @azure/msal-browser v2.20.0 2021-12-07 */
/*! @azure/msal-browser v2.21.0 2022-01-04 */
'use strict';

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

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

/*! @azure/msal-browser v2.20.0 2021-12-07 */
/*! @azure/msal-browser v2.21.0 2022-01-04 */
'use strict';

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

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

/*! @azure/msal-browser v2.20.0 2021-12-07 */
/*! @azure/msal-browser v2.21.0 2022-01-04 */
'use strict';

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

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

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

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

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

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

The `@azure/msal-browser` package described by the code in this folder uses the [`@azure/msal-common` package](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-common) as a dependency to enable authentication in Javascript Single-Page Applications without backend servers. This version of the library uses the OAuth 2.0 Authorization Code Flow with PKCE. To read more about this protocol, as well as the differences between implicit flow and authorization code flow, see the section [below](#implicit-flow-vs-authorization-code-flow-with-pkce). If you are looking for the version of the library that uses the implicit flow, please see the [`msal-core` library](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-core).
The `@azure/msal-browser` package described by the code in this folder uses the [`@azure/msal-common` package](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-common) as a dependency to enable authentication in JavaScript Single-Page Applications without backend servers. This version of the library uses the OAuth 2.0 Authorization Code Flow with PKCE. To read more about this protocol, as well as the differences between implicit flow and authorization code flow, see the section [below](#implicit-flow-vs-authorization-code-flow-with-pkce). If you are looking for the version of the library that uses the implicit flow, please see the [`msal-core` library](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-core).

@@ -63,3 +63,3 @@ This is an improvement upon the current `msal-core` library which will utilize the authorization code flow in the browser. Most features available in the old library will be available in this one, but there are nuances to the authentication flow in both. The `@azure/msal-browser` package does NOT support the implicit flow.

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

@@ -108,3 +108,3 @@

| [TypeScript Sample](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-browser-samples/TypescriptTestApp2.0) | A TypeScript sample showing usage of MSAL 2.0 with the Microsoft Graph API. | `npm start` |
| [Basic Auth Sample](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-browser-samples/VanillaJSTestApp2.0/app/default) | A vanilla Javascript sample showing basic usage of the MSAL 2.0 library (`@azure/msal-browser` package) with the Microsoft Graph API. | `npm start -- -s default` |
| [Basic Auth Sample](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-browser-samples/VanillaJSTestApp2.0/app/default) | A vanilla JavaScript sample showing basic usage of the MSAL 2.0 library (`@azure/msal-browser` package) with the Microsoft Graph API. | `npm start -- -s default` |
| [Multiple Resources Sample](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-browser-samples/VanillaJSTestApp2.0/app/multipleResources) | A vanilla JS sample showing usage of MSAL 2.0 with authentication on page load with a redirect. | `npm start -- -s multipleResources` |

@@ -111,0 +111,0 @@ | [On Page Load Sample](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-browser-samples/VanillaJSTestApp2.0/app/onPageLoad) | A vanilla JS sample showing usage of MSAL 2.0 with authentication on page load with a redirect. | `npm start -- -s onPageLoad` |

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