PassiveFaceLiveness (Deprecated)
Smart camera that captures a reliable selfie of your user using artificial intelligence, capable of detecting and disapproving snapshots and recordings. Ideal for your onboarding.
SDK size
A maximum of about 3.5 MB, which may decrease because of these elements.
Analytics
Our SDKs by default collect information about the user and running environment to better map fraudsters and understand their behaviors. We recommend keeping this collection active as the only purpose of this data is for fraud reduction, but if you wish, you can disable it by .setAnalyticsSettings(boolean useAnalytics)
parameter.
Runtime permissions
Permission | Reason | Required |
---|---|---|
| To capture the user selfie | Yes |
Instantiating the SDK
First, create an object of type PassiveFaceLiveness
. This object is for you to configure all your business rules for the SDK:
All parameters annotated with
@Nullable
can be givennull
values, useful if you want to set only one of the parameters of a single method.
Builder method
Parameter | Required |
---|---|
Usage token associated with your CAF account. | Yes |
User identifier for the purpose of identifying fraudulent profiles and assisting in the identification of Analytics logs in cases of errors and bugs. | No, used for analytics |
Enables/disables data collection for analytics. | No, the default is |
Changes the default settings of the stability sensor, Apply null if you don't want to use this sensor. | No. The default time is 1500 ms and the default threshold is 0.7 m/s². |
Changes the default settings for the brightness sensor, Apply null if you don't want to use this sensor. | No. The default threshold is 3 lx |
Changes the default settings for the orientation sensor, Apply null if you don't want to use this sensor. | No. The standard threshold is 3 m/s². |
Defines the capture settings. The method accepts instances of the ImageCapture and VideoCapture classes. | No. The default is |
Changes the waiting time until the manual capture button is displayed. | No. The default is 15000 (milliseconds) |
Replaces the default SDK layout. Create a file in your project's layout folder, copy this template and make the desired changes. | No. The pattern is this |
Defines the type of mask used in the captures. There are two types:
| No. The defalut is |
Changes the face capture masks: SUCCESS, NORMAL, and FAIL, in that order. If you use this option, use masks with the same detection area as the face, this region is very important for the algorithm to capture. | |
Replaces the SDK's default style. In your project's styles.xml file, copy this template and edit it. | No. The pattern is that. |
Sets the timeout interval for SDK requests. | No. The default is 60 (seconds) |
Sets the proxy settings, as explained here. | No. The default is |
Habilita/desabilita e permite a configuração da visualização da captura realizada, solicitando a confirmação do usuário para prosseguir. | No. The default is disabled |
Delay the activity after the completion of each step. This method can be used to display a success message on the screen itself after the capture, for example. | No. The default is |
Allows you to customize the messages displayed in the "status" balloon during the capture and analysis process. | No. |
It links an attempt at a proof of life to a CPF. | No, the default is |
It ties an attempt at a proof of life to a name. | No, the default is |
Enables/disables the button for the user to switch between the front and rear camera. | No, the default is |
Allows you to enable/disable features of the SDK that consume GoogleServices in the SDK, we do not recommend disabling the services because of the loss of security. | No, the default is |
Enables the use of emulators when | No, the default is |
Allows the use of root devices when | No, the default is |
Enables the use of developer mode when | No, the default is |
Enables Android Debug Bridge (ADB) debugging mode when | No, the default is |
Allows you to use the app in debug mode when | No, the default is |
Allows you to set the capture resolution. The method expects as parameter a
| No. The default is |
Sets the time the image URL will last on the server until it is expired. Expect to receive a time interval between "30m" to "30d". Examples:
| No. The default is |
Enables/disables playback of SDK audios. | No. The default is |
It allows you to customize the audio used by the SDK. | No. The default is |
Enables/disables device brightness boost on opening the SDK. This feature increases proof-of-life security by reflecting screen captures and also aids in better detection and capture quality. | No. The default is |
Allows you to customize the SDK's open-eye validation settings. The method expects a parameter | No. The default is |
Allows you to choose the environment in wich the SDK will run (production, beta). The method takes as parameter an enum | No. The default is |
Enum | Description |
| Will use the Trust Platform production environment to register the SDK executions. |
| Will use the Trust Platform beta environment to register the SDK executions. |
Each environment (beta and production) requires its own specific mobileToken, generated in the Trust platform of the respective environment.
MessageSettings
To use it, simply instantiate a MessageSettings
object and use the methods as needed to customize the messages.
Method | Default value |
---|---|
Message displayed when the algorithm does not recognize a face. | "Não encontramos nenhum rosto" |
Message displayed when the face is not fitted correctly to the mask. | "Encaixe seu rosto" |
Message displayed when the user's face is too far away. | "Aproxime o rosto" |
Message displayed when the user's face is too close to the camera. | "Afaste o rosto" |
Message displayed when more than one face is detected. | "Mais de um rosto detectado" |
Message displayed when the user is in the correct position for capture. | "Segure assim" |
Message displayed during proof-of-life check. | "Verificando selfie…" |
Message displayed when the proof-of-life check refuses the selfie. | "Não conseguimos capturar seu rosto. Tente novamente." |
Message displayed when both eyes are closed. | "Não use óculos escuros e mantenha os olhos abertos" |
Message displayed when the face is tilted to the X-axis (up or down). | "Centralize seu rosto na vertical" |
Message displayed when the face is tilted to the X-axis (left or right side). | "Centralize seu rosto na horizontal" |
Message displayed when the face is tilted to the Z-axis (rotated face). | "Ajuste seu rosto à mascara" |
Message displayed when you start the camera. | "Aguarde..." |
Message displayed when the brightness threshold is lower than expected. | "Ambiente muito escuro" |
Message displayed when the orientation threshold is lower than expected. | "Celular não está na vertical" |
Message displayed when the orientation threshold is lower than expected. | "Mantenha o celular parado" |
Message displayed when there is a processing problem or error in the API response. | "Ops, tivemos um problema ao processar sua imagem. Tente novamente." |
Example
Security validations
We are constantly taking actions to make the product more and more secure, mitigating a number of attacks observed in the capture process and, consequently, reducing as many possible identity frauds as possible. The SDK has some blocks that may prevent its execution in certain contexts. To disable them, you can use the methods as shown in the example below:
Disabling security validations is recommended for testing purposes only. For publishing your application in production, we recommend using the default settings.
Starting Activity
After creating the PassiveFaceLiveness
, start the PassiveFaceLivenessActivity
by passing this object as a parameter via extra intent:
Getting the result
To get the PassiveFaceLivenessResult
object, which contains the captures taken by the SDK, override the onActivityResult
method in the same activity that you started the PassiveFaceLivenessActivity
:
PassiveFaceLivenessResult
Parameter | Allow null |
---|---|
Full path of the image or video on the user's device. | Yes, in case of error |
Full path of the image on the user's device. | Yes, in case of error |
URL of the selfie on the CAF server. | Yes, in case of error |
Signed response from the CAF server confirming that the captured selfie has a real face (not a photo or video). Use this parameter if you want an extra layer of security, checking that the signature of the response is not broken, or caused by request interception. If it is broken, there is a strong indication of request interception. | Yes, in case of error or server unavailability |
Identifier of this execution on our servers. If possible, save this field and send it along to our API. This way we will have more data on how the user behaved during the execution. | Yes, if the user sets |
Object that tells you the reason for the SDK shutdown. For more information, see here | Yes, in case of success |
Defines the face of the camera that was used. Use | No |
Last updated