Skip to content

Using IAD Server

Start container

To start the IAD Server's container use docker run command:

docker run --name iad -d -p 8080:8080 iad-server-prod:2.0.0

It has the following arguments:

  • --name iad names the started container as iad,
  • -d starts the container in the background,
  • -p 8080:8080 exposes the port 8080,
  • iad-server-prod:x.y is the name of the image.

Note that the name of the image should always be the last argument.

After running the container you will have to wait a little for the server to be ready. To check if it is ready, execute the following command to see the logs of the container:

docker logs iad

If you see the message Started IDLiveFaceServerApplication in xx.xxx seconds the server is ready to use.

Once the server is ready to use, you can also check that it is working by inserting (server ip):8080/api_version into your browser, you should see something similar to the following response {"product":"IADServer","version":"x.x.0","expiration_date":"20xx-xx-xxTxx:xx:xxZ"}.

Whenever you wish to stop and delete the container you can use the following commands:

docker stop iad
docker rm iad

Perform capture liveness check

The server exposes an endpoint for processing requests from IAD clients.

To make the capture check you need to upload a bundle generated by IAD client as a application/octet-stream HTTP request to the /check_capture_liveness endpoint.

Idealy you would generate this bundle by running our libraries, but if you just want to try it out you can use this encrypted data file that we prepared for you. Using this file you should be able to run the following requests to check capture liveness:

curl  -X POST                                      \
    -H "Content-type: application/octet-stream"    \
    --data-binary @./encrypted-data                \
    "(server ip):8080/check_capture_liveness"      ;
const fs = require('fs');

var file = fs.readFileSync("./encrypted-data")

fetch(`http://(server ip):8080/check_capture_liveness`, {
    method: "post",
    headers: { 'Content-Type': 'application/octet-stream' },
    body: file
}).then(response => response.json())
  .then(data => console.log(data));
import requests

file = open("./encrypted-data" , "rb")

response = requests.post( "http://(server ip):8080/check_capture_liveness",
                    headers = { 'Content-Type': 'application/octet-stream' },
                    data = file.read())

print(response.text)

The IAD Server will return a JSON response like the one below:

{
  "capture_liveness": {
    "probability": 1,
    "score": 0.30822694
  }
}

It contains the following values:

  • capture_liveness.probability - capture liveness probability from 0 (attack) to 1 (live).
  • capture_liveness.score - capture liveness score.

Add face liveness check

The server response can be supplemented with our face liveness check. To do this, our other product, IDLive Face Server must be additionally installed and run.

To run this container together with IDLive Face please add the following environment variables to the server run command:

  • IAD_SERVER_FACE_LIVENESS_ENABLE=true enables face liveness check mode,
  • IAD_SERVER_FACE_LIVENESS_URL=/full/path/to/liveness/check/endpoint specifies the full path to the face liveness check method, for example http://idlive-face-server/check_liveness.
docker run -d -p 8080:8080 --name iad --env IAD_SERVER_FACE_LIVENESS_ENABLE=true --env IAD_SERVER_FACE_LIVENESS_URL=http://idlive-face-server/check_liveness iad-server-prod:2.0.0

If you wish to set the pipeline to be used on the IDLiveFace liveness check, add the IAD_SERVER_FACE_LIVENESS_PIPELINE environment variable with the pipeline's name as value:

docker run --name iad -d -p 8080:8080 --env IAD_SERVER_FACE_LIVENESS_ENABLE=true --env IAD_SERVER_FACE_LIVENESS_URL=http://idlive-face-server/check_liveness --env IAD_SERVER_FACE_LIVENESS_PIPELINE=astraea  iad-server-prod:2.0.0

In this case the IAD Server will return a JSON response like this one:

{
  "face_liveness": {
    "probability": 0.9885953
  },
  "capture_liveness": {
    "probability": 1.0
  }
}

Note

Remember that face liveness and capture liveness containers must run on the same network. You can set both to be on the same network with the --network=NETWORK_NAME parameter.