Introducing VIDA Identity Stack: All of VIDA, in one place 🎉
For the complete documentation index, see llms.txt. This page is also available as Markdown.

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 result parameter contains the authentication result in JSON format.

  • onError(int errorCode, String errorMessage): Called when an error occurs during authentication. The errorCode and errorMessage parameters provide details about the error.

  • onStateChanged(ProcessState state): Called to handle changes in the authentication process state. The state parameter indicates the current state of the process.

Sample Code

Last updated