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.localneeds the login-capable SDK variant.faceAuthModeFallback: bool. Fall back toserverwhenlocalhas no stored face template. Used only withcustomerUUIDandlocal. 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.trueif the faces matched,falseotherwise.isBlocklisted: bool.trueif the user is blocklisted.allAttemptsExhausted: bool.trueif the user used up all login attempts.spoofAttempt: bool ornull.trueindicates the user tried to spoof the system (using a photo, screen, or other method).hasFaceMask: bool ornull.trueif the user was wearing a face mask.hasLenses: bool ornull.trueif the user was wearing lenses. Alwaysnullon Android.customerUUID: string ornull. Unique user identifier if authentication succeeded.interviewId: string ornull. Session ID in which the user was approved.interviewToken: string ornull. Session token in which the user was approved.token: string ornull. Token that can be used for further API calls.transactionId: string ornull. Unique identifier of the Face Login attempt.selfieBase64: string ornull. Selfie captured during login.selfieEncryptedBase64: string ornull. 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.