Injection Attack Detection (IAD)
This API, in the context of facial capture and evaluation, allows detection of:
Attack vectors: virtual cameras, external devices, browser attacks, network attacks.
Attack content: 3D rendering, facial morphing, face swap, cheap fake, deep fake.
This API requires client-side integration of the IAD capture libraries. The IAD capture library (included in Selphi) controls the capture process on the client and generates the IAD bundle (encrypted package of metadata and images).
The API knows how to unpack the client's IAD bundle to perform both injection attack detection and presentation attack detection.
Endpoint
POST /iadHeaders
x-api-key
string
Yes
Access authorization API Key.
OperationId
string
No
Operation identifier in Platform V2. If sent together with SessionId, a tracking event is emitted in the Security tab of the operation detail.
SessionId
string
No
Session identifier associated with the operation. Required to enable tracking, unless ExtraData.
ExtraData
string
No
Encrypted Token that packages operationId and sessionId. Alternative to sending them separately.
Family
string
No
Tracking event family. Default ONBOARDING.
Request body
Content-Type: application/octet-stream
Parameters
IAD_BUNDLE
binary
Yes
Encrypted package of metadata and images. The bundle must be sent as a application/octet-stream in the body.
Request example
Responses
200 Success
Response parameters
attack
boolean
Boolean value indicating whether an attack was detected. true: an attack was detected, false: no attack was detected.
Response example
400 Bad Request
When the request is invalid, the response includes a specific error code in the errors field that describes the detected issue. See IAD error codes.
IAD error codes
400
Face not found
FACE_NOT_FOUND
No faces were detected in the image.
400
Face is cropped
FACE_CROPPED
The face is only partially within the image.
400
Face is occluded
FACE_IS_OCCLUDED
The face is being partially obscured behind an object.
400
Too many faces detected
TOO_MANY_FACES
More than one face is visible in the image.
400
Facial out-of-plane rotation angle is extremely large
FACE_ANGLE_TOO_LARGE
The face angle relative to the camera viewpoint is too large.
400
Absolute face size is too small
FACE_TOO_SMALL
The face pixel density is very low; it should be closer to the camera or the image should have a higher resolution.
400
Relative face size is too small
FACE_TOO_SMALL
The face is too small; it should be closer to the camera so it occupies a larger portion of the image.
400
Face is too close to one or more borders
FACE_CLOSE_TO_BORDER
The face is too close to the camera viewpoint boundary; it should be centered in the camera view.
400
Failed to parse file
UNKNOWN
The file is not a valid encrypted blob payload or is corrupted.
400
Failed to read metadata
UNKNOWN
The encrypted blob data was not generated with the correct format.
400
Failed to decrypt message
UNKNOWN
The public-private key pair configured on the server and the capture library do not match.
401 Unauthorized
403 Forbidden
502 Bad Gateway
504 Gateway Timeout
Integration with Platform V2 (optional)
If the operation is being tracked in Platform V2 / IDV Suite, the endpoint can emit a tracking event for each call to IAD. This integration is optional and additive: not sending the tracking headers leaves the endpoint behavior identical to that of previous versions.
Activation
To enable tracking in a specific call, simply include the headers OperationId and SessionId (or, alternatively, a ExtraData Tokenized one containing them). In addition, the tenant must have tracking enabled in its internal configuration; otherwise, the headers are ignored.
Published information
When the event is emitted, it appears in the Security tab of the operation detail with the following fields:
IAD Diagnostic
High-level result: Attack Not Detected, Attack Detected, or Error: <details> if detection did not complete.
Request ID
Unique request identifier, useful for correlating with logs.
Version
Version of the IAD engine used. It only appears if the tenant has it configured.
The event is emitted both on successes (Attack Detected / Attack Not Detected) and on errors (engine failure, timeout, invalid bundle), so that any invocation of IAD is recorded with its high-level result. Internal details of the engine or the bundle are not exposed: the event contains only the high-level result and the identifiers needed for audit.
Client-side integration
To generate the encrypted blob payload, it is necessary to use the version of the Selphi Antispoof Widget and capture the onExtractionFinished. The event will return an object with the results of the facial extraction process. One of the properties of this object is encryptedLivenessRaw, which contains the encrypted blob payload.
Once the payload is obtained, it should be sent to the client's server via a POST request. Any HTTP client library can be used, such as Axios or Fetch.
The client's server must receive this payload and send it to the Identity API IAD endpoint. The API will return the results in a JSON object indicating whether it passes the validations.
Integration example
Last updated