import { Service } from "../../.."; export declare class MicrosoftAuthCodeHandler { isInitialized: boolean; private isPopUpActive; private msConfig; private currentWindow; private readonly DEFAULT_AUTHORITY_HOST; private readonly defaultTimeoutOptions; /** * Method to initialize the microsoft OAuth service required config values based on tenantId and clientId * @param clientId - Azure App ClientID * @param tenantId - Customer Id * @returns Window */ initializeOAuthService(clientId: string, tenantId: string): boolean; /** * Helper function to open popup window dimensions and position * @param urlNavigate - URL to open in window * @param popupName - Name of the popup window * @returns Window */ private promptUserLogin; /** * Helper function to open authorization URL inside the hidden iframe * @param redirectUri - URL to open in iframe * @param scope - Microsoft authorization scopes * @returns Promise */ invokeSilentSSOLogin(props: Service.Microsoft.OAuthService.LoginRequest): Promise; /** * Use when we extract the auth code from the microsoft auth response URL * @param urlString - response url received from the microsoft oauth authorize service. * @returns string */ private getAuthCodeFromUrl; /** * Helper function to generate the microsoft authorization URL * @param redirectUri - URL to open in iframe * @param scope - Microsoft authorization scopes * @returns string */ private getAuthenticationUrl; unloadWindow: (e: Event) => 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. */ invokeLoginPopUp(props: Service.Microsoft.OAuthService.LoginRequest): Promise; /** * Use when initiating the logout 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. */ invokeLogout({ clientId, redirectUri }: { clientId?: string; redirectUri: string; }): Promise; /** * Use when initiating the logout process via opening a popup window in the user's browser * it will clear the token from the local storage. * @returns void */ removeToken(): void; /** * Monitors a window until it loads a url with the same origin. * @param popupWindow - window that is being monitored * @returns Promise */ private monitorPopupResponse; /** * Method to check the login popup window is opened or not. * @returns Boolean */ getPopUpActiveStatus(): boolean; /** * Monitors an iframe content window until it loads a url with a response, or hits a specified timeout. * @param iframe * @returns Promise */ private monitorIframeResponse; /** * Closes popup, removes any state vars created during popup calls. * @param popupWindow * @returns void */ cleanPopup(popupWindow?: Window): void; /** * @hidden * Creates a new hidden iframe or gets an existing one for silent token renewal. * @ignore */ createHiddenIframe(): HTMLIFrameElement; /** * @hidden * Removes a hidden iframe from the page. * @ignore */ removeHiddenIframe(iframe: HTMLIFrameElement): void; /** * Helper function to generate the iframe along with microsoft authorization URL * @param urlNavigate - URL to open in iframe * @returns HTMLIFrameElement */ loadIframeSync(urlNavigate: string): HTMLIFrameElement; /** * Helper function to generate the unique popup window name * @param clientId - Azure App ClientID * @returns string */ private generatePopupName; } declare module "../../../index" { namespace Service.Microsoft.OAuthService { type LoginRequest = { clientId?: string; scope: string; redirectUri: string; nonce?: string; state?: string; prompt?: string; }; type Config = { clientId: string; tenantId: string; authority: string; endPoints: { authorizationURL: string; logoutURL: string; }; }; } } //# sourceMappingURL=microsoft-oauth-handler.d.ts.map