SDKs response

Overview

This page explains the reasons why an SDK is terminated. To do this, check the instance of the SDKFailure object class present in the result object.

InstanceOf
Description
Example
Present SDKs

null

The SDK was closed successfully. Your return objects are correctly filled in.

When the user successfully executes the internal steps

DocumentDetector, PassiveFaceLiveness, FaceAuthenticator

InvalidTokenReason

The token entered is not valid for the corresponding product

Parameterize "test123" as token in the SDK builder

DocumentDetector, PassiveFaceLiveness, FaceAuthenticator

PermissionReason

You are missing some mandatory permission to run the SDK

Start DocumentDetector without camera permission granted

DocumentDetector, PassiveFaceLiveness, FaceAuthenticator, AddressCheck

AvailabilityReason

The SDK is not yet available for use. The variable SDKFailure.getMessage() contains instructions for the user

The device's internal storage is full when installing the app, and the face detection template cannot be installed together

PassiveFaceLiveness, FaceAuthenticator

NetworkReason

Internet connection failure

User was without internet during facematch in FaceAuthenticator

DocumentDetector, PassiveFaceLiveness, FaceAuthenticator, AddressCheck

ServerReason

When an SDK request receives a status code of failure

In theory, it shouldn't happen. If you see something like this, let us know!

DocumentDetector, PassiveFaceLiveness, FaceAuthenticator, AddressCheck

SecurityReason

When the SDK cannot be started due to a security reason

When Google Security Provider is not updating

DocumentDetector, PassiveFaceLiveness, FaceAuthenticator

StorageReason

There is no space on the user device's internal storage

When there is no space on the internal storage while capturing the document photo

DocumentDetector, PassiveFaceLiveness, FaceAuthenticator

LibraryReason

When an SDK internal library cannot be started

Forgetting to set theCompress configuration will lead to this failure in the DocumentDetector

DocumentDetector

InvalidFaceReason

There is no face record for the given peopleId

When the user authenticates with a peopleId that has no face record

FaceAuthenticator

Example

The following example shows how to discover and handle the shutdown reason for the DocumentDetector SDK using Kotlin:

    override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
        super.onActivityResult(requestCode, resultCode, data)
        if (requestCode == REQUEST_CODE && resultCode == RESULT_OK) {
            val result = data?.getSerializableExtra(
                DocumentDetectorResult.PARAMETER_NAME
            ) as DocumentDetectorResult

            if (!result.wasSuccessful()) {
                result.sdkFailure?.let {
                    onSdkFailure(it)
                }
                return
            }

            println("DocumentDetectorResult: $result")
        } else {
            println("The user canceled the operation")
        }
        super.onActivityResult(requestCode, resultCode, data)
    }

    private fun onSdkFailure(sdkFailure: SDKFailure?) {
        when (sdkFailure) {
            is InvalidTokenReason -> {
                println("SDKFailure: The token entered as a parameter is not valid, please revise it")
            }
            is PermissionReason -> {
                println("SDKFailure: The user did not grant the necessary permissions")
            }
            is AvailabilityReason -> {
                println("SDKFailure: Instructions are sent in: ${sdkFailure.message}")
            }
            is NetworkReason -> {
                println("SDKFailure: There was a problem with the internet connection")
            }
            is ServerReason -> {
                println("SDKFailure: There was a problem in any communication with the CAF servers, let us know!")
            }
            is SecurityReason -> {
                println("SDKFailure: There was a security problem on the user's device")
            }
            is StorageReason -> {
                println("SDKFailure: There was a problem with the internal storage of the user's device")
            }
            is LibraryReason -> {
                println("SDKFailure: There was a problem with the internal library")
            }
            else -> {
                println("SDKFailure: Unknown reason")
            }
        }
    }

Security Returns

We are constantly taking actions to make the product more secure, mitigating many attacks observed in the capture processes and reducing as many identity fraud attempts as possible. The errors described here are returned in the message field of the SecurityReason class.

Error 300

Represents the blocking of devices with developer mode active.

Developer mode allows users to access advanced settings, such as debugging apps via USB. By default, the SDKs block devices in developer mode.

To disable this validation, use the .setUseDeveloperMode(bool use) method in the SDK Builder.

Error 400

Represents the blocking of devices with Android Debug Bridge (ADB) enabled.

ADB allows users to install and debug apps and access a Unix shell. By default, the SDKs block devices with ADB enabled.

To disable this validation, use the .setUseAdb(bool use) method in the SDK Builder.

Error 500

Represents the blocking of devices with debug mode enabled.

Debug mode allows users to debug applications via USB, enabling them to bypass SDK flows. By default, the SDKs block devices in debug mode.

To disable this validation, use the .setUseDebug(bool use) method in the SDK Builder.

Error 600

Represents the blocking of devices with fraudulent app signatures.

Signature verification blocks reverse engineering attacks and all other malicious attacks that can be done after this process in which the app has its original signature changed. Because of this, SDKs perform this blocking by default.

If you want to disable this validation, use the .checkAppSignature(use: Boolean) method in the SDK Builder.

Last updated

Logo

2023 © Caf. - All rights reserved