Verification (1:1)
Verification answers the question "Is this person who they claim to be?". The SDK captures the face with passive liveness and MobbID compares it with the template of a single user (1:1). It is the operation behind biometric login, payment authorisation and transaction signing.
Before you begin
- The face engine is built, with liveness enabled.
- The user is enrolled.
Start the verification
faceSDK.start(
recognitionMode = MIDRecognitionMode.VERIFICATION,
parameters = MIDVerificationParameters("user-0001"),
operationListener = object : MIDVerificationListener {
override fun onVerificationFinished(
result: MIDVerificationListener.Result,
data: MIDVerificationData?,
errorOccurred: MIDError?,
) {
if (errorOccurred != null) {
// The verification could not be completed: offer the user a retry
return
}
// Show the outcome and send the operation ID to your backend
}
},
)
| Parameter | Description |
|---|---|
MIDRecognitionMode.VERIFICATION | Runs a 1:1 verification. |
MIDVerificationParameters(userId) | Identity claimed by the user: the identifier of the enrolled user. |
MIDVerificationListener | Receives the outcome, the verification data and, if the operation fails, the error. |
Handle the result
- Verified: the face matches the user's enrolment and the liveness check has been passed. Confirm the result in your backend before granting access.
- Not verified: the face does not match, or liveness has not been passed. Let the user try again and, after a limited number of attempts, offer an alternative authentication method.
- Error:
errorOccurreddescribes the cause, such as a network failure or an expired token.
Recommendations
- Take the decision in your backend. The outcome received by the app drives the user interface only. See Operation result.
- Limit the number of attempts per session to discourage brute-force attempts.
- Request the token right before the verification, so that it is valid for the whole operation.
Next step
Validate the outcome on your server with Operation result.