@nibssplc/cams-sdk-react
Version:
React hooks and components for NIBSS CAMS SDK
31 lines (30 loc) • 1.06 kB
TypeScript
import "../utils/crypto-polyfill";
import { CAMSError, type MFAAuthenticatedResponse } from "@nibssplc/cams-sdk";
export interface UseCAMSMSALAuthOptions {
onTokenExpired?: () => void;
scopes?: string[];
storageKey?: string;
prompt?: string;
messageOrigin?: string;
appCode: string;
allowedOrigins?: string[];
ValidateUserEndpoint: string;
activeCookiePeriod?: number;
}
export interface UseCAMSMSALAuthReturn {
login: () => Promise<void>;
logout: () => Promise<void>;
storageKey: string;
isAuthenticated: boolean;
isLoading: boolean;
error: CAMSError | null;
idToken: string;
accessToken: string;
appCode: string;
requiresMFA: boolean;
completeMFA: (data: MFAAuthenticatedResponse) => Promise<MFAAuthenticatedResponse>;
setRequiresMFA: React.Dispatch<React.SetStateAction<boolean>>;
LoginADCredentials: () => Promise<MFAAuthenticatedResponse>;
activeCookiePeriod: number;
}
export declare function useCAMSMSALAuth(options: UseCAMSMSALAuthOptions): UseCAMSMSALAuthReturn;