Interface Biometrics

  • All Implemented Interfaces:

    
    public interface Biometrics
    
                        

    The Biometrics interface provides methods for detecting biometric availability, registering, authenticating, and removing biometrics identifiers.

    • Constructor Detail

    • Method Detail

      • isRegistrationAvailable

         abstract Boolean isRegistrationAvailable(FragmentActivity context)

        Indicates if there is an existing biometric registration on device.

        Parameters:
        context - is the calling FragmentActivity
        Returns:

        Boolean

      • areBiometricsAvailable

         abstract BiometricAvailability areBiometricsAvailable(FragmentActivity context, Boolean allowDeviceCredentials)

        Indicates if the biometric sensor is available, and provides a reasoning if not

        Parameters:
        context - is the calling FragmentActivity
        allowDeviceCredentials - whether or not you choose to allow the use of non-biometric device credentials (PIN, Pattern) as a fallback (on Android versions greater than Q)
        Returns:

        BiometricAvailability

      • removeRegistration

         abstract Boolean removeRegistration()

        Clears existing biometric registrations stored on device. Useful when removing a user from a given device. Returns true if the registration was successfully removed from device.

        Returns:

        Boolean

      • removeRegistration

         abstract Unit removeRegistration(Function1<Boolean, Unit> callback)

        Clears existing biometric registrations stored on device. Useful when removing a user from a given device. Returns true if the registration was successfully removed from device.

        Parameters:
        callback - A callback that receives a Boolean
      • removeRegistrationCompletable

         abstract CompletableFuture<Boolean> removeRegistrationCompletable()

        Clears existing biometric registrations stored on device. Useful when removing a user from a given device. Returns true if the registration was successfully removed from device.

        Returns:

        Boolean

      • isUsingKeystore

         abstract Boolean isUsingKeystore()

        Indicates if the device is device has a reliable version of the Android KeyStore. If it does not, there may be issues creating encryption keys, as well as implications on where these keys are stored. The safest approach is to not offer biometrics if this returns false, but it is possible to force a registration with an unreliable KeyStore.

        Returns:

        Boolean

      • register

         abstract StytchResult<BiometricsAuthData> register(Biometrics.RegisterParameters parameters)

        When a valid/active session exists, this method will add a biometric registration for the current user. The user will later be able to start a new session with biometrics or use biometrics as an additional authentication factor.

        Parameters:
        parameters - required to register a biometrics key
        Returns:

        BiometricsAuthResponse

      • register

         abstract Unit register(Biometrics.RegisterParameters parameters, Function1<StytchResult<BiometricsAuthData>, Unit> callback)

        When a valid/active session exists, this method will add a biometric registration for the current user. The user will later be able to start a new session with biometrics or use biometrics as an additional authentication factor.

        Parameters:
        parameters - required to register a biometrics key
        callback - a callback that receives a BiometricsAuthResponse
      • registerCompletable

         abstract CompletableFuture<StytchResult<BiometricsAuthData>> registerCompletable(Biometrics.RegisterParameters parameters)

        When a valid/active session exists, this method will add a biometric registration for the current user. The user will later be able to start a new session with biometrics or use biometrics as an additional authentication factor.

        Parameters:
        parameters - required to register a biometrics key
        Returns:

        BiometricsAuthResponse

      • authenticate

         abstract StytchResult<BiometricsAuthData> authenticate(Biometrics.AuthenticateParameters parameters)

        If a valid biometric registration exists, this method confirms the current device owner via the device's built-in biometric reader and returns an updated session object by either starting a new session or adding the biometric factor to an existing session.

        Parameters:
        parameters - required to authenticate a biometrics key
        Returns:

        BiometricsAuthResponse

      • authenticate

         abstract Unit authenticate(Biometrics.AuthenticateParameters parameters, Function1<StytchResult<BiometricsAuthData>, Unit> callback)

        If a valid biometric registration exists, this method confirms the current device owner via the device's built-in biometric reader and returns an updated session object by either starting a new session or adding the biometric factor to an existing session.

        Parameters:
        parameters - required to authenticate a biometrics key
        callback - a callback that receives a BiometricsAuthResponse
      • authenticateCompletable

         abstract CompletableFuture<StytchResult<BiometricsAuthData>> authenticateCompletable(Biometrics.AuthenticateParameters parameters)

        If a valid biometric registration exists, this method confirms the current device owner via the device's built-in biometric reader and returns an updated session object by either starting a new session or adding the biometric factor to an existing session.

        Parameters:
        parameters - required to authenticate a biometrics key
        Returns:

        BiometricsAuthResponse