UNPKG

@nibssplc/cams-sdk

Version:

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

36 lines (35 loc) 996 B
export interface MFAConfig { accessToken: string; idToken: string; appCode: string; provider: string; apiEndpoint?: string; } export interface MFAResponse { name: string; email: string; isAuthenticated: boolean; message: string; mfaIsEnabled: boolean; userType: string; tokens: { Bearer: string; Nonce: string; }; } export interface MFAAuthenticator { sendEmailOTP(): Promise<boolean>; verifyOTP(code: string, type: 'EmailOTP' | 'AuthenticatorCode'): Promise<MFAResponse>; getRemainingAttempts(): number; resetAttempts(): void; } export declare class CAMSMFAAuthenticator implements MFAAuthenticator { private config; private attemptCount; private readonly maxAttempts; constructor(config: MFAConfig); sendEmailOTP(): Promise<boolean>; verifyOTP(code: string, type: 'EmailOTP' | 'AuthenticatorCode'): Promise<MFAResponse>; getRemainingAttempts(): number; resetAttempts(): void; }