Using IAD Server¶
Start container¶
To start the IAD Server's container use docker run
command:
docker run --name iad -d -p 8080:8080 idlivedoc-iad-server-prod:2.0.0
It has the following arguments:
--name iad
names the started container asiad
,-d
starts the container in the background,idlivedoc-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 IADServerApplication 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.