Commit iniziale

This commit is contained in:
Paolo A
2025-02-18 22:59:07 +00:00
commit 4bbf35cefb
6879 changed files with 623784 additions and 0 deletions

View File

@@ -0,0 +1,181 @@
import { PopupRequest } from "../request/PopupRequest.js";
import { RedirectRequest } from "../request/RedirectRequest.js";
/**
* Constants
*/
export declare const BrowserConstants: {
/**
* Interaction in progress cache value
*/
INTERACTION_IN_PROGRESS_VALUE: string;
/**
* Invalid grant error code
*/
INVALID_GRANT_ERROR: string;
/**
* Default popup window width
*/
POPUP_WIDTH: number;
/**
* Default popup window height
*/
POPUP_HEIGHT: number;
/**
* Name of the popup window starts with
*/
POPUP_NAME_PREFIX: string;
/**
* Default popup monitor poll interval in milliseconds
*/
DEFAULT_POLL_INTERVAL_MS: number;
/**
* Msal-browser SKU
*/
MSAL_SKU: string;
};
export declare const NativeConstants: {
CHANNEL_ID: string;
PREFERRED_EXTENSION_ID: string;
MATS_TELEMETRY: string;
};
export declare const NativeExtensionMethod: {
readonly HandshakeRequest: "Handshake";
readonly HandshakeResponse: "HandshakeResponse";
readonly GetToken: "GetToken";
readonly Response: "Response";
};
export type NativeExtensionMethod = (typeof NativeExtensionMethod)[keyof typeof NativeExtensionMethod];
export declare const BrowserCacheLocation: {
readonly LocalStorage: "localStorage";
readonly SessionStorage: "sessionStorage";
readonly MemoryStorage: "memoryStorage";
};
export type BrowserCacheLocation = (typeof BrowserCacheLocation)[keyof typeof BrowserCacheLocation];
/**
* HTTP Request types supported by MSAL.
*/
export declare const HTTP_REQUEST_TYPE: {
readonly GET: "GET";
readonly POST: "POST";
};
export type HTTP_REQUEST_TYPE = (typeof HTTP_REQUEST_TYPE)[keyof typeof HTTP_REQUEST_TYPE];
/**
* Temporary cache keys for MSAL, deleted after any request.
*/
export declare const TemporaryCacheKeys: {
readonly AUTHORITY: "authority";
readonly ACQUIRE_TOKEN_ACCOUNT: "acquireToken.account";
readonly SESSION_STATE: "session.state";
readonly REQUEST_STATE: "request.state";
readonly NONCE_IDTOKEN: "nonce.id_token";
readonly ORIGIN_URI: "request.origin";
readonly RENEW_STATUS: "token.renew.status";
readonly URL_HASH: "urlHash";
readonly REQUEST_PARAMS: "request.params";
readonly SCOPES: "scopes";
readonly INTERACTION_STATUS_KEY: "interaction.status";
readonly CCS_CREDENTIAL: "ccs.credential";
readonly CORRELATION_ID: "request.correlationId";
readonly NATIVE_REQUEST: "request.native";
readonly REDIRECT_CONTEXT: "request.redirect.context";
};
export type TemporaryCacheKeys = (typeof TemporaryCacheKeys)[keyof typeof TemporaryCacheKeys];
export declare const StaticCacheKeys: {
readonly ACCOUNT_KEYS: "msal.account.keys";
readonly TOKEN_KEYS: "msal.token.keys";
};
export type StaticCacheKeys = (typeof StaticCacheKeys)[keyof typeof StaticCacheKeys];
/**
* Cache keys stored in-memory
*/
export declare const InMemoryCacheKeys: {
readonly WRAPPER_SKU: "wrapper.sku";
readonly WRAPPER_VER: "wrapper.version";
};
export type InMemoryCacheKeys = (typeof InMemoryCacheKeys)[keyof typeof InMemoryCacheKeys];
/**
* API Codes for Telemetry purposes.
* Before adding a new code you must claim it in the MSAL Telemetry tracker as these number spaces are shared across all MSALs
* 0-99 Silent Flow
* 800-899 Auth Code Flow
*/
export declare const ApiId: {
readonly acquireTokenRedirect: 861;
readonly acquireTokenPopup: 862;
readonly ssoSilent: 863;
readonly acquireTokenSilent_authCode: 864;
readonly handleRedirectPromise: 865;
readonly acquireTokenByCode: 866;
readonly acquireTokenSilent_silentFlow: 61;
readonly logout: 961;
readonly logoutPopup: 962;
};
export type ApiId = (typeof ApiId)[keyof typeof ApiId];
export declare enum InteractionType {
Redirect = "redirect",
Popup = "popup",
Silent = "silent",
None = "none"
}
/**
* Types of interaction currently in progress.
* Used in events in wrapper libraries to invoke functions when certain interaction is in progress or all interactions are complete.
*/
export declare const InteractionStatus: {
/**
* Initial status before interaction occurs
*/
readonly Startup: "startup";
/**
* Status set when all login calls occuring
*/
readonly Login: "login";
/**
* Status set when logout call occuring
*/
readonly Logout: "logout";
/**
* Status set for acquireToken calls
*/
readonly AcquireToken: "acquireToken";
/**
* Status set for ssoSilent calls
*/
readonly SsoSilent: "ssoSilent";
/**
* Status set when handleRedirect in progress
*/
readonly HandleRedirect: "handleRedirect";
/**
* Status set when interaction is complete
*/
readonly None: "none";
};
export type InteractionStatus = (typeof InteractionStatus)[keyof typeof InteractionStatus];
export declare const DEFAULT_REQUEST: RedirectRequest | PopupRequest;
/**
* JWK Key Format string (Type MUST be defined for window crypto APIs)
*/
export declare const KEY_FORMAT_JWK = "jwk";
export declare const WrapperSKU: {
readonly React: "@azure/msal-react";
readonly Angular: "@azure/msal-angular";
};
export type WrapperSKU = (typeof WrapperSKU)[keyof typeof WrapperSKU];
export declare const DB_NAME = "msal.db";
export declare const DB_VERSION = 1;
export declare const DB_TABLE_NAME: string;
export declare const CacheLookupPolicy: {
readonly Default: 0;
readonly AccessToken: 1;
readonly AccessTokenAndRefreshToken: 2;
readonly RefreshToken: 3;
readonly RefreshTokenAndNetwork: 4;
readonly Skip: 5;
};
export type CacheLookupPolicy = (typeof CacheLookupPolicy)[keyof typeof CacheLookupPolicy];
export declare const iFrameRenewalPolicies: CacheLookupPolicy[];
export declare const LOG_LEVEL_CACHE_KEY = "msal.browser.log.level";
export declare const LOG_PII_CACHE_KEY = "msal.browser.log.pii";
export declare const BROWSER_PERF_ENABLED_KEY = "msal.browser.performance.enabled";
//# sourceMappingURL=BrowserConstants.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"BrowserConstants.d.ts","sourceRoot":"","sources":["../../src/utils/BrowserConstants.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAEhE;;GAEG;AACH,eAAO,MAAM,gBAAgB;IACzB;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;CAEN,CA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G;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;CAEG,CAAC;AACX,MAAM,MAAM,iBAAiB,GACzB,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,OAAO,iBAAiB,CAAC,CAAC;AAE/D,eAAO,MAAM,eAAe,EAAE,eAAe,GAAG,YAE/C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,QAAQ,CAAC;AAGpC,eAAO,MAAM,UAAU;;;CAGb,CAAC;AACX,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,OAAO,UAAU,CAAC,CAAC;AAGtE,eAAO,MAAM,OAAO,YAAY,CAAC;AACjC,eAAO,MAAM,UAAU,IAAI,CAAC;AAC5B,eAAO,MAAM,aAAa,QAAoB,CAAC;AAE/C,eAAO,MAAM,iBAAiB;;;;;;;CAmCpB,CAAC;AACX,MAAM,MAAM,iBAAiB,GACzB,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,OAAO,iBAAiB,CAAC,CAAC;AAE/D,eAAO,MAAM,qBAAqB,EAAE,iBAAiB,EAIpD,CAAC;AAEF,eAAO,MAAM,mBAAmB,2BAA2B,CAAC;AAC5D,eAAO,MAAM,iBAAiB,yBAAyB,CAAC;AAExD,eAAO,MAAM,wBAAwB,qCAAqC,CAAC"}

