UNPKG

@nibssplc/cams-sdk

Version:

Central Authentication Management Service (CAMS) SDK for popup-based authentication with Azure AD + custom 2FA

20 lines (19 loc) 720 B
import { CAMSConfig, CAMSTokenResponse, CAMSError } from "./types"; import { Profile } from "./validators"; export interface CAMSEvents { onAuthStart?: () => void; onAuthSuccess?: (token: CAMSTokenResponse) => void; onAuthError?: (error: CAMSError) => void; onTokenExpired?: () => void; } export declare class CAMSSessionManager { private readonly tokenManager; private readonly events; constructor(storage?: Storage, storageKey?: string, events?: CAMSEvents); login(config: CAMSConfig): Promise<CAMSTokenResponse>; logout(): Promise<void>; isAuthenticated(): boolean; getAccessToken(): string | null; private decodeBase64Url; getProfile(): Promise<Profile | null>; }