diff --git a/auth0/src/main/java/com/auth0/android/authentication/storage/SecureCredentialsManager.kt b/auth0/src/main/java/com/auth0/android/authentication/storage/SecureCredentialsManager.kt index 51854633..a04d4ef1 100644 --- a/auth0/src/main/java/com/auth0/android/authentication/storage/SecureCredentialsManager.kt +++ b/auth0/src/main/java/com/auth0/android/authentication/storage/SecureCredentialsManager.kt @@ -31,8 +31,8 @@ public class SecureCredentialsManager @VisibleForTesting(otherwise = VisibleForT private val crypto: CryptoUtil, jwtDecoder: JWTDecoder, private val serialExecutor: Executor, - private val fragmentActivity: WeakReference? = null, - private val localAuthenticationOptions: LocalAuthenticationOptions? = null, + private var fragmentActivity: WeakReference? = null, + private var localAuthenticationOptions: LocalAuthenticationOptions? = null, private val localAuthenticationManagerFactory: LocalAuthenticationManagerFactory? = null, ) : BaseCredentialsManager(apiClient, storage, jwtDecoder) { private val gson: Gson = GsonProvider.gson @@ -59,7 +59,7 @@ public class SecureCredentialsManager @VisibleForTesting(otherwise = VisibleForT /** - * Creates a new SecureCredentialsManager to handle Credentials with Authentication + * Creates a new SecureCredentialsManager to handle Credentials with biometrics Authentication * * @param context a valid context * @param apiClient the Auth0 Authentication API Client to handle token refreshment when needed. @@ -84,6 +84,11 @@ public class SecureCredentialsManager @VisibleForTesting(otherwise = VisibleForT DefaultLocalAuthenticationManagerFactory() ) + public fun enableBiometrics(fragmentActivity: FragmentActivity, localAuthenticationOptions: LocalAuthenticationOptions) { + this.fragmentActivity = WeakReference(fragmentActivity) + this.localAuthenticationOptions = localAuthenticationOptions + } + /** * Saves the given credentials in the Storage. *