View File

@@ -0,0 +1,219 @@
/*! @azure/msal-browser v4.2.1 2025-02-11 */
'use strict';
import { OIDC_DEFAULT_SCOPES } from '@azure/msal-common/browser';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
/**
* Constants
*/
const BrowserConstants = {
/**
* Interaction in progress cache value
*/
INTERACTION_IN_PROGRESS_VALUE: "interaction_in_progress",
/**
* Invalid grant error code
*/
INVALID_GRANT_ERROR: "invalid_grant",
/**
* Default popup window width
*/
POPUP_WIDTH: 483,
/**
* Default popup window height
*/
POPUP_HEIGHT: 600,
/**
* Name of the popup window starts with
*/
POPUP_NAME_PREFIX: "msal",
/**
* Default popup monitor poll interval in milliseconds
*/
DEFAULT_POLL_INTERVAL_MS: 30,
/**
* Msal-browser SKU
*/
MSAL_SKU: "msal.js.browser",
};
const NativeConstants = {
CHANNEL_ID: "53ee284d-920a-4b59-9d30-a60315b26836",
PREFERRED_EXTENSION_ID: "ppnbnpeolgkicgegkbkbjmhlideopiji",
MATS_TELEMETRY: "MATS",
};
const NativeExtensionMethod = {
HandshakeRequest: "Handshake",
HandshakeResponse: "HandshakeResponse",
GetToken: "GetToken",
Response: "Response",
};
const BrowserCacheLocation = {
LocalStorage: "localStorage",
SessionStorage: "sessionStorage",
MemoryStorage: "memoryStorage",
};
/**
* HTTP Request types supported by MSAL.
*/
const HTTP_REQUEST_TYPE = {
GET: "GET",
POST: "POST",
};
/**
* Temporary cache keys for MSAL, deleted after any request.
*/
const TemporaryCacheKeys = {
AUTHORITY: "authority",
ACQUIRE_TOKEN_ACCOUNT: "acquireToken.account",
SESSION_STATE: "session.state",
REQUEST_STATE: "request.state",
NONCE_IDTOKEN: "nonce.id_token",
ORIGIN_URI: "request.origin",
RENEW_STATUS: "token.renew.status",
URL_HASH: "urlHash",
REQUEST_PARAMS: "request.params",
SCOPES: "scopes",
INTERACTION_STATUS_KEY: "interaction.status",
CCS_CREDENTIAL: "ccs.credential",
CORRELATION_ID: "request.correlationId",
NATIVE_REQUEST: "request.native",
REDIRECT_CONTEXT: "request.redirect.context",
};
const StaticCacheKeys = {
ACCOUNT_KEYS: "msal.account.keys",
TOKEN_KEYS: "msal.token.keys",
};
/**
* Cache keys stored in-memory
*/
const InMemoryCacheKeys = {
WRAPPER_SKU: "wrapper.sku",
WRAPPER_VER: "wrapper.version",
};
/**
* API Codes for Telemetry purposes.
* Before adding a new code you must claim it in the MSAL Telemetry tracker as these number spaces are shared across all MSALs
* 0-99 Silent Flow
* 800-899 Auth Code Flow
*/
const ApiId = {
acquireTokenRedirect: 861,
acquireTokenPopup: 862,
ssoSilent: 863,
acquireTokenSilent_authCode: 864,
handleRedirectPromise: 865,
acquireTokenByCode: 866,
acquireTokenSilent_silentFlow: 61,
logout: 961,
logoutPopup: 962,
};
/*
* Interaction type of the API - used for state and telemetry
*/
var InteractionType;
(function (InteractionType) {
InteractionType["Redirect"] = "redirect";
InteractionType["Popup"] = "popup";
InteractionType["Silent"] = "silent";
InteractionType["None"] = "none";
})(InteractionType || (InteractionType = {}));
/**
* Types of interaction currently in progress.
* Used in events in wrapper libraries to invoke functions when certain interaction is in progress or all interactions are complete.
*/
const InteractionStatus = {
/**
* Initial status before interaction occurs
*/
Startup: "startup",
/**
* Status set when all login calls occuring
*/
Login: "login",
/**
* Status set when logout call occuring
*/
Logout: "logout",
/**
* Status set for acquireToken calls
*/
AcquireToken: "acquireToken",
/**
* Status set for ssoSilent calls
*/
SsoSilent: "ssoSilent",
/**
* Status set when handleRedirect in progress
*/
HandleRedirect: "handleRedirect",
/**
* Status set when interaction is complete
*/
None: "none",
};
const DEFAULT_REQUEST = {
scopes: OIDC_DEFAULT_SCOPES,
};
/**
* JWK Key Format string (Type MUST be defined for window crypto APIs)
*/
const KEY_FORMAT_JWK = "jwk";
// Supported wrapper SKUs
const WrapperSKU = {
React: "@azure/msal-react",
Angular: "@azure/msal-angular",
};
// DatabaseStorage Constants
const DB_NAME = "msal.db";
const DB_VERSION = 1;
const DB_TABLE_NAME = `${DB_NAME}.keys`;
const CacheLookupPolicy = {
/*
* acquireTokenSilent will attempt to retrieve an access token from the cache. If the access token is expired
* or cannot be found the refresh token will be used to acquire a new one. Finally, if the refresh token
* is expired acquireTokenSilent will attempt to acquire new access and refresh tokens.
*/
Default: 0,
/*
* acquireTokenSilent will only look for access tokens in the cache. It will not attempt to renew access or
* refresh tokens.
*/
AccessToken: 1,
/*
* acquireTokenSilent will attempt to retrieve an access token from the cache. If the access token is expired or
* cannot be found, the refresh token will be used to acquire a new one. If the refresh token is expired, it
* will not be renewed and acquireTokenSilent will fail.
*/
AccessTokenAndRefreshToken: 2,
/*
* acquireTokenSilent will not attempt to retrieve access tokens from the cache and will instead attempt to
* exchange the cached refresh token for a new access token. If the refresh token is expired, it will not be
* renewed and acquireTokenSilent will fail.
*/
RefreshToken: 3,
/*
* acquireTokenSilent will not look in the cache for the access token. It will go directly to network with the
* cached refresh token. If the refresh token is expired an attempt will be made to renew it. This is equivalent to
* setting "forceRefresh: true".
*/
RefreshTokenAndNetwork: 4,
/*
* acquireTokenSilent will attempt to renew both access and refresh tokens. It will not look in the cache. This will
* always fail if 3rd party cookies are blocked by the browser.
*/
Skip: 5,
};
const iFrameRenewalPolicies = [
CacheLookupPolicy.Default,
CacheLookupPolicy.Skip,
CacheLookupPolicy.RefreshTokenAndNetwork,
];
const LOG_LEVEL_CACHE_KEY = "msal.browser.log.level";
const LOG_PII_CACHE_KEY = "msal.browser.log.pii";
const BROWSER_PERF_ENABLED_KEY = "msal.browser.performance.enabled";
export { ApiId, BROWSER_PERF_ENABLED_KEY, BrowserCacheLocation, BrowserConstants, CacheLookupPolicy, DB_NAME, DB_TABLE_NAME, DB_VERSION, DEFAULT_REQUEST, HTTP_REQUEST_TYPE, InMemoryCacheKeys, InteractionStatus, InteractionType, KEY_FORMAT_JWK, LOG_LEVEL_CACHE_KEY, LOG_PII_CACHE_KEY, NativeConstants, NativeExtensionMethod, StaticCacheKeys, TemporaryCacheKeys, WrapperSKU, iFrameRenewalPolicies };
//# sourceMappingURL=BrowserConstants.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"BrowserConstants.mjs","sources":["../../src/utils/BrowserConstants.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAAA;;;AAGG;AAMH;;AAEG;AACU,MAAA,gBAAgB,GAAG;AAC5B;;AAEG;AACH,IAAA,6BAA6B,EAAE,yBAAyB;AACxD;;AAEG;AACH,IAAA,mBAAmB,EAAE,eAAe;AACpC;;AAEG;AACH,IAAA,WAAW,EAAE,GAAG;AAChB;;AAEG;AACH,IAA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AAC3D,IAAA,MAAM,EAAE,mBAAmB;EAC7B;AAEF;;AAEG;AACI,MAAM,cAAc,GAAG,MAAM;AAEpC;AACa,MAAA,UAAU,GAAG;AACtB,IAAA,KAAK,EAAE,mBAAmB;AAC1B,IAAA,OAAO,EAAE,qBAAqB;EACvB;AAGX;AACO,MAAM,OAAO,GAAG,UAAU;AAC1B,MAAM,UAAU,GAAG,EAAE;AACf,MAAA,aAAa,GAAG,CAAG,EAAA,OAAO,QAAQ;AAElC,MAAA,iBAAiB,GAAG;AAC7B;;;;AAIG;AACH,IAAA,OAAO,EAAE,CAAC;AACV;;;AAGG;AACH,IAAA,WAAW,EAAE,CAAC;AACd;;;;AAIG;AACH,IAAA,0BAA0B,EAAE,CAAC;AAC7B;;;;AAIG;AACH,IAAA,YAAY,EAAE,CAAC;AACf;;;;AAIG;AACH,IAAA,sBAAsB,EAAE,CAAC;AACzB;;;AAGG;AACH,IAAA,IAAI,EAAE,CAAC;EACA;AAIE,MAAA,qBAAqB,GAAwB;AACtD,IAAA,iBAAiB,CAAC,OAAO;AACzB,IAAA,iBAAiB,CAAC,IAAI;AACtB,IAAA,iBAAiB,CAAC,sBAAsB;EAC1C;AAEK,MAAM,mBAAmB,GAAG,yBAAyB;AACrD,MAAM,iBAAiB,GAAG,uBAAuB;AAEjD,MAAM,wBAAwB,GAAG;;;;"}

