For the complete documentation index, see llms.txt. This page is also available as Markdown.

How to Integrate Oz Liveness into Your Web Application

Oz Liveness Web SDK implements the ready-to-use face capture user interface that is essential for seamless customer experience and accurate liveness results. The SDK detects both presentation and injection attacks.

This guide walks you through your first liveness check using Web SDK and Oz API. Here, we cover the SaaS model.

The described flow combines:

  • Capture mode – the Web SDK (or Mobile SDK) captures the Liveness video in the browser/app and the Client backend forwards it to Oz API. Capture results are not sent from the SDK straight to Oz API; the Client backend acts as an intermediary.

  • OzCapsula – a proprietary encrypted binary container. The SDK packages the captured media into it; only Oz API can decrypt and process it. On the device it is an opaque blob – you cannot decode or inspect it, only forward it as-is.

Each step is marked:

  • [Oz SDK] – call our SDK API.

  • [Your code] – call your own backend or your own code.

{{host}} in the examples below is the base URL of your Oz API deployment, provided to you during deployment setup.

Requirements

Component
Minimum version

Oz API

6.6.1

Web SDK

1.9.10

You require a dedicated Web Adapter. Expand the section below if it has not yet been configured for your company.

How to obtain Web Adapter

Tell us domain names of the pages from which you are going to call Web SDK and email for admin access, e.g.:

Domain names from which Web SDK will be called:

  1. www.yourbrand.com

  2. www.yourbrand2.com

Email for admin access:

  • j.doe@yourcompany.com

In response, you’ll get URLs and credentials for further integration and usage. When using SaaS API, you get them from us:

Login: j.doe@yourcompany.com

Password: …

API: https://<link>.ozforensics.com/

Web Console: https://<link>.ozforensics.com

Web Adapter: https://<link>.ozforensics.com/your_company_name/

These parameters are mandatory for OzCapsula to work. Define them in your API configuration file.

Instructions

1

(Oz SDK) Embed the plugin

Oz provides the plugin URL (served by the Oz-hosted adapter). Add it to your page:

2

(your code) Get a session_token from your backend

OzCapsula uses a session token. The token is mandatory for OzCapsula.

Your backend requests a session token from Oz API. Request it before each capture session, as close to the moment the user starts capture as possible.

Endpoint:

Request:

The authorization mechanism for calls to Oz API (access_token) depends on your installation settings: when using Instant API, you can integrate it under your own authorization scheme. If access token is required in your case, please check Authentication. Never expose the access token in the browser. Also, please note that access and session token are different tokens issued for different purposes.

Response:

This token is short-lived (default lifetime: 900 seconds for API Full, 120 seconds for Instant API). Request one per capture session and pass it to the SDK immediately – do not cache or reuse tokens across sessions.

3

(Oz SDK) Launch the plugin with the session_token

4

(Oz SDK) Get the OzCapsula container

When capture completes, the SDK fires the on_capture_complete callback. The container is delivered as the second argument – a Blob with MIME type application/octet-stream.

The container is an opaque encrypted blob. You cannot decode it, inspect it, or extract individual images / frames / metadata from it on the device. It must be forwarded as-is to your backend. If you need access to captured images (e.g., the best shot), retrieve them from the Oz API analysis response on the server side.

Upload it to your backend as application/octet-stream.

5

(your code) Send the container to Oz API

Your backend submits the container in a single synchronous POST request.

Endpoint (Instant API):

Endpoint (Full API):

Headers:

  • Content-Type: application/octet-stream (mandatory).

  • X-Forensic-Access-Token: {{access_token}}. (optional, depends on installation settings).

Request body: the raw container bytes – no JSON envelope, no multipart, no base64 wrapping.

Request (Instant API):

Request (Full API):

On success: HTTP 201 with a JSON folder object describing the result. Check Step 6.

On container-level error: HTTP 400 – see Exceptions.

This guide covers the Liveness analysis. To perform a Face Matching analysis within the OzCapsula flow, see How to Perform a Face Matching Analysis within OzCapsula Flow.

6

(your code) Handle the response

Your backend now has the response – a JSON folder object describing the result.

Make the accept/reject decision using only these two top-level fields:

Interpret system_resolution:

  • SUCCESS – all checks passed; accept the user.

  • DECLINED – one or more checks failed; reject the user.

  • FAILED – a system error prevented at least one analysis from completing; do not treat as accept or reject.

For per-analysis verdicts (for example, to know whether liveness passed but biometry failed), read $.analyses[*].resolution_status with the values described above.

Checklist


With these steps, you are done with basic integration of Web SDK into your web application. You will be able to access recorded media and analysis results in Web Console via browser or programmatically via API (please find the instructions here: retrieving an MP4 video, getting analysis results).

In the Web Plugin Developer Guide, you can find instructions for common next steps:

  • Customizing plugin look-and-feel

  • Adding custom language pack

  • Tuning plugin behavior

  • Plugin parameters and callbacks

  • Security recommendations

Please find a sample for Oz Liveness Web SDK here. To make it work, replace <web-adapter-url> with the Web Adapter URL you've received from us.

For Angular and React, replace https://<link>.ozforensics.com in index.html.

Last updated

Was this helpful?