Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@azure/msal-browser

Package Overview
Dependencies
Maintainers
3
Versions
122
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.8.0 to 2.9.0

53

CHANGELOG.json

@@ -5,2 +5,55 @@ {

{
"date": "Tue, 12 Jan 2021 00:51:26 GMT",
"tag": "@azure/msal-browser_v2.9.0",
"version": "2.9.0",
"comments": {
"none": [
{
"comment": "Update event docs in msal-browser (#2764)",
"author": "joarroyo@microsoft.com",
"commit": "f85db233464aed9718444ab4d29d19f432850bdf",
"package": "@azure/msal-browser"
},
{
"comment": "Update msal-angular link in msal-browser readme (#2751)",
"author": "suhendri_s@outlook.com",
"commit": "16e2b6cf3d4294c3723db49e1eace1d5354e4dcb",
"package": "@azure/msal-browser"
},
{
"comment": "package.lock change",
"author": "samuel.kamau@microsoft.com",
"commit": "4e50ca592f5a17578072be9e4ac28e05b3e6d594",
"package": "@azure/msal-browser"
},
{
"comment": "Fix npm audit warnings",
"author": "janutter@microsoft.com",
"commit": "751026cdaa24dd370c50ad714bf0b1d54c71fbde",
"package": "@azure/msal-browser"
}
],
"minor": [
{
"comment": "Adding an active account API to PublicClientApplication (#2728)",
"author": "prkanher@microsoft.com",
"commit": "ca8c0d55d2abc4eefaa52c833510e313610eb424",
"package": "@azure/msal-browser"
},
{
"comment": "Add internal in-memory storage to BrowserCacheManager (#2765)",
"author": "thomas.norling@microsoft.com",
"commit": "d97cc2e1dc08a56614b66404294c45ff9ab43bca",
"package": "@azure/msal-browser"
},
{
"comment": "Enable strict TypeScript option (#2792)",
"author": "thomas.norling@microsoft.com",
"commit": "a6fae46d307d0a6101e926cb28298fd9f60d4a49",
"package": "@azure/msal-browser"
}
]
}
},
{
"date": "Mon, 07 Dec 2020 22:19:03 GMT",

@@ -7,0 +60,0 @@ "tag": "@azure/msal-browser_v2.8.0",

12

changelog.md
# Change Log - @azure/msal-browser
This log was last generated on Mon, 07 Dec 2020 22:19:03 GMT and should not be manually modified.
This log was last generated on Tue, 12 Jan 2021 00:51:26 GMT and should not be manually modified.
<!-- Start content -->
## 2.9.0
Tue, 12 Jan 2021 00:51:26 GMT
### Minor changes
- Adding an active account API to PublicClientApplication (#2728) (prkanher@microsoft.com)
- Add internal in-memory storage to BrowserCacheManager (#2765) (thomas.norling@microsoft.com)
- Enable strict TypeScript option (#2792) (thomas.norling@microsoft.com)
## 2.8.0

@@ -8,0 +18,0 @@

29

dist/src/app/ClientApplication.d.ts

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

import { CryptoOps } from "../crypto/CryptoOps";
import { Authority, AuthorizationCodeRequest, AuthorizationUrlRequest, AuthorizationCodeClient, AccountInfo, ServerTelemetryManager, SilentFlowClient, ClientConfiguration, BaseAuthRequest, INetworkModule, AuthenticationResult, Logger, RefreshTokenClient, SilentFlowRequest, EndSessionRequest as CommonEndSessionRequest } from "@azure/msal-common";
import { Authority, AuthorizationCodeRequest, AuthorizationCodeClient, AccountInfo, ServerTelemetryManager, SilentFlowClient, ClientConfiguration, BaseAuthRequest, INetworkModule, AuthenticationResult, Logger, RefreshTokenClient, SilentFlowRequest, EndSessionRequest as CommonEndSessionRequest, ICrypto } from "@azure/msal-common";
import { BrowserCacheManager } from "../cache/BrowserCacheManager";
import { Configuration } from "../config/Configuration";
import { BrowserConfiguration, Configuration } from "../config/Configuration";
import { InteractionType } from "../utils/BrowserConstants";
import { RedirectRequest } from "../request/RedirectRequest";
import { PopupRequest } from "../request/PopupRequest";
import { AuthorizationUrlRequest } from "../request/AuthorizationUrlRequest";
import { SsoSilentRequest } from "../request/SsoSilentRequest";

@@ -13,10 +13,10 @@ import { EventError, EventPayload, EventCallbackFunction } from "../event/EventMessage";

export declare abstract class ClientApplication {
protected readonly browserCrypto: CryptoOps;
protected readonly browserCrypto: ICrypto;
protected readonly browserStorage: BrowserCacheManager;
protected readonly networkClient: INetworkModule;
protected readonly tokenExchangePromise: Promise<AuthenticationResult>;
protected config: Configuration;
protected defaultAuthority: Authority;
protected config: BrowserConfiguration;
protected defaultAuthority: Authority | null;
protected logger: Logger;
protected isBrowserEnvironment: boolean;
private activeLocalAccountId;
private eventCallbacks;

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

/**
*
* @param hash
* @param interactionType
*/
private validateAndExtractStateFromHash;
/**
* Checks if hash exists and handles in window.

@@ -174,2 +180,11 @@ * @param responseHash

/**
* Sets the account to use as the active account. If no account is passed to the acquireToken APIs, then MSAL will use this active account.
* @param account
*/
setActiveAccount(account: AccountInfo | null): void;
/**
* Gets the currently active account
*/
getActiveAccount(): AccountInfo | null;
/**
*

@@ -176,0 +191,0 @@ * Use to get the redirect uri configured in MSAL or null.

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

setLogger(logger: Logger): void;
setActiveAccount(account: AccountInfo | null): void;
getActiveAccount(): AccountInfo | null;
}
export declare const stubbedPublicClientApplication: IPublicClientApplication;
import { AuthorizationCodeRequest, ICrypto, AccountEntity, IdTokenEntity, AccessTokenEntity, RefreshTokenEntity, AppMetadataEntity, CacheManager, ServerTelemetryEntity, ThrottlingEntity, Logger } from "@azure/msal-common";
import { CacheOptions } from "../config/Configuration";
import { CryptoOps } from "../crypto/CryptoOps";
import { InteractionType } from "../utils/BrowserConstants";

@@ -13,5 +12,6 @@ /**

private browserStorage;
private internalStorage;
private logger;
private readonly COOKIE_LIFE_MULTIPLIER;
constructor(clientId: string, cacheConfig: CacheOptions, cryptoImpl: CryptoOps, logger: Logger);
constructor(clientId: string, cacheConfig: Required<CacheOptions>, cryptoImpl: ICrypto, logger: Logger);
/**

@@ -43,3 +43,3 @@ * Returns a window storage class implementing the IWindowStorage interface that corresponds to the configured cacheLocation.

*/
getItem(key: string): string;
getItem(key: string): string | null;
/**

@@ -66,3 +66,3 @@ * sets the entry in the browser storage

*/
getIdTokenCredential(idTokenKey: string): IdTokenEntity;
getIdTokenCredential(idTokenKey: string): IdTokenEntity | null;
/**

@@ -77,3 +77,3 @@ * set IdToken credential to the platform cache

*/
getAccessTokenCredential(accessTokenKey: string): AccessTokenEntity;
getAccessTokenCredential(accessTokenKey: string): AccessTokenEntity | null;
/**

@@ -88,3 +88,3 @@ * set accessToken credential to the platform cache

*/
getRefreshTokenCredential(refreshTokenKey: string): RefreshTokenEntity;
getRefreshTokenCredential(refreshTokenKey: string): RefreshTokenEntity | null;
/**

@@ -99,3 +99,3 @@ * set refreshToken credential to the platform cache

*/
getAppMetadata(appMetadataKey: string): AppMetadataEntity;
getAppMetadata(appMetadataKey: string): AppMetadataEntity | null;
/**

@@ -133,3 +133,3 @@ * set appMetadata entity to the platform cache

*/
getTemporaryCache(cacheKey: string, generateKey?: boolean): string;
getTemporaryCache(cacheKey: string, generateKey?: boolean): string | null;
/**

@@ -180,6 +180,2 @@ * Sets the cache item with the key and value given.

/**
* Clear all msal cookies
*/
clearMsalCookie(stateString?: string): void;
/**
* Get cookie expiration time

@@ -219,11 +215,5 @@ * @param cookieLifeDays

/**
* Sets the cacheKey for and stores the authority information in cache
* @param state
* @param authority
*/
setAuthorityCache(authority: string, state: string): void;
/**
* Gets the cached authority based on the cached state. Returns empty if no cached state found.
*/
getCachedAuthority(cachedState: string): string;
getCachedAuthority(cachedState: string): string | null;
/**

@@ -248,1 +238,2 @@ * Updates account, authority, and state in cache

}
export declare const DEFAULT_BROWSER_CACHE_MANAGER: (clientId: string, logger: Logger) => BrowserCacheManager;
import { IWindowStorage } from "./IWindowStorage";
export declare class BrowserStorage implements IWindowStorage {
private _windowStorage;
private cacheLocation;
get windowStorage(): Storage;
private windowStorage;
constructor(cacheLocation: string);
private validateWindowStorage;
getItem(key: string): string;
getItem(key: string): string | null;
setItem(key: string, value: string): void;

@@ -10,0 +8,0 @@ removeItem(key: string): void;

@@ -6,3 +6,3 @@ export interface IWindowStorage {

*/
getItem(key: string): string;
getItem(key: string): string | null;
/**

@@ -9,0 +9,0 @@ * Sets the item in the window storage object with the given key.

@@ -5,3 +5,3 @@ import { IWindowStorage } from "./IWindowStorage";

constructor();
getItem(key: string): string;
getItem(key: string): string | null;
setItem(key: string, value: string): void;

@@ -8,0 +8,0 @@ removeItem(key: string): void;

@@ -74,3 +74,3 @@ import { SystemOptions, LoggerOptions, INetworkModule, ProtocolMode } from "@azure/msal-common";

export declare type Configuration = {
auth?: BrowserAuthOptions;
auth: BrowserAuthOptions;
cache?: CacheOptions;

@@ -93,2 +93,2 @@ system?: BrowserSystemOptions;

*/
export declare function buildConfiguration({ auth: userInputAuth, cache: userInputCache, system: userInputSystem }: Configuration): BrowserConfiguration;
export declare function buildConfiguration({ auth: userInputAuth, cache: userInputCache, system: userInputSystem }: Configuration, isBrowserEnvironment: boolean): BrowserConfiguration;

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

};
hashDoesNotContainStateError: {
code: string;
desc: string;
};
unableToParseStateError: {
code: string;
desc: string;
};
stateInteractionTypeMismatchError: {
code: string;
desc: string;
};
interactionInProgress: {

@@ -67,2 +79,6 @@ code: string;

};
noAccountError: {
code: string;
desc: string;
};
silentPromptValueError: {

@@ -72,6 +88,18 @@ code: string;

};
tokenRequestCacheError: {
noTokenRequestCacheError: {
code: string;
desc: string;
};
unableToParseTokenRequestCacheError: {
code: string;
desc: string;
};
noCachedAuthorityError: {
code: string;
desc: string;
};
authRequestNotSet: {
code: string;
desc: string;
};
invalidCacheType: {

@@ -85,2 +113,6 @@ code: string;

};
databaseNotOpen: {
code: string;
desc: string;
};
};

@@ -117,2 +149,14 @@ /**

/**
* Creates an error thrown when the hash string value is unexpectedly empty.
*/
static createHashDoesNotContainStateError(): BrowserAuthError;
/**
* Creates an error thrown when the hash string value is unexpectedly empty.
*/
static createUnableToParseStateError(): BrowserAuthError;
/**
* Creates an error thrown when the state value in the hash does not match the interaction type of the API attempting to consume it.
*/
static createStateInteractionTypeMismatchError(): BrowserAuthError;
/**
* Creates an error thrown when a browser interaction (redirect or popup) is in progress.

@@ -161,2 +205,6 @@ */

/**
* Creates an error thrown when the account object is not provided in the acquireTokenSilent API.
*/
static createNoAccountError(): BrowserAuthError;
/**
* Creates an error thrown when a given prompt value is invalid for silent requests.

@@ -166,7 +214,18 @@ */

/**
* Creates an error thrown when the cached token request could not be retrieved from the cache
*/
static createUnableToParseTokenRequestCacheError(): BrowserAuthError;
/**
* Creates an error thrown when the token request could not be retrieved from the cache
* @param errDetail
*/
static createTokenRequestCacheError(errDetail: string): BrowserAuthError;
static createNoTokenRequestCacheError(): BrowserAuthError;
/**
* Creates an error thrown when handleCodeResponse is called before initiateAuthRequest (InteractionHandler)
*/
static createAuthRequestNotSetError(): BrowserAuthError;
/**
* Creates an error thrown when the authority could not be retrieved from the cache
*/
static createNoCachedAuthorityError(): BrowserAuthError;
/**
* Creates an error thrown if cache type is invalid.

@@ -179,2 +238,6 @@ */

static createNonBrowserEnvironmentError(): BrowserAuthError;
/**
* Create an error thrown when indexDB database is not open
*/
static createDatabaseNotOpenError(): BrowserAuthError;
}

@@ -16,2 +16,2 @@ export { PublicClientApplication } from "./app/PublicClientApplication";

export { EventType } from "./event/EventType";
export { AuthenticationScheme, AccountInfo, AuthenticationResult, InteractionRequiredAuthError, AuthError, AuthErrorMessage, INetworkModule, ILoggerCallback, Logger, LogLevel, ProtocolMode, StringUtils, UrlString } from "@azure/msal-common";
export { AuthenticationScheme, AccountInfo, AccountEntity, AuthenticationResult, InteractionRequiredAuthError, AuthError, AuthErrorMessage, INetworkModule, ILoggerCallback, Logger, LogLevel, ProtocolMode, StringUtils, UrlString } from "@azure/msal-common";

@@ -11,3 +11,3 @@ import { AuthorizationCodeRequest, AuthenticationResult, AuthorizationCodeClient, Authority, INetworkModule } from "@azure/msal-common";

protected authCodeRequest: AuthorizationCodeRequest;
constructor(authCodeModule: AuthorizationCodeClient, storageImpl: BrowserCacheManager);
constructor(authCodeModule: AuthorizationCodeClient, storageImpl: BrowserCacheManager, authCodeRequest: AuthorizationCodeRequest);
/**

@@ -17,3 +17,3 @@ * Function to enable user interaction.

*/
abstract initiateAuthRequest(requestUrl: string, authCodeRequest: AuthorizationCodeRequest, params: InteractionParams): Window | Promise<HTMLIFrameElement> | Promise<void>;
abstract initiateAuthRequest(requestUrl: string, params: InteractionParams): Window | Promise<HTMLIFrameElement> | Promise<void>;
/**

@@ -23,4 +23,4 @@ * Function to handle response parameters from hash.

*/
handleCodeResponse(locationHash: string, authority: Authority, networkModule: INetworkModule): Promise<AuthenticationResult>;
handleCodeResponse(locationHash: string, state: string, authority: Authority, networkModule: INetworkModule): Promise<AuthenticationResult>;
protected updateTokenEndpointAuthority(cloudInstanceHostname: string, authority: Authority, networkModule: INetworkModule): Promise<void>;
}

@@ -13,3 +13,3 @@ import { AuthorizationCodeRequest, AuthorizationCodeClient } from "@azure/msal-common";

private currentWindow;
constructor(authCodeModule: AuthorizationCodeClient, storageImpl: BrowserCacheManager);
constructor(authCodeModule: AuthorizationCodeClient, storageImpl: BrowserCacheManager, authCodeRequest: AuthorizationCodeRequest);
/**

@@ -19,3 +19,3 @@ * Opens a popup window with given request Url.

*/
initiateAuthRequest(requestUrl: string, authCodeRequest: AuthorizationCodeRequest, params: PopupParams): Window;
initiateAuthRequest(requestUrl: string, params: PopupParams): Window;
/**

@@ -22,0 +22,0 @@ * Monitors a window until it loads a url with a known hash, or hits a specified timeout.

@@ -11,3 +11,3 @@ import { AuthorizationCodeClient, AuthorizationCodeRequest, ICrypto, AuthenticationResult, Authority, INetworkModule } from "@azure/msal-common";

private browserCrypto;
constructor(authCodeModule: AuthorizationCodeClient, storageImpl: BrowserCacheManager, browserCrypto: ICrypto);
constructor(authCodeModule: AuthorizationCodeClient, storageImpl: BrowserCacheManager, authCodeRequest: AuthorizationCodeRequest, browserCrypto: ICrypto);
/**

@@ -17,3 +17,3 @@ * Redirects window to given URL.

*/
initiateAuthRequest(requestUrl: string, authCodeRequest: AuthorizationCodeRequest, params: RedirectParams): Promise<void>;
initiateAuthRequest(requestUrl: string, params: RedirectParams): Promise<void>;
/**

@@ -23,3 +23,3 @@ * Handle authorization code response in the window.

*/
handleCodeResponse(locationHash: string, authority: Authority, networkModule: INetworkModule, clientId?: string): Promise<AuthenticationResult>;
handleCodeResponse(locationHash: string, state: string, authority: Authority, networkModule: INetworkModule, clientId?: string): Promise<AuthenticationResult>;
}

@@ -6,3 +6,3 @@ import { AuthorizationCodeRequest, AuthorizationCodeClient } from "@azure/msal-common";

private navigateFrameWait;
constructor(authCodeModule: AuthorizationCodeClient, storageImpl: BrowserCacheManager, navigateFrameWait: number);
constructor(authCodeModule: AuthorizationCodeClient, storageImpl: BrowserCacheManager, authCodeRequest: AuthorizationCodeRequest, navigateFrameWait: number);
/**

@@ -13,3 +13,3 @@ * Creates a hidden iframe to given URL using user-requested scopes as an id.

*/
initiateAuthRequest(requestUrl: string, authCodeRequest: AuthorizationCodeRequest): Promise<HTMLIFrameElement>;
initiateAuthRequest(requestUrl: string): Promise<HTMLIFrameElement>;
/**

@@ -16,0 +16,0 @@ * Monitors an iframe content window until it loads a url with a known hash, or hits a specified timeout.

import { AuthorizationUrlRequest as CommonAuthorizationUrlRequest } from "@azure/msal-common";
export declare type AuthorizationUrlRequest = Partial<CommonAuthorizationUrlRequest>;
export declare type AuthorizationUrlRequest = Omit<CommonAuthorizationUrlRequest, "state" | "nonce"> & {
state: string;
nonce: string;
};

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

import { SilentFlowRequest, StringDict } from "@azure/msal-common";
import { AccountInfo, SilentFlowRequest, StringDict } from "@azure/msal-common";
/**

@@ -15,8 +15,9 @@ * SilentRequest: Request object passed by user to retrieve tokens from the

*/
export declare type SilentRequest = Omit<SilentFlowRequest, "authority" | "correlationId" | "forceRefresh"> & {
export declare type SilentRequest = Omit<SilentFlowRequest, "authority" | "correlationId" | "forceRefresh" | "account"> & {
redirectUri?: string;
extraQueryParameters?: StringDict;
authority?: string;
account?: AccountInfo;
correlationId?: string;
forceRefresh?: boolean;
};

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

handleRedirectPromise = 865,
acquireTokenSilent_silentFlow = 61
acquireTokenSilent_silentFlow = 61,
logout = 961
}

@@ -57,0 +58,0 @@ export declare enum InteractionType {

@@ -12,3 +12,3 @@ import { InteractionType } from "./BrowserConstants";

*/
static extractBrowserRequestState(browserCrypto: ICrypto, state: string): BrowserStateObject;
static extractBrowserRequestState(browserCrypto: ICrypto, state: string): BrowserStateObject | null;
/**

@@ -15,0 +15,0 @@ * Parses properties of server response from url hash

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

},
"version": "2.8.0",
"version": "2.9.0",
"description": "Microsoft Authentication Library for js",

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

"devDependencies": {
"@azure/storage-blob": "^12.2.0-preview.1",
"@azure/storage-blob": "^12.2.1",
"@babel/core": "^7.7.2",

@@ -92,4 +92,4 @@ "@babel/plugin-proposal-class-properties": "^7.7.0",

"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-typescript2": "^0.24.3",
"rollup-plugin-uglify": "^6.0.4",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.29.0",
"shx": "^0.3.2",

@@ -104,4 +104,4 @@ "sinon": "^7.5.0",

"dependencies": {
"@azure/msal-common": "^2.0.0"
"@azure/msal-common": "^2.1.0"
}
}

@@ -60,3 +60,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.8.0/js/msal-browser.min.js"></script>
<script type="text/javascript" src="https://alcdn.msauth.net/browser/2.9.0/js/msal-browser.min.js"></script>
```

@@ -174,3 +174,3 @@

- Angular: [@azure/msal-angular v2 (Alpha)](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/msal-angular-v2/lib/msal-angular)
- Angular: [@azure/msal-angular v2 (Alpha)](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-angular)
- React: [@azure/msal-react (Alpha)](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-react)

@@ -177,0 +177,0 @@

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is 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

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