Commit iniziale
This commit is contained in:
6
node_modules/@azure/msal-browser/dist/controllers/ControllerFactory.d.ts
generated
vendored
Normal file
6
node_modules/@azure/msal-browser/dist/controllers/ControllerFactory.d.ts
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import { IController } from "./IController.js";
|
||||
import { Configuration } from "../config/Configuration.js";
|
||||
import { InitializeApplicationRequest } from "../request/InitializeApplicationRequest.js";
|
||||
export declare function createV3Controller(config: Configuration, request?: InitializeApplicationRequest): Promise<IController>;
|
||||
export declare function createController(config: Configuration): Promise<IController | null>;
|
||||
//# sourceMappingURL=ControllerFactory.d.ts.map
|
||||
1
node_modules/@azure/msal-browser/dist/controllers/ControllerFactory.d.ts.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/controllers/ControllerFactory.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ControllerFactory.d.ts","sourceRoot":"","sources":["../../src/controllers/ControllerFactory.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAG3D,OAAO,EAAE,4BAA4B,EAAE,MAAM,4CAA4C,CAAC;AAE1F,wBAAsB,kBAAkB,CACpC,MAAM,EAAE,aAAa,EACrB,OAAO,CAAC,EAAE,4BAA4B,GACvC,OAAO,CAAC,WAAW,CAAC,CAKtB;AAED,wBAAsB,gBAAgB,CAClC,MAAM,EAAE,aAAa,GACtB,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAgB7B"}
|
||||
35
node_modules/@azure/msal-browser/dist/controllers/ControllerFactory.mjs
generated
vendored
Normal file
35
node_modules/@azure/msal-browser/dist/controllers/ControllerFactory.mjs
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
/*! @azure/msal-browser v4.2.1 2025-02-11 */
|
||||
'use strict';
|
||||
import { NestedAppOperatingContext } from '../operatingcontext/NestedAppOperatingContext.mjs';
|
||||
import { StandardOperatingContext } from '../operatingcontext/StandardOperatingContext.mjs';
|
||||
import { StandardController } from './StandardController.mjs';
|
||||
import { NestedAppAuthController } from './NestedAppAuthController.mjs';
|
||||
|
||||
/*
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License.
|
||||
*/
|
||||
async function createV3Controller(config, request) {
|
||||
const standard = new StandardOperatingContext(config);
|
||||
await standard.initialize();
|
||||
return StandardController.createController(standard, request);
|
||||
}
|
||||
async function createController(config) {
|
||||
const standard = new StandardOperatingContext(config);
|
||||
const nestedApp = new NestedAppOperatingContext(config);
|
||||
const operatingContexts = [standard.initialize(), nestedApp.initialize()];
|
||||
await Promise.all(operatingContexts);
|
||||
if (nestedApp.isAvailable() && config.auth.supportsNestedAppAuth) {
|
||||
return NestedAppAuthController.createController(nestedApp);
|
||||
}
|
||||
else if (standard.isAvailable()) {
|
||||
return StandardController.createController(standard);
|
||||
}
|
||||
else {
|
||||
// Since neither of the actual operating contexts are available keep the UnknownOperatingContextController
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
export { createController, createV3Controller };
|
||||
//# sourceMappingURL=ControllerFactory.mjs.map
|
||||
1
node_modules/@azure/msal-browser/dist/controllers/ControllerFactory.mjs.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/controllers/ControllerFactory.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ControllerFactory.mjs","sources":["../../src/controllers/ControllerFactory.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;AAAA;;;AAGG;AAUI,eAAe,kBAAkB,CACpC,MAAqB,EACrB,OAAsC,EAAA;AAEtC,IAAA,MAAM,QAAQ,GAAG,IAAI,wBAAwB,CAAC,MAAM,CAAC,CAAC;AAEtD,IAAA,MAAM,QAAQ,CAAC,UAAU,EAAE,CAAC;IAC5B,OAAO,kBAAkB,CAAC,gBAAgB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AAClE,CAAC;AAEM,eAAe,gBAAgB,CAClC,MAAqB,EAAA;AAErB,IAAA,MAAM,QAAQ,GAAG,IAAI,wBAAwB,CAAC,MAAM,CAAC,CAAC;AACtD,IAAA,MAAM,SAAS,GAAG,IAAI,yBAAyB,CAAC,MAAM,CAAC,CAAC;AAExD,IAAA,MAAM,iBAAiB,GAAG,CAAC,QAAQ,CAAC,UAAU,EAAE,EAAE,SAAS,CAAC,UAAU,EAAE,CAAC,CAAC;AAE1E,IAAA,MAAM,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IAErC,IAAI,SAAS,CAAC,WAAW,EAAE,IAAI,MAAM,CAAC,IAAI,CAAC,qBAAqB,EAAE;AAC9D,QAAA,OAAO,uBAAuB,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC;AAC9D,KAAA;AAAM,SAAA,IAAI,QAAQ,CAAC,WAAW,EAAE,EAAE;AAC/B,QAAA,OAAO,kBAAkB,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;AACxD,KAAA;AAAM,SAAA;;AAEH,QAAA,OAAO,IAAI,CAAC;AACf,KAAA;AACL;;;;"}
|
||||
59
node_modules/@azure/msal-browser/dist/controllers/IController.d.ts
generated
vendored
Normal file
59
node_modules/@azure/msal-browser/dist/controllers/IController.d.ts
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
import { AccountInfo, Logger, PerformanceCallbackFunction, IPerformanceClient, AccountFilter } from "@azure/msal-common/browser";
|
||||
import { RedirectRequest } from "../request/RedirectRequest.js";
|
||||
import { PopupRequest } from "../request/PopupRequest.js";
|
||||
import { SilentRequest } from "../request/SilentRequest.js";
|
||||
import { SsoSilentRequest } from "../request/SsoSilentRequest.js";
|
||||
import { EndSessionRequest } from "../request/EndSessionRequest.js";
|
||||
import { ApiId, WrapperSKU } from "../utils/BrowserConstants.js";
|
||||
import { INavigationClient } from "../navigation/INavigationClient.js";
|
||||
import { EndSessionPopupRequest } from "../request/EndSessionPopupRequest.js";
|
||||
import { ITokenCache } from "../cache/ITokenCache.js";
|
||||
import { AuthorizationCodeRequest } from "../request/AuthorizationCodeRequest.js";
|
||||
import { BrowserConfiguration } from "../config/Configuration.js";
|
||||
import { AuthenticationResult } from "../response/AuthenticationResult.js";
|
||||
import { EventCallbackFunction } from "../event/EventMessage.js";
|
||||
import { ClearCacheRequest } from "../request/ClearCacheRequest.js";
|
||||
import { InitializeApplicationRequest } from "../request/InitializeApplicationRequest.js";
|
||||
import { EventType } from "../event/EventType.js";
|
||||
export interface IController {
|
||||
initialize(request?: InitializeApplicationRequest): Promise<void>;
|
||||
acquireTokenPopup(request: PopupRequest): Promise<AuthenticationResult>;
|
||||
acquireTokenRedirect(request: RedirectRequest): Promise<void>;
|
||||
acquireTokenSilent(silentRequest: SilentRequest): Promise<AuthenticationResult>;
|
||||
acquireTokenByCode(request: AuthorizationCodeRequest): Promise<AuthenticationResult>;
|
||||
acquireTokenNative(request: PopupRequest | SilentRequest | SsoSilentRequest, apiId: ApiId, accountId?: string): Promise<AuthenticationResult>;
|
||||
addEventCallback(callback: EventCallbackFunction, eventTypes?: Array<EventType>): string | null;
|
||||
removeEventCallback(callbackId: string): void;
|
||||
addPerformanceCallback(callback: PerformanceCallbackFunction): string;
|
||||
removePerformanceCallback(callbackId: string): boolean;
|
||||
enableAccountStorageEvents(): void;
|
||||
disableAccountStorageEvents(): void;
|
||||
getAccount(accountFilter: AccountFilter): AccountInfo | null;
|
||||
getAccountByHomeId(homeAccountId: string): AccountInfo | null;
|
||||
getAccountByLocalId(localId: string): AccountInfo | null;
|
||||
getAccountByUsername(userName: string): AccountInfo | null;
|
||||
getAllAccounts(accountFilter?: AccountFilter): AccountInfo[];
|
||||
handleRedirectPromise(hash?: string): Promise<AuthenticationResult | null>;
|
||||
loginPopup(request?: PopupRequest): Promise<AuthenticationResult>;
|
||||
loginRedirect(request?: RedirectRequest): Promise<void>;
|
||||
logout(logoutRequest?: EndSessionRequest): Promise<void>;
|
||||
logoutRedirect(logoutRequest?: EndSessionRequest): Promise<void>;
|
||||
logoutPopup(logoutRequest?: EndSessionPopupRequest): Promise<void>;
|
||||
clearCache(logoutRequest?: ClearCacheRequest): Promise<void>;
|
||||
ssoSilent(request: SsoSilentRequest): Promise<AuthenticationResult>;
|
||||
getTokenCache(): ITokenCache;
|
||||
getLogger(): Logger;
|
||||
setLogger(logger: Logger): void;
|
||||
setActiveAccount(account: AccountInfo | null): void;
|
||||
getActiveAccount(): AccountInfo | null;
|
||||
initializeWrapperLibrary(sku: WrapperSKU, version: string): void;
|
||||
setNavigationClient(navigationClient: INavigationClient): void;
|
||||
/** @internal */
|
||||
getConfiguration(): BrowserConfiguration;
|
||||
hydrateCache(result: AuthenticationResult, request: SilentRequest | SsoSilentRequest | RedirectRequest | PopupRequest): Promise<void>;
|
||||
/** @internal */
|
||||
isBrowserEnv(): boolean;
|
||||
/** @internal */
|
||||
getPerformanceClient(): IPerformanceClient;
|
||||
}
|
||||
//# sourceMappingURL=IController.d.ts.map
|
||||
1
node_modules/@azure/msal-browser/dist/controllers/IController.d.ts.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/controllers/IController.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"IController.d.ts","sourceRoot":"","sources":["../../src/controllers/IController.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,WAAW,EACX,MAAM,EACN,2BAA2B,EAC3B,kBAAkB,EAClB,aAAa,EAChB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,KAAK,EAA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AAgB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAEpE,aAAa,IAAI,WAAW,CAAC;IAE7B,SAAS,IAAI,MAAM,CAAC;IAEpB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAEhC,gBAAgB,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,GAAG,IAAI,CAAC;IAEpD,gBAAgB,IAAI,WAAW,GAAG,IAAI,CAAC;IAEvC,wBAAwB,CAAC,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAEjE,mBAAmB,CAAC,gBAAgB,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAE/D,gBAAgB;IAChB,gBAAgB,IAAI,oBAAoB,CAAC;IAEzC,YAAY,CACR,MAAM,EAAE,oBAAoB,EAC5B,OAAO,EACD,aAAa,GACb,gBAAgB,GAChB,eAAe,GACf,YAAY,GACnB,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjB,gBAAgB;IAChB,YAAY,IAAI,OAAO,CAAC;IAExB,gBAAgB;IAChB,oBAAoB,IAAI,kBAAkB,CAAC;CAC9C"}
|
||||
203
node_modules/@azure/msal-browser/dist/controllers/NestedAppAuthController.d.ts
generated
vendored
Normal file
203
node_modules/@azure/msal-browser/dist/controllers/NestedAppAuthController.d.ts
generated
vendored
Normal file
@@ -0,0 +1,203 @@
|
||||
import { CommonAuthorizationUrlRequest, CommonSilentFlowRequest, PerformanceCallbackFunction, AccountInfo, Logger, ICrypto, IPerformanceClient, AccountFilter } from "@azure/msal-common/browser";
|
||||
import { ITokenCache } from "../cache/ITokenCache.js";
|
||||
import { BrowserConfiguration } from "../config/Configuration.js";
|
||||
import { INavigationClient } from "../navigation/INavigationClient.js";
|
||||
import { AuthorizationCodeRequest } from "../request/AuthorizationCodeRequest.js";
|
||||
import { EndSessionPopupRequest } from "../request/EndSessionPopupRequest.js";
|
||||
import { EndSessionRequest } from "../request/EndSessionRequest.js";
|
||||
import { PopupRequest } from "../request/PopupRequest.js";
|
||||
import { RedirectRequest } from "../request/RedirectRequest.js";
|
||||
import { SilentRequest } from "../request/SilentRequest.js";
|
||||
import { SsoSilentRequest } from "../request/SsoSilentRequest.js";
|
||||
import { ApiId, WrapperSKU } from "../utils/BrowserConstants.js";
|
||||
import { IController } from "./IController.js";
|
||||
import { NestedAppOperatingContext } from "../operatingcontext/NestedAppOperatingContext.js";
|
||||
import { IBridgeProxy } from "../naa/IBridgeProxy.js";
|
||||
import { NestedAppAuthAdapter } from "../naa/mapping/NestedAppAuthAdapter.js";
|
||||
import { EventHandler } from "../event/EventHandler.js";
|
||||
import { EventType } from "../event/EventType.js";
|
||||
import { EventCallbackFunction } from "../event/EventMessage.js";
|
||||
import { AuthenticationResult } from "../response/AuthenticationResult.js";
|
||||
import { BrowserCacheManager } from "../cache/BrowserCacheManager.js";
|
||||
import { ClearCacheRequest } from "../request/ClearCacheRequest.js";
|
||||
import { AccountContext } from "../naa/BridgeAccountContext.js";
|
||||
import { InitializeApplicationRequest } from "../request/InitializeApplicationRequest.js";
|
||||
export declare class NestedAppAuthController implements IController {
|
||||
protected readonly operatingContext: NestedAppOperatingContext;
|
||||
protected readonly bridgeProxy: IBridgeProxy;
|
||||
protected readonly browserCrypto: ICrypto;
|
||||
protected readonly config: BrowserConfiguration;
|
||||
protected readonly browserStorage: BrowserCacheManager;
|
||||
protected logger: Logger;
|
||||
protected readonly performanceClient: IPerformanceClient;
|
||||
protected readonly eventHandler: EventHandler;
|
||||
protected readonly nestedAppAuthAdapter: NestedAppAuthAdapter;
|
||||
protected currentAccountContext: AccountContext | null;
|
||||
constructor(operatingContext: NestedAppOperatingContext);
|
||||
/**
|
||||
* Factory function to create a new instance of NestedAppAuthController
|
||||
* @param operatingContext
|
||||
* @returns Promise<IController>
|
||||
*/
|
||||
static createController(operatingContext: NestedAppOperatingContext): Promise<IController>;
|
||||
/**
|
||||
* Specific implementation of initialize function for NestedAppAuthController
|
||||
* @returns
|
||||
*/
|
||||
initialize(request?: InitializeApplicationRequest): Promise<void>;
|
||||
/**
|
||||
* Validate the incoming request and add correlationId if not present
|
||||
* @param request
|
||||
* @returns
|
||||
*/
|
||||
private ensureValidRequest;
|
||||
/**
|
||||
* Internal implementation of acquireTokenInteractive flow
|
||||
* @param request
|
||||
* @returns
|
||||
*/
|
||||
private acquireTokenInteractive;
|
||||
/**
|
||||
* Internal implementation of acquireTokenSilent flow
|
||||
* @param request
|
||||
* @returns
|
||||
*/
|
||||
private acquireTokenSilentInternal;
|
||||
/**
|
||||
* acquires tokens from cache
|
||||
* @param request
|
||||
* @returns
|
||||
*/
|
||||
private acquireTokenFromCache;
|
||||
/**
|
||||
*
|
||||
* @param request
|
||||
* @returns
|
||||
*/
|
||||
private acquireTokenFromCacheInternal;
|
||||
/**
|
||||
* acquireTokenPopup flow implementation
|
||||
* @param request
|
||||
* @returns
|
||||
*/
|
||||
acquireTokenPopup(request: PopupRequest): Promise<AuthenticationResult>;
|
||||
/**
|
||||
* acquireTokenRedirect flow is not supported in nested app auth
|
||||
* @param request
|
||||
*/
|
||||
acquireTokenRedirect(request: RedirectRequest): Promise<void>;
|
||||
/**
|
||||
* acquireTokenSilent flow implementation
|
||||
* @param silentRequest
|
||||
* @returns
|
||||
*/
|
||||
acquireTokenSilent(silentRequest: SilentRequest): Promise<AuthenticationResult>;
|
||||
/**
|
||||
* Hybrid flow is not currently supported in nested app auth
|
||||
* @param request
|
||||
*/
|
||||
acquireTokenByCode(request: AuthorizationCodeRequest): Promise<AuthenticationResult>;
|
||||
/**
|
||||
* acquireTokenNative flow is not currently supported in nested app auth
|
||||
* @param request
|
||||
* @param apiId
|
||||
* @param accountId
|
||||
*/
|
||||
acquireTokenNative(request: SilentRequest | Partial<Omit<CommonAuthorizationUrlRequest, "requestedClaimsHash" | "responseMode" | "codeChallenge" | "codeChallengeMethod" | "platformBroker">> | PopupRequest, apiId: ApiId, // eslint-disable-line @typescript-eslint/no-unused-vars
|
||||
accountId?: string | undefined): Promise<AuthenticationResult>;
|
||||
/**
|
||||
* acquireTokenByRefreshToken flow is not currently supported in nested app auth
|
||||
* @param commonRequest
|
||||
* @param silentRequest
|
||||
*/
|
||||
acquireTokenByRefreshToken(commonRequest: CommonSilentFlowRequest, // eslint-disable-line @typescript-eslint/no-unused-vars
|
||||
silentRequest: SilentRequest): Promise<AuthenticationResult>;
|
||||
/**
|
||||
* Adds event callbacks to array
|
||||
* @param callback
|
||||
* @param eventTypes
|
||||
*/
|
||||
addEventCallback(callback: EventCallbackFunction, eventTypes?: Array<EventType>): string | null;
|
||||
/**
|
||||
* Removes callback with provided id from callback array
|
||||
* @param callbackId
|
||||
*/
|
||||
removeEventCallback(callbackId: string): void;
|
||||
addPerformanceCallback(callback: PerformanceCallbackFunction): string;
|
||||
removePerformanceCallback(callbackId: string): boolean;
|
||||
enableAccountStorageEvents(): void;
|
||||
disableAccountStorageEvents(): void;
|
||||
/**
|
||||
* Returns all the accounts in the cache that match the optional filter. If no filter is provided, all accounts are returned.
|
||||
* @param accountFilter - (Optional) filter to narrow down the accounts returned
|
||||
* @returns Array of AccountInfo objects in cache
|
||||
*/
|
||||
getAllAccounts(accountFilter?: AccountFilter): AccountInfo[];
|
||||
/**
|
||||
* Returns the first account found in the cache that matches the account filter passed in.
|
||||
* @param accountFilter
|
||||
* @returns The first account found in the cache matching the provided filter or null if no account could be found.
|
||||
*/
|
||||
getAccount(accountFilter: AccountFilter): AccountInfo | null;
|
||||
/**
|
||||
* Returns the signed in account matching username.
|
||||
* (the account object is created at the time of successful login)
|
||||
* or null when no matching account is found.
|
||||
* This API is provided for convenience but getAccountById should be used for best reliability
|
||||
* @param username
|
||||
* @returns The account object stored in MSAL
|
||||
*/
|
||||
getAccountByUsername(username: string): AccountInfo | null;
|
||||
/**
|
||||
* Returns the signed in account matching homeAccountId.
|
||||
* (the account object is created at the time of successful login)
|
||||
* or null when no matching account is found
|
||||
* @param homeAccountId
|
||||
* @returns The account object stored in MSAL
|
||||
*/
|
||||
getAccountByHomeId(homeAccountId: string): AccountInfo | null;
|
||||
/**
|
||||
* Returns the signed in account matching localAccountId.
|
||||
* (the account object is created at the time of successful login)
|
||||
* or null when no matching account is found
|
||||
* @param localAccountId
|
||||
* @returns The account object stored in MSAL
|
||||
*/
|
||||
getAccountByLocalId(localAccountId: string): AccountInfo | null;
|
||||
/**
|
||||
* Sets the account to use as the active account. If no account is passed to the acquireToken APIs, then MSAL will use this active account.
|
||||
* @param account
|
||||
*/
|
||||
setActiveAccount(account: AccountInfo | null): void;
|
||||
/**
|
||||
* Gets the currently active account
|
||||
*/
|
||||
getActiveAccount(): AccountInfo | null;
|
||||
handleRedirectPromise(hash?: string | undefined): Promise<AuthenticationResult | null>;
|
||||
loginPopup(request?: PopupRequest | undefined): Promise<AuthenticationResult>;
|
||||
loginRedirect(request?: RedirectRequest | undefined): Promise<void>;
|
||||
logout(logoutRequest?: EndSessionRequest | undefined): Promise<void>;
|
||||
logoutRedirect(logoutRequest?: EndSessionRequest | undefined): Promise<void>;
|
||||
logoutPopup(logoutRequest?: EndSessionPopupRequest | undefined): Promise<void>;
|
||||
ssoSilent(request: Partial<Omit<CommonAuthorizationUrlRequest, "requestedClaimsHash" | "responseMode" | "codeChallenge" | "codeChallengeMethod" | "platformBroker">>): Promise<AuthenticationResult>;
|
||||
getTokenCache(): ITokenCache;
|
||||
/**
|
||||
* Returns the logger instance
|
||||
*/
|
||||
getLogger(): Logger;
|
||||
/**
|
||||
* Replaces the default logger set in configurations with new Logger with new configurations
|
||||
* @param logger Logger instance
|
||||
*/
|
||||
setLogger(logger: Logger): void;
|
||||
initializeWrapperLibrary(sku: WrapperSKU, version: string): void;
|
||||
setNavigationClient(navigationClient: INavigationClient): void;
|
||||
getConfiguration(): BrowserConfiguration;
|
||||
isBrowserEnv(): boolean;
|
||||
getBrowserCrypto(): ICrypto;
|
||||
getPerformanceClient(): IPerformanceClient;
|
||||
getRedirectResponse(): Map<string, Promise<AuthenticationResult | null>>;
|
||||
clearCache(logoutRequest?: ClearCacheRequest): Promise<void>;
|
||||
hydrateCache(result: AuthenticationResult, request: SilentRequest | SsoSilentRequest | RedirectRequest | PopupRequest): Promise<void>;
|
||||
}
|
||||
//# sourceMappingURL=NestedAppAuthController.d.ts.map
|
||||
1
node_modules/@azure/msal-browser/dist/controllers/NestedAppAuthController.d.ts.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/controllers/NestedAppAuthController.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"NestedAppAuthController.d.ts","sourceRoot":"","sources":["../../src/controllers/NestedAppAuthController.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,6BAA6B,EAC7B,uBAAuB,EACvB,2BAA2B,EAC3B,WAAW,EACX,MAAM,EACN,OAAO,EACP,kBAAkB,EAQlB,aAAa,EAEhB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAClF,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EACH,KAAK,EACL,UAAU,EAIb,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,yBAAyB,EAAE,MAAM,kDAAkD,CAAC;AA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,CAAC;IAGhB,SAAS,CAEL,OAAO,EAAE,OAAO,CACZ,IAAI,CACA,6BAA6B,EAC3B,qBAAqB,GACrB,cAAc,GACd,eAAe,GACf,qBAAqB,GACrB,gBAAgB,CACrB,CACJ,GACF,OAAO,CAAC,oBAAoB,CAAC;IAGhC,aAAa,IAAI,WAAW;IAI5B;;OAEG;IACI,SAAS,IAAI,MAAM;IAI1B;;;OAGG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAK/B,wBAAwB,CAAC,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAShE,mBAAmB,CAAC,gBAAgB,EAAE,iBAAiB,GAAG,IAAI;IAM9D,gBAAgB,IAAI,oBAAoB;IAIxC,YAAY,IAAI,OAAO;IAIvB,gBAAgB,IAAI,OAAO;IAI3B,oBAAoB,IAAI,kBAAkB;IAI1C,mBAAmB,IAAI,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAAC;IAKlE,UAAU,CAAC,aAAa,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAI5D,YAAY,CACd,MAAM,EAAE,oBAAoB,EAC5B,OAAO,EACD,aAAa,GACb,gBAAgB,GAChB,eAAe,GACf,YAAY,GACnB,OAAO,CAAC,IAAI,CAAC;CAcnB"}
|
||||
516
node_modules/@azure/msal-browser/dist/controllers/NestedAppAuthController.mjs
generated
vendored
Normal file
516
node_modules/@azure/msal-browser/dist/controllers/NestedAppAuthController.mjs
generated
vendored
Normal file
@@ -0,0 +1,516 @@
|
||||
/*! @azure/msal-browser v4.2.1 2025-02-11 */
|
||||
'use strict';
|
||||
import { DEFAULT_CRYPTO_IMPLEMENTATION, buildStaticAuthorityOptions, PerformanceEvents, TimeUtils, AuthError, OIDC_DEFAULT_SCOPES, AccountEntity } from '@azure/msal-common/browser';
|
||||
import { InteractionType, CacheLookupPolicy, DEFAULT_REQUEST } from '../utils/BrowserConstants.mjs';
|
||||
import { CryptoOps } from '../crypto/CryptoOps.mjs';
|
||||
import { NestedAppAuthAdapter } from '../naa/mapping/NestedAppAuthAdapter.mjs';
|
||||
import { NestedAppAuthError } from '../error/NestedAppAuthError.mjs';
|
||||
import { EventHandler } from '../event/EventHandler.mjs';
|
||||
import { EventType } from '../event/EventType.mjs';
|
||||
import { BrowserCacheManager, DEFAULT_BROWSER_CACHE_MANAGER } from '../cache/BrowserCacheManager.mjs';
|
||||
import { getAccount, getAllAccounts, getAccountByUsername, getAccountByHomeId, getAccountByLocalId, setActiveAccount, getActiveAccount } from '../cache/AccountManager.mjs';
|
||||
import { createNewGuid } from '../crypto/BrowserCrypto.mjs';
|
||||
|
||||
/*
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License.
|
||||
*/
|
||||
class NestedAppAuthController {
|
||||
constructor(operatingContext) {
|
||||
this.operatingContext = operatingContext;
|
||||
const proxy = this.operatingContext.getBridgeProxy();
|
||||
if (proxy !== undefined) {
|
||||
this.bridgeProxy = proxy;
|
||||
}
|
||||
else {
|
||||
throw new Error("unexpected: bridgeProxy is undefined");
|
||||
}
|
||||
// Set the configuration.
|
||||
this.config = operatingContext.getConfig();
|
||||
// Initialize logger
|
||||
this.logger = this.operatingContext.getLogger();
|
||||
// Initialize performance client
|
||||
this.performanceClient = this.config.telemetry.client;
|
||||
// Initialize the crypto class.
|
||||
this.browserCrypto = operatingContext.isBrowserEnvironment()
|
||||
? new CryptoOps(this.logger, this.performanceClient, true)
|
||||
: DEFAULT_CRYPTO_IMPLEMENTATION;
|
||||
this.eventHandler = new EventHandler(this.logger);
|
||||
// Initialize the browser storage class.
|
||||
this.browserStorage = this.operatingContext.isBrowserEnvironment()
|
||||
? new BrowserCacheManager(this.config.auth.clientId, this.config.cache, this.browserCrypto, this.logger, this.performanceClient, this.eventHandler, buildStaticAuthorityOptions(this.config.auth))
|
||||
: DEFAULT_BROWSER_CACHE_MANAGER(this.config.auth.clientId, this.logger, this.performanceClient, this.eventHandler);
|
||||
this.nestedAppAuthAdapter = new NestedAppAuthAdapter(this.config.auth.clientId, this.config.auth.clientCapabilities, this.browserCrypto, this.logger);
|
||||
// Set the active account if available
|
||||
const accountContext = this.bridgeProxy.getAccountContext();
|
||||
this.currentAccountContext = accountContext ? accountContext : null;
|
||||
}
|
||||
/**
|
||||
* Factory function to create a new instance of NestedAppAuthController
|
||||
* @param operatingContext
|
||||
* @returns Promise<IController>
|
||||
*/
|
||||
static async createController(operatingContext) {
|
||||
const controller = new NestedAppAuthController(operatingContext);
|
||||
return Promise.resolve(controller);
|
||||
}
|
||||
/**
|
||||
* Specific implementation of initialize function for NestedAppAuthController
|
||||
* @returns
|
||||
*/
|
||||
async initialize(request) {
|
||||
const initCorrelationId = request?.correlationId || createNewGuid();
|
||||
await this.browserStorage.initialize(initCorrelationId);
|
||||
return Promise.resolve();
|
||||
}
|
||||
/**
|
||||
* Validate the incoming request and add correlationId if not present
|
||||
* @param request
|
||||
* @returns
|
||||
*/
|
||||
ensureValidRequest(request) {
|
||||
if (request?.correlationId) {
|
||||
return request;
|
||||
}
|
||||
return {
|
||||
...request,
|
||||
correlationId: this.browserCrypto.createNewGuid(),
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Internal implementation of acquireTokenInteractive flow
|
||||
* @param request
|
||||
* @returns
|
||||
*/
|
||||
async acquireTokenInteractive(request) {
|
||||
const validRequest = this.ensureValidRequest(request);
|
||||
this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_START, InteractionType.Popup, validRequest);
|
||||
const atPopupMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenPopup, validRequest.correlationId);
|
||||
atPopupMeasurement?.add({ nestedAppAuthRequest: true });
|
||||
try {
|
||||
const naaRequest = this.nestedAppAuthAdapter.toNaaTokenRequest(validRequest);
|
||||
const reqTimestamp = TimeUtils.nowSeconds();
|
||||
const response = await this.bridgeProxy.getTokenInteractive(naaRequest);
|
||||
const result = {
|
||||
...this.nestedAppAuthAdapter.fromNaaTokenResponse(naaRequest, response, reqTimestamp),
|
||||
};
|
||||
// cache the tokens in the response
|
||||
await this.hydrateCache(result, request);
|
||||
// cache the account context in memory after successful token fetch
|
||||
this.currentAccountContext = {
|
||||
homeAccountId: result.account.homeAccountId,
|
||||
environment: result.account.environment,
|
||||
tenantId: result.account.tenantId,
|
||||
};
|
||||
this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, InteractionType.Popup, result);
|
||||
atPopupMeasurement.add({
|
||||
accessTokenSize: result.accessToken.length,
|
||||
idTokenSize: result.idToken.length,
|
||||
});
|
||||
atPopupMeasurement.end({
|
||||
success: true,
|
||||
requestId: result.requestId,
|
||||
});
|
||||
return result;
|
||||
}
|
||||
catch (e) {
|
||||
const error = e instanceof AuthError
|
||||
? e
|
||||
: this.nestedAppAuthAdapter.fromBridgeError(e);
|
||||
this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_FAILURE, InteractionType.Popup, null, e);
|
||||
atPopupMeasurement.end({
|
||||
success: false,
|
||||
}, e);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Internal implementation of acquireTokenSilent flow
|
||||
* @param request
|
||||
* @returns
|
||||
*/
|
||||
async acquireTokenSilentInternal(request) {
|
||||
const validRequest = this.ensureValidRequest(request);
|
||||
this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_START, InteractionType.Silent, validRequest);
|
||||
// Look for tokens in the cache first
|
||||
const result = await this.acquireTokenFromCache(validRequest);
|
||||
if (result) {
|
||||
this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, InteractionType.Silent, result);
|
||||
return result;
|
||||
}
|
||||
// proceed with acquiring tokens via the host
|
||||
const ssoSilentMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.SsoSilent, validRequest.correlationId);
|
||||
ssoSilentMeasurement?.increment({
|
||||
visibilityChangeCount: 0,
|
||||
});
|
||||
ssoSilentMeasurement?.add({
|
||||
nestedAppAuthRequest: true,
|
||||
});
|
||||
try {
|
||||
const naaRequest = this.nestedAppAuthAdapter.toNaaTokenRequest(validRequest);
|
||||
const reqTimestamp = TimeUtils.nowSeconds();
|
||||
const response = await this.bridgeProxy.getTokenSilent(naaRequest);
|
||||
const result = this.nestedAppAuthAdapter.fromNaaTokenResponse(naaRequest, response, reqTimestamp);
|
||||
// cache the tokens in the response
|
||||
await this.hydrateCache(result, request);
|
||||
// cache the account context in memory after successful token fetch
|
||||
this.currentAccountContext = {
|
||||
homeAccountId: result.account.homeAccountId,
|
||||
environment: result.account.environment,
|
||||
tenantId: result.account.tenantId,
|
||||
};
|
||||
this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, InteractionType.Silent, result);
|
||||
ssoSilentMeasurement?.add({
|
||||
accessTokenSize: result.accessToken.length,
|
||||
idTokenSize: result.idToken.length,
|
||||
});
|
||||
ssoSilentMeasurement?.end({
|
||||
success: true,
|
||||
requestId: result.requestId,
|
||||
});
|
||||
return result;
|
||||
}
|
||||
catch (e) {
|
||||
const error = e instanceof AuthError
|
||||
? e
|
||||
: this.nestedAppAuthAdapter.fromBridgeError(e);
|
||||
this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_FAILURE, InteractionType.Silent, null, e);
|
||||
ssoSilentMeasurement?.end({
|
||||
success: false,
|
||||
}, e);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* acquires tokens from cache
|
||||
* @param request
|
||||
* @returns
|
||||
*/
|
||||
async acquireTokenFromCache(request) {
|
||||
const atsMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenSilent, request.correlationId);
|
||||
atsMeasurement?.add({
|
||||
nestedAppAuthRequest: true,
|
||||
});
|
||||
// if the request has claims, we cannot look up in the cache
|
||||
if (request.claims) {
|
||||
this.logger.verbose("Claims are present in the request, skipping cache lookup");
|
||||
return null;
|
||||
}
|
||||
// if the request has forceRefresh, we cannot look up in the cache
|
||||
if (request.forceRefresh) {
|
||||
this.logger.verbose("forceRefresh is set to true, skipping cache lookup");
|
||||
return null;
|
||||
}
|
||||
// respect cache lookup policy
|
||||
let result = null;
|
||||
if (!request.cacheLookupPolicy) {
|
||||
request.cacheLookupPolicy = CacheLookupPolicy.Default;
|
||||
}
|
||||
switch (request.cacheLookupPolicy) {
|
||||
case CacheLookupPolicy.Default:
|
||||
case CacheLookupPolicy.AccessToken:
|
||||
case CacheLookupPolicy.AccessTokenAndRefreshToken:
|
||||
result = await this.acquireTokenFromCacheInternal(request);
|
||||
break;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
if (result) {
|
||||
this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, InteractionType.Silent, result);
|
||||
atsMeasurement?.add({
|
||||
accessTokenSize: result?.accessToken.length,
|
||||
idTokenSize: result?.idToken.length,
|
||||
});
|
||||
atsMeasurement?.end({
|
||||
success: true,
|
||||
});
|
||||
return result;
|
||||
}
|
||||
this.logger.error("Cached tokens are not found for the account, proceeding with silent token request.");
|
||||
this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_FAILURE, InteractionType.Silent, null);
|
||||
atsMeasurement?.end({
|
||||
success: false,
|
||||
});
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param request
|
||||
* @returns
|
||||
*/
|
||||
async acquireTokenFromCacheInternal(request) {
|
||||
// always prioritize the account context from the bridge
|
||||
const accountContext = this.bridgeProxy.getAccountContext() || this.currentAccountContext;
|
||||
let currentAccount = null;
|
||||
if (accountContext) {
|
||||
currentAccount = getAccount(accountContext, this.logger, this.browserStorage);
|
||||
}
|
||||
// fall back to brokering if no cached account is found
|
||||
if (!currentAccount) {
|
||||
this.logger.verbose("No active account found, falling back to the host");
|
||||
return Promise.resolve(null);
|
||||
}
|
||||
this.logger.verbose("active account found, attempting to acquire token silently");
|
||||
const authRequest = {
|
||||
...request,
|
||||
correlationId: request.correlationId || this.browserCrypto.createNewGuid(),
|
||||
authority: request.authority || currentAccount.environment,
|
||||
scopes: request.scopes?.length
|
||||
? request.scopes
|
||||
: [...OIDC_DEFAULT_SCOPES],
|
||||
};
|
||||
// fetch access token and check for expiry
|
||||
const tokenKeys = this.browserStorage.getTokenKeys();
|
||||
const cachedAccessToken = this.browserStorage.getAccessToken(currentAccount, authRequest, tokenKeys, currentAccount.tenantId, this.performanceClient, authRequest.correlationId);
|
||||
// If there is no access token, log it and return null
|
||||
if (!cachedAccessToken) {
|
||||
this.logger.verbose("No cached access token found");
|
||||
return Promise.resolve(null);
|
||||
}
|
||||
else if (TimeUtils.wasClockTurnedBack(cachedAccessToken.cachedAt) ||
|
||||
TimeUtils.isTokenExpired(cachedAccessToken.expiresOn, this.config.system.tokenRenewalOffsetSeconds)) {
|
||||
this.logger.verbose("Cached access token has expired");
|
||||
return Promise.resolve(null);
|
||||
}
|
||||
const cachedIdToken = this.browserStorage.getIdToken(currentAccount, tokenKeys, currentAccount.tenantId, this.performanceClient, authRequest.correlationId);
|
||||
if (!cachedIdToken) {
|
||||
this.logger.verbose("No cached id token found");
|
||||
return Promise.resolve(null);
|
||||
}
|
||||
return this.nestedAppAuthAdapter.toAuthenticationResultFromCache(currentAccount, cachedIdToken, cachedAccessToken, authRequest, authRequest.correlationId);
|
||||
}
|
||||
/**
|
||||
* acquireTokenPopup flow implementation
|
||||
* @param request
|
||||
* @returns
|
||||
*/
|
||||
async acquireTokenPopup(request) {
|
||||
return this.acquireTokenInteractive(request);
|
||||
}
|
||||
/**
|
||||
* acquireTokenRedirect flow is not supported in nested app auth
|
||||
* @param request
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
acquireTokenRedirect(request) {
|
||||
throw NestedAppAuthError.createUnsupportedError();
|
||||
}
|
||||
/**
|
||||
* acquireTokenSilent flow implementation
|
||||
* @param silentRequest
|
||||
* @returns
|
||||
*/
|
||||
async acquireTokenSilent(silentRequest) {
|
||||
return this.acquireTokenSilentInternal(silentRequest);
|
||||
}
|
||||
/**
|
||||
* Hybrid flow is not currently supported in nested app auth
|
||||
* @param request
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
acquireTokenByCode(request // eslint-disable-line @typescript-eslint/no-unused-vars
|
||||
) {
|
||||
throw NestedAppAuthError.createUnsupportedError();
|
||||
}
|
||||
/**
|
||||
* acquireTokenNative flow is not currently supported in nested app auth
|
||||
* @param request
|
||||
* @param apiId
|
||||
* @param accountId
|
||||
*/
|
||||
acquireTokenNative(request, apiId, // eslint-disable-line @typescript-eslint/no-unused-vars
|
||||
accountId // eslint-disable-line @typescript-eslint/no-unused-vars
|
||||
) {
|
||||
throw NestedAppAuthError.createUnsupportedError();
|
||||
}
|
||||
/**
|
||||
* acquireTokenByRefreshToken flow is not currently supported in nested app auth
|
||||
* @param commonRequest
|
||||
* @param silentRequest
|
||||
*/
|
||||
acquireTokenByRefreshToken(commonRequest, // eslint-disable-line @typescript-eslint/no-unused-vars
|
||||
silentRequest // eslint-disable-line @typescript-eslint/no-unused-vars
|
||||
) {
|
||||
throw NestedAppAuthError.createUnsupportedError();
|
||||
}
|
||||
/**
|
||||
* Adds event callbacks to array
|
||||
* @param callback
|
||||
* @param eventTypes
|
||||
*/
|
||||
addEventCallback(callback, eventTypes) {
|
||||
return this.eventHandler.addEventCallback(callback, eventTypes);
|
||||
}
|
||||
/**
|
||||
* Removes callback with provided id from callback array
|
||||
* @param callbackId
|
||||
*/
|
||||
removeEventCallback(callbackId) {
|
||||
this.eventHandler.removeEventCallback(callbackId);
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
addPerformanceCallback(callback) {
|
||||
throw NestedAppAuthError.createUnsupportedError();
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
removePerformanceCallback(callbackId) {
|
||||
throw NestedAppAuthError.createUnsupportedError();
|
||||
}
|
||||
enableAccountStorageEvents() {
|
||||
throw NestedAppAuthError.createUnsupportedError();
|
||||
}
|
||||
disableAccountStorageEvents() {
|
||||
throw NestedAppAuthError.createUnsupportedError();
|
||||
}
|
||||
// #region Account APIs
|
||||
/**
|
||||
* Returns all the accounts in the cache that match the optional filter. If no filter is provided, all accounts are returned.
|
||||
* @param accountFilter - (Optional) filter to narrow down the accounts returned
|
||||
* @returns Array of AccountInfo objects in cache
|
||||
*/
|
||||
getAllAccounts(accountFilter) {
|
||||
return getAllAccounts(this.logger, this.browserStorage, this.isBrowserEnv(), accountFilter);
|
||||
}
|
||||
/**
|
||||
* Returns the first account found in the cache that matches the account filter passed in.
|
||||
* @param accountFilter
|
||||
* @returns The first account found in the cache matching the provided filter or null if no account could be found.
|
||||
*/
|
||||
getAccount(accountFilter) {
|
||||
return getAccount(accountFilter, this.logger, this.browserStorage);
|
||||
}
|
||||
/**
|
||||
* Returns the signed in account matching username.
|
||||
* (the account object is created at the time of successful login)
|
||||
* or null when no matching account is found.
|
||||
* This API is provided for convenience but getAccountById should be used for best reliability
|
||||
* @param username
|
||||
* @returns The account object stored in MSAL
|
||||
*/
|
||||
getAccountByUsername(username) {
|
||||
return getAccountByUsername(username, this.logger, this.browserStorage);
|
||||
}
|
||||
/**
|
||||
* Returns the signed in account matching homeAccountId.
|
||||
* (the account object is created at the time of successful login)
|
||||
* or null when no matching account is found
|
||||
* @param homeAccountId
|
||||
* @returns The account object stored in MSAL
|
||||
*/
|
||||
getAccountByHomeId(homeAccountId) {
|
||||
return getAccountByHomeId(homeAccountId, this.logger, this.browserStorage);
|
||||
}
|
||||
/**
|
||||
* Returns the signed in account matching localAccountId.
|
||||
* (the account object is created at the time of successful login)
|
||||
* or null when no matching account is found
|
||||
* @param localAccountId
|
||||
* @returns The account object stored in MSAL
|
||||
*/
|
||||
getAccountByLocalId(localAccountId) {
|
||||
return getAccountByLocalId(localAccountId, this.logger, this.browserStorage);
|
||||
}
|
||||
/**
|
||||
* Sets the account to use as the active account. If no account is passed to the acquireToken APIs, then MSAL will use this active account.
|
||||
* @param account
|
||||
*/
|
||||
setActiveAccount(account) {
|
||||
/*
|
||||
* StandardController uses this to allow the developer to set the active account
|
||||
* in the nested app auth scenario the active account is controlled by the app hosting the nested app
|
||||
*/
|
||||
return setActiveAccount(account, this.browserStorage);
|
||||
}
|
||||
/**
|
||||
* Gets the currently active account
|
||||
*/
|
||||
getActiveAccount() {
|
||||
return getActiveAccount(this.browserStorage);
|
||||
}
|
||||
// #endregion
|
||||
handleRedirectPromise(hash // eslint-disable-line @typescript-eslint/no-unused-vars
|
||||
) {
|
||||
return Promise.resolve(null);
|
||||
}
|
||||
loginPopup(request // eslint-disable-line @typescript-eslint/no-unused-vars
|
||||
) {
|
||||
return this.acquireTokenInteractive(request || DEFAULT_REQUEST);
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
loginRedirect(request) {
|
||||
throw NestedAppAuthError.createUnsupportedError();
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
logout(logoutRequest) {
|
||||
throw NestedAppAuthError.createUnsupportedError();
|
||||
}
|
||||
logoutRedirect(logoutRequest // eslint-disable-line @typescript-eslint/no-unused-vars
|
||||
) {
|
||||
throw NestedAppAuthError.createUnsupportedError();
|
||||
}
|
||||
logoutPopup(logoutRequest // eslint-disable-line @typescript-eslint/no-unused-vars
|
||||
) {
|
||||
throw NestedAppAuthError.createUnsupportedError();
|
||||
}
|
||||
ssoSilent(
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
request) {
|
||||
return this.acquireTokenSilentInternal(request);
|
||||
}
|
||||
getTokenCache() {
|
||||
throw NestedAppAuthError.createUnsupportedError();
|
||||
}
|
||||
/**
|
||||
* Returns the logger instance
|
||||
*/
|
||||
getLogger() {
|
||||
return this.logger;
|
||||
}
|
||||
/**
|
||||
* Replaces the default logger set in configurations with new Logger with new configurations
|
||||
* @param logger Logger instance
|
||||
*/
|
||||
setLogger(logger) {
|
||||
this.logger = logger;
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
initializeWrapperLibrary(sku, version) {
|
||||
/*
|
||||
* Standard controller uses this to set the sku and version of the wrapper library in the storage
|
||||
* we do nothing here
|
||||
*/
|
||||
return;
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
setNavigationClient(navigationClient) {
|
||||
this.logger.warning("setNavigationClient is not supported in nested app auth");
|
||||
}
|
||||
getConfiguration() {
|
||||
return this.config;
|
||||
}
|
||||
isBrowserEnv() {
|
||||
return this.operatingContext.isBrowserEnvironment();
|
||||
}
|
||||
getBrowserCrypto() {
|
||||
return this.browserCrypto;
|
||||
}
|
||||
getPerformanceClient() {
|
||||
throw NestedAppAuthError.createUnsupportedError();
|
||||
}
|
||||
getRedirectResponse() {
|
||||
throw NestedAppAuthError.createUnsupportedError();
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
async clearCache(logoutRequest) {
|
||||
throw NestedAppAuthError.createUnsupportedError();
|
||||
}
|
||||
async hydrateCache(result, request) {
|
||||
this.logger.verbose("hydrateCache called");
|
||||
const accountEntity = AccountEntity.createFromAccountInfo(result.account, result.cloudGraphHostName, result.msGraphHost);
|
||||
await this.browserStorage.setAccount(accountEntity, result.correlationId);
|
||||
return this.browserStorage.hydrateCache(result, request);
|
||||
}
|
||||
}
|
||||
|
||||
export { NestedAppAuthController };
|
||||
//# sourceMappingURL=NestedAppAuthController.mjs.map
|
||||
1
node_modules/@azure/msal-browser/dist/controllers/NestedAppAuthController.mjs.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/controllers/NestedAppAuthController.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
405
node_modules/@azure/msal-browser/dist/controllers/StandardController.d.ts
generated
vendored
Normal file
405
node_modules/@azure/msal-browser/dist/controllers/StandardController.d.ts
generated
vendored
Normal file
@@ -0,0 +1,405 @@
|
||||
import { AccountInfo, INetworkModule, Logger, CommonSilentFlowRequest, ICrypto, PerformanceCallbackFunction, IPerformanceClient, BaseAuthRequest, AccountFilter } from "@azure/msal-common/browser";
|
||||
import { BrowserCacheManager } from "../cache/BrowserCacheManager.js";
|
||||
import { BrowserConfiguration } from "../config/Configuration.js";
|
||||
import { ApiId, WrapperSKU, CacheLookupPolicy } from "../utils/BrowserConstants.js";
|
||||
import { RedirectRequest } from "../request/RedirectRequest.js";
|
||||
import { PopupRequest } from "../request/PopupRequest.js";
|
||||
import { SsoSilentRequest } from "../request/SsoSilentRequest.js";
|
||||
import { EventCallbackFunction } from "../event/EventMessage.js";
|
||||
import { EventType } from "../event/EventType.js";
|
||||
import { EndSessionRequest } from "../request/EndSessionRequest.js";
|
||||
import { EndSessionPopupRequest } from "../request/EndSessionPopupRequest.js";
|
||||
import { INavigationClient } from "../navigation/INavigationClient.js";
|
||||
import { EventHandler } from "../event/EventHandler.js";
|
||||
import { PopupClient } from "../interaction_client/PopupClient.js";
|
||||
import { RedirectClient } from "../interaction_client/RedirectClient.js";
|
||||
import { SilentIframeClient } from "../interaction_client/SilentIframeClient.js";
|
||||
import { SilentRefreshClient } from "../interaction_client/SilentRefreshClient.js";
|
||||
import { ITokenCache } from "../cache/ITokenCache.js";
|
||||
import { NativeMessageHandler } from "../broker/nativeBroker/NativeMessageHandler.js";
|
||||
import { SilentRequest } from "../request/SilentRequest.js";
|
||||
import { SilentCacheClient } from "../interaction_client/SilentCacheClient.js";
|
||||
import { SilentAuthCodeClient } from "../interaction_client/SilentAuthCodeClient.js";
|
||||
import { AuthorizationCodeRequest } from "../request/AuthorizationCodeRequest.js";
|
||||
import { StandardOperatingContext } from "../operatingcontext/StandardOperatingContext.js";
|
||||
import { BaseOperatingContext } from "../operatingcontext/BaseOperatingContext.js";
|
||||
import { IController } from "./IController.js";
|
||||
import { AuthenticationResult } from "../response/AuthenticationResult.js";
|
||||
import { ClearCacheRequest } from "../request/ClearCacheRequest.js";
|
||||
import { InitializeApplicationRequest } from "../request/InitializeApplicationRequest.js";
|
||||
export declare class StandardController implements IController {
|
||||
protected readonly operatingContext: StandardOperatingContext;
|
||||
protected readonly browserCrypto: ICrypto;
|
||||
protected readonly browserStorage: BrowserCacheManager;
|
||||
protected readonly nativeInternalStorage: BrowserCacheManager;
|
||||
protected readonly networkClient: INetworkModule;
|
||||
protected navigationClient: INavigationClient;
|
||||
protected readonly config: BrowserConfiguration;
|
||||
private tokenCache;
|
||||
protected logger: Logger;
|
||||
protected isBrowserEnvironment: boolean;
|
||||
protected readonly eventHandler: EventHandler;
|
||||
protected readonly redirectResponse: Map<string, Promise<AuthenticationResult | null>>;
|
||||
protected nativeExtensionProvider: NativeMessageHandler | undefined;
|
||||
private hybridAuthCodeResponses;
|
||||
protected readonly performanceClient: IPerformanceClient;
|
||||
protected initialized: boolean;
|
||||
private activeSilentTokenRequests;
|
||||
private activeIframeRequest;
|
||||
private ssoSilentMeasurement?;
|
||||
private acquireTokenByCodeAsyncMeasurement?;
|
||||
/**
|
||||
* @constructor
|
||||
* Constructor for the PublicClientApplication used to instantiate the PublicClientApplication object
|
||||
*
|
||||
* Important attributes in the Configuration object for auth are:
|
||||
* - clientID: the application ID of your application. You can obtain one by registering your application with our Application registration portal : https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredAppsPreview
|
||||
* - authority: the authority URL for your application.
|
||||
* - redirect_uri: the uri of your application registered in the portal.
|
||||
*
|
||||
* In Azure AD, authority is a URL indicating the Azure active directory that MSAL uses to obtain tokens.
|
||||
* It is of the form https://login.microsoftonline.com/{Enter_the_Tenant_Info_Here}
|
||||
* If your application supports Accounts in one organizational directory, replace "Enter_the_Tenant_Info_Here" value with the Tenant Id or Tenant name (for example, contoso.microsoft.com).
|
||||
* If your application supports Accounts in any organizational directory, replace "Enter_the_Tenant_Info_Here" value with organizations.
|
||||
* If your application supports Accounts in any organizational directory and personal Microsoft accounts, replace "Enter_the_Tenant_Info_Here" value with common.
|
||||
* To restrict support to Personal Microsoft accounts only, replace "Enter_the_Tenant_Info_Here" value with consumers.
|
||||
*
|
||||
* In Azure B2C, authority is of the form https://{instance}/tfp/{tenant}/{policyName}/
|
||||
* Full B2C functionality will be available in this library in future versions.
|
||||
*
|
||||
* @param configuration Object for the MSAL PublicClientApplication instance
|
||||
*/
|
||||
constructor(operatingContext: StandardOperatingContext);
|
||||
static createController(operatingContext: BaseOperatingContext, request?: InitializeApplicationRequest): Promise<IController>;
|
||||
private trackPageVisibility;
|
||||
/**
|
||||
* Initializer function to perform async startup tasks such as connecting to WAM extension
|
||||
* @param request {?InitializeApplicationRequest} correlation id
|
||||
*/
|
||||
initialize(request?: InitializeApplicationRequest): Promise<void>;
|
||||
/**
|
||||
* Event handler function which allows users to fire events after the PublicClientApplication object
|
||||
* has loaded during redirect flows. This should be invoked on all page loads involved in redirect
|
||||
* auth flows.
|
||||
* @param hash Hash to process. Defaults to the current value of window.location.hash. Only needs to be provided explicitly if the response to be handled is not contained in the current value.
|
||||
* @returns Token response or null. If the return value is null, then no auth redirect was detected.
|
||||
*/
|
||||
handleRedirectPromise(hash?: string): Promise<AuthenticationResult | null>;
|
||||
/**
|
||||
* The internal details of handleRedirectPromise. This is separated out to a helper to allow handleRedirectPromise to memoize requests
|
||||
* @param hash
|
||||
* @returns
|
||||
*/
|
||||
private handleRedirectPromiseInternal;
|
||||
/**
|
||||
* Use when you want to obtain an access_token for your API by redirecting the user's browser window to the authorization endpoint. This function redirects
|
||||
* the page, so any code that follows this function will not execute.
|
||||
*
|
||||
* IMPORTANT: It is NOT recommended to have code that is dependent on the resolution of the Promise. This function will navigate away from the current
|
||||
* browser window. It currently returns a Promise in order to reflect the asynchronous nature of the code running in this function.
|
||||
*
|
||||
* @param request
|
||||
*/
|
||||
acquireTokenRedirect(request: RedirectRequest): Promise<void>;
|
||||
/**
|
||||
* Use when you want to obtain an access_token for your API via opening a popup window in the user's browser
|
||||
*
|
||||
* @param request
|
||||
*
|
||||
* @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.
|
||||
*/
|
||||
acquireTokenPopup(request: PopupRequest): Promise<AuthenticationResult>;
|
||||
private trackPageVisibilityWithMeasurement;
|
||||
/**
|
||||
* This function uses a hidden iframe to fetch an authorization code from the eSTS. There are cases where this may not work:
|
||||
* - Any browser using a form of Intelligent Tracking Prevention
|
||||
* - If there is not an established session with the service
|
||||
*
|
||||
* In these cases, the request must be done inside a popup or full frame redirect.
|
||||
*
|
||||
* For the cases where interaction is required, you cannot send a request with prompt=none.
|
||||
*
|
||||
* If your refresh token has expired, you can use this function to fetch a new set of tokens silently as long as
|
||||
* you session on the server still exists.
|
||||
* @param request {@link SsoSilentRequest}
|
||||
*
|
||||
* @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.
|
||||
*/
|
||||
ssoSilent(request: SsoSilentRequest): Promise<AuthenticationResult>;
|
||||
/**
|
||||
* This function redeems an authorization code (passed as code) from the eSTS token endpoint.
|
||||
* This authorization code should be acquired server-side using a confidential client to acquire a spa_code.
|
||||
* This API is not indended for normal authorization code acquisition and redemption.
|
||||
*
|
||||
* Redemption of this authorization code will not require PKCE, as it was acquired by a confidential client.
|
||||
*
|
||||
* @param request {@link AuthorizationCodeRequest}
|
||||
* @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.
|
||||
*/
|
||||
acquireTokenByCode(request: AuthorizationCodeRequest): Promise<AuthenticationResult>;
|
||||
/**
|
||||
* Creates a SilentAuthCodeClient to redeem an authorization code.
|
||||
* @param request
|
||||
* @returns Result of the operation to redeem the authorization code
|
||||
*/
|
||||
private acquireTokenByCodeAsync;
|
||||
/**
|
||||
* Attempt to acquire an access token from the cache
|
||||
* @param silentCacheClient SilentCacheClient
|
||||
* @param commonRequest CommonSilentFlowRequest
|
||||
* @param silentRequest SilentRequest
|
||||
* @returns A promise that, when resolved, returns the access token
|
||||
*/
|
||||
protected acquireTokenFromCache(commonRequest: CommonSilentFlowRequest, cacheLookupPolicy: CacheLookupPolicy): Promise<AuthenticationResult>;
|
||||
/**
|
||||
* Attempt to acquire an access token via a refresh token
|
||||
* @param commonRequest CommonSilentFlowRequest
|
||||
* @param cacheLookupPolicy CacheLookupPolicy
|
||||
* @returns A promise that, when resolved, returns the access token
|
||||
*/
|
||||
acquireTokenByRefreshToken(commonRequest: CommonSilentFlowRequest, cacheLookupPolicy: CacheLookupPolicy): Promise<AuthenticationResult>;
|
||||
/**
|
||||
* Attempt to acquire an access token via an iframe
|
||||
* @param request CommonSilentFlowRequest
|
||||
* @returns A promise that, when resolved, returns the access token
|
||||
*/
|
||||
protected acquireTokenBySilentIframe(request: CommonSilentFlowRequest): Promise<AuthenticationResult>;
|
||||
/**
|
||||
* Deprecated logout function. Use logoutRedirect or logoutPopup instead
|
||||
* @param logoutRequest
|
||||
* @deprecated
|
||||
*/
|
||||
logout(logoutRequest?: EndSessionRequest): Promise<void>;
|
||||
/**
|
||||
* Use to log out the current user, and redirect the user to the postLogoutRedirectUri.
|
||||
* Default behaviour is to redirect the user to `window.location.href`.
|
||||
* @param logoutRequest
|
||||
*/
|
||||
logoutRedirect(logoutRequest?: EndSessionRequest): Promise<void>;
|
||||
/**
|
||||
* Clears local cache for the current user then opens a popup window prompting the user to sign-out of the server
|
||||
* @param logoutRequest
|
||||
*/
|
||||
logoutPopup(logoutRequest?: EndSessionPopupRequest): Promise<void>;
|
||||
/**
|
||||
* Creates a cache interaction client to clear broswer cache.
|
||||
* @param logoutRequest
|
||||
*/
|
||||
clearCache(logoutRequest?: ClearCacheRequest): Promise<void>;
|
||||
/**
|
||||
* Returns all the accounts in the cache that match the optional filter. If no filter is provided, all accounts are returned.
|
||||
* @param accountFilter - (Optional) filter to narrow down the accounts returned
|
||||
* @returns Array of AccountInfo objects in cache
|
||||
*/
|
||||
getAllAccounts(accountFilter?: AccountFilter): AccountInfo[];
|
||||
/**
|
||||
* Returns the first account found in the cache that matches the account filter passed in.
|
||||
* @param accountFilter
|
||||
* @returns The first account found in the cache matching the provided filter or null if no account could be found.
|
||||
*/
|
||||
getAccount(accountFilter: AccountFilter): AccountInfo | null;
|
||||
/**
|
||||
* Returns the signed in account matching username.
|
||||
* (the account object is created at the time of successful login)
|
||||
* or null when no matching account is found.
|
||||
* This API is provided for convenience but getAccountById should be used for best reliability
|
||||
* @param username
|
||||
* @returns The account object stored in MSAL
|
||||
*/
|
||||
getAccountByUsername(username: string): AccountInfo | null;
|
||||
/**
|
||||
* Returns the signed in account matching homeAccountId.
|
||||
* (the account object is created at the time of successful login)
|
||||
* or null when no matching account is found
|
||||
* @param homeAccountId
|
||||
* @returns The account object stored in MSAL
|
||||
*/
|
||||
getAccountByHomeId(homeAccountId: string): AccountInfo | null;
|
||||
/**
|
||||
* Returns the signed in account matching localAccountId.
|
||||
* (the account object is created at the time of successful login)
|
||||
* or null when no matching account is found
|
||||
* @param localAccountId
|
||||
* @returns The account object stored in MSAL
|
||||
*/
|
||||
getAccountByLocalId(localAccountId: string): AccountInfo | null;
|
||||
/**
|
||||
* Sets the account to use as the active account. If no account is passed to the acquireToken APIs, then MSAL will use this active account.
|
||||
* @param account
|
||||
*/
|
||||
setActiveAccount(account: AccountInfo | null): void;
|
||||
/**
|
||||
* Gets the currently active account
|
||||
*/
|
||||
getActiveAccount(): AccountInfo | null;
|
||||
/**
|
||||
* Hydrates the cache with the tokens from an AuthenticationResult
|
||||
* @param result
|
||||
* @param request
|
||||
* @returns
|
||||
*/
|
||||
hydrateCache(result: AuthenticationResult, request: SilentRequest | SsoSilentRequest | RedirectRequest | PopupRequest): Promise<void>;
|
||||
/**
|
||||
* Acquire a token from native device (e.g. WAM)
|
||||
* @param request
|
||||
*/
|
||||
acquireTokenNative(request: PopupRequest | SilentRequest | SsoSilentRequest, apiId: ApiId, accountId?: string): Promise<AuthenticationResult>;
|
||||
/**
|
||||
* Returns boolean indicating if this request can use the platform broker
|
||||
* @param request
|
||||
*/
|
||||
canUsePlatformBroker(request: RedirectRequest | PopupRequest | SsoSilentRequest, accountId?: string): boolean;
|
||||
/**
|
||||
* Get the native accountId from the account
|
||||
* @param request
|
||||
* @returns
|
||||
*/
|
||||
getNativeAccountId(request: RedirectRequest | PopupRequest | SsoSilentRequest): string;
|
||||
/**
|
||||
* Returns new instance of the Popup Interaction Client
|
||||
* @param correlationId
|
||||
*/
|
||||
createPopupClient(correlationId?: string): PopupClient;
|
||||
/**
|
||||
* Returns new instance of the Redirect Interaction Client
|
||||
* @param correlationId
|
||||
*/
|
||||
protected createRedirectClient(correlationId?: string): RedirectClient;
|
||||
/**
|
||||
* Returns new instance of the Silent Iframe Interaction Client
|
||||
* @param correlationId
|
||||
*/
|
||||
createSilentIframeClient(correlationId?: string): SilentIframeClient;
|
||||
/**
|
||||
* Returns new instance of the Silent Cache Interaction Client
|
||||
*/
|
||||
protected createSilentCacheClient(correlationId?: string): SilentCacheClient;
|
||||
/**
|
||||
* Returns new instance of the Silent Refresh Interaction Client
|
||||
*/
|
||||
protected createSilentRefreshClient(correlationId?: string): SilentRefreshClient;
|
||||
/**
|
||||
* Returns new instance of the Silent AuthCode Interaction Client
|
||||
*/
|
||||
protected createSilentAuthCodeClient(correlationId?: string): SilentAuthCodeClient;
|
||||
/**
|
||||
* Adds event callbacks to array
|
||||
* @param callback
|
||||
*/
|
||||
addEventCallback(callback: EventCallbackFunction, eventTypes?: Array<EventType>): string | null;
|
||||
/**
|
||||
* Removes callback with provided id from callback array
|
||||
* @param callbackId
|
||||
*/
|
||||
removeEventCallback(callbackId: string): void;
|
||||
/**
|
||||
* Registers a callback to receive performance events.
|
||||
*
|
||||
* @param {PerformanceCallbackFunction} callback
|
||||
* @returns {string}
|
||||
*/
|
||||
addPerformanceCallback(callback: PerformanceCallbackFunction): string;
|
||||
/**
|
||||
* Removes a callback registered with addPerformanceCallback.
|
||||
*
|
||||
* @param {string} callbackId
|
||||
* @returns {boolean}
|
||||
*/
|
||||
removePerformanceCallback(callbackId: string): boolean;
|
||||
/**
|
||||
* Adds event listener that emits an event when a user account is added or removed from localstorage in a different browser tab or window
|
||||
* @deprecated These events will be raised by default and this method will be removed in a future major version.
|
||||
*/
|
||||
enableAccountStorageEvents(): void;
|
||||
/**
|
||||
* Removes event listener that emits an event when a user account is added or removed from localstorage in a different browser tab or window
|
||||
* @deprecated These events will be raised by default and this method will be removed in a future major version.
|
||||
*/
|
||||
disableAccountStorageEvents(): void;
|
||||
/**
|
||||
* Gets the token cache for the application.
|
||||
*/
|
||||
getTokenCache(): ITokenCache;
|
||||
/**
|
||||
* Returns the logger instance
|
||||
*/
|
||||
getLogger(): Logger;
|
||||
/**
|
||||
* Replaces the default logger set in configurations with new Logger with new configurations
|
||||
* @param logger Logger instance
|
||||
*/
|
||||
setLogger(logger: Logger): void;
|
||||
/**
|
||||
* Called by wrapper libraries (Angular & React) to set SKU and Version passed down to telemetry, logger, etc.
|
||||
* @param sku
|
||||
* @param version
|
||||
*/
|
||||
initializeWrapperLibrary(sku: WrapperSKU, version: string): void;
|
||||
/**
|
||||
* Sets navigation client
|
||||
* @param navigationClient
|
||||
*/
|
||||
setNavigationClient(navigationClient: INavigationClient): void;
|
||||
/**
|
||||
* Returns the configuration object
|
||||
*/
|
||||
getConfiguration(): BrowserConfiguration;
|
||||
/**
|
||||
* Returns the performance client
|
||||
*/
|
||||
getPerformanceClient(): IPerformanceClient;
|
||||
/**
|
||||
* Returns the browser env indicator
|
||||
*/
|
||||
isBrowserEnv(): boolean;
|
||||
/**
|
||||
* Generates a correlation id for a request if none is provided.
|
||||
*
|
||||
* @protected
|
||||
* @param {?Partial<BaseAuthRequest>} [request]
|
||||
* @returns {string}
|
||||
*/
|
||||
protected getRequestCorrelationId(request?: Partial<BaseAuthRequest>): string;
|
||||
/**
|
||||
* Use when initiating the login process by redirecting the user's browser to the authorization endpoint. This function redirects the page, so
|
||||
* any code that follows this function will not execute.
|
||||
*
|
||||
* IMPORTANT: It is NOT recommended to have code that is dependent on the resolution of the Promise. This function will navigate away from the current
|
||||
* browser window. It currently returns a Promise in order to reflect the asynchronous nature of the code running in this function.
|
||||
*
|
||||
* @param request
|
||||
*/
|
||||
loginRedirect(request?: RedirectRequest): Promise<void>;
|
||||
/**
|
||||
* Use when initiating the login process via opening a popup window in the user's browser
|
||||
*
|
||||
* @param request
|
||||
*
|
||||
* @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.
|
||||
*/
|
||||
loginPopup(request?: PopupRequest): Promise<AuthenticationResult>;
|
||||
/**
|
||||
* Silently acquire an access token for a given set of scopes. Returns currently processing promise if parallel requests are made.
|
||||
*
|
||||
* @param {@link (SilentRequest:type)}
|
||||
* @returns {Promise.<AuthenticationResult>} - a promise that is fulfilled when this function has completed, or rejected if an error was raised. Returns the {@link AuthResponse} object
|
||||
*/
|
||||
acquireTokenSilent(request: SilentRequest): Promise<AuthenticationResult>;
|
||||
/**
|
||||
* Silently acquire an access token for a given set of scopes. Will use cached token if available, otherwise will attempt to acquire a new token from the network via refresh token.
|
||||
* @param {@link (SilentRequest:type)}
|
||||
* @param {@link (AccountInfo:type)}
|
||||
* @returns {Promise.<AuthenticationResult>} - a promise that is fulfilled when this function has completed, or rejected if an error was raised. Returns the {@link AuthResponse}
|
||||
*/
|
||||
protected acquireTokenSilentAsync(request: SilentRequest & {
|
||||
correlationId: string;
|
||||
}, account: AccountInfo): Promise<AuthenticationResult>;
|
||||
/**
|
||||
* AcquireTokenSilent without the iframe fallback. This is used to enable the correct fallbacks in cases where there's a potential for multiple silent requests to be made in parallel and prevent those requests from making concurrent iframe requests.
|
||||
* @param silentRequest
|
||||
* @param cacheLookupPolicy
|
||||
* @returns
|
||||
*/
|
||||
private acquireTokenSilentNoIframe;
|
||||
}
|
||||
//# sourceMappingURL=StandardController.d.ts.map
|
||||
1
node_modules/@azure/msal-browser/dist/controllers/StandardController.d.ts.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/controllers/StandardController.d.ts.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1377
node_modules/@azure/msal-browser/dist/controllers/StandardController.mjs
generated
vendored
Normal file
1377
node_modules/@azure/msal-browser/dist/controllers/StandardController.mjs
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
node_modules/@azure/msal-browser/dist/controllers/StandardController.mjs.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/controllers/StandardController.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
86
node_modules/@azure/msal-browser/dist/controllers/UnknownOperatingContextController.d.ts
generated
vendored
Normal file
86
node_modules/@azure/msal-browser/dist/controllers/UnknownOperatingContextController.d.ts
generated
vendored
Normal file
@@ -0,0 +1,86 @@
|
||||
import { CommonAuthorizationUrlRequest, CommonSilentFlowRequest, PerformanceCallbackFunction, AccountInfo, Logger, ICrypto, IPerformanceClient, AccountFilter } from "@azure/msal-common/browser";
|
||||
import { ITokenCache } from "../cache/ITokenCache.js";
|
||||
import { BrowserConfiguration } from "../config/Configuration.js";
|
||||
import { BrowserCacheManager } from "../cache/BrowserCacheManager.js";
|
||||
import { INavigationClient } from "../navigation/INavigationClient.js";
|
||||
import { AuthorizationCodeRequest } from "../request/AuthorizationCodeRequest.js";
|
||||
import { EndSessionPopupRequest } from "../request/EndSessionPopupRequest.js";
|
||||
import { EndSessionRequest } from "../request/EndSessionRequest.js";
|
||||
import { PopupRequest } from "../request/PopupRequest.js";
|
||||
import { RedirectRequest } from "../request/RedirectRequest.js";
|
||||
import { SilentRequest } from "../request/SilentRequest.js";
|
||||
import { SsoSilentRequest } from "../request/SsoSilentRequest.js";
|
||||
import { AuthenticationResult } from "../response/AuthenticationResult.js";
|
||||
import { ApiId, WrapperSKU } from "../utils/BrowserConstants.js";
|
||||
import { IController } from "./IController.js";
|
||||
import { UnknownOperatingContext } from "../operatingcontext/UnknownOperatingContext.js";
|
||||
import { EventCallbackFunction } from "../event/EventMessage.js";
|
||||
import { ClearCacheRequest } from "../request/ClearCacheRequest.js";
|
||||
import { EventType } from "../event/EventType.js";
|
||||
/**
|
||||
* UnknownOperatingContextController class
|
||||
*
|
||||
* - Until initialize method is called, this controller is the default
|
||||
* - AFter initialize method is called, this controller will be swapped out for the appropriate controller
|
||||
* if the operating context can be determined; otherwise this controller will continued be used
|
||||
*
|
||||
* - Why do we have this? We don't want to dynamically import (download) all of the code in StandardController if we don't need to.
|
||||
*
|
||||
* - Only includes implementation for getAccounts and handleRedirectPromise
|
||||
* - All other methods are will throw initialization error (because either initialize method or the factory method were not used)
|
||||
* - This controller is necessary for React Native wrapper, server side rendering and any other scenario where we don't have a DOM
|
||||
*
|
||||
*/
|
||||
export declare class UnknownOperatingContextController implements IController {
|
||||
protected readonly operatingContext: UnknownOperatingContext;
|
||||
protected logger: Logger;
|
||||
protected readonly browserStorage: BrowserCacheManager;
|
||||
protected readonly config: BrowserConfiguration;
|
||||
protected readonly performanceClient: IPerformanceClient;
|
||||
private readonly eventHandler;
|
||||
protected readonly browserCrypto: ICrypto;
|
||||
protected isBrowserEnvironment: boolean;
|
||||
protected initialized: boolean;
|
||||
constructor(operatingContext: UnknownOperatingContext);
|
||||
getBrowserStorage(): BrowserCacheManager;
|
||||
getAccount(accountFilter: AccountFilter): AccountInfo | null;
|
||||
getAccountByHomeId(homeAccountId: string): AccountInfo | null;
|
||||
getAccountByLocalId(localAccountId: string): AccountInfo | null;
|
||||
getAccountByUsername(username: string): AccountInfo | null;
|
||||
getAllAccounts(): AccountInfo[];
|
||||
initialize(): Promise<void>;
|
||||
acquireTokenPopup(request: PopupRequest): Promise<AuthenticationResult>;
|
||||
acquireTokenRedirect(request: RedirectRequest): Promise<void>;
|
||||
acquireTokenSilent(silentRequest: SilentRequest): Promise<AuthenticationResult>;
|
||||
acquireTokenByCode(request: AuthorizationCodeRequest): Promise<AuthenticationResult>;
|
||||
acquireTokenNative(request: PopupRequest | SilentRequest | Partial<Omit<CommonAuthorizationUrlRequest, "responseMode" | "codeChallenge" | "codeChallengeMethod" | "requestedClaimsHash" | "platformBroker">>, apiId: ApiId, accountId?: string | undefined): Promise<AuthenticationResult>;
|
||||
acquireTokenByRefreshToken(commonRequest: CommonSilentFlowRequest, silentRequest: SilentRequest): Promise<AuthenticationResult>;
|
||||
addEventCallback(callback: EventCallbackFunction, eventTypes?: Array<EventType>): string | null;
|
||||
removeEventCallback(callbackId: string): void;
|
||||
addPerformanceCallback(callback: PerformanceCallbackFunction): string;
|
||||
removePerformanceCallback(callbackId: string): boolean;
|
||||
enableAccountStorageEvents(): void;
|
||||
disableAccountStorageEvents(): void;
|
||||
handleRedirectPromise(hash?: string | undefined): Promise<AuthenticationResult | null>;
|
||||
loginPopup(request?: PopupRequest | undefined): Promise<AuthenticationResult>;
|
||||
loginRedirect(request?: RedirectRequest | undefined): Promise<void>;
|
||||
logout(logoutRequest?: EndSessionRequest | undefined): Promise<void>;
|
||||
logoutRedirect(logoutRequest?: EndSessionRequest | undefined): Promise<void>;
|
||||
logoutPopup(logoutRequest?: EndSessionPopupRequest | undefined): Promise<void>;
|
||||
ssoSilent(request: Partial<Omit<CommonAuthorizationUrlRequest, "responseMode" | "codeChallenge" | "codeChallengeMethod" | "requestedClaimsHash" | "platformBroker">>): Promise<AuthenticationResult>;
|
||||
getTokenCache(): ITokenCache;
|
||||
getLogger(): Logger;
|
||||
setLogger(logger: Logger): void;
|
||||
setActiveAccount(account: AccountInfo | null): void;
|
||||
getActiveAccount(): AccountInfo | null;
|
||||
initializeWrapperLibrary(sku: WrapperSKU, version: string): void;
|
||||
setNavigationClient(navigationClient: INavigationClient): void;
|
||||
getConfiguration(): BrowserConfiguration;
|
||||
isBrowserEnv(): boolean;
|
||||
getBrowserCrypto(): ICrypto;
|
||||
getPerformanceClient(): IPerformanceClient;
|
||||
getRedirectResponse(): Map<string, Promise<AuthenticationResult | null>>;
|
||||
clearCache(logoutRequest?: ClearCacheRequest): Promise<void>;
|
||||
hydrateCache(result: AuthenticationResult, request: SilentRequest | SsoSilentRequest | RedirectRequest | PopupRequest): Promise<void>;
|
||||
}
|
||||
//# sourceMappingURL=UnknownOperatingContextController.d.ts.map
|
||||
1
node_modules/@azure/msal-browser/dist/controllers/UnknownOperatingContextController.d.ts.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/controllers/UnknownOperatingContextController.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"UnknownOperatingContextController.d.ts","sourceRoot":"","sources":["../../src/controllers/UnknownOperatingContextController.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,6BAA6B,EAC7B,uBAAuB,EACvB,2BAA2B,EAC3B,WAAW,EACX,MAAM,EACN,OAAO,EACP,kBAAkB,EAElB,aAAa,EAChB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EACH,mBAAmB,EAEtB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAClF,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,gDAAgD,CAAC;AAMzF,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM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C,EAAE,sBAAsB,GAAG,SAAS,GACnD,OAAO,CAAC,IAAI,CAAC;IAKhB,SAAS,CAEL,OAAO,EAAE,OAAO,CACZ,IAAI,CACA,6BAA6B,EAC3B,cAAc,GACd,eAAe,GACf,qBAAqB,GACrB,qBAAqB,GACrB,gBAAgB,CACrB,CACJ,GACF,OAAO,CAAC,oBAAoB,CAAC;IAKhC,aAAa,IAAI,WAAW;IAK5B,SAAS,IAAI,MAAM;IAInB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAK/B,gBAAgB,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,GAAG,IAAI;IAInD,gBAAgB,IAAI,WAAW,GAAG,IAAI;IAMtC,wBAAwB,CAAC,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAIhE,mBAAmB,CAAC,gBAAgB,EAAE,iBAAiB,GAAG,IAAI;IAI9D,gBAAgB,IAAI,oBAAoB;IAGxC,YAAY,IAAI,OAAO;IAKvB,gBAAgB,IAAI,OAAO;IAK3B,oBAAoB,IAAI,kBAAkB;IAK1C,mBAAmB,IAAI,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAAC;IAOlE,UAAU,CAAC,aAAa,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAM5D,YAAY,CAEd,MAAM,EAAE,oBAAoB,EAE5B,OAAO,EACD,aAAa,GACb,gBAAgB,GAChB,eAAe,GACf,YAAY,GACnB,OAAO,CAAC,IAAI,CAAC;CAInB"}
|
||||
268
node_modules/@azure/msal-browser/dist/controllers/UnknownOperatingContextController.mjs
generated
vendored
Normal file
268
node_modules/@azure/msal-browser/dist/controllers/UnknownOperatingContextController.mjs
generated
vendored
Normal file
@@ -0,0 +1,268 @@
|
||||
/*! @azure/msal-browser v4.2.1 2025-02-11 */
|
||||
'use strict';
|
||||
import { DEFAULT_CRYPTO_IMPLEMENTATION } from '@azure/msal-common/browser';
|
||||
import { BrowserCacheManager, DEFAULT_BROWSER_CACHE_MANAGER } from '../cache/BrowserCacheManager.mjs';
|
||||
import { CryptoOps } from '../crypto/CryptoOps.mjs';
|
||||
import { blockAPICallsBeforeInitialize, blockNonBrowserEnvironment } from '../utils/BrowserUtils.mjs';
|
||||
import { EventHandler } from '../event/EventHandler.mjs';
|
||||
|
||||
/*
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License.
|
||||
*/
|
||||
/**
|
||||
* UnknownOperatingContextController class
|
||||
*
|
||||
* - Until initialize method is called, this controller is the default
|
||||
* - AFter initialize method is called, this controller will be swapped out for the appropriate controller
|
||||
* if the operating context can be determined; otherwise this controller will continued be used
|
||||
*
|
||||
* - Why do we have this? We don't want to dynamically import (download) all of the code in StandardController if we don't need to.
|
||||
*
|
||||
* - Only includes implementation for getAccounts and handleRedirectPromise
|
||||
* - All other methods are will throw initialization error (because either initialize method or the factory method were not used)
|
||||
* - This controller is necessary for React Native wrapper, server side rendering and any other scenario where we don't have a DOM
|
||||
*
|
||||
*/
|
||||
class UnknownOperatingContextController {
|
||||
constructor(operatingContext) {
|
||||
// Flag representing whether or not the initialize API has been called and completed
|
||||
this.initialized = false;
|
||||
this.operatingContext = operatingContext;
|
||||
this.isBrowserEnvironment =
|
||||
this.operatingContext.isBrowserEnvironment();
|
||||
this.config = operatingContext.getConfig();
|
||||
this.logger = operatingContext.getLogger();
|
||||
// Initialize performance client
|
||||
this.performanceClient = this.config.telemetry.client;
|
||||
// Initialize the crypto class.
|
||||
this.browserCrypto = this.isBrowserEnvironment
|
||||
? new CryptoOps(this.logger, this.performanceClient)
|
||||
: DEFAULT_CRYPTO_IMPLEMENTATION;
|
||||
this.eventHandler = new EventHandler(this.logger);
|
||||
// Initialize the browser storage class.
|
||||
this.browserStorage = this.isBrowserEnvironment
|
||||
? new BrowserCacheManager(this.config.auth.clientId, this.config.cache, this.browserCrypto, this.logger, this.performanceClient, this.eventHandler, undefined)
|
||||
: DEFAULT_BROWSER_CACHE_MANAGER(this.config.auth.clientId, this.logger, this.performanceClient, this.eventHandler);
|
||||
}
|
||||
getBrowserStorage() {
|
||||
return this.browserStorage;
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
getAccount(accountFilter) {
|
||||
return null;
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
getAccountByHomeId(homeAccountId) {
|
||||
return null;
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
getAccountByLocalId(localAccountId) {
|
||||
return null;
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
getAccountByUsername(username) {
|
||||
return null;
|
||||
}
|
||||
getAllAccounts() {
|
||||
return [];
|
||||
}
|
||||
initialize() {
|
||||
this.initialized = true;
|
||||
return Promise.resolve();
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
acquireTokenPopup(request) {
|
||||
blockAPICallsBeforeInitialize(this.initialized);
|
||||
blockNonBrowserEnvironment();
|
||||
return {};
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
acquireTokenRedirect(request) {
|
||||
blockAPICallsBeforeInitialize(this.initialized);
|
||||
blockNonBrowserEnvironment();
|
||||
return Promise.resolve();
|
||||
}
|
||||
acquireTokenSilent(
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
silentRequest) {
|
||||
blockAPICallsBeforeInitialize(this.initialized);
|
||||
blockNonBrowserEnvironment();
|
||||
return {};
|
||||
}
|
||||
acquireTokenByCode(
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
request) {
|
||||
blockAPICallsBeforeInitialize(this.initialized);
|
||||
blockNonBrowserEnvironment();
|
||||
return {};
|
||||
}
|
||||
acquireTokenNative(
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
request,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
apiId,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
accountId) {
|
||||
blockAPICallsBeforeInitialize(this.initialized);
|
||||
blockNonBrowserEnvironment();
|
||||
return {};
|
||||
}
|
||||
acquireTokenByRefreshToken(
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
commonRequest,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
silentRequest) {
|
||||
blockAPICallsBeforeInitialize(this.initialized);
|
||||
blockNonBrowserEnvironment();
|
||||
return {};
|
||||
}
|
||||
addEventCallback(
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
callback,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
eventTypes) {
|
||||
return null;
|
||||
}
|
||||
removeEventCallback(
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
callbackId) { }
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
addPerformanceCallback(callback) {
|
||||
blockAPICallsBeforeInitialize(this.initialized);
|
||||
blockNonBrowserEnvironment();
|
||||
return "";
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
removePerformanceCallback(callbackId) {
|
||||
blockAPICallsBeforeInitialize(this.initialized);
|
||||
blockNonBrowserEnvironment();
|
||||
return true;
|
||||
}
|
||||
enableAccountStorageEvents() {
|
||||
blockAPICallsBeforeInitialize(this.initialized);
|
||||
blockNonBrowserEnvironment();
|
||||
}
|
||||
disableAccountStorageEvents() {
|
||||
blockAPICallsBeforeInitialize(this.initialized);
|
||||
blockNonBrowserEnvironment();
|
||||
}
|
||||
handleRedirectPromise(
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
hash) {
|
||||
blockAPICallsBeforeInitialize(this.initialized);
|
||||
return Promise.resolve(null);
|
||||
}
|
||||
loginPopup(
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
request) {
|
||||
blockAPICallsBeforeInitialize(this.initialized);
|
||||
blockNonBrowserEnvironment();
|
||||
return {};
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
loginRedirect(request) {
|
||||
blockAPICallsBeforeInitialize(this.initialized);
|
||||
blockNonBrowserEnvironment();
|
||||
return {};
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
logout(logoutRequest) {
|
||||
blockAPICallsBeforeInitialize(this.initialized);
|
||||
blockNonBrowserEnvironment();
|
||||
return {};
|
||||
}
|
||||
logoutRedirect(
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
logoutRequest) {
|
||||
blockAPICallsBeforeInitialize(this.initialized);
|
||||
blockNonBrowserEnvironment();
|
||||
return {};
|
||||
}
|
||||
logoutPopup(
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
logoutRequest) {
|
||||
blockAPICallsBeforeInitialize(this.initialized);
|
||||
blockNonBrowserEnvironment();
|
||||
return {};
|
||||
}
|
||||
ssoSilent(
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
request) {
|
||||
blockAPICallsBeforeInitialize(this.initialized);
|
||||
blockNonBrowserEnvironment();
|
||||
return {};
|
||||
}
|
||||
getTokenCache() {
|
||||
blockAPICallsBeforeInitialize(this.initialized);
|
||||
blockNonBrowserEnvironment();
|
||||
return {};
|
||||
}
|
||||
getLogger() {
|
||||
return this.logger;
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
setLogger(logger) {
|
||||
blockAPICallsBeforeInitialize(this.initialized);
|
||||
blockNonBrowserEnvironment();
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
setActiveAccount(account) {
|
||||
blockAPICallsBeforeInitialize(this.initialized);
|
||||
blockNonBrowserEnvironment();
|
||||
}
|
||||
getActiveAccount() {
|
||||
blockAPICallsBeforeInitialize(this.initialized);
|
||||
blockNonBrowserEnvironment();
|
||||
return null;
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
initializeWrapperLibrary(sku, version) {
|
||||
this.browserStorage.setWrapperMetadata(sku, version);
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
setNavigationClient(navigationClient) {
|
||||
blockAPICallsBeforeInitialize(this.initialized);
|
||||
blockNonBrowserEnvironment();
|
||||
}
|
||||
getConfiguration() {
|
||||
return this.config;
|
||||
}
|
||||
isBrowserEnv() {
|
||||
blockAPICallsBeforeInitialize(this.initialized);
|
||||
blockNonBrowserEnvironment();
|
||||
return true;
|
||||
}
|
||||
getBrowserCrypto() {
|
||||
blockAPICallsBeforeInitialize(this.initialized);
|
||||
blockNonBrowserEnvironment();
|
||||
return {};
|
||||
}
|
||||
getPerformanceClient() {
|
||||
blockAPICallsBeforeInitialize(this.initialized);
|
||||
blockNonBrowserEnvironment();
|
||||
return {};
|
||||
}
|
||||
getRedirectResponse() {
|
||||
blockAPICallsBeforeInitialize(this.initialized);
|
||||
blockNonBrowserEnvironment();
|
||||
return {};
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
async clearCache(logoutRequest) {
|
||||
blockAPICallsBeforeInitialize(this.initialized);
|
||||
blockNonBrowserEnvironment();
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
async hydrateCache(
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
result,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
request) {
|
||||
blockAPICallsBeforeInitialize(this.initialized);
|
||||
blockNonBrowserEnvironment();
|
||||
}
|
||||
}
|
||||
|
||||
export { UnknownOperatingContextController };
|
||||
//# sourceMappingURL=UnknownOperatingContextController.mjs.map
|
||||
1
node_modules/@azure/msal-browser/dist/controllers/UnknownOperatingContextController.mjs.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/controllers/UnknownOperatingContextController.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user