Face verification (1:1)
Face verification compares the face of the person using the app with the face enrolled for a user (1:1). The plugin opens the capture screen, applies liveness and runs the comparison on your MobbID server.
MobbIdApi.faceVerification(onSuccess, onError, userId, livenessMethod);
Parameters
| Parameter | Type | Description |
|---|---|---|
onSuccess | (result) => void | Called when the verification is completed. See Result. |
onError | (error) => void | Called when the verification cannot be completed. See Error handling. |
userId | string | Identifier of the enrolled user. |
livenessMethod | string | Liveness method. See Liveness methods. |
Liveness methods
| Value | Capture | Description |
|---|---|---|
HEAD_PASSIVE_IMAGE | Image | Passive liveness on a single image. The user only looks at the camera. Recommended. |
HEAD_PASSIVE | Video | Passive liveness on a short video. |
Both methods are passive: the user does not have to move or follow instructions.
Result
{
"result": "USER_VERIFIED",
"data": {
"operationId": "2f4c1c4e-6b39-4c8b-9a51-1a0f8a3c7d20"
}
}
| Property | Type | Description |
|---|---|---|
result | string | USER_VERIFIED when the face matches the enrolled user, USER_NOT_VERIFIED otherwise. |
data.operationId | string | Identifier of the verification operation on your MobbID server. |
Take the decision in your backend
The result received by the app drives the user interface only. Send operationId to your backend and read the operation with Get an operation before granting access.
Recommendations
- Limit the number of attempts per session and, after repeated failures, offer an alternative authentication method.
- Request the token right before the verification, so that it remains valid during the whole operation.