Biometric Authentication for Login

0
Good day, I'm trying to setup Biometric Authentication for logging in if the user has logged in before.This means storing the Username and Password under a react native keychain JS action, for safety purposes.I can't seem to find a way to do this reliably, has anyone done this before?Any assistance would be appreciated.I'm on Studio Pro 11.12
asked
1 answers
0

Hi Dewald,

I wouldn't recommend storing the user's username and password, even i n the React Native Keychain.


A better approach is:

  • Authenticate the user once using their credentials.
  • Store a secure access token, refresh token, or a custom session token in the React Native Keychain.
  • When the user enables biometric authentication, first verify the fingerprint/Face ID, then retrieve the token from the Keychain and use it to authenticate the user again.


This is the approach commonly used in production applications, as it avoids storing the user's actual password while still providing a seamless biometric login experience.


If you're using Studio Pro 11.12, this can be implemented using a custom React Native module/JS action together with the Keychain APIs.


Another approach is to avoid storing the username and password altogether.


For anonymous users, show the normal login page initially. After the user logs in successfully for the first time, call a nanoflow that enables biometric authentication.


You can use the Is Biometric Authentication Supported activity to check whether the device supports biometrics. If it does, call the Biometric Authentication activity. If the authentication succeeds, navigate directly to the landing page. Otherwise, show a toast message indicating that biometric authentication is not available (or failed) and redirect the user back to the login page.


With this approach, there is no need to store the user's username or password, reducing the risk of exposing sensitive credentials.


Kindly mark this as the accepted answer if it helps.

answered