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.19.0 to 2.20.0

dist/interaction_client/HybridSpaAuthorizationCodeClient.d.ts

43

CHANGELOG.json

@@ -5,2 +5,45 @@ {

{
"date": "Tue, 07 Dec 2021 00:17:01 GMT",
"tag": "@azure/msal-browser_v2.20.0",
"version": "2.20.0",
"comments": {
"none": [
{
"author": "kamausamuel11@gmail.com",
"package": "@azure/msal-browser",
"commit": "8259de7520d2940d290332cd03c5b8babeb0966e",
"comment": "deps: run an audit fix on msal-browser"
},
{
"author": "thomas.norling@microsoft.com",
"package": "@azure/msal-browser",
"commit": "02dbd9172368bfc69e4a47f01a3ada0b96345c81",
"comment": "Package.json updates"
}
],
"minor": [
{
"author": "janutter@microsoft.com",
"package": "@azure/msal-browser",
"commit": "4741b6c3a6a3dd58feefde93c095c05e1eca5e03",
"comment": "Add acquireTokenByCode API for hybrid spa flow #3978"
},
{
"author": "beachball",
"package": "@azure/msal-browser",
"comment": "Bump @azure/msal-common to v5.2.0",
"commit": "d7c209f7aa3ae4380a77a31ff1319fbf7201ae45"
}
],
"patch": [
{
"author": "hemoral@microsoft.com",
"package": "@azure/msal-browser",
"commit": "e983e25ba899bb437a135ec50ad6c77023c72e5b",
"comment": "Fix circular dependencies in AuthenticationHeaderParser and AsyncMemoryStorage #4235"
}
]
}
},
{
"date": "Mon, 01 Nov 2021 23:53:21 GMT",

@@ -7,0 +50,0 @@ "tag": "@azure/msal-browser_v2.19.0",

15

CHANGELOG.md
# Change Log - @azure/msal-browser
This log was last generated on Mon, 01 Nov 2021 23:53:21 GMT and should not be manually modified.
This log was last generated on Tue, 07 Dec 2021 00:17:01 GMT and should not be manually modified.
<!-- Start content -->
## 2.20.0
Tue, 07 Dec 2021 00:17:01 GMT
### Minor changes
- Add acquireTokenByCode API for hybrid spa flow #3978 (janutter@microsoft.com)
- Bump @azure/msal-common to v5.2.0
### Patches
- Fix circular dependencies in AuthenticationHeaderParser and AsyncMemoryStorage #4235 (hemoral@microsoft.com)
## 2.19.0

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

2

dist/_virtual/_tslib.js

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

/*! @azure/msal-browser v2.19.0 2021-11-02 */
/*! @azure/msal-browser v2.20.0 2021-12-07 */
'use strict';

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

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

import { ITokenCache } from "../cache/ITokenCache";
import { AuthorizationCodeRequest } from "../request/AuthorizationCodeRequest";
export declare abstract class ClientApplication {

@@ -26,2 +27,3 @@ protected readonly browserCrypto: ICrypto;

private redirectResponse;
private hybridAuthCodeResponses;
/**

@@ -92,2 +94,19 @@ * @constructor

/**
* This function redeems an authorization code (passed as code) from the eSTS token endpoint.
* This authorization code should be acquired server-side using a confidential client to acquire a spa_code.
* This API is not indended for normal authorization code acquisition and redemption.
*
* Redemption of this authorization code will not require PKCE, as it was acquired by a confidential client.
*
* @param request {@link AuthorizationCodeRequest}
* @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.
*/
acquireTokenByCode(request: AuthorizationCodeRequest): Promise<AuthenticationResult>;
/**
* Creates a SilentAuthCodeClient to redeem an authorization code.
* @param request
* @returns Result of the operation to redeem the authorization code
*/
private acquireTokenByCodeAsync;
/**
* Use this function to obtain a token before every call to the API / resource provider

@@ -94,0 +113,0 @@ *

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

/*! @azure/msal-browser v2.19.0 2021-11-02 */
/*! @azure/msal-browser v2.20.0 2021-12-07 */
'use strict';

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

import { TokenCache } from '../cache/TokenCache.js';
import { SilentAuthCodeClient } from '../interaction_client/SilentAuthCodeClient.js';
import { BrowserAuthError } from '../error/BrowserAuthError.js';

@@ -64,2 +66,4 @@ /*

this.redirectResponse = new Map();
// Initial hybrid spa map
this.hybridAuthCodeResponses = new Map();
// Initialize the crypto class.

@@ -270,2 +274,73 @@ this.browserCrypto = this.isBrowserEnvironment ? new CryptoOps(this.logger) : DEFAULT_CRYPTO_IMPLEMENTATION;

/**
* This function redeems an authorization code (passed as code) from the eSTS token endpoint.
* This authorization code should be acquired server-side using a confidential client to acquire a spa_code.
* This API is not indended for normal authorization code acquisition and redemption.
*
* Redemption of this authorization code will not require PKCE, as it was acquired by a confidential client.
*
* @param request {@link AuthorizationCodeRequest}
* @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.
*/
ClientApplication.prototype.acquireTokenByCode = function (request) {
return __awaiter(this, void 0, void 0, function () {
var response;
var _this = this;
return __generator(this, function (_a) {
this.preflightBrowserEnvironmentCheck(InteractionType.Silent);
this.logger.trace("acquireTokenByCode called", request.correlationId);
this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_BY_CODE_START, InteractionType.Silent, request);
try {
if (!request.code) {
throw BrowserAuthError.createAuthCodeRequiredError();
}
response = this.hybridAuthCodeResponses.get(request.code);
if (!response) {
this.logger.verbose("Initiating new acquireTokenByCode request", request.correlationId);
response = this.acquireTokenByCodeAsync(request)
.then(function (result) {
_this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_BY_CODE_SUCCESS, InteractionType.Silent, result);
_this.hybridAuthCodeResponses.delete(request.code);
return result;
})
.catch(function (error) {
_this.hybridAuthCodeResponses.delete(request.code);
throw error;
});
this.hybridAuthCodeResponses.set(request.code, response);
}
else {
this.logger.verbose("Existing acquireTokenByCode request found", request.correlationId);
}
return [2 /*return*/, response];
}
catch (e) {
this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_BY_CODE_FAILURE, InteractionType.Silent, null, e);
throw e;
}
return [2 /*return*/];
});
});
};
/**
* Creates a SilentAuthCodeClient to redeem an authorization code.
* @param request
* @returns Result of the operation to redeem the authorization code
*/
ClientApplication.prototype.acquireTokenByCodeAsync = function (request) {
return __awaiter(this, void 0, void 0, function () {
var silentAuthCodeClient, silentTokenResult;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
this.logger.trace("acquireTokenByCodeAsync called", request.correlationId);
silentAuthCodeClient = new SilentAuthCodeClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.acquireTokenByCode, request.correlationId);
return [4 /*yield*/, silentAuthCodeClient.acquireToken(request)];
case 1:
silentTokenResult = _a.sent();
return [2 /*return*/, silentTokenResult];
}
});
});
};
/**
* Use this function to obtain a token before every call to the API / resource provider

@@ -272,0 +347,0 @@ *

@@ -11,2 +11,3 @@ import { AuthenticationResult, AccountInfo, Logger } from "@azure/msal-common";

import { ITokenCache } from "../cache/ITokenCache";
import { AuthorizationCodeRequest } from "../request/AuthorizationCodeRequest";
import { BrowserConfiguration } from "../config/Configuration";

@@ -17,2 +18,3 @@ export interface IPublicClientApplication {

acquireTokenSilent(silentRequest: SilentRequest): Promise<AuthenticationResult>;
acquireTokenByCode(request: AuthorizationCodeRequest): Promise<AuthenticationResult>;
addEventCallback(callback: Function): string | null;

@@ -19,0 +21,0 @@ removeEventCallback(callbackId: string): void;

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

/*! @azure/msal-browser v2.19.0 2021-11-02 */
/*! @azure/msal-browser v2.20.0 2021-12-07 */
'use strict';

