Authenteq API Documentation
  • Introduction
  • Create an Account
  • Documentation
    • Change Log
      • Mobile SDK
      • Web and API
    • Migration Guides
      • Mobile SDK 1.63 & WebIDV
      • Multi-Document Flow
    • Version Support
  • Mobile SDK
    • iOS
      • iOS Requirements
      • Installation
      • Identification
        • Identification Result
        • Document Identification Result
      • Face Authentication
      • Errors
      • Customization
    • Android
      • Android Requirements
      • Installation
      • Identification
        • Identification Result
        • Document Identification Result
      • Face Authentication
      • Customization
    • React Native
      • iOS
      • Android
    • Flutter
      • iOS
      • Android
    • Authentication Token
    • UI Customization
    • Examples
  • Web
    • Web Overview
    • Getting Started
    • How to Integrate Web?
    • Examples
    • API Reference
  • Export
    • Export Overview
    • API Reference
  • Webhook
    • Webhook Overview
  • AML
    • AML Overview
    • API Reference
  • Verification Links
    • Verification Links Overview
  • Recognition
    • Recognition Overview
    • API Reference
Powered by GitBook
On this page
  • Implementation
  • Example to Start a Face Authentication
  • Get Face Authentication Result
  • Obtain the result of a face authentication

Was this helpful?

  1. Mobile SDK
  2. Android

Face Authentication

Explains how to integrate a face authentication

PreviousDocument Identification ResultNextCustomization

Last updated 2 years ago

Was this helpful?

To perform a face authentication it is required to have already an "Identification" and its verification ID. The process consist in a liveness check of the user and a final check to verify the match with the identification.

Implementation

  • Create a FaceAuthenticationParams object with authentication information and the verification id you want to verify

  • Start the verification with FaceAuthenticationActivity.startForResult

  • Handle result in onActivityResult method

Example to Start a Face Authentication

Please update the below code with your Client ID and Client Secret from your .

We suggest to use the token authentication in production environment.

void faceAuthentication(String verificationId) {
    FaceAuthenticationParams faceAuthenticationParams = new FaceAuthenticationParamsWithClientSecret(
        "< client id >",
        "< client secret >",
        verificationId
        R.style.AuthenteqThemeBase // optional
    );
    FaceAuthenticationActivity.startForResult(
        activity, 
        MY_REQUEST_FACEAUTH_CODE,
        faceAuthenticationParams
    );
}

@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
    if (requestCode == MY_REQUEST_FACEAUTH_CODE) {
        if (resultCode == RESULT_OK) {
            String code = FaceAuthenticationActivity.getResult(data);
            // Check face authentication result with the CODE provided
        } else {
            Throwable throwable = FaceAuthenticationActivity.getError(data);
            // Handle error
        } else {
            super.onActivityResult(requestCode, resultCode, data);
        }
    }
}
fun faceAuthentication(verificationId: String) {
        val faceAuthenticationParams = FaceAuthenticationParamsWithClientSecret(
                "< client id >",
                "< client secret >",
                verificationId
        )
        FaceAuthenticationActivity.startForResult(
                this,
                MY_REQUEST_FACEAUTH_CODE,
                faceAuthenticationParams
        )
}

override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
        if (requestCode == MY_REQUEST_FACEAUTH_CODE) {
            if (resultCode == Activity.RESULT_OK) {
                FaceAuthenticationActivity.getResult(data)?.let { code ->
                    // Check face authentication result with the CODE provided
                }
            } else {
                FaceAuthenticationActivity.getError(data)?.let { error ->
                    // Handle error
                }
            }
        } else {
            super.onActivityResult(requestCode, resultCode, data)
        }
}
void faceAuthentication(String verificationId) {
    FaceAuthenticationParams faceAuthenticationParams = new FaceAuthenticationParamsWithToken(
        "< client id >",
        "< token >",
        verificationId
        R.style.AuthenteqThemeBase // optional
    );
    FaceAuthenticationActivity.startForResult(
        activity, 
        MY_REQUEST_FACEAUTH_CODE,
        faceAuthenticationParams
    );
}
fun faceAuthentication(verificationId: String) {
        val faceAuthenticationParams = FaceAuthenticationParamsWithToken(
                "< client id >",
                "< token >",
                verificationId
        )
        FaceAuthenticationActivity.startForResult(
                this,
                MY_REQUEST_FACEAUTH_CODE,
                faceAuthenticationParams
        )
}

Authentication token can only be used for a single operation. Always generate a new token before start a new face authentication.

Get Face Authentication Result

With the code obtained from FaceAuthenticationActivity.getResult it is possible to get the face authentication result using the following API:

Obtain the result of a face authentication

GET https://api.app.authenteq.com/mobile-sdk/face-authentication-result

This endpoint is authorized with Basic Authorization. You should use your Client ID and Client Secret from the Customer Dashboard as the credentials.

Query Parameters

Name
Type
Description

code*

string

The code provided at the conclusion of SDK face authentication

Headers

Name
Type
Description

Authorization*

string

Your client credentials combined with a colon separator, base64-encoded and prefixed with "Basic ".

{
  "accessToken": "81e4cbce-cdad-11eb-8fc3-784f4385af2b"
}
{
  "errorCode": "API_KEYS_MISSING",
  "errorMessage": "No API Keys in the Authorization header"
{
  "errorCode": "ACCOUNT_DEACTIVATED",
  "errorMessage": "Account deactivated. Please contact your Authenteq Sales Representative in order to keep using this service"
}huiHjio

When successful the response will contain a single boolean property named success:

{
    "success": true
}

Authentication Token can be obtained with face authentication and then specified with the FaceAuthenticationParams as the following code:

Customer Dashboard
API