ashish-sdk
Version:
ThoughtSpot Embed SDK
44 lines (43 loc) • 1.8 kB
TypeScript
import { EmbedConfig } from './types';
export declare let loggedInStatus: boolean;
export declare let samlAuthWindow: Window;
export declare let samlCompletionPromise: Promise<void>;
export declare let sessionInfo: any;
export declare const SSO_REDIRECTION_MARKER_GUID = "5e16222e-ef02-43e9-9fbd-24226bf3ce5b";
export declare const EndPoints: {
AUTH_VERIFICATION: string;
SAML_LOGIN_TEMPLATE: (targetUrl: string) => string;
OIDC_LOGIN_TEMPLATE: (targetUrl: string) => string;
TOKEN_LOGIN: string;
BASIC_LOGIN: string;
};
/**
* Return sessionInfo if available else make a loggedIn check to fetch the sessionInfo
*/
export declare function getSessionInfo(): any;
export declare function initSession(sessionDetails: any): void;
/**
* Perform token based authentication
* @param embedConfig The embed configuration
*/
export declare const doTokenAuth: (embedConfig: EmbedConfig) => Promise<void>;
/**
* Perform basic authentication to the ThoughtSpot cluster using the cluster
* credentials.
*
* Warning: This feature is primarily intended for developer testing. It is
* strongly advised not to use this authentication method in production.
* @param embedConfig The embed configuration
*/
export declare const doBasicAuth: (embedConfig: EmbedConfig) => Promise<void>;
export declare const doSamlAuth: (embedConfig: EmbedConfig) => Promise<void>;
export declare const doOIDCAuth: (embedConfig: EmbedConfig) => Promise<void>;
/**
* Perform authentication on the ThoughtSpot cluster
* @param embedConfig The embed configuration
*/
export declare const authenticate: (embedConfig: EmbedConfig) => Promise<void>;
/**
* Check if we are authenticated to the ThoughtSpot cluster
*/
export declare const isAuthenticated: () => boolean;