UNPKG

@asposecloud/aspose-tasks-cloud

Version:
31 lines (30 loc) 937 B
import { Configuration } from "./configuration"; /** * Authentication logic for api calls */ export interface IAuthentication { /** * Apply authentication settings to header and query params. */ applyToRequest(requestOptions: any, configuration: Configuration): Promise<void> | void; /** * Handle 401 response. */ handle401response(configuration: Configuration): Promise<void> | void; } /** * Implements OAuth authentication */ export declare class OAuth implements IAuthentication { private accessToken; /** * Apply authentication settings to header and query params. * If token is not available, requests a new one. */ applyToRequest(requestOptions: any, configuration: Configuration): Promise<void>; /** * Handle 401 response by requesting a new token. */ handle401response(configuration: Configuration): Promise<void>; private _requestToken; }