Register and load biometric secrets
masterVersion 4.0+ allows you to encrypt and save a secret behind the biometric prompt. This provides true security by ensuring the secret is only accessible after successful biometric authentication.
Register a secret
Use Fingerprint.registerBiometricSecret() to save a string. The secret must match the regex [a-zA-Z0-9\-]+.
Load a secret
Use Fingerprint.loadBiometricSecret() to retrieve the previously saved secret after a successful biometric prompt.
// Registering a secret
Fingerprint.registerBiometricSecret({
description: "Some biometric description",
secret: "my-super-secret",
invalidateOnEnrollment: true,
disableBackup: true,
}, successCallback, errorCallback);
// Loading a secret
Fingerprint.loadBiometricSecret({
description: "Some biometric description",
disableBackup: true,
}, successCallback, errorCallback);