Class BiometricAuth


  • @RestrictTo(LIBRARY)
    public class BiometricAuth
    extends java.lang.Object
    Helper class for managing Biometric Authentication Process.
    • Constructor Summary

      Constructors 
      Constructor Description
      BiometricAuth​(java.lang.String title, java.lang.String subtitle, boolean allowDeviceCredentials, androidx.fragment.app.FragmentActivity activity, BiometricAuthCompletionHandler biometricAuthListener)
      Initializes Biometric authentication with the caller and callback handlers.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void authenticate()  
      androidx.fragment.app.FragmentActivity getActivity()
      Return the activity of the client application that will host the prompt.
      BiometricAuthCompletionHandler getBiometricAuthListener()
      Return the Biometric Authentication listener used to return authentication result.
      android.app.KeyguardManager getKeyguardManager()
      Return the mechanism used to lock and unlock the device.
      java.lang.String getSubtitle()
      The subtitle to be displayed on the prompt.
      java.lang.String getTitle()
      The title to be displayed on the prompt.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BiometricAuth

        public BiometricAuth​(java.lang.String title,
                             java.lang.String subtitle,
                             boolean allowDeviceCredentials,
                             @NonNull
                             androidx.fragment.app.FragmentActivity activity,
                             @NonNull
                             BiometricAuthCompletionHandler biometricAuthListener)
        Initializes Biometric authentication with the caller and callback handlers. If device has no Biometric enrolled, it fallback to device credentials authentication.
        Parameters:
        title - the title to be displayed on the prompt.
        subtitle - the subtitle to be displayed on the prompt.
        allowDeviceCredentials - if true, accepts device PIN, pattern, or password to process notification.
        activity - the activity of the client application that will host the prompt.
        biometricAuthListener - listener for receiving the biometric authentication result.
    • Method Detail

      • getKeyguardManager

        public android.app.KeyguardManager getKeyguardManager()
        Return the mechanism used to lock and unlock the device.
        Returns:
        the KeyguardManager instance.
      • getTitle

        public java.lang.String getTitle()
        The title to be displayed on the prompt.
        Returns:
        the Title as String.
      • getSubtitle

        public java.lang.String getSubtitle()
        The subtitle to be displayed on the prompt.
        Returns:
        the Subtitle as String.
      • getBiometricAuthListener

        public BiometricAuthCompletionHandler getBiometricAuthListener()
        Return the Biometric Authentication listener used to return authentication result.
        Returns:
        the Biometric Authentication listener.
      • getActivity

        public androidx.fragment.app.FragmentActivity getActivity()
        Return the activity of the client application that will host the prompt.
        Returns:
        the Activity that hosts the prompt.
      • authenticate

        public void authenticate()