@equinor/fusion-framework-module-msal-node
Version:
Fusion Framework module for secure Azure AD authentication in Node.js using MSAL. Supports interactive, silent, and token-only authentication modes with encrypted token storage.
33 lines (32 loc) • 1.7 kB
TypeScript
import { PersistenceCachePlugin, type IPersistence } from '@azure/msal-node-extensions';
/**
* Creates a persistence cache for storing authentication data securely on disk.
*
* The cache is encrypted and scoped to the current user for security. It is uniquely identified
* by the provided tenant and client IDs, and is associated with the 'fusion-framework' service.
*
* @param tenantId - The Azure AD tenant ID used to identify the cache.
* @param clientId - The Azure AD client/application ID used to identify the cache.
* @returns A promise that resolves to the created persistence cache instance.
*/
export declare const createPersistenceCache: (tenantId: string, clientId: string) => Promise<IPersistence>;
/**
* Clears the persistence cache for a specific tenant and client.
*
* Deletes the cache file and all associated authentication data for the given tenant and client IDs.
*
* @param tenantId - The Azure AD tenant ID.
* @param clientId - The Azure AD client/application ID.
* @returns A promise that resolves when the cache has been successfully cleared.
*/
export declare const clearPersistenceCache: (tenantId: string, clientId: string) => Promise<void>;
/**
* Creates a `PersistenceCachePlugin` instance for use with MSAL, using the provided tenant and client IDs.
*
* This plugin enables MSAL to use the secure persistence cache for token storage.
*
* @param tenantId - The Azure AD tenant ID.
* @param clientId - The Azure AD client/application ID.
* @returns A promise that resolves to an instance of `PersistenceCachePlugin`.
*/
export declare const createPersistenceCachePlugin: (tenantId: string, clientId: string) => Promise<PersistenceCachePlugin>;