Liveness Check on Web Service
The Liveness module helps determine whether the person in front of the camera is physically present and live.
The feature requires either a Mobile client or a Web Component for operation and session data collection. You also need a storage solution for session data. For details, see the Storage page.
Active and Passive Modes
Liveness detection can be performed in three modes: active, passive, and passive with blink.
The active mode requires users to turn their head during the session. This guarantees highly accurate liveness detection.
Passive Liveness requires only a selfie. This approach can provide an improved user experience, but Active Liveness can provide higher accuracy.
Passive liveness can also be complemented with a blink check. In this case, after the selfie step, the user is prompted to blink. Once the blink is detected, the passive liveness check is completed.
The livenessType parameter determines the liveness check mode, see LivenessType Enumeration for details.
The liveness check status is indicated by the status field, where 0 signifies confirmed liveness and 1 indicates that liveness is not confirmed.
Web API
To get results through the API, see Face SDK OpenAPI.
Use Liveness Selfie for Face Comparison
After a Liveness check is completed, you can use the selfie captured during the session as one of the input images for Face Comparison.
There are two ways to get the liveness selfie and pass it to the Match request.
Option 1: Use selfie returned in response
- Complete the liveness check.
- Get the liveness result that contains the selfie.
- Encode the selfie in Base64.
- Pass the encoded image to the Match request.
For information about how to run Face Comparison, see Face Comparison.
Option 2: Get selfie from storage
- Complete the liveness check.
- Get the liveness transaction ID.
- Use the transaction ID to request the liveness result through the API.
- In the response, find the link to the selfie stored in the configured storage.
- Download the selfie from storage.
- Encode the selfie in Base64.
- Pass the encoded image to the Match request.
The selfie is not returned directly by this API response by design. The Face SDK Web Service does not authenticate API consumers, so it cannot verify that the caller is authorized to receive the captured selfie. Instead, the response provides a link to the file in storage. Access to the file must be controlled on the storage side.
For information on where liveness session files are stored, see Result Directory. For storage configuration details, see the Storage page.
Result Directory
The liveness check results, a person's selfie, and video of the liveness detection session are stored on the backend at:
faceapi-session/year={year}/month={month}/day={day}/hour={hour}/minute={minute}/{tag}/transactionId