View File

@@ -0,0 +1,12 @@
import { InteractionType } from "./BrowserConstants.js";
import { ICrypto } from "@azure/msal-common/browser";
export type BrowserStateObject = {
interactionType: InteractionType;
};
/**
* Extracts the BrowserStateObject from the state string.
* @param browserCrypto
* @param state
*/
export declare function extractBrowserRequestState(browserCrypto: ICrypto, state: string): BrowserStateObject | null;
//# sourceMappingURL=BrowserProtocolUtils.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"BrowserProtocolUtils.d.ts","sourceRoot":"","sources":["../../src/utils/BrowserProtocolUtils.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EACH,OAAO,EAKV,MAAM,4BAA4B,CAAC;AAEpC,MAAM,MAAM,kBAAkB,GAAG;IAC7B,eAAe,EAAE,eAAe,CAAC;CACpC,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,0BAA0B,CACtC,aAAa,EAAE,OAAO,EACtB,KAAK,EAAE,MAAM,GACd,kBAAkB,GAAG,IAAI,CAY3B"}

View File

@@ -0,0 +1,28 @@
/*! @azure/msal-browser v4.2.1 2025-02-11 */
'use strict';
import { ProtocolUtils, createClientAuthError, ClientAuthErrorCodes } from '@azure/msal-common/browser';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
/**
* Extracts the BrowserStateObject from the state string.
* @param browserCrypto
* @param state
*/
function extractBrowserRequestState(browserCrypto, state) {
if (!state) {
return null;
}
try {
const requestStateObj = ProtocolUtils.parseRequestState(browserCrypto, state);
return requestStateObj.libraryState.meta;
}
catch (e) {
throw createClientAuthError(ClientAuthErrorCodes.invalidState);
}
}
export { extractBrowserRequestState };
//# sourceMappingURL=BrowserProtocolUtils.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"BrowserProtocolUtils.mjs","sources":["../../src/utils/BrowserProtocolUtils.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAAA;;;AAGG;AAeH;;;;AAIG;AACa,SAAA,0BAA0B,CACtC,aAAsB,EACtB,KAAa,EAAA;IAEb,IAAI,CAAC,KAAK,EAAE;AACR,QAAA,OAAO,IAAI,CAAC;AACf,KAAA;IAED,IAAI;QACA,MAAM,eAAe,GACjB,aAAa,CAAC,iBAAiB,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;AAC1D,QAAA,OAAO,eAAe,CAAC,YAAY,CAAC,IAA0B,CAAC;AAClE,KAAA;AAAC,IAAA,OAAO,CAAC,EAAE;AACR,QAAA,MAAM,qBAAqB,CAAC,oBAAoB,CAAC,YAAY,CAAC,CAAC;AAClE,KAAA;AACL;;;;"}