@@ -19,2 +19,5 @@ import { BrowserConfigurationAuthError } from '../error/BrowserConfigurationAuthError.js';

},
acquireTokenByCode: function () {
return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());
},
getAllAccounts: function () {

@@ -21,0 +24,0 @@ return [];

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

/*! @azure/msal-browser v2.19.0 2021-11-02 */
/*! @azure/msal-browser v2.20.0 2021-12-07 */
'use strict';

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

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

import { Logger } from "..";
import { Logger } from "@azure/msal-common";
import { IAsyncStorage } from "./IAsyncMemoryStorage";

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

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

/*! @azure/msal-browser v2.19.0 2021-11-02 */
/*! @azure/msal-browser v2.20.0 2021-12-07 */
'use strict';
import { __awaiter, __generator } from '../_virtual/_tslib.js';
import { BrowserAuthError, BrowserAuthErrorMessage } from '../error/BrowserAuthError.js';
import { DatabaseStorage } from './DatabaseStorage.js';
import { MemoryStorage } from './MemoryStorage.js';
import { BrowserAuthError, BrowserAuthErrorMessage } from '../error/BrowserAuthError.js';

@@ -8,0 +8,0 @@ /*

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

/*! @azure/msal-browser v2.19.0 2021-11-02 */
/*! @azure/msal-browser v2.20.0 2021-12-07 */
'use strict';

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

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

/*! @azure/msal-browser v2.19.0 2021-11-02 */
/*! @azure/msal-browser v2.20.0 2021-12-07 */
'use strict';

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

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

/*! @azure/msal-browser v2.19.0 2021-11-02 */
/*! @azure/msal-browser v2.20.0 2021-12-07 */
'use strict';

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

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

/*! @azure/msal-browser v2.19.0 2021-11-02 */
/*! @azure/msal-browser v2.20.0 2021-12-07 */
'use strict';

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

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

/*! @azure/msal-browser v2.19.0 2021-11-02 */
/*! @azure/msal-browser v2.20.0 2021-12-07 */
'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.19.0 2021-11-02 */
/*! @azure/msal-browser v2.20.0 2021-12-07 */
'use strict';

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

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

/*! @azure/msal-browser v2.19.0 2021-11-02 */
/*! @azure/msal-browser v2.20.0 2021-12-07 */
'use strict';

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

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

/*! @azure/msal-browser v2.19.0 2021-11-02 */
/*! @azure/msal-browser v2.20.0 2021-12-07 */
'use strict';

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

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

/*! @azure/msal-browser v2.19.0 2021-11-02 */
/*! @azure/msal-browser v2.20.0 2021-12-07 */
'use strict';

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

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

/*! @azure/msal-browser v2.19.0 2021-11-02 */
/*! @azure/msal-browser v2.20.0 2021-12-07 */
'use strict';

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

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

/*! @azure/msal-browser v2.19.0 2021-11-02 */
/*! @azure/msal-browser v2.20.0 2021-12-07 */
'use strict';

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

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

/*! @azure/msal-browser v2.19.0 2021-11-02 */
/*! @azure/msal-browser v2.20.0 2021-12-07 */
'use strict';

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

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

/*! @azure/msal-browser v2.19.0 2021-11-02 */
/*! @azure/msal-browser v2.20.0 2021-12-07 */
'use strict';

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

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

};
authCodeRequired: {
code: string;
desc: string;
};
databaseUnavailable: {

@@ -306,2 +310,6 @@ code: string;

/**
* Create an error when an authorization code is required but not provided
*/
static createAuthCodeRequiredError(): BrowserAuthError;
/**
* Create an error when IndexedDB is unavailable

@@ -308,0 +316,0 @@ */

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

/*! @azure/msal-browser v2.19.0 2021-11-02 */
/*! @azure/msal-browser v2.20.0 2021-12-07 */
'use strict';

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

},
authCodeRequired: {
code: "auth_code_required",
desc: "An authorization code must be provided (as the `code` property on the request) to this flow."
},
databaseUnavailable: {

@@ -392,2 +396,8 @@ code: "database_unavailable",

/**
* Create an error when an authorization code is required but not provided
*/
BrowserAuthError.createAuthCodeRequiredError = function () {
return new BrowserAuthError(BrowserAuthErrorMessage.authCodeRequired.code, BrowserAuthErrorMessage.authCodeRequired.desc);
};
/**
* Create an error when IndexedDB is unavailable

@@ -394,0 +404,0 @@ */

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

/*! @azure/msal-browser v2.19.0 2021-11-02 */
/*! @azure/msal-browser v2.20.0 2021-12-07 */
'use strict';

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

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

/*! @azure/msal-browser v2.19.0 2021-11-02 */
/*! @azure/msal-browser v2.20.0 2021-12-07 */
'use strict';

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

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

/*! @azure/msal-browser v2.19.0 2021-11-02 */
/*! @azure/msal-browser v2.20.0 2021-12-07 */
'use strict';

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

@@ -14,2 +14,5 @@ export declare enum EventType {

SSO_SILENT_FAILURE = "msal:ssoSilentFailure",
ACQUIRE_TOKEN_BY_CODE_START = "msal:acquireTokenByCodeStart",
ACQUIRE_TOKEN_BY_CODE_SUCCESS = "msal:acquireTokenByCodeSuccess",
ACQUIRE_TOKEN_BY_CODE_FAILURE = "msal:acquireTokenByCodeFailure",
HANDLE_REDIRECT_START = "msal:handleRedirectStart",

@@ -16,0 +19,0 @@ HANDLE_REDIRECT_END = "msal:handleRedirectEnd",

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

/*! @azure/msal-browser v2.19.0 2021-11-02 */
/*! @azure/msal-browser v2.20.0 2021-12-07 */
'use strict';

@@ -21,2 +21,5 @@ /*

EventType["SSO_SILENT_FAILURE"] = "msal:ssoSilentFailure";
EventType["ACQUIRE_TOKEN_BY_CODE_START"] = "msal:acquireTokenByCodeStart";
EventType["ACQUIRE_TOKEN_BY_CODE_SUCCESS"] = "msal:acquireTokenByCodeSuccess";
EventType["ACQUIRE_TOKEN_BY_CODE_FAILURE"] = "msal:acquireTokenByCodeFailure";
EventType["HANDLE_REDIRECT_START"] = "msal:handleRedirectStart";

@@ -23,0 +26,0 @@ EventType["HANDLE_REDIRECT_END"] = "msal:handleRedirectEnd";

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

export { AuthorizationUrlRequest } from "./request/AuthorizationUrlRequest";
export { AuthorizationCodeRequest } from "./request/AuthorizationCodeRequest";
export { LoadTokenOptions } from "./cache/TokenCache";

@@ -24,0 +25,0 @@ export { EventMessage, EventPayload, EventError, EventCallbackFunction, EventMessageUtils, PopupEvent } from "./event/EventMessage";

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

/*! @azure/msal-browser v2.19.0 2021-11-02 */
/*! @azure/msal-browser v2.20.0 2021-12-07 */
'use strict';

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

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

/*! @azure/msal-browser v2.19.0 2021-11-02 */
/*! @azure/msal-browser v2.20.0 2021-12-07 */
'use strict';

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

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

/*! @azure/msal-browser v2.19.0 2021-11-02 */
/*! @azure/msal-browser v2.20.0 2021-12-07 */
'use strict';

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

ThrottlingUtils.removeThrottle(this.browserStorage, this.config.auth.clientId, authCodeRequest);
return [4 /*yield*/, interactionHandler.handleCodeResponse(hash, state, authClient.authority, this.networkClient)];
return [4 /*yield*/, interactionHandler.handleCodeResponseFromHash(hash, state, authClient.authority, this.networkClient)];
case 6:

@@ -124,0 +124,0 @@ result = _a.sent();

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

/*! @azure/msal-browser v2.19.0 2021-11-02 */
/*! @azure/msal-browser v2.20.0 2021-12-07 */
'use strict';

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

interactionHandler = new RedirectHandler(authClient, this.browserStorage, cachedRequest, this.logger, this.browserCrypto);
return [4 /*yield*/, interactionHandler.handleCodeResponse(hash, state, authClient.authority, this.networkClient, this.config.auth.clientId)];
return [4 /*yield*/, interactionHandler.handleCodeResponseFromHash(hash, state, authClient.authority, this.networkClient, this.config.auth.clientId)];
case 2: return [2 /*return*/, _a.sent()];

@@ -219,0 +219,0 @@ }

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

/*! @azure/msal-browser v2.19.0 2021-11-02 */
/*! @azure/msal-browser v2.20.0 2021-12-07 */
'use strict';

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

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

/*! @azure/msal-browser v2.19.0 2021-11-02 */
/*! @azure/msal-browser v2.20.0 2021-12-07 */
'use strict';

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

// Handle response from hash string
return [2 /*return*/, silentHandler.handleCodeResponse(hash, state, authClient.authority, this.networkClient)];
return [2 /*return*/, silentHandler.handleCodeResponseFromHash(hash, state, authClient.authority, this.networkClient)];
}

