SDK reference, Cordova SDK

Face Login

Face Login authenticates a user by performing a face match between a captured selfie and a previously enrolled face. Call startFaceLogin() to authenticate an enrolled user. The only argument is an optional face login config object.

Prerequisites

  • The SDK is initialized. See Installation.
  • The user has an approved account with an enrolled face.

Enrollment happens as a byproduct of a standard onboarding flow that includes the addFaceMatch module. Alternatively, an admin can enroll a user by clicking Add face to Database in Dashboard.

Start Face Login

cordova.exec(
  function (result) { console.log(JSON.stringify(result)); },
  function (error) { console.log(error.code, error.message); },
  "Cplugin",
  "startFaceLogin",
  [{ showTutorials: true }]  // or [] for native defaults
);

Every key of the face login config is optional. An omitted key keeps the native SDK default.

  • showTutorials: bool. Show the tutorial before capture. Native default.
  • waitForTutorials: bool. The user must wait for the tutorial to finish before continuing. Native default. Applies to this call only.
  • customerUUID: string. When present, performs a 1:1 login for that customer. When absent, performs a 1:N login.
  • faceAuthMode: string. "server" or "local". Native default. local needs the login-capable SDK variant.
  • faceAuthModeFallback: bool. Fall back to server when local has no stored face template. Used only with customerUUID and local. Native default.
  • lensesCheck: bool. Enable the lenses check. Native default.
  • faceMaskCheck: bool. Enable the face mask check. Native default.
  • logAuthenticationEnabled: bool. Send liveness stats after the attempt. Native default.
  • recognitionThreshold: number. SDK-wide; it stays in effect for later SDK calls.
  • spoofThreshold: number. SDK-wide; it stays in effect for later SDK calls.
  • e2eEncryptionEnabled: bool. Android only. Native default. See End-to-End Encryption (E2EE).

FaceLoginResult

The success callback receives the same object on both platforms. Every key is always present, and is null when the SDK has no value.

  • faceMatched: bool. true if the faces matched, false otherwise.
  • isBlocklisted: bool. true if the user is blocklisted.
  • allAttemptsExhausted: bool. true if the user used up all login attempts.
  • spoofAttempt: bool or null. true indicates the user tried to spoof the system (using a photo, screen, or other method).
  • hasFaceMask: bool or null. true if the user was wearing a face mask.
  • hasLenses: bool or null. true if the user was wearing lenses. Always null on Android.
  • customerUUID: string or null. Unique user identifier if authentication succeeded.
  • interviewId: string or null. Session ID in which the user was approved.
  • interviewToken: string or null. Session token in which the user was approved.
  • token: string or null. Token that can be used for further API calls.
  • transactionId: string or null. Unique identifier of the Face Login attempt.
  • selfieBase64: string or null. Selfie captured during login.
  • selfieEncryptedBase64: string or null. Encrypted selfie.

A completed login that did not match (not recognized, spoof, or blocklisted) is a success with faceMatched: false, not an error.

The error callback receives { code, message, cause }, where code is userCancelled, permissionsDenied, faceLoginError, faceLoginInProgress, or activityNotPresent, plus bridgeFailure on Android when the plugin can't convert the native result. See Results — startFaceLogin().

End-to-End Encryption (E2EE)

Info

End-to-End Encryption (E2EE) for Face Login is supported on Android only.

By default, Face Login does not use E2EE. To enable it, set e2eEncryptionEnabled to true.

// Android only; requires e2eeUrl in initializeSDK
cordova.exec(success, error, "Cplugin", "startFaceLogin", [
  { e2eEncryptionEnabled: true }
]);

See End-to-End Encryption (E2EE) for full E2EE setup.

Was this page helpful?