-
Notifications
You must be signed in to change notification settings - Fork 2
5.1 Authentification with facial recognition
The process can be started via face recognition. The following animation demonstrates how this works.
After entering the authentication website, the current image of the webcam will appear on the right side of the screen. If the "Authorize" button is pressed, an image will be taken and displayed in the right rectangle. This image is sent to the Face-Recognition API of Microsoft Azure in the background. First, the program tries to recognize a face from the image. In a second step, if a face is detected the service tries to identify the person with a learned model. If no known person is recognized, the login fails. But if an entitled person is recognized, a web hook fetches the customer list via Integromat. From the customer list the needed customer can be selected. Afterwards the process can be started with the recognized person. As soon as the process is started, it will redirect the site to the corresponding instance on the Camunda interface.
For face recognition, the cognitive services of Microsoft Azure were used. (Microsoft Azure Face API). To interact with it a small API, written in PHP, is used for the backend. It consists of three files: analyze.php, save_image.php and start_process.php. The frontend is written in HTML, CSS and JavaScript.
save_image.php save_image.php receives an image via POST and stores it on the web server. In response it returns the path to the image. So we have a URL to the image for the next step.
analyze.php analyze.php receives the URL to the image via GET and sends it in a first step to the Azure Face detect API. It returns an array with all faces found. The faces are returned as IDs valid for 24 hours. The first element is taken from the array. In a next step, the face-ID and the group name "Paneer" are sent to the Azure Face identify API. The group was created before. A group is made up from people, each person was trained with pictures. The response is a person-ID. In the last step this is converted into a name with a GET request. This name is then returned by analyze.php via JSON as a response to the GET call.
start_process.php start_process.php is started with a GET request This API accepts person, customer, mandate and a businesskey. It starts the Camunda process via a GET request. The response is a JSON with the ID of the started process.
The JavaScript frontend needs a list of available customer. Those customers are stored in a google spreadsheet database. To get the list of customer an Integromat scenario is used. This Scenario is called via a GET-request and uses the google-sheet integration from Integromat to subtract the customer. Then it is converted to json, using the defined data-structure, and is returned to the caller.