You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

@azure/msal-common

Package Overview
Dependencies
0
Maintainers
3
Versions
117
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 14.5.0 to 14.6.0-alpha.0

0

dist/account/AccountInfo.d.ts

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

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

@@ -0,0 +0,0 @@ export type CcsCredential = {

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

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

5

dist/authority/Authority.d.ts

@@ -30,4 +30,5 @@ import { AuthorityType } from "./AuthorityType";

protected correlationId: string | undefined;
private managedIdentity;
private static reservedTenantDomains;
constructor(authority: string, networkInterface: INetworkModule, cacheManager: ICacheManager, authorityOptions: AuthorityOptions, logger: Logger, performanceClient?: IPerformanceClient, correlationId?: string);
constructor(authority: string, networkInterface: INetworkModule, cacheManager: ICacheManager, authorityOptions: AuthorityOptions, logger: Logger, performanceClient?: IPerformanceClient, correlationId?: string, managedIdentity?: boolean);
/**

@@ -110,3 +111,3 @@ * Get {@link AuthorityType}

/**
* Boolean that returns whethr or not tenant discovery has been completed.
* Boolean that returns whether or not tenant discovery has been completed.
*/

@@ -113,0 +114,0 @@ discoveryComplete(): boolean;

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

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

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

export type AzureRegion = string;
//# sourceMappingURL=AzureRegion.d.ts.map

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

@@ -0,0 +0,0 @@ export type CloudDiscoveryMetadata = {

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

@@ -0,0 +0,0 @@ export type ImdsOptions = {

@@ -0,0 +0,0 @@ import { ServerResponseType } from "../utils/Constants";

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

@@ -0,0 +0,0 @@ import { RegionDiscoveryOutcomes, RegionDiscoverySources } from "../utils/Constants";

@@ -0,0 +0,0 @@ /// <reference types="node" />

@@ -268,11 +268,2 @@ import { AccountFilter, CredentialFilter, ValidCredentialType, AppMetadataFilter, AppMetadataCache, TokenKeys } from "./utils/CacheTypes";

/**
* Retrieve the cached credentials into a cacherecord
* @param account {AccountInfo}
* @param request {BaseAuthRequest}
* @param environment {string}
* @param performanceClient {?IPerformanceClient}
* @param correlationId {?string}
*/
readCacheRecord(account: AccountInfo, request: BaseAuthRequest, environment: string, performanceClient?: IPerformanceClient, correlationId?: string): CacheRecord;
/**
* Retrieve AccountEntity from cache

@@ -279,0 +270,0 @@ * @param account

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

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

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

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

@@ -0,0 +0,0 @@ import { CredentialType, AuthenticationScheme } from "../../utils/Constants";

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

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

*/
export type RefreshTokenEntity = CredentialEntity;
export type RefreshTokenEntity = CredentialEntity & {
expiresOn?: string;
};
//# sourceMappingURL=RefreshTokenEntity.d.ts.map

@@ -0,0 +0,0 @@ export type ServerTelemetryEntity = {

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

export declare class ThrottlingEntity {
export type ThrottlingEntity = {
throttleTime: number;

@@ -7,9 +7,3 @@ error?: string;

subError?: string;
/**
* validates if a given cache entry is "Throttling", parses <key,value>
* @param key
* @param entity
*/
static isThrottlingEntity(key: string, entity?: object): boolean;
}
};
//# sourceMappingURL=ThrottlingEntity.d.ts.map

@@ -0,0 +0,0 @@ import { AccountFilter } from "../utils/CacheTypes";

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

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

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

@@ -42,3 +42,3 @@ import { AuthenticationScheme } from "../../utils/Constants";

*/
export declare function createRefreshTokenEntity(homeAccountId: string, environment: string, refreshToken: string, clientId: string, familyId?: string, userAssertionHash?: string): RefreshTokenEntity;
export declare function createRefreshTokenEntity(homeAccountId: string, environment: string, refreshToken: string, clientId: string, familyId?: string, userAssertionHash?: string, expiresOn?: number): RefreshTokenEntity;
export declare function isCredentialEntity(entity: object): boolean;

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

export declare function isServerTelemetryEntity(key: string, entity?: object): boolean;
/**
* validates if a given cache entry is "Throttling", parses <key,value>
* @param key
* @param entity
*/
export declare function isThrottlingEntity(key: string, entity?: object): boolean;
//# sourceMappingURL=CacheHelpers.d.ts.map

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

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

@@ -0,0 +0,0 @@ import { ClientConfiguration, CommonClientConfiguration } from "../config/ClientConfiguration";

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

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

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

@@ -14,2 +14,3 @@ export declare const CLIENT_ID = "client_id";

export declare const EXPIRES_IN = "expires_in";
export declare const REFRESH_TOKEN_EXPIRES_IN = "refresh_token_expires_in";
export declare const STATE = "state";

@@ -16,0 +17,0 @@ export declare const NONCE = "nonce";

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

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

@@ -0,0 +0,0 @@ import { JsonWebTokenTypes } from "../utils/Constants";

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

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

@@ -0,0 +0,0 @@ import * as AuthErrorCodes from "./AuthErrorCodes";

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

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

@@ -0,0 +0,0 @@ export declare const clientInfoDecodingError = "client_info_decoding_error";

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

@@ -0,0 +0,0 @@ export declare const redirectUriEmpty = "redirect_uri_empty";

@@ -22,2 +22,6 @@ import { AuthError } from "./AuthError";

};
bad_token: {
code: string;
desc: string;
};
};

@@ -24,0 +28,0 @@ /**

export declare const noTokensFound = "no_tokens_found";
export declare const nativeAccountUnavailable = "native_account_unavailable";
export declare const refreshTokenExpired = "refresh_token_expired";
export declare const interactionRequired = "interaction_required";
export declare const consentRequired = "consent_required";
export declare const loginRequired = "login_required";
export declare const badToken = "bad_token";
//# sourceMappingURL=InteractionRequiredAuthErrorCodes.d.ts.map

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

export declare const missingKidError = "missing_kid_error";
export declare const missingAlgError = "missing_alg_error";
//# sourceMappingURL=JoseHeaderErrorCodes.d.ts.map

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

@@ -83,3 +83,3 @@ /**

export { ClientConfigurationError, ClientConfigurationErrorMessage, ClientConfigurationErrorCodes, createClientConfigurationError, } from "./error/ClientConfigurationError";
export { Constants, OIDC_DEFAULT_SCOPES, PromptValue, PersistentCacheKeys, ServerResponseType, ResponseMode, CacheOutcome, CredentialType, CacheType, CacheAccountType, AuthenticationScheme, CodeChallengeMethodValues, PasswordGrantConstants, ThrottlingConstants, ClaimsRequestKeys, HeaderNames, Errors, THE_FAMILY_ID, ONE_DAY_IN_MS, GrantType, AADAuthorityConstants, HttpStatus, JsonWebTokenTypes, } from "./utils/Constants";
export { Constants, OIDC_DEFAULT_SCOPES, PromptValue, PersistentCacheKeys, ServerResponseType, ResponseMode, CacheOutcome, CredentialType, CacheType, CacheAccountType, AuthenticationScheme, CodeChallengeMethodValues, PasswordGrantConstants, ThrottlingConstants, ClaimsRequestKeys, HeaderNames, Errors, THE_FAMILY_ID, ONE_DAY_IN_MS, GrantType, AADAuthorityConstants, HttpStatus, DEFAULT_TOKEN_RENEWAL_OFFSET_SEC, JsonWebTokenTypes, } from "./utils/Constants";
export * as AADServerParamKeys from "./constants/AADServerParamKeys";

@@ -86,0 +86,0 @@ export { StringUtils } from "./utils/StringUtils";

@@ -0,0 +0,0 @@ import { LoggerOptions } from "../config/ClientConfiguration";

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

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

@@ -0,0 +0,0 @@ import { ShrOptions } from "../crypto/SignedHttpRequest";

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

export declare const name = "@azure/msal-common";
export declare const version = "14.5.0";
export declare const version = "14.6.0-alpha.0";
//# sourceMappingURL=packageMetadata.d.ts.map

@@ -0,0 +0,0 @@ import { AuthenticationScheme } from "../utils/Constants";

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

@@ -0,0 +0,0 @@ import { ResponseMode } from "../utils/Constants";

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

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

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

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

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

@@ -17,6 +17,13 @@ import { AccountInfo } from "../account/AccountInfo";

export type CommonSilentFlowRequest = BaseAuthRequest & {
/** Account object to lookup the credentials */
account: AccountInfo;
/** Skip cache lookup and forces network call(s) to get fresh tokens */
forceRefresh: boolean;
/** RedirectUri registered on the app registration - only required in brokering scenarios */
redirectUri?: string;
/** Key value pairs to include on the POST body to the /token endpoint */
tokenBodyParameters?: StringDict;
/** If refresh token will expire within the configured value, consider it already expired. Used to pre-emptively invoke interaction when cached refresh token is close to expiry. */
refreshTokenExpirationOffsetSeconds?: number;
};
//# sourceMappingURL=CommonSilentFlowRequest.d.ts.map

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

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

@@ -0,0 +0,0 @@ export type NativeSignOutRequest = {

@@ -0,0 +0,0 @@ import { ResponseMode } from "../utils/Constants";

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

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

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

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

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

@@ -0,0 +0,0 @@ export type IMDSBadResponse = {

@@ -69,3 +69,3 @@ import { ServerAuthorizationTokenResponse } from "./ServerAuthorizationTokenResponse";

}
export declare function buildAccountToCache(cacheStorage: CacheManager, authority: Authority, homeAccountId: string, idTokenClaims: TokenClaims, base64Decode: (input: string) => string, clientInfo?: string, claimsTenantId?: string | null, authCodePayload?: AuthorizationCodePayload, nativeAccountId?: string, logger?: Logger): AccountEntity;
export declare function buildAccountToCache(cacheStorage: CacheManager, authority: Authority, homeAccountId: string, idTokenClaims: TokenClaims, base64Decode: (input: string) => string, clientInfo?: string, environment?: string, claimsTenantId?: string | null, authCodePayload?: AuthorizationCodePayload, nativeAccountId?: string, logger?: Logger): AccountEntity;
//# sourceMappingURL=ResponseHandler.d.ts.map

@@ -32,2 +32,3 @@ import { AuthenticationScheme } from "../utils/Constants";

refresh_token?: string;
refresh_token_expires_in?: number;
id_token?: string;

@@ -34,0 +35,0 @@ client_info?: string;

@@ -14,2 +14,5 @@ import { PerformanceEvent } from "./PerformanceEvent";

event: PerformanceEvent;
/**
* @deprecated This attribute will be removed in the next major version
*/
measurement: IPerformanceMeasurement;

@@ -30,2 +33,5 @@ };

emitEvents(events: PerformanceEvent[], correlationId: string): void;
/**
* @deprecated This method will be removed in the next major version
*/
startPerformanceMeasurement(measureName: string, correlationId: string): IPerformanceMeasurement;

@@ -32,0 +38,0 @@ generateId(): string;

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

import { ApplicationTelemetry } from "../../config/ClientConfiguration";
import { Logger } from "../../logger/Logger";
import { InProgressPerformanceEvent, IPerformanceClient, PerformanceCallbackFunction, QueueMeasurement } from "./IPerformanceClient";
import { PerformanceEvent, PerformanceEvents } from "./PerformanceEvent";
import { IPerformanceMeasurement } from "./IPerformanceMeasurement";
import { PerformanceEvent, PerformanceEvents } from "./PerformanceEvent";
export interface PreQueueEvent {

@@ -67,2 +67,3 @@ name: PerformanceEvents;

* @returns {IPerformanceMeasurement}
* @deprecated This method will be removed in the next major version
*/

@@ -125,3 +126,3 @@ startPerformanceMeasurement(measureName: string, // eslint-disable-line @typescript-eslint/no-unused-vars

*/
endMeasurement(event: PerformanceEvent, measurement?: IPerformanceMeasurement): PerformanceEvent | null;
endMeasurement(event: PerformanceEvent): PerformanceEvent | null;
/**

@@ -193,3 +194,9 @@ * Saves extra information to be emitted when the measurements are flushed

private truncateIntegralFields;
/**
* Returns event duration in milliseconds
* @param startTimeMs {number}
* @returns {number}
*/
private getDurationMs;
}
//# sourceMappingURL=PerformanceClient.d.ts.map

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

@@ -0,0 +0,0 @@ import { CacheOutcome } from "../../utils/Constants";

@@ -0,0 +0,0 @@ export type ServerTelemetryRequest = {

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

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

@@ -48,2 +48,3 @@ export declare const Constants: {

readonly CLIENT_ERROR_RANGE_START: 400;
readonly UNAUTHORIZED: 401;
readonly CLIENT_ERROR_RANGE_END: 499;

@@ -298,2 +299,3 @@ readonly SERVER_ERROR_RANGE_START: 500;

export declare const ONE_DAY_IN_MS = 86400000;
export declare const DEFAULT_TOKEN_RENEWAL_OFFSET_SEC = 300;
//# sourceMappingURL=Constants.d.ts.map

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

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

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

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

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

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

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

},
"version": "14.5.0",
"version": "14.6.0-alpha.0",
"description": "Microsoft Authentication Library for js",

@@ -16,0 +16,0 @@ "keywords": [

@@ -89,2 +89,4 @@ /*

protected correlationId: string | undefined;
// Indicates if the authority is fake, for the purpose of a Managed Identity Application
private managedIdentity: boolean;
// Reserved tenant domain names that will not be replaced with tenant id

@@ -106,3 +108,4 @@ private static reservedTenantDomains: Set<string> = new Set([

performanceClient?: IPerformanceClient,
correlationId?: string
correlationId?: string,
managedIdentity?: boolean
) {

@@ -122,2 +125,3 @@ this.canonicalAuthority = authority;

this.correlationId = correlationId;
this.managedIdentity = managedIdentity || false;
this.regionDiscovery = new RegionDiscovery(

@@ -388,3 +392,3 @@ networkInterface,

/**
* Boolean that returns whethr or not tenant discovery has been completed.
* Boolean that returns whether or not tenant discovery has been completed.
*/

@@ -1126,3 +1130,5 @@ discoveryComplete(): boolean {

getPreferredCache(): string {
if (this.discoveryComplete()) {
if (this.managedIdentity) {
return Constants.DEFAULT_AUTHORITY_HOST;
} else if (this.discoveryComplete()) {
return this.metadata.preferred_cache;

@@ -1129,0 +1135,0 @@ } else {

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

*/
export type RefreshTokenEntity = CredentialEntity;
export type RefreshTokenEntity = CredentialEntity & {
expiresOn?: string;
};

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

import { ThrottlingConstants } from "../../utils/Constants";
export class ThrottlingEntity {
export type ThrottlingEntity = {
// Unix-time value representing the expiration of the throttle

@@ -17,22 +15,2 @@ throttleTime: number;

subError?: string;
/**
* validates if a given cache entry is "Throttling", parses <key,value>
* @param key
* @param entity
*/
static isThrottlingEntity(key: string, entity?: object): boolean {
let validateKey: boolean = false;
if (key) {
validateKey =
key.indexOf(ThrottlingConstants.THROTTLING_PREFIX) === 0;
}
let validateEntity: boolean = true;
if (entity) {
validateEntity = entity.hasOwnProperty("throttleTime");
}
return validateKey && validateEntity;
}
}
};

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

Separators,
ThrottlingConstants,
} from "../../utils/Constants";

@@ -172,3 +173,4 @@ import { TimeUtils } from "../../utils/TimeUtils";

familyId?: string,
userAssertionHash?: string
userAssertionHash?: string,
expiresOn?: number
): RefreshTokenEntity {

@@ -191,2 +193,6 @@ const rtEntity: RefreshTokenEntity = {

if (expiresOn) {
rtEntity.expiresOn = expiresOn.toString();
}
return rtEntity;

@@ -331,1 +337,20 @@ }

}
/**
* validates if a given cache entry is "Throttling", parses <key,value>
* @param key
* @param entity
*/
export function isThrottlingEntity(key: string, entity?: object): boolean {
let validateKey: boolean = false;
if (key) {
validateKey = key.indexOf(ThrottlingConstants.THROTTLING_PREFIX) === 0;
}
let validateEntity: boolean = true;
if (entity) {
validateEntity = entity.hasOwnProperty("throttleTime");
}
return validateKey && validateEntity;
}

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

import { invoke, invokeAsync } from "../utils/FunctionWrappers";
import { generateCredentialKey } from "../cache/utils/CacheHelpers";
const DEFAULT_REFRESH_TOKEN_EXPIRATION_OFFSET_SECONDS = 300; // 5 Minutes
/**

@@ -219,2 +223,15 @@ * OAuth2.0 refresh token client

}
if (
refreshToken.expiresOn &&
TimeUtils.isTokenExpired(
refreshToken.expiresOn,
request.refreshTokenExpirationOffsetSeconds ||
DEFAULT_REFRESH_TOKEN_EXPIRATION_OFFSET_SECONDS
)
) {
throw createInteractionRequiredAuthError(
InteractionRequiredAuthErrorCodes.refreshTokenExpired
);
}
// attach cached RT size to the current measurement

@@ -233,9 +250,25 @@

return invokeAsync(
this.acquireToken.bind(this),
PerformanceEvents.RefreshTokenClientAcquireToken,
this.logger,
this.performanceClient,
request.correlationId
)(refreshTokenRequest);
try {
return await invokeAsync(
this.acquireToken.bind(this),
PerformanceEvents.RefreshTokenClientAcquireToken,
this.logger,
this.performanceClient,
request.correlationId
)(refreshTokenRequest);
} catch (e) {
if (
e instanceof InteractionRequiredAuthError &&
e.subError === InteractionRequiredAuthErrorCodes.badToken
) {
// Remove bad refresh token from cache
this.logger.verbose(
"acquireTokenWithRefreshToken: bad refresh token, removing from cache"
);
const badRefreshTokenKey = generateCredentialKey(refreshToken);
this.cacheManager.removeRefreshToken(badRefreshTokenKey);
}
throw e;
}
}

@@ -242,0 +275,0 @@

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

import { invokeAsync } from "../utils/FunctionWrappers";
import { getTenantFromAuthorityString } from "../authority/Authority";

@@ -122,9 +123,11 @@ /** @internal */

const environment =
request.authority || this.authority.getPreferredCache();
const cacheRecord = this.cacheManager.readCacheRecord(
const requestTenantId =
request.account.tenantId ||
getTenantFromAuthorityString(request.authority);
const tokenKeys = this.cacheManager.getTokenKeys();
const cachedAccessToken = this.cacheManager.getAccessToken(
request.account,
request,
environment,
tokenKeys,
requestTenantId,
this.performanceClient,

@@ -134,3 +137,3 @@ request.correlationId

if (!cacheRecord.accessToken) {
if (!cachedAccessToken) {
// must refresh due to non-existent access_token

@@ -145,5 +148,5 @@ this.setCacheOutcome(

} else if (
TimeUtils.wasClockTurnedBack(cacheRecord.accessToken.cachedAt) ||
TimeUtils.wasClockTurnedBack(cachedAccessToken.cachedAt) ||
TimeUtils.isTokenExpired(
cacheRecord.accessToken.expiresOn,
cachedAccessToken.expiresOn,
this.config.systemOptions.tokenRenewalOffsetSeconds

@@ -161,4 +164,4 @@ )

} else if (
cacheRecord.accessToken.refreshOn &&
TimeUtils.isTokenExpired(cacheRecord.accessToken.refreshOn, 0)
cachedAccessToken.refreshOn &&
TimeUtils.isTokenExpired(cachedAccessToken.refreshOn, 0)
) {

@@ -171,2 +174,19 @@ // must refresh (in the background) due to the refresh_in value

const environment =
request.authority || this.authority.getPreferredCache();
const cacheRecord: CacheRecord = {
account: this.cacheManager.readAccountFromCache(request.account),
accessToken: cachedAccessToken,
idToken: this.cacheManager.getIdToken(
request.account,
tokenKeys,
requestTenantId,
this.performanceClient,
request.correlationId
),
refreshToken: null,
appMetadata:
this.cacheManager.readAppMetadataFromCache(environment),
};
this.setCacheOutcome(lastCacheOutcome, request.correlationId);

@@ -173,0 +193,0 @@

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

import { ILoggerCallback, Logger, LogLevel } from "../logger/Logger";
import { Constants } from "../utils/Constants";
import {
Constants,
DEFAULT_TOKEN_RENEWAL_OFFSET_SEC,
} from "../utils/Constants";
import { version } from "../packageMetadata";

@@ -25,5 +28,2 @@ import { Authority } from "../authority/Authority";

// Token renewal offset default in seconds
const DEFAULT_TOKEN_RENEWAL_OFFSET_SEC = 300;
/**

@@ -30,0 +30,0 @@ * Use the configuration object to configure MSAL Modules and initialize the base interfaces for MSAL.

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

export const EXPIRES_IN = "expires_in";
export const REFRESH_TOKEN_EXPIRES_IN = "refresh_token_expires_in";
export const STATE = "state";

@@ -21,0 +22,0 @@ export const NONCE = "nonce";

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

InteractionRequiredAuthErrorCodes.loginRequired,
InteractionRequiredAuthErrorCodes.badToken,
];

@@ -27,2 +28,3 @@

"consent_required",
"bad_token",
];

@@ -35,2 +37,6 @@

"The requested account is not available in the native broker. It may have been deleted or logged out. Please sign-in again using an interactive API.",
[InteractionRequiredAuthErrorCodes.refreshTokenExpired]:
"Refresh token has expired.",
[InteractionRequiredAuthErrorCodes.badToken]:
"Identity provider returned bad_token due to an expired or invalid refresh token. Please invoke an interactive API to resolve.",
};

@@ -55,2 +61,8 @@

},
bad_token: {
code: InteractionRequiredAuthErrorCodes.badToken,
desc: InteractionRequiredAuthErrorMessages[
InteractionRequiredAuthErrorCodes.badToken
],
},
};

@@ -57,0 +69,0 @@

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

export const nativeAccountUnavailable = "native_account_unavailable";
export const refreshTokenExpired = "refresh_token_expired";

@@ -15,1 +16,2 @@ // Codes potentially returned by server

export const loginRequired = "login_required";
export const badToken = "bad_token";

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

HttpStatus,
DEFAULT_TOKEN_RENEWAL_OFFSET_SEC,
JsonWebTokenTypes,

@@ -209,0 +210,0 @@ } from "./utils/Constants";

/* eslint-disable header/header */
export const name = "@azure/msal-common";
export const version = "14.5.0";
export const version = "14.6.0-alpha.0";

@@ -23,5 +23,12 @@ /*

export type CommonSilentFlowRequest = BaseAuthRequest & {
/** Account object to lookup the credentials */
account: AccountInfo;
/** Skip cache lookup and forces network call(s) to get fresh tokens */
forceRefresh: boolean;
/** RedirectUri registered on the app registration - only required in brokering scenarios */
redirectUri?: string;
/** Key value pairs to include on the POST body to the /token endpoint */
tokenBodyParameters?: StringDict;
/** If refresh token will expire within the configured value, consider it already expired. Used to pre-emptively invoke interaction when cached refresh token is close to expiry. */
refreshTokenExpirationOffsetSeconds?: number;
};

@@ -438,5 +438,6 @@ /*

serverTokenResponse.client_info,
env,
claimsTenantId,
authCodePayload,
undefined,
undefined, // nativeAccountId
this.logger

@@ -501,2 +502,14 @@ );

if (serverTokenResponse.refresh_token) {
let rtExpiresOn: number | undefined;
if (serverTokenResponse.refresh_token_expires_in) {
const rtExpiresIn: number =
typeof serverTokenResponse.refresh_token_expires_in ===
"string"
? parseInt(
serverTokenResponse.refresh_token_expires_in,
10
)
: serverTokenResponse.refresh_token_expires_in;
rtExpiresOn = reqTimestamp + rtExpiresIn;
}
cachedRefreshToken = CacheHelpers.createRefreshTokenEntity(

@@ -508,3 +521,4 @@ this.homeAccountIdentifier,

serverTokenResponse.foci,
userAssertionHash
userAssertionHash,
rtExpiresOn
);

@@ -660,2 +674,3 @@ }

clientInfo?: string,
environment?: string,
claimsTenantId?: string | null,

@@ -683,5 +698,6 @@ authCodePayload?: AuthorizationCodePayload,

{
homeAccountId: homeAccountId,
idTokenClaims: idTokenClaims,
clientInfo: clientInfo,
homeAccountId,
idTokenClaims,
clientInfo,
environment,
cloudGraphHostName: authCodePayload?.cloud_graph_host_name,

@@ -688,0 +704,0 @@ msGraphHost: authCodePayload?.msgraph_host,

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

refresh_token?: string;
refresh_token_expires_in?: number;
id_token?: string;

@@ -41,0 +42,0 @@ client_info?: string;

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

event: PerformanceEvent;
/**
* @deprecated This attribute will be removed in the next major version
*/
measurement: IPerformanceMeasurement;

@@ -39,2 +42,5 @@ };

emitEvents(events: PerformanceEvent[], correlationId: string): void;
/**
* @deprecated This method will be removed in the next major version
*/
startPerformanceMeasurement(

@@ -41,0 +47,0 @@ measureName: string,

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

} from "./IPerformanceClient";
import { IPerformanceMeasurement } from "./IPerformanceMeasurement";
import {

@@ -22,2 +21,4 @@ IntFields,

} from "./PerformanceEvent";
import { IPerformanceMeasurement } from "./IPerformanceMeasurement";
import { StubPerformanceMeasurement } from "./StubPerformanceClient";

@@ -116,2 +117,3 @@ export interface PreQueueEvent {

* @returns {IPerformanceMeasurement}
* @deprecated This method will be removed in the next major version
*/

@@ -279,7 +281,2 @@ startPerformanceMeasurement(

);
const performanceMeasurement = this.startPerformanceMeasurement(
measureName,
eventCorrelationId
);
performanceMeasurement.startMeasurement();

@@ -308,11 +305,8 @@ const inProgressEvent: PerformanceEvent = {

): PerformanceEvent | null => {
return this.endMeasurement(
{
// Initial set of event properties
...inProgressEvent,
// Properties set when event ends
...event,
},
performanceMeasurement
);
return this.endMeasurement({
// Initial set of event properties
...inProgressEvent,
// Properties set when event ends
...event,
});
},

@@ -331,4 +325,4 @@ discard: () => {

},
measurement: performanceMeasurement,
event: inProgressEvent,
measurement: new StubPerformanceMeasurement(),
};

@@ -347,6 +341,3 @@ }

*/
endMeasurement(
event: PerformanceEvent,
measurement?: IPerformanceMeasurement
): PerformanceEvent | null {
endMeasurement(event: PerformanceEvent): PerformanceEvent | null {
const rootEvent: PerformanceEvent | undefined =

@@ -375,13 +366,4 @@ this.eventsByCorrelationId.get(event.correlationId);

measurement?.endMeasurement();
const durationMs = measurement?.flushMeasurement();
// null indicates no measurement was taken (e.g. needed performance APIs not present)
if (!durationMs) {
this.logger.trace(
"PerformanceClient: Performance measurement not taken",
rootEvent.correlationId
);
return null;
}
const durationMs =
event.durationMs || this.getDurationMs(event.startTimeMs);
this.logger.trace(

@@ -644,2 +626,13 @@ `PerformanceClient: Performance measurement ended for ${event.name}: ${durationMs} ms`,

}
/**
* Returns event duration in milliseconds
* @param startTimeMs {number}
* @returns {number}
*/
private getDurationMs(startTimeMs: number): number {
const durationMs = Date.now() - startTimeMs;
// Handle clock skew
return durationMs < 0 ? durationMs : 0;
}
}

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

}
calculateQueuedTime(): number {

@@ -60,0 +59,0 @@ return 0;

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

CLIENT_ERROR_RANGE_START: 400,
UNAUTHORIZED: 401,
CLIENT_ERROR_RANGE_END: 499,

@@ -374,1 +375,4 @@ SERVER_ERROR_RANGE_START: 500,

export const ONE_DAY_IN_MS = 86400000;
// Token renewal offset default in seconds
export const DEFAULT_TOKEN_RENEWAL_OFFSET_SEC = 300;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc