Liveness detection and face matching provide a secure biometric verification process to ensure real-time user authenticity. The system involves multiple steps to prevent spoofing and ensure that the user is both physically present and matches the registered identity.
The Process
The complete liveness detection and face matching workflow includes three main steps:
- Start Liveness Session
- Integrate Liveness in Frontend
- Match Liveness Face
These steps work together to authenticate users using live face recognition and verify their identity securely.
1️⃣ Start Liveness Detection Session
- The client sends a POST request to the /start-liveness-session/ endpoint.
- The backend generates a unique sessionId to identify and manage the liveness detection session.
- This sessionId is returned in the response and must be passed to the frontend for further processing.
2️⃣ Frontend Liveness Integration
- The frontend uses the sessionId received from Step 1 to initiate the liveness session on the client side.
- Users interact with the live detection component (camera) to capture a real-time face.
- This component ensures that the user is not using spoofing methods (e.g., photo or video playback).
- For implementation details and how the frontend works, refer to the Frontend Integration Guide click here.
3️⃣ Match Liveness Face
- Once the frontend completes the live capture, it triggers the third step.
- The client sends a POST request to the /match-liveness-face/ endpoint.
- The request must include the sessionId (from Step 1) and the userId of the registered user.
- The backend checks:
- If the user is really present (liveness detection successful).
- If the live face matches the registered user (face match successful).
- If both validations pass, the system confirms the user’s identity.