Installation and deployment of the service
Prerequisites
Before installing IAD Service, make sure you have:
Docker installed and running
A valid Facephi license file
Access to the Facephi Docker registry
Access to the Docker registry
Log in to the Facephi Docker registry:
docker login facephicorp.jfrog.ioYou will need the credentials provided by Facephi.
Installation
Breaking change notice (2.0.0) Version 2.0.0 is not backward compatible with 1.x.x integrations. Before upgrading a deployed client, review and update:
the paths of the public endpoints
the multipart request field names (
file-> requiredcapture; requests that only includefile(are rejected)the parsing of the correct responses (the fields
capture_livenessand related fields are no longer returned)
Download the Docker image
Replace 2.0.0 with the desired version.
Prepare the directories
Create the directories for the license, configuration, and logs:
Place the license file
Copy your license file to the license directory:
Deployment with Docker Compose
Create docker-compose.yml:
Start the service
Verify the deployment
Experimental replay attack mitigation
The service can apply a freshness window to incoming capture payloads. This experimental protection is disabled by default.
Enable it with
FACEPHI_IAD_REPLAY_ATTACK_CHECKER_ENABLED=trueAdjust the freshness window with
FACEPHI_IAD_REPLAY_ATTACK_TOLERANCE_TIME=<seconds>Default freshness window:
300secondsWhen the freshness window is exceeded, the public API returns HTTP
400withmessageequal toReplay attack detected
This feature is configured at startup through environment variables. It is not part of config.json nor is it exposed through GET|POST /api/v1/iad/config.
Example with docker run:
Example with Docker Compose:
License configuration
The license file must be located at /app/license/license.lic inside the container.
License file format
Optional fields:
LICENSE_URLS=— comma-separated license server URLs (required for LOCAL type)LICENSE_PATH_OFFLINE=— path to the offline activation file (required for MACHINE + OFFLINE)
LICENSE_ID and LICENSE_DATA, if present, are ignored by the service as of version 2.0.0. IAD product credentials are embedded at build time, so these fields must be omitted in deployment templates.
Public API summary
Compatibility note The following paths correspond to the 2.0.0 version contract. Clients built for 1.x.x must be migrated before they can call this version correctly.
Operational endpoints exposed by the service:
POST /api/v1/iad/liveness/evaluatePOST /api/v1/iad/extractGET /api/v1/iad/versionGET /api/v1/iad/healthGET|POST /api/v1/iad/config
JWT authentication
JWT authentication is optional and disabled by default.
Configure it at startup in
/app/config/config.jsonwithauth_enabled,auth_jwt_secret,auth_accept_authorization_header,auth_accept_api_key_headerandauth_api_key_header_nameOverride those values with environment variables
FACEPHI_IAD_REST_AUTH_*GET /api/v1/iad/confignever returns JWT authentication keysPOST /api/v1/iad/configrejects JWT authentication keys; manage them only at startup
Example startup configuration:
Example environment variables:
Detailed capture information (longDetails)
POST /api/v1/iad/liveness/evaluate accepts an optional multipart text field longDetails in the same body multipart/form-data than the mandatory part capture.
Accepted values are
trueandfalse(case-insensitive, no spaces).When the field is missing, empty, or
false, the endpoint returns the standard public liveness payload.Any other value is rejected with HTTP
400.
For longDetails=true to return additionalInfo at the top level, all of the following conditions must be met:
engine_bi_records_enabledresolves astrue.engine_urlpoints to an IAD Server that exposes both/check_capture_livenessand/bi_records.The BI record is available before it expires
engine_bi_records_timeout_ms.
Operational notes:
The service automatically generates the header
correlation-id; clients do not send it.The BI lookup uses the current UTC date window when querying
/bi_records; keep the clocks of the service host and the IAD Server synchronized.
Activation paths for the Docker flow with embedded engine:
Set
logger_long_detail=trueen/app/config/config.json.Set
FACEPHI_IAD_LOGGER_LONG_DETAIL=truein the service container environment.Set
IAD_SERVER_BI_LOGS_ENABLED=truein the service container environment. Optionally, setIAD_SERVER_BI_LOGS_PATHto customize the BI logs directory.
Why these options work:
When the service launches the embedded engine,
src/App.cppinjectsIAD_SERVER_BI_LOGS_ENABLED=trueandIAD_SERVER_BI_LOGS_PATH=/app/logsby default in the engine child process as long aslogger_long_detailresolves astrueand those internal variables are absent.Direct exports
IAD_SERVER_BI_LOGS_*also work because the child engine inherits the parent process environment.If the service is configured to call an external engine instead of launching the embedded one, configure the equivalent BI logging capability in that engine deployment.
These keys can be set in /app/config/config.json, later updated via POST /api/v1/iad/config, or overridden with the environment variables FACEPHI_IAD_ENGINE_BI_RECORDS_*.
Example configuration snippet:
Example of runtime configuration update:
Example container environment using the service-level flag:
Container environment alternative using the engine's inherited internal variables directly:
Example liveness request:
Firewall configuration for license validation
Add firewall rules to allow outgoing HTTPS traffic to Facephi license servers:
52.223.22.71
443
TCP/IP
35.71.188.31
443
TCP/IP
75.2.113.112
443
TCP/IP
99.83.149.57
443
TCP/IP
Allow HTTPS traffic to:
https://api.cryptlex.com:443https://api.eu.cryptlex.com:443
Service configuration
Create /app/config/config.json to customize the behavior of the service.
Configuration file location
Default location:
/app/config/config.json(inside the container)Mount an external file: Use volume mapping in docker-compose
Example full configuration (current default values)
Service parameters
port
integer
6982
Service listening port
number_of_threads
integer
1
Worker threads for request processing
connection_timeout
integer
60
Connection Timeout in seconds (0 = no Timeout)
keep_alive_request_number
integer
0
Keep-alive requests (0 = disabled)
client_max_body_size
integer
100
Maximum request body size in MB
logger_path
string
""
Log file path (empty = stdout)
logger_level
string
"info"
Log level: trace, debug, info, warn, error
logger_rotation
string
"daily"
Log rotation: daily, hourly, size
logger_max_files
integer
7
Maximum number of log files to keep
auth_enabled
boolean
false
Requires JWT authentication for protected endpoints
auth_jwt_secret
string
""
HS256 shared secret used to validate JWTs
auth_accept_authorization_header
boolean
true
Accepts Authorization: Bearer <jwt>
auth_accept_api_key_header
boolean
true
Accepts JWT in the configured API Key header
auth_api_key_header_name
string
"x-api-key"
Header name used when token extraction by API Key is enabled
Engine parameters
engine_connection_timeout
integer
10000
Connection Timeout (ms)
engine_request_timeout
integer
60000
Request Timeout (ms)
engine_max_retries
integer
3
Maximum number of retries
engine_retry_delay
integer
1000
Delay between retries (ms)
engine_verify_ssl
boolean
false
Verifies the SSL certificates of capture analysis
engine_verbose
boolean
false
Enables detailed HTTP logging for capture analysis
engine_pool_size
integer
4
Connection pool size
engine_url
string
"http://localhost:8080"
Base URL of the capture analysis runtime
engine_bi_records_enabled
boolean
true
Enables obtaining additionalInfo for longDetails=true
engine_bi_records_max_retries
integer
3
Retries while waiting for the BI record
engine_bi_records_retry_delay_ms
integer
50
Delay between BI record retries (ms)
engine_bi_records_timeout_ms
integer
300
Total latency budget for BI retrieval (ms)
engine_bi_records_redact_request_data
boolean
false
Removes output.request_data of additionalInfo
Production configuration
For production deployments:
Development configuration
For local development:
Dynamic configuration updates
Update the configuration without restarting:
POST /api/v1/iad/config expects a JSON object with the field config_json_string, which contains the complete configuration serialized as a JSON string. JWT authentication keys are rejected by this endpoint and must be configured only at startup.
Note: Runtime updates are not persisted automatically. To make permanent changes, update the configuration file on disk and restart the service if necessary.
Troubleshooting
The service does not start
Check the license file:
Check the logs:
License validation fails
Verify the license file permissions:
chmod 644 license.licMake sure the firewall allows outgoing HTTPS traffic to the license servers
Check the license expiration date
Confirm that the license corresponds to the IAD Service product
Performance issues
Increase
engine_pool_sizeto handle more concurrent requestsAdjust
number_of_threadsaccording to the available CPU coresMonitor resource usage:
docker stats facephi-iad-serviceCheck the logs for timeout or retry errors
Update
To upgrade to a new version:
Important Upgrading from 1.x.x to 2.0.0 is an API migration with breaking changes, not a direct replacement. Validate all client calls against the new endpoint names and request/response examples before promoting the deployment.
Always review the release notes before upgrading.
Last updated