Skip to main content

Operation result

Every enrolment, verification and identification is an operation on your MobbID server, identified by an operationId. The outcome received by the app is suitable for updating the user interface, but the access decision must always be taken in your backend: a mobile app can be tampered with, your server cannot.

PurposeWhereHow
Update the user interface after the captureAppThe listener passed to faceSDK.start
Grant access, authorise a payment, sign a transactionBackendGet an operation

1. Send the operation identifier to your backend​

Since version 7.1, the result data of every operation includes its identifier. It can also be retrieved from the SDK at any time:

val operationId: String? = MIDBiometricManager.getCurrentOperationId()

Send it to your backend, associated with the user's session.

2. Read the operation in your backend​

Use a token obtained with the API role key:

Backend
curl 'https://{SERVER-URL}/api/v7/application/YOUR_APPLICATION_ID/operation/OPERATION_ID' \
--header 'Authorization: Bearer YOUR_AUTH_TOKEN'
Response (excerpt)
{
"id": "3f2b9c1e-7a4d-4e8b-9c21-5d6e7f8a9b0c",
"biometricMethod": "FACE",
"type": "VERIFICATION",
"status": "SUCCESS",
"data": {
"result": true,
"userId": "user-0001",
"liveness": "FACE_PASSIVE_IMAGE",
"livenessThreshold": 0.5,
"matchingThreshold": 0.63
}
}

3. Take the decision​

Grant access only when all these conditions are met:

  • status is SUCCESS.
  • type is the operation you expected, for example VERIFICATION.
  • data.userId is the user of the current session.
  • data.result is true.

In identifications, data.ranking lists the candidates with their scores. The operation also includes the scores, the thresholds applied, the quality controls and the selfie used as evidence. See The operation object.