Socket
Socket
Sign inDemoInstall

@azure/msal

Package Overview
Dependencies
1
Maintainers
3
Versions
29
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.2.2-beta.1 to 1.2.2

.babelrc

0

.eslintrc.json

@@ -0,0 +0,0 @@ {

2

.mocharc.json
{
"require": ["test/setup.js", "ts-node/register", "source-map-support/register"],
"require": ["test/setup.js", "@babel/polyfill"],
"spec": ["./test/*.spec.ts", "./test/**/*.spec.ts"]
}
# 1.2.2
## Features
* Add `setLogger` function to `UserAgentApplication`. (#1251)
## Enhancements
* Render hidden iframes synchronously if `navigateFrameWait` is set to `0`. (#1278)
* Add `redirectStartPage` property to `AuthenticationParameters` to allow apps to indicate which page triggered the redirect. (#1343)
## Bugs
* Properly remove temporary cache entries. (#1339)
* Always send back the accessToken and scopes if the response includes them. (#1351)
* Ensure silent operations timeout if the iframe never returns to the app domain. (#1354)
* Ensure hidden iframes are properly removed. (#1415)
## Logging / Telemetry
* Add telemetry for `acquireTokenSilent`. (#1388)
# 1.2.1

@@ -13,3 +25,3 @@

## enhancements
## Enhancements
* `isAngular` flag removal from `redirect` use cases(#1193)

@@ -144,3 +156,3 @@

#### Configuration
* Initialization of the MSAL JS library – We introduced a ‘Configuration’ object that can be sent through the constructor of UserAgentApplication() class.
* Initialization of the MSAL JS library – We introduced a 'Configuration' object that can be sent through the constructor of UserAgentApplication() class.

@@ -248,3 +260,3 @@ ##### Configuration datatype :

* ‘Request’ object is introduced for all login/accessToken calls, this replaces previous overloading of login/acquireToken calls.
* 'Request' object is introduced for all login/accessToken calls, this replaces previous overloading of login/acquireToken calls.
* Users can choose to pass optional parameters to finetune their requests for authentication and authorization.

@@ -256,6 +268,6 @@ * 'User' object is now replaced with 'Account' => the public API getUser() is now getAccount() with more enhanced data.

```javascript
export type QPDict = {[key: string]: string};
export type QPDict = {[key: string]: string};
// Request type
export type AuthenticationParameters = {
export type AuthenticationParameters = {
scopes?: Array<string>;

@@ -311,4 +323,4 @@ extraScopesToConsent?: Array<string>;

#### Response Object
* ‘Response’ and 'Error' objects are introduced for server responses and app failures
- For ‘Redirect’ usecases, explicit success and failure call backs should be passed to ‘handleRedirectCallbacks()’.
* 'Response' and 'Error' objects are introduced for server responses and app failures
- For 'Redirect' usecases, explicit success and failure call backs should be passed to 'handleRedirectCallbacks()'.
- For 'Popup' and 'Silent' usecases, a promise pattern i.e.,' .then and .catch' can be used.

@@ -319,12 +331,12 @@

```javascript
export type AuthResponse = {
uniqueId: string;
tenantId: string;
tokenType: string;
idToken: IdToken;
accessToken: string;
scopes: Array<string>;
expiresOn: Date;
account: Account;
accountState: string;
export type AuthResponse = {
uniqueId: string;
tenantId: string;
tokenType: string;
idToken: IdToken;
accessToken: string;
scopes: Array<string>;
expiresOn: Date;
account: Account;
accountState: string;
};

@@ -337,7 +349,7 @@ ```

```javascript
export class AuthError extends Error {
errorCode: string;
errorMessage: string;
...
}
export class AuthError extends Error {
errorCode: string;
errorMessage: string;
...
}
```

@@ -344,0 +356,0 @@

@@ -0,0 +0,0 @@ var webpackConfig = require('./webpack.config');

@@ -0,0 +0,0 @@ import { ClientInfo } from "./ClientInfo";

@@ -0,0 +0,0 @@ "use strict";

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

redirectUri?: string;
redirectStartPage?: string;
};
export declare function validateClaimsRequest(request: AuthenticationParameters): void;

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { Authority, AuthorityType } from "./Authority";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { IUri } from "../IUri";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { Authority } from "./Authority";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { AadAuthority } from "./AadAuthority";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { Account } from "./Account";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { AccessTokenKey } from "./AccessTokenKey";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { AccessTokenCacheItem } from "./AccessTokenCacheItem";

@@ -124,10 +124,6 @@ "use strict";

for (key in storage) {
if (!state || key.indexOf(state) !== -1) {
var splitKey = key.split(Constants_1.Constants.resourceDelimiter);
var keyState = splitKey.length > 1 ? splitKey[splitKey.length - 1] : null;
if (keyState === state && !this.tokenRenewalInProgress(keyState)) {
this.removeItem(key);
this.setItemCookie(key, "", -1);
this.clearMsalCookie(state);
}
if ((!state || key.indexOf(state) !== -1) && !this.tokenRenewalInProgress(state)) {
this.removeItem(key);
this.setItemCookie(key, "", -1);
this.clearMsalCookie(state);
}

@@ -134,0 +130,0 @@ }

@@ -0,0 +0,0 @@ import { CacheLocation } from "../Configuration";

@@ -0,0 +0,0 @@ "use strict";

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

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { Logger } from "./Logger";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ export declare const AuthErrorMessage: {

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { AuthError } from "./AuthError";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { ClientAuthError } from "./ClientAuthError";

@@ -0,0 +0,0 @@ import { ServerError } from "./ServerError";

@@ -0,0 +0,0 @@ import { AuthError } from "./AuthError";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { StringDict } from "./MsalTypes";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ export { UserAgentApplication } from "./UserAgentApplication";

@@ -0,0 +0,0 @@ "use strict";

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

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ export interface ILoggerCallback {

@@ -0,0 +0,0 @@ "use strict";

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

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ export declare class ScopeSet {

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { Authority } from "./authority/Authority";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import TelemetryEvent from "./TelemetryEvent";

@@ -17,2 +17,3 @@ "use strict";

_this.event[TelemetryUtils_1.prependEventNamePrefix("application_version")] = platform.applicationVersion;
_this.event[TelemetryUtils_1.prependEventNamePrefix("effective_connection_speed")] = platform.networkInformation && platform.networkInformation.connectionSpeed;
_this.event["" + TelemetryConstants_1.TELEMETRY_BLOB_EVENT_NAMES.UiEventCountTelemetryBatchKey] = _this.getEventCount(TelemetryUtils_1.prependEventNamePrefix("ui_event"), eventCount);

@@ -19,0 +20,0 @@ _this.event["" + TelemetryConstants_1.TELEMETRY_BLOB_EVENT_NAMES.HttpEventCountTelemetryBatchKey] = _this.getEventCount(TelemetryUtils_1.prependEventNamePrefix("http_event"), eventCount);

@@ -0,0 +0,0 @@ export declare const EVENT_NAME_PREFIX = "msal.";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ export default class TelemetryEvent {

@@ -0,0 +0,0 @@ "use strict";

@@ -12,2 +12,3 @@ import TelemetryEvent from "./TelemetryEvent";

constructor(config: TelemetryConfig, telemetryEmitter: TelemetryEmitter);
static getTelemetrymanagerStub(clientId: string): TelemetryManager;
startEvent(event: TelemetryEvent): void;

@@ -14,0 +15,0 @@ stopEvent(event: TelemetryEvent): void;

@@ -5,2 +5,3 @@ "use strict";

var DefaultEvent_1 = tslib_1.__importDefault(require("./DefaultEvent"));
var Constants_1 = require("../utils/Constants");
// for use in cache events

@@ -21,3 +22,6 @@ var MSAL_CACHE_EVENT_VALUE_PREFIX = "msal.token";

// TODO THROW if bad options
this.telemetryPlatform = config.platform;
this.telemetryPlatform = tslib_1.__assign({ sdk: Constants_1.Constants.libraryName, sdkVersion: Constants_1.libraryVersion(), networkInformation: {
// @ts-ignore
connectionSpeed: navigator && navigator.connection && navigator.connection.effectiveType
} }, config.platform);
this.clientId = config.clientId;

@@ -32,2 +36,16 @@ this.onlySendFailureTelemetry = config.onlySendFailureTelemetry;

}
TelemetryManager.getTelemetrymanagerStub = function (clientId) {
var applicationName = "UnSetStub";
var applicationVersion = "0.0";
var telemetryEmitter = function () { };
var telemetryPlatform = {
applicationName: applicationName,
applicationVersion: applicationVersion
};
var telemetryManagerConfig = {
platform: telemetryPlatform,
clientId: clientId
};
return new this(telemetryManagerConfig, telemetryEmitter);
};
TelemetryManager.prototype.startEvent = function (event) {

@@ -34,0 +52,0 @@ if (!this.telemetryEmitter) {

@@ -16,6 +16,7 @@ import TelemetryEvent from "./TelemetryEvent";

export interface TelemetryPlatform {
sdk: string;
sdkVersion: string;
sdk?: string;
sdkVersion?: string;
applicationName: string;
applicationVersion: string;
networkInformation?: NetworkInformation;
}

@@ -27,1 +28,4 @@ export interface TelemetryConfig {

}
export interface NetworkInformation {
connectionSpeed: string;
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=TelemetryTypes.js.map
export declare const scrubTenantFromUri: (uri: string) => String;
export declare const hashPersonalIdentifier: (valueToHash: string) => string;
export declare const prependEventNamePrefix: (suffix: string) => string;

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { Authority } from "./authority/Authority";

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

export declare class Constants {
static readonly libraryName: string;
static readonly claims: string;

@@ -64,3 +65,2 @@ static readonly clientId: string;

URL_HASH = "urlHash",
ANGULAR_LOGIN_REQUEST = "angular.login.request",
INTERACTION_STATUS = "interaction_status",

@@ -67,0 +67,0 @@ REDIRECT_REQUEST = "redirect_request"

@@ -14,2 +14,8 @@ "use strict";

}
Object.defineProperty(Constants, "libraryName", {
get: function () { return "Msal.js"; } // used in telemetry sdkName
,
enumerable: true,
configurable: true
});
Object.defineProperty(Constants, "claims", {

@@ -187,3 +193,2 @@ get: function () { return "claims"; },

TemporaryCacheKeys["URL_HASH"] = "urlHash";
TemporaryCacheKeys["ANGULAR_LOGIN_REQUEST"] = "angular.login.request";
TemporaryCacheKeys["INTERACTION_STATUS"] = "interaction_status";

@@ -190,0 +195,0 @@ TemporaryCacheKeys["REDIRECT_REQUEST"] = "redirect_request";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { AuthenticationParameters } from "../AuthenticationParameters";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { AuthResponse } from "../AuthResponse";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { IUri } from "../IUri";

@@ -0,0 +0,0 @@ "use strict";

@@ -27,3 +27,3 @@ import { Logger } from "../Logger";

*/
static monitorWindowForHash(contentWindow: Window, timeout: number, urlNavigate: string): Promise<string>;
static monitorWindowForHash(contentWindow: Window, timeout: number, urlNavigate: string, isSilentCall?: boolean): Promise<string>;
/**

@@ -30,0 +30,0 @@ * @hidden

@@ -30,3 +30,3 @@ "use strict";

*/
WindowUtils.monitorWindowForHash = function (contentWindow, timeout, urlNavigate) {
WindowUtils.monitorWindowForHash = function (contentWindow, timeout, urlNavigate, isSilentCall) {
return new Promise(function (resolve, reject) {

@@ -51,9 +51,22 @@ var maxTicks = timeout / WindowUtils.POLLING_INTERVAL_MS;

catch (e) { }
// Don't process blank pages or cross domain
if (!href || href === "about:blank") {
return;
if (isSilentCall) {
/*
* Always run clock for silent calls
* as silent operations should be short,
* and to ensure they always at worst timeout.
*/
ticks++;
}
// Only run clock when we are on same domain
ticks++;
if (UrlUtils_1.UrlUtils.urlContainsHash(href)) {
else {
// Don't process blank pages or cross domain
if (!href || href === "about:blank") {
return;
}
/*
* Only run clock when we are on same domain for popups
* as popup operations can take a long time.
*/
ticks++;
}
if (href && UrlUtils_1.UrlUtils.urlContainsHash(href)) {
clearInterval(intervalId);

@@ -150,3 +163,3 @@ resolve(contentWindow.location.hash);

WindowUtils.removeHiddenIframe = function (iframe) {
if (document.body !== iframe.parentNode) {
if (document.body === iframe.parentNode) {
document.body.removeChild(iframe);

@@ -153,0 +166,0 @@ }

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

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { ClientInfo } from "./ClientInfo";

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

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

redirectUri?: string;
redirectStartPage?: string;
};
export declare function validateClaimsRequest(request: AuthenticationParameters): void;

@@ -0,0 +0,0 @@ import { Authority, AuthorityType } from "./Authority";

@@ -0,0 +0,0 @@ import { IUri } from "../IUri";

@@ -0,0 +0,0 @@ import { Authority } from "./Authority";

@@ -0,0 +0,0 @@ import { AadAuthority } from "./AadAuthority";

@@ -0,0 +0,0 @@ import { Account } from "./Account";

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

@@ -0,0 +0,0 @@ import { AccessTokenKey } from "./AccessTokenKey";

@@ -0,0 +0,0 @@ import { AccessTokenCacheItem } from "./AccessTokenCacheItem";

@@ -122,10 +122,6 @@ /*

for (key in storage) {
if (!state || key.indexOf(state) !== -1) {
var splitKey = key.split(Constants.resourceDelimiter);
var keyState = splitKey.length > 1 ? splitKey[splitKey.length - 1] : null;
if (keyState === state && !this.tokenRenewalInProgress(keyState)) {
this.removeItem(key);
this.setItemCookie(key, "", -1);
this.clearMsalCookie(state);
}
if ((!state || key.indexOf(state) !== -1) && !this.tokenRenewalInProgress(state)) {
this.removeItem(key);
this.setItemCookie(key, "", -1);
this.clearMsalCookie(state);
}

@@ -132,0 +128,0 @@ }

@@ -0,0 +0,0 @@ import { CacheLocation } from "../Configuration";

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

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

@@ -0,0 +0,0 @@ import { Logger } from "./Logger";

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

@@ -0,0 +0,0 @@ export declare const AuthErrorMessage: {

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

@@ -0,0 +0,0 @@ import { AuthError } from "./AuthError";

@@ -0,0 +0,0 @@ import { ClientAuthError } from "./ClientAuthError";

@@ -0,0 +0,0 @@ import { ServerError } from "./ServerError";

@@ -0,0 +0,0 @@ import { AuthError } from "./AuthError";

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

@@ -0,0 +0,0 @@ import { StringDict } from "./MsalTypes";

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

@@ -0,0 +0,0 @@ export { UserAgentApplication } from "./UserAgentApplication";

@@ -0,0 +0,0 @@ export { UserAgentApplication } from "./UserAgentApplication";

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

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

@@ -0,0 +0,0 @@ export interface ILoggerCallback {

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

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

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

@@ -0,0 +0,0 @@ export declare class ScopeSet {

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

@@ -0,0 +0,0 @@ import { Authority } from "./authority/Authority";

@@ -0,0 +0,0 @@ import TelemetryEvent from "./TelemetryEvent";

@@ -15,2 +15,3 @@ import * as tslib_1 from "tslib";

_this.event[prependEventNamePrefix("application_version")] = platform.applicationVersion;
_this.event[prependEventNamePrefix("effective_connection_speed")] = platform.networkInformation && platform.networkInformation.connectionSpeed;
_this.event["" + TELEMETRY_BLOB_EVENT_NAMES.UiEventCountTelemetryBatchKey] = _this.getEventCount(prependEventNamePrefix("ui_event"), eventCount);

@@ -17,0 +18,0 @@ _this.event["" + TELEMETRY_BLOB_EVENT_NAMES.HttpEventCountTelemetryBatchKey] = _this.getEventCount(prependEventNamePrefix("http_event"), eventCount);

@@ -0,0 +0,0 @@ export declare const EVENT_NAME_PREFIX = "msal.";

@@ -0,0 +0,0 @@ export var EVENT_NAME_PREFIX = "msal.";

@@ -0,0 +0,0 @@ export default class TelemetryEvent {

@@ -0,0 +0,0 @@ import * as tslib_1 from "tslib";

@@ -12,2 +12,3 @@ import TelemetryEvent from "./TelemetryEvent";

constructor(config: TelemetryConfig, telemetryEmitter: TelemetryEmitter);
static getTelemetrymanagerStub(clientId: string): TelemetryManager;
startEvent(event: TelemetryEvent): void;

@@ -14,0 +15,0 @@ stopEvent(event: TelemetryEvent): void;

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

import * as tslib_1 from "tslib";
import DefaultEvent from "./DefaultEvent";
import { libraryVersion, Constants } from "../utils/Constants";
// for use in cache events

@@ -17,3 +19,6 @@ var MSAL_CACHE_EVENT_VALUE_PREFIX = "msal.token";

// TODO THROW if bad options
this.telemetryPlatform = config.platform;
this.telemetryPlatform = tslib_1.__assign({ sdk: Constants.libraryName, sdkVersion: libraryVersion(), networkInformation: {
// @ts-ignore
connectionSpeed: navigator && navigator.connection && navigator.connection.effectiveType
} }, config.platform);
this.clientId = config.clientId;

@@ -28,2 +33,16 @@ this.onlySendFailureTelemetry = config.onlySendFailureTelemetry;

}
TelemetryManager.getTelemetrymanagerStub = function (clientId) {
var applicationName = "UnSetStub";
var applicationVersion = "0.0";
var telemetryEmitter = function () { };
var telemetryPlatform = {
applicationName: applicationName,
applicationVersion: applicationVersion
};
var telemetryManagerConfig = {
platform: telemetryPlatform,
clientId: clientId
};
return new this(telemetryManagerConfig, telemetryEmitter);
};
TelemetryManager.prototype.startEvent = function (event) {

@@ -30,0 +49,0 @@ if (!this.telemetryEmitter) {

@@ -16,6 +16,7 @@ import TelemetryEvent from "./TelemetryEvent";

export interface TelemetryPlatform {
sdk: string;
sdkVersion: string;
sdk?: string;
sdkVersion?: string;
applicationName: string;
applicationVersion: string;
networkInformation?: NetworkInformation;
}

@@ -27,1 +28,4 @@ export interface TelemetryConfig {

}
export interface NetworkInformation {
connectionSpeed: string;
}
export declare const scrubTenantFromUri: (uri: string) => String;
export declare const hashPersonalIdentifier: (valueToHash: string) => string;
export declare const prependEventNamePrefix: (suffix: string) => string;

@@ -0,0 +0,0 @@ import { B2cAuthority } from "../authority/B2cAuthority";

@@ -0,0 +0,0 @@ import { Authority } from "./authority/Authority";

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

export declare class Constants {
static readonly libraryName: string;
static readonly claims: string;

@@ -64,3 +65,2 @@ static readonly clientId: string;

URL_HASH = "urlHash",
ANGULAR_LOGIN_REQUEST = "angular.login.request",
INTERACTION_STATUS = "interaction_status",

@@ -67,0 +67,0 @@ REDIRECT_REQUEST = "redirect_request"

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

}
Object.defineProperty(Constants, "libraryName", {
get: function () { return "Msal.js"; } // used in telemetry sdkName
,
enumerable: true,
configurable: true
});
Object.defineProperty(Constants, "claims", {

@@ -185,3 +191,2 @@ get: function () { return "claims"; },

TemporaryCacheKeys["URL_HASH"] = "urlHash";
TemporaryCacheKeys["ANGULAR_LOGIN_REQUEST"] = "angular.login.request";
TemporaryCacheKeys["INTERACTION_STATUS"] = "interaction_status";

@@ -188,0 +193,0 @@ TemporaryCacheKeys["REDIRECT_REQUEST"] = "redirect_request";

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

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

@@ -0,0 +0,0 @@ import { AuthenticationParameters } from "../AuthenticationParameters";

@@ -0,0 +0,0 @@ import { AuthResponse } from "../AuthResponse";

@@ -0,0 +0,0 @@ import * as tslib_1 from "tslib";

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

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

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

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

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

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

@@ -0,0 +0,0 @@ import { IUri } from "../IUri";

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

@@ -27,3 +27,3 @@ import { Logger } from "../Logger";

*/
static monitorWindowForHash(contentWindow: Window, timeout: number, urlNavigate: string): Promise<string>;
static monitorWindowForHash(contentWindow: Window, timeout: number, urlNavigate: string, isSilentCall?: boolean): Promise<string>;
/**

@@ -30,0 +30,0 @@ * @hidden

@@ -28,3 +28,3 @@ import { ClientAuthError } from "../error/ClientAuthError";

*/
WindowUtils.monitorWindowForHash = function (contentWindow, timeout, urlNavigate) {
WindowUtils.monitorWindowForHash = function (contentWindow, timeout, urlNavigate, isSilentCall) {
return new Promise(function (resolve, reject) {

@@ -49,9 +49,22 @@ var maxTicks = timeout / WindowUtils.POLLING_INTERVAL_MS;

catch (e) { }
// Don't process blank pages or cross domain
if (!href || href === "about:blank") {
return;
if (isSilentCall) {
/*
* Always run clock for silent calls
* as silent operations should be short,
* and to ensure they always at worst timeout.
*/
ticks++;
}
// Only run clock when we are on same domain
ticks++;
if (UrlUtils.urlContainsHash(href)) {
else {
// Don't process blank pages or cross domain
if (!href || href === "about:blank") {
return;
}
/*
* Only run clock when we are on same domain for popups
* as popup operations can take a long time.
*/
ticks++;
}
if (href && UrlUtils.urlContainsHash(href)) {
clearInterval(intervalId);

@@ -148,3 +161,3 @@ resolve(contentWindow.location.hash);

WindowUtils.removeHiddenIframe = function (iframe) {
if (document.body !== iframe.parentNode) {
if (document.body === iframe.parentNode) {
document.body.removeChild(iframe);

@@ -151,0 +164,0 @@ }

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

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

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

},
"version": "1.2.2-beta.1",
"version": "1.2.2",
"description": "Microsoft Authentication Library for js",

@@ -31,5 +31,6 @@ "keywords": [

"clean": "shx rm -rf dist lib-commonjs lib-es6",
"clean:coverage": "rimraf ../../.nyc_output/*",
"doc": "npm run doc:generate && npm run doc:deploy",
"doc:generate": "typedoc --mode modules --excludePrivate --excludeProtected --out ./docs ./src/ --gitRevision dev",
"doc:deploy": "gh-pages -d docs -a -e docs/msal",
"doc:generate": "typedoc --mode modules --excludePrivate --excludeProtected --out ./ref ./src/ --gitRevision dev",
"doc:deploy": "gh-pages -d ref -a -e ref/msal-core",
"build:modules": "tsc && tsc -m es6 --outDir lib-es6 && npm run build:webpack",

@@ -39,4 +40,4 @@ "build:modules:watch": "tsc -m es6 --outDir lib-es6 --watch",

"test": "mocha",
"test:coverage": "nyc mocha",
"test:report": "nyc report | coveralls",
"test:coverage": "nyc --reporter=text mocha",
"test:coverage:only": "npm run clean:coverage && npm run test:coverage",
"lint": "eslint src --ext .ts",

@@ -50,2 +51,10 @@ "build:webpack": "webpack",

"devDependencies": {
"@babel/core": "^7.7.2",
"@babel/plugin-proposal-class-properties": "^7.7.0",
"@babel/plugin-proposal-object-rest-spread": "^7.6.2",
"@babel/polyfill": "^7.7.0",
"@babel/preset-env": "^7.7.1",
"@babel/preset-typescript": "^7.7.2",
"@babel/register": "^7.7.0",
"@istanbuljs/nyc-config-babel": "^2.1.1",
"@types/chai": "^4.1.7",

@@ -63,9 +72,9 @@ "@types/handlebars": "4.0.33",

"awesome-typescript-loader": "^3.2.3",
"babel-plugin-istanbul": "^5.2.0",
"babel-polyfill": "^6.26.0",
"chai": "^4.2.0",
"coveralls": "^3.0.7",
"eslint": "^6.0.1",
"fork-ts-checker-webpack-plugin": "^0.5.1",
"gh-pages": "^2.1.1",
"handlebars": "^4.1.2",
"handlebars": "^4.7.3",
"husky": "^1.3.1",

@@ -80,2 +89,3 @@ "istanbul-instrumenter-loader": "^3.0.1",

"phantomjs-polyfill": "0.0.2",
"rimraf": "^3.0.0",
"shx": "^0.2.2",

@@ -88,3 +98,3 @@ "sinon": "^7.3.1",

"tslint": "^5.8.0",
"typedoc": "^0.14.2",
"typedoc": "^0.16.11",
"typescript": "^3.2.1",

@@ -91,0 +101,0 @@ "uglifyjs-webpack-plugin": "^2.1.1",

@@ -5,3 +5,3 @@

| [Getting Started](https://docs.microsoft.com/en-us/azure/active-directory/develop/guidedsetups/active-directory-javascriptspa)| [AAD Docs](https://aka.ms/aaddevv2) | [Library Reference](https://azuread.github.io/microsoft-authentication-library-for-js/docs/msal/) | [Support](README.md#community-help-and-support) | [Samples](https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/Samples)
| [Getting Started](https://docs.microsoft.com/en-us/azure/active-directory/develop/guidedsetups/active-directory-javascriptspa)| [AAD Docs](https://aka.ms/aaddevv2) | [Library Reference](https://azuread.github.io/microsoft-authentication-library-for-js/ref/msal-core/) | [Support](README.md#community-help-and-support) | [Samples](https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/Samples)
| --- | --- | --- | --- | --- |

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

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

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

redirectUri?: string;
redirectStartPage?: string;
};

@@ -29,0 +30,0 @@

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

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

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

@@ -136,10 +136,6 @@ /*

for (key in storage) {
if (!state || key.indexOf(state) !== -1) {
const splitKey = key.split(Constants.resourceDelimiter);
const keyState = splitKey.length > 1 ? splitKey[splitKey.length-1]: null;
if (keyState === state && !this.tokenRenewalInProgress(keyState)) {
this.removeItem(key);
this.setItemCookie(key, "", -1);
this.clearMsalCookie(state);
}
if ((!state || key.indexOf(state) !== -1) && !this.tokenRenewalInProgress(state)) {
this.removeItem(key);
this.setItemCookie(key, "", -1);
this.clearMsalCookie(state);
}

@@ -146,0 +142,0 @@ }

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

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

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

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

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

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

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

@@ -0,0 +0,0 @@ export { UserAgentApplication } from "./UserAgentApplication";

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

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

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

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

@@ -0,0 +0,0 @@ import TelemetryEvent from "./TelemetryEvent";

@@ -0,0 +0,0 @@ import TelemetryEvent from "./TelemetryEvent";

@@ -15,2 +15,3 @@ import { EVENT_NAME_PREFIX, TELEMETRY_BLOB_EVENT_NAMES } from "./TelemetryConstants";

this.event[prependEventNamePrefix("application_version")] = platform.applicationVersion;
this.event[prependEventNamePrefix("effective_connection_speed")] = platform.networkInformation && platform.networkInformation.connectionSpeed;
this.event[`${TELEMETRY_BLOB_EVENT_NAMES.UiEventCountTelemetryBatchKey}`] = this.getEventCount(prependEventNamePrefix("ui_event"), eventCount);

@@ -17,0 +18,0 @@ this.event[`${TELEMETRY_BLOB_EVENT_NAMES.HttpEventCountTelemetryBatchKey}`] = this.getEventCount(prependEventNamePrefix("http_event"), eventCount);

@@ -0,0 +0,0 @@ import TelemetryEvent from "./TelemetryEvent";

@@ -0,0 +0,0 @@ export const EVENT_NAME_PREFIX = "msal.";

@@ -0,0 +0,0 @@ import { TELEMETRY_BLOB_EVENT_NAMES } from "./TelemetryConstants";

@@ -12,2 +12,3 @@ import TelemetryEvent from "./TelemetryEvent";

import DefaultEvent from "./DefaultEvent";
import { libraryVersion, Constants } from "../utils/Constants";

@@ -39,3 +40,11 @@ // for use in cache events

// TODO THROW if bad options
this.telemetryPlatform = config.platform;
this.telemetryPlatform = {
sdk: Constants.libraryName,
sdkVersion: libraryVersion(),
networkInformation: {
// @ts-ignore
connectionSpeed: navigator && navigator.connection && navigator.connection.effectiveType
},
...config.platform
};
this.clientId = config.clientId;

@@ -51,2 +60,18 @@ this.onlySendFailureTelemetry = config.onlySendFailureTelemetry;

static getTelemetrymanagerStub(clientId: string) : TelemetryManager {
const applicationName = "UnSetStub";
const applicationVersion = "0.0";
const telemetryEmitter = () => {};
const telemetryPlatform: TelemetryPlatform = {
applicationName,
applicationVersion
};
const telemetryManagerConfig: TelemetryConfig = {
platform: telemetryPlatform,
clientId: clientId
};
return new this(telemetryManagerConfig, telemetryEmitter);
}
startEvent(event: TelemetryEvent) {

@@ -53,0 +78,0 @@ if (!this.telemetryEmitter) {

@@ -12,6 +12,7 @@ import TelemetryEvent from "./TelemetryEvent";

export interface TelemetryPlatform {
sdk: string;
sdkVersion: string;
sdk?: string;
sdkVersion?: string;
applicationName: string;
applicationVersion: string;
networkInformation?: NetworkInformation
}

@@ -24,1 +25,6 @@

}
// In the browser this commes from navigator.connection
export interface NetworkInformation {
connectionSpeed: string;
}

@@ -0,0 +0,0 @@ import { B2cAuthority } from "../authority/B2cAuthority";

@@ -0,0 +0,0 @@ import TelemetryEvent from "./TelemetryEvent";

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

export class Constants {
static get libraryName(): string { return "Msal.js"; } // used in telemetry sdkName
static get claims(): string { return "claims"; }

@@ -86,3 +87,2 @@ static get clientId(): string { return "clientId"; }

URL_HASH = "urlHash",
ANGULAR_LOGIN_REQUEST = "angular.login.request",
INTERACTION_STATUS = "interaction_status",

@@ -89,0 +89,0 @@ REDIRECT_REQUEST = "redirect_request"

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

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

@@ -0,0 +0,0 @@ import { AuthResponse } from "../AuthResponse";

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

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

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

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

@@ -38,3 +38,3 @@ import { ClientAuthError } from "../error/ClientAuthError";

*/
static monitorWindowForHash(contentWindow: Window, timeout: number, urlNavigate: string): Promise<string> {
static monitorWindowForHash(contentWindow: Window, timeout: number, urlNavigate: string, isSilentCall?: boolean): Promise<string> {
return new Promise((resolve, reject) => {

@@ -61,11 +61,23 @@ const maxTicks = timeout / WindowUtils.POLLING_INTERVAL_MS;

// Don't process blank pages or cross domain
if (!href || href === "about:blank") {
return;
if (isSilentCall) {
/*
* Always run clock for silent calls
* as silent operations should be short,
* and to ensure they always at worst timeout.
*/
ticks++;
} else {
// Don't process blank pages or cross domain
if (!href || href === "about:blank") {
return;
}
/*
* Only run clock when we are on same domain for popups
* as popup operations can take a long time.
*/
ticks++;
}
// Only run clock when we are on same domain
ticks++;
if (UrlUtils.urlContainsHash(href)) {
if (href && UrlUtils.urlContainsHash(href)) {
clearInterval(intervalId);

@@ -171,3 +183,3 @@ resolve(contentWindow.location.hash);

static removeHiddenIframe(iframe: HTMLIFrameElement) {
if (document.body !== iframe.parentNode) {
if (document.body === iframe.parentNode) {
document.body.removeChild(iframe);

@@ -174,0 +186,0 @@ }

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

@@ -0,0 +0,0 @@ {

@@ -0,0 +0,0 @@ {

@@ -0,0 +0,0 @@ var path = require("path");

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 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 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 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 too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc