Fingerprint after inactivity

26
February 12, 2019, at 04:40 AM

I am implementing fingerprint support to protect sensitive areas of my app and access to some web APIs (using a signature). I am initializing the key generator like this:

            keyPairGenerator.initialize(
                KeyGenParameterSpec.Builder(KEY_NAME, KeyProperties.PURPOSE_SIGN)
                .setDigests(KeyProperties.DIGEST_SHA256)
                .setAlgorithmParameterSpec(ECGenParameterSpec("secp256r1"))
                .setUserAuthenticationRequired(true)
                .setInvalidatedByBiometricEnrollment(true)
                .build()
        )

This setup will require the user's fingerprint every time the key is retrieved to create the signature. The behavior I want is more like this:

            keyPairGenerator.initialize(
                KeyGenParameterSpec.Builder(KEY_NAME, KeyProperties.PURPOSE_SIGN)
                .setDigests(KeyProperties.DIGEST_SHA256)
                .setAlgorithmParameterSpec(ECGenParameterSpec("secp256r1"))
                .setUserAuthenticationRequired(true)
                .setUserAuthenticationValidityDurationSeconds(10)
                .setInvalidatedByBiometricEnrollment(true)
                .build()
        )

Here the authenticaation is good for 10 seconds because of "setUserAuthenticationValidityDurationSeconds". What I really want is something like "setUserAuthenticationInvalidAfterInactivitySeconds". In other words I would like the authentication to be invalidated only after a period of user inactivity in my app. Does this exist or do I have to create something proprietary?

READ ALSO
Gradle Task from Plugin Doesn't Run on “Build”, But Does Run on “Clean”

Gradle Task from Plugin Doesn't Run on “Build”, But Does Run on “Clean”

We have an Android project which requires a certain Gradle Plugin Task to run before we build the APK(The plugin is written by us)

21
Android Things UDP Socket over IPv6

Android Things UDP Socket over IPv6

There is pretty much no error logs but it can't actually send anything over mesh network on udpSeems to receive without any issues but on send it doesn't go

23
Android X + Truth + Guava test compile issue

Android X + Truth + Guava test compile issue

I have an Android library (called api) gradle module as part of a larger projectI just migrated the whole project to AndroidX

14
Remove native base FABs ripple effect on android

Remove native base FABs ripple effect on android

I'm having problem with native base FAB button it shows a square ripple effect when i press it

34