adpa-enterprise-framework-automation
Version:
Modular, standards-compliant Node.js/TypeScript automation framework for enterprise requirements, project, and data management. Provides CLI and API for BABOK v3, PMBOK 7th Edition, and DMBOK 2.0 (in progress). Production-ready Express.js API with TypeSpe
60 lines • 1.94 kB
TypeScript
/**
* SharePoint OAuth2 Authentication Handler
* Part of ADPA (Automated Document Processing Assistant) v2.1.3
*
* Handles OAuth 2.0 authentication flow for Microsoft Graph API and SharePoint access.
* Implements MSAL (Microsoft Authentication Library) for secure token management.
*
* Features:
* - Interactive authentication flow
* - Token refresh and caching
* - Multi-tenant support
* - Device code flow for headless environments
* - Secure token storage
*/
import { AuthenticationResult, AccountInfo } from '@azure/msal-node';
import { OAuth2Config } from './types.js';
export declare class SharePointOAuth2 {
private config;
private msalApp;
private tokenCache;
private cacheFilePath;
constructor(config: OAuth2Config);
/**
* Start interactive OAuth2 authentication flow
* @returns Promise with authentication result
*/ startInteractiveFlow(): Promise<AuthenticationResult>;
/**
* Start device code authentication flow (for headless environments)
* @returns Promise with authentication result
*/
startDeviceCodeFlow(): Promise<AuthenticationResult>;
/**
* Get valid access token (handles refresh automatically)
* @returns Valid access token
*/
getValidAccessToken(): Promise<string>;
/**
* Check if user is currently authenticated
* @returns Boolean indicating authentication status
*/
isAuthenticated(): Promise<boolean>;
/**
* Get current user account information
* @returns Account information or null
*/
getCurrentAccount(): Promise<AccountInfo | null>;
/**
* Sign out current user
*/
signOut(): Promise<void>; /**
* Load token cache from file
*/
private loadTokenCache;
/**
* Save token cache to file
* @param authResult Authentication result to cache
*/
private saveTokenCache;
}
//# sourceMappingURL=SharePointOAuth2.d.ts.map