UNPKG

@looker/sdk-rtl

Version:
50 lines (49 loc) 1.86 kB
import { AuthSession } from './authSession'; import type { IRequestProps } from './transport'; import { AuthToken } from './authToken'; import type { ICryptoHash } from './cryptoHash'; import type { IPlatformServices } from './platformServices'; interface IAuthCodeGrantTypeParams { grant_type: 'authorization_code'; code: string; code_verifier: string; client_id: string; redirect_uri: string; } export declare class OAuthSession extends AuthSession { activeToken: AuthToken; crypto: ICryptoHash; reentry: boolean; private static readonly codeVerifierKey; static readonly returnUrlKey = "looker_oauth_return_url"; constructor(services: IPlatformServices); readConfig(): { [x: string]: any; readConfig(section?: string): import("./apiSettings").IApiSection; isConfigured(): boolean; base_url: string; headers?: import("./transport").IRequestHeaders; verify_ssl: boolean; timeout: number; encoding?: string | null; agentTag: string; maxTries?: number; waitHandler?: import("./transport").Waitable; signal?: AbortSignal; }; authenticate(props: IRequestProps): Promise<IRequestProps>; get code_verifier(): string | null; set code_verifier(value: string | null); get returnUrl(): string | null; set returnUrl(value: string | null); clearStorage(): void; login(_sudoId?: string | number): Promise<any>; private requestToken; createAuthCodeRequestUrl(scope: string, state: string): Promise<string>; redeemAuthCodeBody(authCode: string, codeVerifier?: string): IAuthCodeGrantTypeParams; redeemAuthCode(authCode: string, codeVerifier?: string): Promise<AuthToken>; getToken(): Promise<AuthToken>; isAuthenticated(): boolean; logout(): Promise<boolean>; } export {};