For the complete documentation index, see llms.txt. This page is also available as Markdown.

Face Capture with IAD - Selphi

Differences from standard Face Capture

The Selphi IAD Component is functionally equivalent to the Selphi Component standard version, incorporating additional security controls aimed at detecting video injection attacks and untrusted capture environments.

The integration, configuration and usage Flow of the component are the same. The main functional difference is the inclusion of the field iad in the result (SelphiResult), which contains the anti-fraud analysis information prepared for server verification.

To use it, a new License is required and the standard component dependency must be replaced with:

implementation "com.facephi.androidsdk:selphi_iad_component:$version"

This component has two important restrictions:

  • Devices with at least 3 GB of RAM.

  • Front camera with preview of 1920x1080 or higher.

Introduction

Face Capture with video Injection Attack Detection is performed through the Selphi IAD Component.

This component is responsible for capturing a user selfie and extracting the most relevant facial features, incorporating a set of preventive security controls aimed at detecting untrusted environments. During the process, the following steps are performed, among others:

  • Internal management of cameras and permissions.

  • Detection of spoofing attempts using videos or manipulated camera sources.

  • Guided assistance during Face Capture.

  • Generation of biometric templates and user images.

In the Simplified Launch the basic steps for SDK integration are described. This page details the specific information needed to launch and configure this component.


Dependency

The specific component dependency is:


Available controllers

This component includes several controllers, each focused on a specific function.

Controller
Description

SelphiController

Main Facial Recognition controller

RawTemplateController

Generation of a RawTemplate from an image

SignatureSelphiController

Signing a process using a Face Capture


Simplified Launch

Once the SDK has been started and a new operation created, the component can be launched using any of its controllers.


Basic configuration

To launch the component, it is necessary to create an object SelphiConfigurationData, which defines the widget behavior.

The component allows the following liveness detection modes:

  • SelphiFaceLivenessMode.NONE

  • SelphiFaceLivenessMode.PASSIVE

  • SelphiFaceLivenessMode.MOVE


Receiving the result

The launch result is returned as an object SdkResult, which can indicate a successful result or an error (in the result data, the field carrying the information associated with the IAD will be Receipt of the successful result - data)

Error handling

Errors will be returned as a 'SelphiError' object.

List of errors:

  • SPI_ACTIVITY_RESULT_ERROR: The activity result is incorrect.

  • SPI_ACTIVITY_RESULT_MSG_ERROR: The activity result received in msg is incorrect.

  • SPI_APPLICATION_CONTEXT_ERROR: The required application context is null.

  • SPI_BAD_EXTRACTOR_CONFIGURATION_ERROR: Widget: Incorrect extractor configuration.

  • SPI_CAMERA_PERMISSION_DENIED: The user has denied the permissions.

  • SPI_CANCEL_BY_USER: The user has canceled the process.

  • SPI_CANCEL_LAUNCH: A general SDK cancellation has been made.

  • SPI_COMPONENT_LICENSE_ERROR: The component License is not valid.

  • SPI_CONTROL_NOT_INITIALIZATED_ERROR: Widget: Initialization error.

  • SPI_EMPTY_LICENSE: The License string is empty.

  • SPI_EXTRACTION_LICENSE_ERROR: Widget: License error.

  • SPI_FETCH_DATA_ERROR: Error while retrieving the result.

  • SPI_FLOW_ERROR: Error in the Flow process.

  • SPI_HARDWARE_ERROR: Widget: Hardware error.

  • SPI_INITIALIZATION_ERROR: Initialization error.

  • SPI_MANAGER_NOT_INITIALIZED: The managers are null.

  • SPI_NO_DATA_ERROR: The input data are null.

  • SPI_OPERATION_NOT_CREATED: There is no operation in progress.

  • SPI_RESOURCES_NOT_FOUND: The resources zip was not found.

  • SPI_SETTINGS_PERMISSION_ERROR: Widget: Permission error.

  • SPI_TEMPLATE_ERROR:

  • SPI_TIMEOUT: Timeout in the process.

  • SPI_UNEXPECTED_CAPTURE_ERROR: Widget: Capture error.

  • SPI_UNKNOWN_ERROR: Unknown error.

  • SPI_WIDGET_RESULT_DATA_ERROR: Error in the widget output data.

Receiving the successful result - data

When the result is successful (SdkResult.Success), an object is obtained SelphiResult.

The images are returned in SdkImage. The bitmap can be accessed through image.bitmap. To convert an image to Base64:

Returned fields

  • templateRaw Raw template generated after extraction. Valid for Matching processes.

  • template Processed template after extraction. Valid for Matching processes.

  • bestImage Best image captured in original resolution. This image has the original size extracted from the camera. Valid for the Liveness process.

  • bestImageCropped Cropped image centered on the user's face. It is obtained from the bestImage.

  • logImages List with the 5 best images (requires logImages = true).

  • bestImageTokenized Best encrypted image of the process. Valid for the Liveness process.

  • bestImageTokenized Best encrypted image of the process. Valid for the Liveness process.

  • iad Information obtained in the video injection attack analysis prepared for sending to the verification service.

  • livenessDiagnostic Information from the verification process confirming that the person is physically present and real.