View File

@@ -0,0 +1,76 @@
import { invoke, invokeAsync } from "@azure/msal-common/browser";
import { BrowserConfiguration } from "../config/Configuration.js";
/**
* Clears hash from window url.
*/
export declare function clearHash(contentWindow: Window): void;
/**
* Replaces current hash with hash from provided url
*/
export declare function replaceHash(url: string): void;
/**
* Returns boolean of whether the current window is in an iframe or not.
*/
export declare function isInIframe(): boolean;
/**
* Returns boolean of whether or not the current window is a popup opened by msal
*/
export declare function isInPopup(): boolean;
/**
* Returns current window URL as redirect uri
*/
export declare function getCurrentUri(): string;
/**
* Gets the homepage url for the current window location.
*/
export declare function getHomepage(): string;
/**
* Throws error if we have completed an auth and are
* attempting another auth request inside an iframe.
*/
export declare function blockReloadInHiddenIframes(): void;
/**
* Block redirect operations in iframes unless explicitly allowed
* @param interactionType Interaction type for the request
* @param allowRedirectInIframe Config value to allow redirects when app is inside an iframe
*/
export declare function blockRedirectInIframe(allowRedirectInIframe: boolean): void;
/**
* Block redirectUri loaded in popup from calling AcquireToken APIs
*/
export declare function blockAcquireTokenInPopups(): void;
/**
* Throws error if token requests are made in non-browser environment
* @param isBrowserEnvironment Flag indicating if environment is a browser.
*/
export declare function blockNonBrowserEnvironment(): void;
/**
* Throws error if initialize hasn't been called
* @param initialized
*/
export declare function blockAPICallsBeforeInitialize(initialized: boolean): void;
/**
* Helper to validate app environment before making an auth request
* @param initialized
*/
export declare function preflightCheck(initialized: boolean): void;
/**
* Helper to validate app enviornment before making redirect request
* @param initialized
* @param config
*/
export declare function redirectPreflightCheck(initialized: boolean, config: BrowserConfiguration): void;
/**
* Adds a preconnect link element to the header which begins DNS resolution and SSL connection in anticipation of the /token request
* @param loginDomain Authority domain, including https protocol e.g. https://login.microsoftonline.com
* @returns
*/
export declare function preconnect(authority: string): void;
/**
* Wrapper function that creates a UUID v7 from the current timestamp.
* @returns {string}
*/
export declare function createGuid(): string;
export { invoke };
export { invokeAsync };
//# sourceMappingURL=BrowserUtils.d.ts.map