@@ -101,0 +101,0 @@ });

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

/*! @azure/msal-browser v2.19.0 2021-11-02 */
/*! @azure/msal-browser v2.20.0 2021-12-07 */
'use strict';

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

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

/*! @azure/msal-browser v2.19.0 2021-11-02 */
/*! @azure/msal-browser v2.20.0 2021-12-07 */
'use strict';

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

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

import { CommonAuthorizationCodeRequest, AuthenticationResult, AuthorizationCodeClient, Authority, INetworkModule, CcsCredential, Logger } from "@azure/msal-common";
import { AuthorizationCodePayload, CommonAuthorizationCodeRequest, AuthenticationResult, AuthorizationCodeClient, Authority, INetworkModule, CcsCredential, Logger } from "@azure/msal-common";
import { BrowserCacheManager } from "../cache/BrowserCacheManager";

@@ -22,4 +22,13 @@ export declare type InteractionParams = {};

*/
handleCodeResponse(locationHash: string, state: string, authority: Authority, networkModule: INetworkModule): Promise<AuthenticationResult>;
handleCodeResponseFromHash(locationHash: string, state: string, authority: Authority, networkModule: INetworkModule): Promise<AuthenticationResult>;
/**
* Process auth code response from AAD
* @param authCodeResponse
* @param state
* @param authority
* @param networkModule
* @returns
*/
handleCodeResponseFromServer(authCodeResponse: AuthorizationCodePayload, state: string, authority: Authority, networkModule: INetworkModule, validateNonce?: boolean): Promise<AuthenticationResult>;
/**
* Updates authority based on cloudInstanceHostname

@@ -26,0 +35,0 @@ * @param cloudInstanceHostname

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

/*! @azure/msal-browser v2.19.0 2021-11-02 */
/*! @azure/msal-browser v2.20.0 2021-12-07 */
'use strict';

