Integration Overview
Overview
The authentication process involves creating a request data transfer object (AuthenticatorRequestDTO), setting necessary parameters, and calling the authenticate method on the VidaAuthenticator.
The result of this asynchronous call is handled via callbacks in an AuthenticationStatusListener
A detailed explanation of each method is given below
AuthenticatorRequestDTO
A Data Transfer Object (DTO) used to encapsulate the parameters required for the authentication process.
Parameters:
API Key: A unique key provided to authenticate the API request.
License Key: A key provided to verify the application's license.
AuthEventID: An identifier for the authentication event.
Language ID (Optional): The language code (e.g., "en" for English) for localisation purposes.
Liveness Retry (Optional): Enable or disable the liveness retry feature, which attempts to recapture a live image in case of capture failures. This feature is disabled by default
AuthenticatorRequestDTO requestDTO = new AuthenticatorRequestDTO();
requestDTO.setApiKey(KeyConstant.API_KEY);
requestDTO.setLicenseKey(KeyConstant.LICENSE_KEY);
requestDTO.setLanguageId("en");
requestDTO.setAuthEventID("authEventId");
requestDTO.setLivenessRetry(true); VidaAuthenticator.authenticate()
This method initiates the authentication process. It is asynchronous and uses callbacks to handle the result.
Parameters:
WeakReference to Activity: A weak reference to the current Activity to avoid memory leaks.
AuthenticatorRequestDTO: An instance containing all the necessary authentication parameters.
AuthenticationStatusListener: A listener interface to handle the success, error, and state change callbacks.
AuthenticationStatusListener
An interface to handle the outcomes of the authentication process.
Methods:
onSuccess(JSONObject result): Called when authentication is successful. The
resultparameter contains the authentication result in JSON format.onError(int errorCode, String errorMessage): Called when an error occurs during authentication. The
errorCodeanderrorMessageparameters provide details about the error.onStateChanged(ProcessState state): Called to handle changes in the authentication process state. The
stateparameter indicates the current state of the process.
Sample Code
Last updated