Advanced information

Additional Controllers

SignatureSelphiController

Works equivalently to SelphiController, with the difference that it generates a signature file on the platform.

RawTemplateController

Allows generating a RawTemplate from an image (Bitmap).

Usage example:

Advanced configuration

The component behavior is defined by SelphiConfigurationData.

Available parameters

  • resourcesPath Name of the resources ZIP file (located in assets). Example: “resources-selphi-2-0.zip“.

  • cropPercent Face crop percentage. The higher the number, the greater the rectangle crop relative to the face.

  • cropImageDebug Shows crop debugging information.

  • showResultAfterCapture Shows a confirmation screen after capture. The user is given the option to repeat the capture process if the image obtained is not correct.

  • showTutorial Activates the tutorial screen. It intuitively explains how the capture is performed.

  • livenessMode Liveness detection mode (NONE, PASSIVE, MOVE).

    • SelphiFaceLivenessMode.NONE: Indicates that photo-detection mode should not be activated in authentication processes.

    • SelphiFaceLivenessMode.PASSIVE: Indicates that the passive liveness check is performed on the server, sending the corresponding “BestImage” or “TemplateRaw” for that purpose.

    • SelphiFaceLivenessMode.MOVE: Indicates that the liveness check is active, showing instructions during capture, and returning the corresponding result of the process.

  • stabilizationMode Forces the user to keep their head steady before capturing, looking straight ahead and without moving their head.

  • cameraFlashEnabled Turns on the camera flash.

  • fullscreen Prioritizes full-screen display.

  • templateRawOptimized Optimizes the templateRaw generated.

  • qrMode Activates QR Code reading before the authentication process.

  • videoFilename Absolute path for recording the process video. The application is responsible for requesting the necessary permissions from the phone if required.

  • viewsContent Advanced view configuration via XML. This property does not alter the contents of the resources file.

  • showDiagnostic Displays diagnostic screens.

  • logImages Returns the 5 best captured images.

  • showPreviousTip Shows an informational screen before capture.

  • extractionDuration Duration of the extraction process.

  • cameraPreferred Preferred camera (FRONT, BACK).

  • vibrationEnabled Vibration feedback when finished.

  • moveSuccessfulAttempts Retries allowed on successful captures (default 1).

  • moveFailedAttempts Retries allowed on incorrect captures (default 2).


Component customization

In addition to the changes that can be made at the SDK level (explained in SDK Customization), this component allows its own customization.

Texts

The texts can be customized by overwriting the values in a strings XML file.

Name

Value

selphi_component_timeout_title

Time exceeded

selphi_component_timeout_desc

We couldn't identify you. Try again

selphi_component_internal_error_title

There was a technical problem

selphi_component_internal_error_desc

We apologize. The capture could not be completed

selphi_component_tip_message

Place your face in the center of the circle

selphi_component_tip_message_alt

Place your face in the center of the circle

selphi_component_tip_anim_alt

A person shows their face inside the circle and the app takes a photo.

selphi_component_tip_title

Facial Recognition

selphi_component_tip_button

START

selphi_component_tip_button_alt

Start Face Capture

selphi_component_tip_move_message

Place your face in the center of the circle and follow the instructions

selphi_component_tip_move_message_alt

Place your face in the center of the circle and follow the instructions

selphi_component_tip_move_anim_alt

A person shows their face inside the circle, moves it slightly to one side, and the app takes a photo.

selphi_component_tip_move_title

Facial Recognition

selphi_component_tip_move_button

START

selphi_component_qr_tip_title

Scan the QR Code

selphi_component_qr_tip_message

Focus the QR Code within the frame

selphi_component_qr_tip_anim_alt

Focus the QR Code within the frame

selphi_component_qr_tip_button

Start

selphi_component_tip_close_button_alt

Back

selphi_component_tip_info_button_alt

View tips

selphi_component_tutorial_message_1

Place your face in the center and look straight at the camera.

selphi_component_tutorial_message_2

Remove any item covering your face.

selphi_component_tutorial_message_3

Look for a well-lit environment, without shadows on your face.

selphi_component_tutorial_1_anim_alt

The photo is taken when the person is in the center.

selphi_component_tutorial_2_anim_alt

A person takes off their sunglasses and moves their hair away from their eyes.

selphi_component_tutorial_3_anim_alt

The image appears dark and a person turns on the light.

selphi_component_tutorial_close_button_alt

Back to the previous tutorial

Animations

Lottie animations can be overridden by adding files with the same name in res/raw/.

Last updated