UNPKG

@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.

35 lines (34 loc) 1.85 kB
/** * 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. * * Requires `@azure/msal-node-extensions` to be installed (optional dependency). * Only available in interactive desktop environments with a system keychain. * * @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<import("@azure/msal-node-extensions").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<import("@azure/msal-node-extensions").PersistenceCachePlugin>;