Biometrics Integration

SmartDevicesPlus provides an easy way to integrate a GeneXus application with the device's biometrics hardware.

This feature will allow users to use the fingerprint scanner on any Android and iPhone device (provided the device has the required hardware), and FaceID for the iPhone X.

Biometrics can be used for a variety of functionalities, but the most common usage is to store login credentials (user, password and/or token). In this way, the application user can access the aplication's secured information using the fingerprint reader, without re-entering credentials manually.

Biometrics can be enabled automatically in the "Design System Wizard", or if the developer needs a different behaviour can be integrated manually using the 'SDPBiometrics' external object.

Using the wizard:

Biometrics can be enabled directly from the "Design System Wizard". Just select the checkbox and the necessary code will be added it in the Login panel of the application.

BiometricsImg01

Using the external object:

You can use the 'SDPBiometrics' External Object like any other GeneXus external object.

BiometricsImg02

This external object has the following methods:

IsAvailable:

Return True when the fingerprint scanner is available and False if not.

GetLastMessage:

This method returns the error message when any operation fails so you can understand the cause of the problem.

Authenticate:

Returns True when the user authenticated properly (Fingerprint or Face ID).

StoreDataWithBiometrics:

This method encrypts and saves the information cached in the external object using the fingerprint. User will be prompted to authenticate before storing the information.

ReadDataWithBiometrics:

This method recovers the saved and encrypted information using the fingerprint. User will be prompted to authenticate before the information is obtained.

DeleteSecureData:

This method deletes stored information.

Add/Get/Remove/Clear CacheData:

This methods are used to handle the cached information of the external object.

Cache is only meant to store temporal information, inside a single event. User can add/remove as many fields as wanted in the cache, but must consider that cached information is not secured and is not recovered nor stored automatically, so this functions must be used in conjunction with the operations ReadDataWithBiometrics and StoreDataWithBiometrics. After the information is stored, cache must be cleared.

Examples

Use the fingerprint before calling a SDPanel or WorkWithDevices

In this example the fingerprint authentication is requested when you call some object.

BiometricsImg03

Save information in the fingerprint:

In this example information is saved in the cache of the fingerprint.

BiometricsImg04

Recover Information to the fingerprint:

In this example information is recovered from the cache of the fingerprint and then the cache is cleared.

BiometricsImg05

Activation of Fingerprint in the device/emulator

Android

To use the fingerprint functionality you need to have the fingerprint enabled in the device. In the following link you can see how do it:

https://android.gadgethacks.com/how-to/android-basics-unlock-your-phone-with-your-fingerprint-0171206/

If you are working with the Android SDK emulator, you should emulate the fingerprint recognition from the following option:

BiometricsImg06

iOS

To use this feature in iOS you should enable the Touch ID in the device. If you are working with the XCode Simulator you can do it as follows:

https://developer.apple.com/library/content/documentation/IDEs/Conceptual/iOS_Simulator_Guide/InteractingwithiOSandwatchOS/InteractingwithiOSandwatchOS.html