View File

@@ -0,0 +1 @@
{"version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,EAAE,CAAC"}

View File

@@ -0,0 +1,173 @@
/*! @azure/msal-browser v4.2.1 2025-02-11 */
'use strict';
import { UrlString } from '@azure/msal-common/browser';
export { invoke, invokeAsync } from '@azure/msal-common/browser';
import { createBrowserAuthError } from '../error/BrowserAuthError.mjs';
import { BrowserConstants, BrowserCacheLocation } from './BrowserConstants.mjs';
import { createNewGuid } from '../crypto/BrowserCrypto.mjs';
import { createBrowserConfigurationAuthError } from '../error/BrowserConfigurationAuthError.mjs';
import { blockIframeReload, redirectInIframe, blockNestedPopups, nonBrowserEnvironment, uninitializedPublicClientApplication } from '../error/BrowserAuthErrorCodes.mjs';
import { inMemRedirectUnavailable } from '../error/BrowserConfigurationAuthErrorCodes.mjs';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
/**
* Clears hash from window url.
*/
function clearHash(contentWindow) {
// Office.js sets history.replaceState to null
contentWindow.location.hash = "";
if (typeof contentWindow.history.replaceState === "function") {
// Full removes "#" from url
contentWindow.history.replaceState(null, "", `${contentWindow.location.origin}${contentWindow.location.pathname}${contentWindow.location.search}`);
}
}
/**
* Replaces current hash with hash from provided url
*/
function replaceHash(url) {
const urlParts = url.split("#");
urlParts.shift(); // Remove part before the hash
window.location.hash = urlParts.length > 0 ? urlParts.join("#") : "";
}
/**
* Returns boolean of whether the current window is in an iframe or not.
*/
function isInIframe() {
return window.parent !== window;
}
/**
* Returns boolean of whether or not the current window is a popup opened by msal
*/
function isInPopup() {
return (typeof window !== "undefined" &&
!!window.opener &&
window.opener !== window &&
typeof window.name === "string" &&
window.name.indexOf(`${BrowserConstants.POPUP_NAME_PREFIX}.`) === 0);
}
// #endregion
/**
* Returns current window URL as redirect uri
*/
function getCurrentUri() {
return typeof window !== "undefined" && window.location
? window.location.href.split("?")[0].split("#")[0]
: "";
}
/**
* Gets the homepage url for the current window location.
*/
function getHomepage() {
const currentUrl = new UrlString(window.location.href);
const urlComponents = currentUrl.getUrlComponents();
return `${urlComponents.Protocol}//${urlComponents.HostNameAndPort}/`;
}
/**
* Throws error if we have completed an auth and are
* attempting another auth request inside an iframe.
*/
function blockReloadInHiddenIframes() {
const isResponseHash = UrlString.hashContainsKnownProperties(window.location.hash);
// return an error if called from the hidden iframe created by the msal js silent calls
if (isResponseHash && isInIframe()) {
throw createBrowserAuthError(blockIframeReload);
}
}
/**
* Block redirect operations in iframes unless explicitly allowed
* @param interactionType Interaction type for the request
* @param allowRedirectInIframe Config value to allow redirects when app is inside an iframe
*/
function blockRedirectInIframe(allowRedirectInIframe) {
if (isInIframe() && !allowRedirectInIframe) {
// If we are not in top frame, we shouldn't redirect. This is also handled by the service.
throw createBrowserAuthError(redirectInIframe);
}
}
/**
* Block redirectUri loaded in popup from calling AcquireToken APIs
*/
function blockAcquireTokenInPopups() {
// Popups opened by msal popup APIs are given a name that starts with "msal."
if (isInPopup()) {
throw createBrowserAuthError(blockNestedPopups);
}
}
/**
* Throws error if token requests are made in non-browser environment
* @param isBrowserEnvironment Flag indicating if environment is a browser.
*/
function blockNonBrowserEnvironment() {
if (typeof window === "undefined") {
throw createBrowserAuthError(nonBrowserEnvironment);
}
}
/**
* Throws error if initialize hasn't been called
* @param initialized
*/
function blockAPICallsBeforeInitialize(initialized) {
if (!initialized) {
throw createBrowserAuthError(uninitializedPublicClientApplication);
}
}
/**
* Helper to validate app environment before making an auth request
* @param initialized
*/
function preflightCheck(initialized) {
// Block request if not in browser environment
blockNonBrowserEnvironment();
// Block auth requests inside a hidden iframe
blockReloadInHiddenIframes();
// Block redirectUri opened in a popup from calling MSAL APIs
blockAcquireTokenInPopups();
// Block token acquisition before initialize has been called
blockAPICallsBeforeInitialize(initialized);
}
/**
* Helper to validate app enviornment before making redirect request
* @param initialized
* @param config
*/
function redirectPreflightCheck(initialized, config) {
preflightCheck(initialized);
blockRedirectInIframe(config.system.allowRedirectInIframe);
// Block redirects if memory storage is enabled but storeAuthStateInCookie is not
if (config.cache.cacheLocation === BrowserCacheLocation.MemoryStorage &&
!config.cache.storeAuthStateInCookie) {
throw createBrowserConfigurationAuthError(inMemRedirectUnavailable);
}
}
/**
* Adds a preconnect link element to the header which begins DNS resolution and SSL connection in anticipation of the /token request
* @param loginDomain Authority domain, including https protocol e.g. https://login.microsoftonline.com
* @returns
*/
function preconnect(authority) {
const link = document.createElement("link");
link.rel = "preconnect";
link.href = new URL(authority).origin;
link.crossOrigin = "anonymous";
document.head.appendChild(link);
// The browser will close connection if not used within a few seconds, remove element from the header after 10s
window.setTimeout(() => {
try {
document.head.removeChild(link);
}
catch { }
}, 10000); // 10s Timeout
}
/**
* Wrapper function that creates a UUID v7 from the current timestamp.
* @returns {string}
*/
function createGuid() {
return createNewGuid();
}
export { blockAPICallsBeforeInitialize, blockAcquireTokenInPopups, blockNonBrowserEnvironment, blockRedirectInIframe, blockReloadInHiddenIframes, clearHash, createGuid, getCurrentUri, getHomepage, isInIframe, isInPopup, preconnect, preflightCheck, redirectPreflightCheck, replaceHash };
//# sourceMappingURL=BrowserUtils.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"BrowserUtils.mjs","sources":["../../src/utils/BrowserUtils.ts"],"sourcesContent":[null],"names":["BrowserAuthErrorCodes.blockIframeReload","BrowserAuthErrorCodes.redirectInIframe","BrowserAuthErrorCodes.blockNestedPopups","BrowserAuthErrorCodes.nonBrowserEnvironment","BrowserAuthErrorCodes.uninitializedPublicClientApplication","BrowserConfigurationAuthErrorCodes.inMemRedirectUnavailable","BrowserCrypto.createNewGuid"],"mappings":";;;;;;;;;;;AAAA;;;AAGG;AAeH;;AAEG;AACG,SAAU,SAAS,CAAC,aAAqB,EAAA;;AAE3C,IAAA,aAAa,CAAC,QAAQ,CAAC,IAAI,GAAG,EAAE,CAAC;IACjC,IAAI,OAAO,aAAa,CAAC,OAAO,CAAC,YAAY,KAAK,UAAU,EAAE;;AAE1D,QAAA,aAAa,CAAC,OAAO,CAAC,YAAY,CAC9B,IAAI,EACJ,EAAE,EACF,CAAA,EAAG,aAAa,CAA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