Face Recognition
In this guide we will explain the steps to create an identity process with a face recognition.
1. Create an enrollment
First we must create a user record for face recognition, this is done using the enrollment API, the type of enrollment must be face-recognition
, Below is an example of how to create an enrollment.
The next step is to upload the image that will be used as the basis for the user face recognition, the link that should be used to upload the image is the one that comes in the file_upload_link
field that was obtained in the enrollment creation response, as shown in the reference image below.
2. Get enrollment
It is essential to verify the status of an enrollment before proceeding to the next step. The enrollment status can be either success or failure. In the meantime the enrollment process, the status remains pending with the reason waiting_file_upload
.
If the file is successfully uploaded, the status will change to success
. However, if an internal error occurs, there is a timeout, or the enrollment is declined, the status will be failure
.
Reason | Description |
---|---|
no_face_detected |
Indicates the face was not detected. |
face_in_blocklist |
Indicates the face being enrolled is in the client's blocklist. |
file_format_not_supported |
Indicates the image file format is not supported. |
Note: You must use the enrollment_id
returned in step 1 (Create an enrollment)
3. Generate a temporary token
Finally, you must generate a temporary token so that your user can perform the face recognition through a web browser using the account API, it is important to define the following field account_id
when generating the temporary token as shown in the image below.
The value of the account_id
field must be the account_id generated or assigned in the previous step.
Now your users will be able to verify through the browser using the following URL https://identity.truora.com/?token=<api_key>
, the api_key
field refers to the token generated in the previous step.
For more information on web verification of users see the Getting Started section in the documentation.