Introduction
Face authentication is a tool to perform KYC checks once and then use the same scanRef to perform multiple verifications in just 30 seconds. The flow only requires the user to take a regular face photo to perform the authentication.
Pre-conditions
A successful verification must be performed before initializing face authentication. For face authentication all you need is a scanRef, which is obtained during token generation.Getting started
Follow the iDenfy SDK integration guide, which is required for face authentication as well. After completing the steps and the application compiles successfully, you are ready to implement face-auth specific logic.You will receive a webhook callback if it is your preferred way of handling results (recommended as it is more secure and reliable). The webhook structure is:
{
"token": "token",
"clientId": "clientId",
"scanRef": "scanRef",
"status": "SUCCESS",
"type": "AUTHENTICATION",
"method": "FACE_MATCHING",
"facePhoto": "https://s3.eu-west-1.amazonaws.com/production.users.storage/users_storage/users/<HASH>/FRONT.png?AWSAccessKeyId=<KEY>&Signature=<SIG>&Expires=<STAMP>"
}
The
facePhoto key is a String (URL), can be null, with a max length of 500. It provides a URL to download the selfie photo used for authentication.SUCCESSFAILEDCANCELEDEXPIREDTo set your webhook URL, contact tech support via the dashboard.
If you also want to handle results directly in the mobile app, implement the result handling in the SDK:
private var identificationResultsCallback = registerForActivityResult(
ActivityResultContracts.StartActivityForResult()
) { result: ActivityResult ->
val resultCode = result.resultCode
val data = result.data
if (resultCode == IdenfyController.IDENFY_FACE_AUTHENTICATION_RESULT_CODE) {
val faceAuthenticationResult: FaceAuthenticationResult =
data!!.getParcelableExtra(IdenfyController.IDENFY_FACE_AUTHENTICATION_RESULT)!!
Toast.makeText(this, "Face Authentication Status: " + faceAuthenticationResult.faceAuthenticationStatus.status, Toast.LENGTH_SHORT).show()
when (faceAuthenticationResult.faceAuthenticationStatus) {
FaceAuthenticationStatus.SUCCESS -> {
// The user completed authentication flow, was successfully authenticated
}
FaceAuthenticationStatus.FAILED -> {
// The user completed authentication flow, was not successfully authenticated
}
FaceAuthenticationStatus.EXIT -> {
// The user did not complete authentication flow
}
}
}
}
Before initializing the SDK, you need to check whether the user can use face authentication and generate an authToken. See the Token Generation for SDK documentation.
Customization
Immediate redirect
An additional boolean can be passed to set the immediate redirect feature. This controls whether the results from the SDK should be received immediately without any additional result pages. The client completes the verification, a loading state appears and closes — without showing the final status screen.Face detection
Face detection can be enabled, which requires users to place their face into the marked area before taking a photo.
Contact tech support via the Jira customer portal to enable this feature. Face detection will apply to both KYC verification and face authentication flows.
Passive liveness detection
While using face matching authentication, passive liveness detection can be enabled to detect whether a selfie photo is genuine or not.Contact tech support via the Jira customer portal to enable this feature. This will apply to both KYC verification and face authentication flows.
Auto capture
Auto capture can be enabled, which requires users to place their face into the marked area and the picture will be automatically taken and immediately processed:
Contact tech support via the Jira customer portal to enable this feature for face authentication.