> ## Documentation Index
> Fetch the complete documentation index at: https://documentation.idenfy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Face Auth iFrame

> Embed iDenfy face authentication in your web page using an iFrame for seamless returning-user biometric re-verification without redirects.

## 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](/face-authentication/token-generation).

After the process is finished, you may close the iFrame and display a desired page to your client.

| Query String Parameter | Example Value                |
| ---------------------- | ---------------------------- |
| `token`                | `3FA5TFPA2ZE3LMPGGS1EGOJNJE` |

Example redirect URL: `https://face.authentication.idenfy.com/?token=3FA5TFPA2ZE3LMPGGS1EGOJNJE`

### Code Example

```html theme={"system"}
<!DOCTYPE html>
<html>
  <body>
    <iframe
      id="iframe"
      style="width: 80%; height: 800px"
      src="https://face.authentication.idenfy.com/?token=3FA5TFPA2ZE3LMPGGS1EGOJNJE"
      allow="camera; fullscreen"
      allowFullScreen></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](/guides/dashboard/settings/system-notifications-webhooks-emails) a `FACIAL_AUTHENTICATION` notification type webhook.

### Possible `status` Values

| Name       | Description                                                                                                                            |
| ---------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| `SUCCESS`  | Authentication is successful. This message is also sent upon successful enrollment.                                                    |
| `FAILED`   | Authentication failed due to fraudulent activity or other possible vulnerabilities. This message is also sent upon enrollment failure. |
| `EXPIRED`  | Face authentication token expired before the user started the process.                                                                 |
| `CANCELED` | Face authentication session was canceled by the user.                                                                                  |

### Possible `failReason` Values

| Value                         | Description                                                           |
| ----------------------------- | --------------------------------------------------------------------- |
| `FACE_MISMATCH`               | The face does not match the enrolled reference photo.                 |
| `FAKE_FACE`                   | A spoofing attempt was detected (e.g., printed photo, screen replay). |
| `VIRTUAL_CAMERA`              | A virtual or emulated camera was used instead of a physical device.   |
| `FACE_NOT_FOUND`              | No face was detected in the captured image.                           |
| `TOO_MANY_FACES`              | More than one face was detected in the frame.                         |
| `FACE_ANGLE_TOO_LARGE`        | The face was turned too far from a frontal position.                  |
| `FACE_TOO_SMALL`              | The face occupies too small a portion of the frame.                   |
| `FACE_CLOSE_TO_BORDER`        | The face is too close to the edge of the image.                       |
| `FACE_TOO_CLOSE`              | The face is too close to the camera.                                  |
| `FACE_CROPPED`                | Part of the face is cut off or outside the frame.                     |
| `FACE_IS_OCCLUDED`            | The face is partially covered (e.g., by a mask, hand, or object).     |
| `EYES_CLOSED`                 | The person's eyes are closed.                                         |
| `FAILED_TO_PREDICT_LANDMARKS` | Facial landmark detection failed.                                     |
| `PROBABILITY_TOO_SMALL`       | The face-match confidence score is below the required threshold.      |
| `FAKE_CAPTURE`                | The capture process was tampered with or bypassed.                    |
| `DUPLICATE_IMAGE`             | The same image was submitted more than once.                          |

### Webhook Response Example (EXPIRED)

```json theme={"system"}
{
  "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.

| Name       | Description                                                 |
| ---------- | ----------------------------------------------------------- |
| `APPROVED` | The user completed face authentication and it was approved. |
| `FAILED`   | The user completed face authentication but it failed.       |

<Info>
  To assess the face authentication session, evaluate the [webhooks](#webhook) sent from the back-office. The statuses in the iFrame console are complementary.
</Info>
