ERROR HANDLING

Robust error handling is critical for a secure and reliable biometric authentication system. The PrivateID Session API returns detailed error information through standardized error codes and HTTP status responses. These mechanisms facilitate precise debugging, support automated retry strategies, and ensure that critical security events are promptly flagged.


Specific Error Codes

The API defines a set of error codes to distinguish between various failure modes:

Error CodeNameDescription
1SPOOFSpoofing Attempt Detected — Static image, deepfake, or synthetic biometric detected.
-5DESKTOPDesktop Mode Restricted — Attempted operation in disallowed desktop environment.
-7CAMERA_FAILCamera Failure — Could not initialize or capture from camera.
-10LOW_LIGHTLow Ambient Light — Insufficient lighting for reliable biometric capture.
-11MULTIPLE_FACESMultiple Faces Detected — Ambiguity during biometric analysis.
-13Session Expired — Session no longer valid.
-14Unauthorized Callback — Callback attempted without valid credentials.
-15Token Already Used — Possible replay attack detected.
-16Device Mismatch — Device differs from registration source.

General HTTP Status Errors

Standard HTTP status codes also indicate common failure modes:

HTTP Status CodeMeaningPossible Causes
401UnauthorizedMissing or invalid x_api_key, clientID, clientSecret, or SLC.
400Bad RequestMalformed JSON, missing parameters, or invalid field types.
500Internal Server ErrorTransient server-side issue or cryptographic operation failure.

Error Response Format

When an error occurs, the API returns a structured JSON payload:

{
  "status": "error",
  "message": "Camera failure detected",
  "errorCodes": [-7]
}

Fields:

  • status: Always set to "error" on failure.
  • message: Human-readable message.
  • errorCodes: Array of numeric codes.

Cryptographic and Audit Considerations

  • Immutable Audit Trails: All error events are logged with cryptographically signed audit trails. This ensures that the logs are tamper-evident and can be reliably used for forensic analysis without compromising sensitive biometric data.

  • Error Isolation and Granularity: The defined error codes are granular enough to distinguish between security-critical issues (e.g., spoofing attempts) and operational issues (e.g., low-light conditions), enabling tailored remediation strategies.

  • Automated Remediation: The detailed error responses allow clients to implement automated error-handling routines.

  • Data Integrity: Errors occurring during cryptographic token generation or comparison trigger immediate alerts, ensuring that any discrepancies are promptly addressed. This minimizes the risk of compromised authentication integrity.


Implementation Recommendations

  • Logging and Monitoring: Integrate robust logging mechanisms that capture both the error response and associated audit metadata. Ensure that these logs are stored securely and are accessible for forensic analysis.

  • Automated Alerts: Configure monitoring systems to trigger alerts on detection of critical errors (e.g., SPOOF attempts or repeated CAMERA_FAIL events) to enable immediate investigation and remediation.

  • Client-Side Handling: Implement client-side error handling that differentiates between permanent errors (e.g., invalid credentials) and transient errors (e.g., low ambient light) to optimize the user experience and system throughput.

Was this page helpful?