@@ -26,13 +26,37 @@ import { __awaiter, __generator } from '../_virtual/_tslib.js';

*/
InteractionHandler.prototype.handleCodeResponse = function (locationHash, state, authority, networkModule) {
InteractionHandler.prototype.handleCodeResponseFromHash = function (locationHash, state, authority, networkModule) {
return __awaiter(this, void 0, void 0, function () {
var stateKey, requestState, authCodeResponse, nonceKey, cachedNonce, cachedCcsCred, tokenResponse;
var stateKey, requestState, authCodeResponse;
return __generator(this, function (_a) {
this.browserRequestLogger.verbose("InteractionHandler.handleCodeResponse called");
// Check that location hash isn't empty.
if (StringUtils.isEmpty(locationHash)) {
throw BrowserAuthError.createEmptyHashError(locationHash);
}
stateKey = this.browserStorage.generateStateKey(state);
requestState = this.browserStorage.getTemporaryCache(stateKey);
if (!requestState) {
throw ClientAuthError.createStateNotFoundError("Cached State");
}
authCodeResponse = this.authModule.handleFragmentResponse(locationHash, requestState);
return [2 /*return*/, this.handleCodeResponseFromServer(authCodeResponse, state, authority, networkModule)];
});
});
};
/**
* Process auth code response from AAD
* @param authCodeResponse
* @param state
* @param authority
* @param networkModule
* @returns
*/
InteractionHandler.prototype.handleCodeResponseFromServer = function (authCodeResponse, state, authority, networkModule, validateNonce) {
if (validateNonce === void 0) { validateNonce = true; }
return __awaiter(this, void 0, void 0, function () {
var stateKey, requestState, nonceKey, cachedNonce, cachedCcsCred, tokenResponse;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
this.browserRequestLogger.verbose("InteractionHandler.handleCodeResponse called");
// Check that location hash isn't empty.
if (StringUtils.isEmpty(locationHash)) {
throw BrowserAuthError.createEmptyHashError(locationHash);
}
this.browserRequestLogger.trace("InteractionHandler.handleCodeResponseFromServer called");
stateKey = this.browserStorage.generateStateKey(state);

@@ -43,3 +67,2 @@ requestState = this.browserStorage.getTemporaryCache(stateKey);

}
authCodeResponse = this.authModule.handleFragmentResponse(locationHash, requestState);
nonceKey = this.browserStorage.generateNonceKey(requestState);

@@ -55,3 +78,6 @@ cachedNonce = this.browserStorage.getTemporaryCache(nonceKey);

case 2:
authCodeResponse.nonce = cachedNonce || undefined;
// Nonce validation not needed when redirect not involved (e.g. hybrid spa, renewing token via rt)
if (validateNonce) {
authCodeResponse.nonce = cachedNonce || undefined;
}
authCodeResponse.state = requestState;

@@ -58,0 +84,0 @@ // Add CCS parameters if available

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

/*! @azure/msal-browser v2.19.0 2021-11-02 */
/*! @azure/msal-browser v2.20.0 2021-12-07 */
'use strict';

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

@@ -23,4 +23,4 @@ import { AuthorizationCodeClient, CommonAuthorizationCodeRequest, ICrypto, AuthenticationResult, Authority, INetworkModule, Logger } from "@azure/msal-common";

*/
handleCodeResponse(locationHash: string, state: string, authority: Authority, networkModule: INetworkModule, clientId?: string): Promise<AuthenticationResult>;
handleCodeResponseFromHash(locationHash: string, state: string, authority: Authority, networkModule: INetworkModule, clientId?: string): Promise<AuthenticationResult>;
}
//# sourceMappingURL=RedirectHandler.d.ts.map

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

/*! @azure/msal-browser v2.19.0 2021-11-02 */
/*! @azure/msal-browser v2.20.0 2021-12-07 */
'use strict';

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

*/
RedirectHandler.prototype.handleCodeResponse = function (locationHash, state, authority, networkModule, clientId) {
RedirectHandler.prototype.handleCodeResponseFromHash = function (locationHash, state, authority, networkModule, clientId) {
return __awaiter(this, void 0, void 0, function () {

@@ -84,0 +84,0 @@ var stateKey, requestState, authCodeResponse, nonceKey, cachedNonce, cachedCcsCred, tokenResponse;

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

/*! @azure/msal-browser v2.19.0 2021-11-02 */
/*! @azure/msal-browser v2.20.0 2021-12-07 */
'use strict';

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

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

/*! @azure/msal-browser v2.19.0 2021-11-02 */
/*! @azure/msal-browser v2.20.0 2021-12-07 */
'use strict';

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

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

/*! @azure/msal-browser v2.19.0 2021-11-02 */
/*! @azure/msal-browser v2.20.0 2021-12-07 */
'use strict';

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

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

/*! @azure/msal-browser v2.19.0 2021-11-02 */
/*! @azure/msal-browser v2.20.0 2021-12-07 */
'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.19.0";
export declare const version = "2.20.0";
//# sourceMappingURL=packageMetadata.d.ts.map

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

/*! @azure/msal-browser v2.19.0 2021-11-02 */
/*! @azure/msal-browser v2.20.0 2021-12-07 */
'use strict';
/* eslint-disable header/header */
var name = "@azure/msal-browser";
var version = "2.19.0";
var version = "2.20.0";
export { name, version };
//# sourceMappingURL=packageMetadata.js.map

@@ -85,2 +85,3 @@ import { PopupRequest } from "../request/PopupRequest";

handleRedirectPromise = 865,
acquireTokenByCode = 866,
acquireTokenSilent_silentFlow = 61,

@@ -87,0 +88,0 @@ logout = 961,

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

/*! @azure/msal-browser v2.19.0 2021-11-02 */
/*! @azure/msal-browser v2.20.0 2021-12-07 */
'use strict';

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

ApiId[ApiId["handleRedirectPromise"] = 865] = "handleRedirectPromise";
ApiId[ApiId["acquireTokenByCode"] = 866] = "acquireTokenByCode";
ApiId[ApiId["acquireTokenSilent_silentFlow"] = 61] = "acquireTokenSilent_silentFlow";

@@ -98,0 +99,0 @@ ApiId[ApiId["logout"] = 961] = "logout";

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

/*! @azure/msal-browser v2.19.0 2021-11-02 */
/*! @azure/msal-browser v2.20.0 2021-12-07 */
'use strict';

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

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

/*! @azure/msal-browser v2.19.0 2021-11-02 */
/*! @azure/msal-browser v2.20.0 2021-12-07 */
'use strict';

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

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

/*! @azure/msal-browser v2.19.0 2021-11-02 */
/*! @azure/msal-browser v2.20.0 2021-12-07 */
'use strict';

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

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

/*! @azure/msal-browser v2.19.0 2021-11-02 */
/*! @azure/msal-browser v2.20.0 2021-12-07 */
'use strict';

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

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

/*! @azure/msal-browser v2.19.0 2021-11-02 */
/*! @azure/msal-browser v2.20.0 2021-12-07 */
'use strict';

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

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

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

@@ -62,2 +62,3 @@ "keywords": [

"build": "npm run clean && npm run build:modules",
"link:localDeps": "npx lerna bootstrap --scope @azure/msal-common --scope @azure/msal-browser",
"prepack": "npm run build:all"

@@ -95,4 +96,4 @@ },

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

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

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

@@ -113,2 +113,4 @@

| [Angular 10 Sample](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-angular-v2-samples/angular10-browser-sample) | An Angular 10 sample showing usage of MSAL 2.0 with the Microsoft Graph API. | `npm start` |
| [Hybrid Spa Sample (w/ MSAL Node)](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-browser-samples/HybridSample) | Sample demonstrating how to use `acquireTokenByCode` to perform SSO for applications that leverage server-side and client-side authentication using MSAL Browser and MSAL Node. | `npm start` |
| [Vue 3 Sample](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-browser-samples/vue3-sample-app) | A Vue 3 sample showing usage of MSAL 2.0 with the Microsoft Graph API. | `npm start` |

@@ -115,0 +117,0 @@ More instructions to run the samples can be found in the [`README.md` file](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/samples/msal-browser-samples/VanillaJSTestApp2.0/Readme.md) of the VanillaJSTestApp2.0 folder.

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