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
- Swift
- Objective-C
faceSDK.start(recognitionMode: .verification,
parameters: MIDVerificationParameters(userId: "user-0001"),
operationListener: self)
extension ViewController: MIDVerificationListener {
func onVerificationFinished(result: MIDVerificationListenerResult, data: MIDVerificationData?, errorOccurred: MIDError?) {
guard result != .error else {
// The verification could not be completed: offer the user a retry
return
}
// Show the outcome and send the operation ID to your backend
}
}
[faceSDK startRecognitionMode:CMIDRecognitionMode.verification
parameters:[[CMIDVerificationParameters alloc] initWithUserId:@"user-0001"]
operationListener:self];
// CMIDVerificationListener
- (void)onVerificationFinishedResult:(CMIDVerificationListenerResult *)result
data:(CMIDVerificationData * _Nullable)data
errorOccurred:(CMIDError * _Nullable)errorOccurred {
if (result == CMIDVerificationListenerResult.error) {
// 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 |
|---|---|
.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.