Socket
Socket
Sign inDemoInstall

@azure/msal-browser

Package Overview
Dependencies
Maintainers
3
Versions
117
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.0.0-beta.3 to 2.0.0-beta.4

dist/src/app/IPublicClientApplication.d.ts

24

changelog.md

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

# 2.0.0-beta.4
## Breaking Changes
* Updated all APIs to send `openid` and `profile` by default in all requests (#1868)
## Features and Fixes
* add interface for PublicClientApplication (#1870)
* Update `monitorIframeForHash` to be purely time-based (#1873)
* Instantiate Logger instance for PublicClientApplication (#1882)
* Fix an issue with encoding in cookies and state values (#1852)
* Fix issue where cache isn't being cleaned correctly (#1856)
* Fix issue where expiration isn't calculated correctly (#1860)
* Fix an issue where the crypto APIs were not truly random (#1872)
* Remove all non-application specific initialization from PublicClientApplication constructor (#1885, #1886)
* Added support for IE11 (#1883, #1884)
* Added support for redirection to pages with custom hashes or query params (#1862)
* Remove deprecated `handleRedirectCallback()` API (#1863)
* Remove function typings for `redirectUri` and `postLogoutRedirectUri` (#1861).
* Add support for Instance Discovery, combine all authority classes into a single generic class (#1811)
# 2.0.0-beta.3
* add `setKnownAuthorities` to constructor call for B2C Authority scenarios (#1646)
## Breaking Changes
* `@azure/msal-browser` now follows a unified cache schema similar to other MSAL libraries (#1624, #1655, #1680, #1711, #1762, #1771)
* Updated browser library to follow common format for request, response, and client configurations (#1682, #1711, #1762, #1770, #1771, #1793)
* Account interface updated to AccountInfo.ts (#1789)
## Features and Fixes
* add `setKnownAuthorities` to constructor call for B2C Authority scenarios (#1646)
* Library state is now sent as a encoded JSON object (#1790)

@@ -7,0 +29,0 @@ * Added a request object for logout APIs, made logout async (#1802)

94

dist/src/app/PublicClientApplication.d.ts
import { AuthorizationUrlRequest, AuthenticationResult, SilentFlowRequest, AccountInfo, EndSessionRequest } from "@azure/msal-common";
import { Configuration } from "../config/Configuration";
import { AuthCallback } from "../types/AuthCallback";
import { IPublicClientApplication } from "./IPublicClientApplication";
import { RedirectRequest } from "../request/RedirectRequest";
import { PopupRequest } from "../request/PopupRequest";
/**

@@ -8,3 +10,3 @@ * The PublicClientApplication class is the object exposed by the library to perform authentication and authorization functions in Single Page Applications

*/
export declare class PublicClientApplication {
export declare class PublicClientApplication implements IPublicClientApplication {
private readonly browserCrypto;

@@ -15,3 +17,4 @@ private readonly browserStorage;

private config;
private defaultAuthorityPromise;
private defaultAuthority;
private logger;
/**

@@ -40,14 +43,2 @@ * @constructor

/**
* WARNING: This function will be deprecated soon.
* Process any redirect-related data and send back the success or error object.
* IMPORTANT: Please do not use this function when using the popup APIs, as it may break the response handling
* in the main window.
*
* @param {@link (AuthCallback:type)} authCallback - Callback which contains
* an AuthError object, containing error data from either the server
* or the library, depending on the origin of the error, or the AuthResponse object
* containing data from the server (returned with a null or non-blocking error).
*/
handleRedirectCallback(authCallback: AuthCallback): Promise<void>;
/**
* Event handler function which allows users to fire events after the PublicClientApplication object

@@ -66,3 +57,3 @@ * has loaded during redirect flows. This should be invoked on all page loads involved in redirect

/**
* Checks if hash exists and handles in window. Otherwise, cancel any current requests and continue.
* Checks if hash exists and handles in window.
* @param responseHash

@@ -81,3 +72,3 @@ * @param interactionHandler

*/
loginRedirect(request: AuthorizationUrlRequest): Promise<void>;
loginRedirect(request: RedirectRequest): Promise<void>;
/**

@@ -93,3 +84,3 @@ * Use when you want to obtain an access_token for your API by redirecting the user's browser window to the authorization endpoint. This function redirects

*/
acquireTokenRedirect(request: AuthorizationUrlRequest): Promise<void>;
acquireTokenRedirect(request: RedirectRequest): Promise<void>;
/**

@@ -102,3 +93,3 @@ * Use when initiating the login process via opening a popup window in the user's browser

*/
loginPopup(request: AuthorizationUrlRequest): Promise<AuthenticationResult>;
loginPopup(request: PopupRequest): Promise<AuthenticationResult>;
/**

@@ -111,3 +102,3 @@ * Use when you want to obtain an access_token for your API via opening a popup window in the user's browser

*/
acquireTokenPopup(request: AuthorizationUrlRequest): Promise<AuthenticationResult>;
acquireTokenPopup(request: PopupRequest): Promise<AuthenticationResult>;
/**

@@ -147,3 +138,3 @@ * Helper which acquires an authorization code with a popup from given url, and exchanges the code for a set of OAuth tokens.

*/
acquireTokenSilent(silentRequest: SilentFlowRequest): Promise<AuthenticationResult>;
acquireTokenSilent(request: SilentFlowRequest): Promise<AuthenticationResult>;
/**

@@ -163,2 +154,16 @@ * Helper which acquires an authorization code silently using a hidden iframe from given url

/**
* Returns all accounts that MSAL currently has data for.
* (the account object is created at the time of successful login)
* or null when no state is found
* @returns {@link IAccount[]} - Array of account objects in cache
*/
getAllAccounts(): AccountInfo[];
/**
* Returns the signed in account matching username.
* (the account object is created at the time of successful login)
* or null when no state is found
* @returns {@link IAccount} - the account object stored in MSAL
*/
getAccountByUsername(userName: string): AccountInfo;
/**
*

@@ -170,3 +175,3 @@ * Use to get the redirect uri configured in MSAL or null.

*/
getRedirectUri(): string;
private getRedirectUri;
/**

@@ -178,18 +183,8 @@ * Use to get the post logout redirect uri configured in MSAL or null.

*/
getPostLogoutRedirectUri(): string;
private getPostLogoutRedirectUri;
/**
* Returns all accounts that MSAL currently has data for.
* (the account object is created at the time of successful login)
* or null when no state is found
* @returns {@link IAccount[]} - Array of account objects in cache
* Used to get a discovered version of the default authority.
*/
getAllAccounts(): AccountInfo[];
private getDiscoveredDefaultAuthority;
/**
* Returns the signed in account matching username.
* (the account object is created at the time of successful login)
* or null when no state is found
* @returns {@link IAccount} - the account object stored in MSAL
*/
getAccountByUsername(userName: string): AccountInfo;
/**
* Helper to check whether interaction is in progress.

@@ -209,4 +204,4 @@ */

/**
* Creates a Client Configuration object with the given authority, or the default authority.
* @param authorityUri
* Creates a Client Configuration object with the given request authority, or the default authority.
* @param requestAuthority
*/

@@ -217,8 +212,8 @@ private getClientConfiguration;

*/
private preflightRequest;
private preflightInteractiveRequest;
/**
* Helper to initialize required request parameters.
* Initializer function for all request APIs
* @param request
*/
private initializeRequest;
private initializeBaseRequest;
/**

@@ -228,5 +223,18 @@ * Generates a request that will contain the openid and profile scopes.

*/
private generateLoginRequest;
private generateAuthorizationCodeRequest;
private generateLogoutRequest;
private setDefaultScopes;
/**
* Helper to initialize required request parameters for interactive APIs and ssoSilent()
* @param request
*/
private initializeAuthorizationRequest;
/**
* Generates an auth code request tied to the url request.
* @param request
*/
private initializeAuthorizationCodeRequest;
/**
* Initializer for the logout request.
* @param logoutRequest
*/
private initializeLogoutRequest;
}

@@ -6,4 +6,5 @@ import { SystemOptions, LoggerOptions, INetworkModule } from "@azure/msal-common";

knownAuthorities?: Array<string>;
redirectUri?: string | (() => string);
postLogoutRedirectUri?: string | (() => string);
cloudDiscoveryMetadata?: string;
redirectUri?: string;
postLogoutRedirectUri?: string;
navigateToLoginRequestUrl?: boolean;

@@ -10,0 +11,0 @@ };

@@ -24,7 +24,2 @@ import { PkceCodes } from "@azure/msal-common";

private generateCodeChallengeFromVerifier;
/**
* Generates a character string based on input array.
* @param buffer
*/
private bufferToCVString;
}

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

};
invalidCacheType: {
code: string;
desc: string;
};
};

@@ -131,3 +135,3 @@ /**

*/
static createMonitorWindowTimeoutError(urlNavigate: string): BrowserAuthError;
static createMonitorWindowTimeoutError(): BrowserAuthError;
/**

@@ -159,2 +163,6 @@ * Creates an error thrown when navigateWindow is called inside an iframe.

static createTokenRequestCacheError(errDetail: string): BrowserAuthError;
/**
* Creates an error thrown if cache type is invalid.
*/
static createInvalidCacheTypeError(): BrowserAuthError;
}

@@ -5,3 +5,5 @@ export { PublicClientApplication } from "./app/PublicClientApplication";

export { BrowserConfigurationAuthError, BrowserConfigurationAuthErrorMessage } from "./error/BrowserConfigurationAuthError";
export type { AuthCallback } from "./types/AuthCallback";
export { AuthorizationUrlRequest, SilentFlowRequest, EndSessionRequest, AuthenticationResult, InteractionRequiredAuthError, AuthError, AuthErrorMessage, INetworkModule, Logger, LogLevel } from "@azure/msal-common";
export { IPublicClientApplication } from "./app/IPublicClientApplication";
export { PopupRequest } from "./request/PopupRequest";
export { RedirectRequest } from "./request/RedirectRequest";
export { AccountInfo, AuthorizationUrlRequest, SilentFlowRequest, EndSessionRequest, AuthenticationResult, InteractionRequiredAuthError, AuthError, AuthErrorMessage, INetworkModule, ILoggerCallback, Logger, LogLevel } from "@azure/msal-common";

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

* Monitors a window until it loads a url with a known hash, or hits a specified timeout.
* @param contentWindow - window that is being monitored
* @param popupWindow - window that is being monitored
* @param timeout - milliseconds until timeout
* @param urlNavigate - url that was navigated to
*/
monitorWindowForHash(contentWindow: Window, timeout: number, urlNavigate: string): Promise<string>;
monitorPopupForHash(popupWindow: Window, timeout: number): Promise<string>;
/**

@@ -25,0 +25,0 @@ * @hidden

@@ -8,3 +8,3 @@ import { AuthorizationCodeRequest, ICrypto, AuthenticationResult } from "@azure/msal-common";

*/
initiateAuthRequest(requestUrl: string, authCodeRequest: AuthorizationCodeRequest, browserCrypto?: ICrypto): Window;
initiateAuthRequest(requestUrl: string, authCodeRequest: AuthorizationCodeRequest, redirectStartPage?: string, browserCrypto?: ICrypto): Window;
/**

@@ -11,0 +11,0 @@ * Handle authorization code response in the window.

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

* Monitors an iframe content window until it loads a url with a known hash, or hits a specified timeout.
* @param iframeContentWindow
* @param iframe
* @param timeout
* @param urlNavigate
*/
monitorFrameForHash(iframe: HTMLIFrameElement, timeout: number, urlNavigate: string): Promise<string>;
monitorIframeForHash(iframe: HTMLIFrameElement, timeout: number): Promise<string>;
/**

@@ -22,0 +21,0 @@ * @hidden

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

/**
* Replaces current hash with hash from provided url
*/
static replaceHash(url: string): void;
/**
* Returns boolean of whether the current window is in an iframe or not.

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

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

},
"version": "2.0.0-beta.3",
"version": "2.0.0-beta.4",
"description": "Microsoft Authentication Library for js",

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

"dependencies": {
"@azure/msal-common": "1.0.0-beta.3"
"@azure/msal-common": "1.0.0-beta.4"
}
}

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

| ------| ------- | ---------| --------- |
| July 6th, 2020 (Tentative) | @azure/msal-browser v2.0.0 | No release notes yet | Full version of the `@azure/msal-browser` package; relies on `@azure/msal-common` v1.0.0 |
| July 13th, 2020 (Tentative) | @azure/msal-browser v2.0.0 | No release notes yet | Full version of the `@azure/msal-browser` package; relies on `@azure/msal-common` v1.0.0 |
| May 11, 2020 | @azure/msal-browser v2.0.0-beta | No release notes yet | Beta version of the `@azure/msal-browser` package; relies on `@azure/msal-common` v1.0.0-beta |

@@ -78,3 +78,4 @@ | January 17, 2020 | @azure/msal-browser v2.0.0-alpha | No release notes yet | Alpha version of the `@azure/msal-browser` package with authorization code flow for SPAs working in dev; relies on msal-common v1.0.0-alpha |

4. [Managing Token Lifetimes](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/token-lifetimes.md)
5. [Logging Out a User](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/logout.md)
5. [Managing Accounts](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-common/docs/Accounts.md)
6. [Logging Out a User](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/logout.md)

@@ -86,6 +87,7 @@ ### Advanced Topics

- [Cache Storage](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/caching.md)
- [Performance Enhancements](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/performance.md)
## Samples
The [`VanillaJSTestApp2.0` folder](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples) contains sample applications for our libraries. You can run any sample by changing the `authConfig.js` file in the respective folder to match your app registration and running the `npm` command `npm start -- -s <sample-name> -p <port>`.
The [`VanillaJSTestApp2.0` folder](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples) contains sample applications for our libraries. You can run any sample by changing the `authConfig.js` file in the respective folder to match your app registration and running the `npm` command `npm start -- -s <sample-name> -p <port>`.

@@ -148,3 +150,3 @@ Here is a complete list of samples for the MSAL.js 2.x library:

The MSAL library will now support the Authorization Code Flow with PKCE for Browser-Based Applications without a backend web server.
The MSAL library will now support the Authorization Code Flow with PKCE for Browser-Based Applications without a backend web server.
We plan to continue support for the implicit flow in the `msal-core` library.

@@ -151,0 +153,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

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