FaceLiveness
Enables you to integrate live facial verification and fingerprint authentication technology into your Android applications, offering a seamless and secure way to authenticate users.
Current Version
Name | Version |
---|---|
| 3.2.0 |
Requirements
Minimum Android SDK API version:
minSdk 21
(Android 5 Lollipop)Android SDK API version to compile:
compileSdk 34
To publish your app on the Google Play Store, you must complete a data safety form. Since we integrate with the FingerPrintJS SDK, you'll need to provide the following information:
Question in Google Play Console's data safety form | Response |
---|---|
Does your app collect or share any of the required user data types? | Yes. |
What type of data is collected? | Device or other identifiers. |
Is this data collected, shared, or both? | Collected. |
Is this data processed ephemerally? | Yes. |
Why is this user data collected? | Fraud Prevention, Security, and Compliance. |
versionName
and versionCode
are mandatory for the SDK to work correctly.
SDK Dependencies
FaceLiveness leverages the following external SDKs:
SDK | Version |
---|---|
| 9.0.4 |
| 2.4.0 |
iProov Biometrics Android: Enables the integration of live facial verification technology.
Fingerprint Pro Android: Provides fingerprint authentication capabilities to enhance security features in your app.
These dependencies are easily managed through Gradle and are bundled with the SDK for ease of installation.
Runtime permissions
Permission | Reason | Required |
---|---|---|
| Capturing the selfie in live facial verification policies | Yes |
Installation
If your version of Gradle is earlier than 7, add these lines to your build.gradle
.
If your version of Gradle is 7 or newer, add these lines to your settings.gradle
.
Add support for Java 8 to your build.gradle
file. Skip this step if Java 8 is enabled.
Add the SDK version to the dependencies section in your build.gradle
file
Instantiating the SDK
First, create an object of type FaceLiveness
. This object is for you to configure all your business rules:
Builder method
Parameter | Required |
---|---|
Usage token associated with your Identity account (see how to get it here). | Yes |
Used to redirect the SDK to the desired stage in caf api. The method takes as parameter an enum
| No. The default is |
Used to change the SDK filter, that has the following options:
| No, the default is |
Used to enable screenshots during the SDK scan. Disabled by default for security reasons. | No, the default is |
Used to enable a default loading progressbar during loading events. You can set your customized loading screen instead, using the | No, the default is |
Used to customize the image URL expiration time, that has the following options:
| No, the default is |
Used to enable the use of reverse proxy to execute face liveness. If used, the certificates must be set with the setCertificates method. | No, the default is the original IProov URL |
Used to set pinned certificates for reverse proxy implementation. | No, the default is an empty list |
Used to enable the use of reverse proxy to execute SDK's authentications. | No, the default is the original Caf's URL |
Reverse proxy
In order to implement reverse proxy settings, you must follow these instructions:
FaceLiveness reverse proxy
Set your proxy to communicate with `wss://us.rp.secure.iproov.me/ws´.
Use the method
.setFaceLivenessBaseUrl
to set the URL on which the FaceLiveness must run.The URL's protocol must be WSS.
Use the method
.setCertificates
method to set the certificates, which are base64-encoded SHA-256 hash of certificate' Subject Public Key Info.Certificates are needed in order to make Faceliveness reverse proxy work.
Authentication reverse proxy
Set your proxy to communicate with the URL that corresponds the CAFStage you are using:
CAFStage.PROD -> https://api.public.caf.io/v1/sdks/faces/
CAFStage.BETA -> https://api.public.beta.caf.io/v1/sdks/faces/
CAFStage.DEV -> https://api.public.dev.caf.io/v1/sdks/faces/
Use the method
.setAuthenticationBaseUrl
to set the URL on which the authorization requests must run.The URL's protocol must be HTTPS.
Consulting a policy
To authenticate a user, use the .startSDK()
method. You must enter the user's CPF, your app's Context and a VerifyLivenessListener
object.
Parameters
Parameter | Required |
---|---|
User CPF | Yes |
Your app Context | Yes |
Response Listener | Yes |
Example
VerifyLivenessListener options
Method | Description |
---|---|
| The execution has ended with success, you have to use the |
| The execution has ended with error, you have to use the |
| The execution has been cancelled by the user. |
| The SDK is loading, you can use this method to set a action in your app, for example a loading. |
| The SDK is not loading anymore, you can use this method to set a action in your app, for example, you can stop your previous loading. |
FaceLivenessResult
Success
Return | Reason |
---|---|
| Signed response from the CAF server confirming that the captured selfie has a real face. This parameter is used to get 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. |
Signedresponse params
Event | Description |
---|---|
| Request identifier. |
| Validation of a living person, identifies whether the user passed successfully or not. |
| Request token. |
| User identifier provided for the request. |
| Temporary link to the image, generated by our API. |
| User identifier provided for the SDK. |
| Sdk version in use. |
| Token expiration. |
The isAlive parameter is VERY IMPORTANT, based on this validation, the user can be guided to continue the flow or not. In case of isAlive: true
, it would be able to continue with the journey. If isAlive: false
, this user is not valid and should be prevented from continuing their journey.
Error
Return | Reason |
---|---|
| In case of any error, return the error. |
| In case of a specific error, return the instance of the error. |
SDKFailure
Return | Reason |
---|---|
| Error description. |
| Return the type of the error. |
ErrorType
type | Description |
---|---|
| Indicates that the device does not have permission to access the camera. This error typically occurs when the user denies access to the camera or if the app lacks the necessary permissions. |
| Indicates a network-related error occurred. This error may occur due to various network issues such as a lack of internet connection, server timeouts, or network congestion. |
| Indicates an exception occurred on the server-side.<br. />This error is typically returned when there is an issue with the server processing the facial recognition request. This could include server-side errors, misconfigurations, or service interruptions. |
| Indicates an issue with the provided token. This error may occur if the provided authentication token is invalid, expired, or lacks the necessary permissions to perform facial recognition tasks. |
| Indicates that the device is not supported. This error may occur if the device hardware or software does not meet the minimum requirements for facial recognition functionality. |
| Indicates an exception occurred on certificate pinning. This error may occur when the provided certificates on the reverse proxy implementation are not right. |
Last updated