UNPKG

@geogirafe/lib-geoportal

Version:

GeoGirafe is a flexible application to build online geoportals.

35 lines (34 loc) • 1.48 kB
import IGirafeContext from '../context/icontext.js'; export default abstract class AbstractConnectManager { private readonly storagePath; private readonly urlParameterForHash; protected readonly context: IGirafeContext; constructor(context: IGirafeContext); protected get state(): import("../main.js").State; abstract initialize(): Promise<void>; abstract login(): Promise<void>; abstract silentLogin(): Promise<void>; abstract logout(): Promise<void>; protected loggedOutFromBackend(): void; handleErrorFromIssuer(): void; handleUnknownError(error: Error): void; protected loggedOut(saveState?: boolean): void; /** * The RedirectUrl has to be the same for all call to the issuer * Because the authentication is given for a specific redirectUrl. * Therefore, we keep it in localStorage. */ protected get redirectUrl(): string; protected set redirectUrl(value: string); protected getLoginRedirectUrl(silent: boolean): string; protected getLogoutRedirectUrl(): string; /** * Save the URL hash to a query parameter since some OIDC providers don't allow URL hashes in the redirect URL */ protected preserveUrlHash(url: URL): void; protected restoreUrlHash(url: URL): void; protected loadFromLocalStorage(path: string): unknown; protected saveToLocalStorage(path: string, value: string): void; protected resetUrl(): void; finalizeLoginWorkflow(): void; }