FaceLiveness
Runtime permissions
Permission | Reason | Required |
---|---|---|
| Capturing the selfie in policies with facial re-authentication | Yes |
Before Instantiating
Before Instantiating the SDK, in this specific version, we sdk you to come back and add other of our maven repository inside the dependencyResolutionManagement
method in the settings.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 |
Enum | Description |
| production environment. |
| beta environment. |
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 |
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. |
Signed response 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. |
SDKFailure
Return | Reason |
---|---|
| In case of a CAF SDK specific error, return the instance of the error. |
InstanceOf | Description | Example | Methods |
---|---|---|---|
| Network error | The user's internet disabled | .getMessage() .getThrowable() |
| When a SDK request receives a status code of failure | In theory, it shouldn't happen. If you see something like this, let us know! | .getMessage() .getCode() |
| Generic exceptions | When an unexpected exception happens | .getMessage() |
Last updated