Skip to content

The legacy fingerprint authentication using Fingerprint Manager with the new AndroidX MasterKey.

License

Notifications You must be signed in to change notification settings

pisalcoding/android-fingerprint-auth

Repository files navigation

Android Fingerprint Auth

The legacy fingerprint authentication using Fingerprint Manager with the new AndroidX MasterKey.

Usage

Step 1: Add this your root build.gradle

repositories {  
	...
    maven { url "https://jitpack.io" }
}

Step 2: Add this your app build.gradle

dependencies {
    implementation 'com.github.pisalcoding:android-fingerprint-auth:Tag'
}

Step 3: Usage

class MainActivity : AppCompatActivity() {

    private fun authenticate(
        doOnSuccess: BiometricSuccessBlock,
        doOnFailure: BiometricFailureBlock,
    ) {
        val fingerprintFragment = FingerprintDialogFragment.newInstance()
        FingerprintAuth.from(this)
            .withDialogView(fingerprintFragment)
            .doOnSuccess {
                Log.d("FingerprintAuth", "Successful!. Here you can access encrypted sharedpreference wrapped in CredentailsKeeper.")
                doOnSuccess(this)
            }
            .doOnFailure {
                Log.d("FingerprintAuth", "Failed: $it")
                doOnFailure(it)
            }
            .authenticate()
    }
}


data class Credentials(
    val username: String,
    val pin: String,
) : ICredentials

For more details, check the sample 'app'.

About

The legacy fingerprint authentication using Fingerprint Manager with the new AndroidX MasterKey.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages