@nibssplc/cams-sdk
Version:
Central Authentication Management Service (CAMS) SDK for popup-based authentication with Azure AD + custom 2FA
21 lines (20 loc) • 1.88 kB
TypeScript
import { AttestationResult, StandaloneMFARequest, type Credentials, type MFAAuthenticatedResponse, type MFASDKRequest, type UserValidatedResponse } from "./types";
export interface MFAAuthenticator {
LoginADCredentials(credentials: Credentials, appCode: string, CredentialsAuthEndpoint: string): Promise<MFAAuthenticatedResponse>;
VerifyMFAOTP(ValidateRequest: StandaloneMFARequest, MFAEndpoint: string): Promise<MFAAuthenticatedResponse>;
HandleFIDOLogin(RetrieveAuthChallengeEndpoint: string, AuthChallengeVerifyEndpoint: string, authenticate: (options: PublicKeyCredentialRequestOptions) => Promise<PublicKeyCredential>): Promise<boolean>;
HandleRegister(RegisterNewChallengeEndpoint: string, RegisterVerify: string, register: (options: PublicKeyCredentialCreationOptions) => Promise<AttestationResult>, data: Record<string, unknown>): Promise<boolean>;
GetRemainingAttempts(): number;
ResetUserAttempts(): void;
}
export declare class CAMSMFAAuthenticator implements MFAAuthenticator {
private attemptCount;
private readonly maxAttempts;
GetUserMFAConfig(config: MFASDKRequest): Promise<UserValidatedResponse>;
VerifyMFAOTP(ValidateRequest: StandaloneMFARequest, MFAEndpoint: string): Promise<MFAAuthenticatedResponse>;
LoginADCredentials(credentials: Credentials, CredentialsAuthEndpoint: string): Promise<MFAAuthenticatedResponse>;
HandleFIDOLogin(RetrieveAuthChallengeEndpoint: string, AuthChallengeVerifyEndpoint: string, authenticate: (options: PublicKeyCredentialRequestOptions) => Promise<PublicKeyCredential>): Promise<boolean>;
HandleRegister(RegisterNewChallengeEndpoint: string, RegisterVerify: string, register: (options: PublicKeyCredentialCreationOptions) => Promise<AttestationResult>, data: Record<string, unknown>): Promise<boolean>;
GetRemainingAttempts(): number;
ResetUserAttempts(): void;
}