Skip to main content

iFrame Integration

To use face authentication with an iFrame, insert the verification platform URL directly into your iframe tag:
https://face.authentication.idenfy.com/?token={{token}}
The token query string parameter is obtained after generating a token. After the process is finished, you may close the iframe and display a desired page to your client.
Query String ParameterExample Value
token3FA5TFPA2ZE3LMPGGS1EGOJNJE
Example redirect URL: https://face.authentication.idenfy.com/?token=3FA5TFPA2ZE3LMPGGS1EGOJNJE

Code Example

<!DOCTYPE html>
<html>
  <body>
    <iframe
      id="iframe"
      style="width: 80%; height: 800px"
      src="https://face.authentication.idenfy.com/?token=3FA5TFPA2ZE3LMPGGS1EGOJNJE"
      allow="camera"></iframe>

    

    <script>
      window.addEventListener('message', receiveMessage, false);
      function receiveMessage(event) {
        console.log(event);
        // ...
      }
    </script>
  </body>
</html>

Webhook

You can receive information when face authentication actions are performed by setting up a FACIAL_AUTHENTICATION notification type webhook.

Possible status Values

NameDescription
SUCCESSAuthentication is successful. This message is also sent upon successful enrollment.
FAILEDAuthentication failed due to fraudulent activity or other possible vulnerabilities. This message is also sent upon enrollment failure.
EXPIREDFace authentication token expired before the user started the process.
CANCELEDFace authentication session was canceled by the user.

Possible failReason Values

ValueDescription
FACE_MISMATCHThe face does not match the enrolled reference photo.
FAKE_FACEA spoofing attempt was detected (e.g., printed photo, screen replay).
VIRTUAL_CAMERAA virtual or emulated camera was used instead of a physical device.
FACE_NOT_FOUNDNo face was detected in the captured image.
TOO_MANY_FACESMore than one face was detected in the frame.
FACE_ANGLE_TOO_LARGEThe face was turned too far from a frontal position.
FACE_TOO_SMALLThe face occupies too small a portion of the frame.
FACE_CLOSE_TO_BORDERThe face is too close to the edge of the image.
FACE_TOO_CLOSEThe face is too close to the camera.
FACE_CROPPEDPart of the face is cut off or outside the frame.
FACE_IS_OCCLUDEDThe face is partially covered (e.g., by a mask, hand, or object).
EYES_CLOSEDThe person’s eyes are closed.
FAILED_TO_PREDICT_LANDMARKSFacial landmark detection failed.
PROBABILITY_TOO_SMALLThe face-match confidence score is below the required threshold.
FAKE_CAPTUREThe capture process was tampered with or bypassed.
DUPLICATE_IMAGEThe same image was submitted more than once.

Webhook Response Example (EXPIRED)

{
  "id": "8d471b4c-3822-4547-aec5-a9d0cc0aa105",
  "scanRef": "8df398bb-7340-11ee-9aec-0221b1f59063",
  "clientId": "FD155HLZ5Z",
  "status": "EXPIRED",
  "token": "UbYZnDdrTElsSDBQFeNkd8MxI9CpSEO0qR5jtRcz",
  "type": "AUTHENTICATION",
  "method": "FACE_MATCHING",
  "facePhoto": null,
  "failReason": null,
  "ipAddress": null
}

iFrame Console Status Values

Information about the face authentication statuses is available in the browser console on the data object.
NameDescription
APPROVEDThe user completed face authentication and it was approved.
FAILEDThe user completed face authentication but it failed.
To assess the face authentication session, evaluate the webhooks sent from the back-office. The statuses in the iFrame console are complementary.