SelfLender / react-native-biometrics

React Native module for iOS and Android biometrics
MIT License
664 stars 229 forks source link

Error calling createKeys with face recognition #120

Open narayanrahulv opened 4 years ago

narayanrahulv commented 4 years ago

I am having an error where calling createKeys gives me the following error on android (phone is running android 10 and face recognition is enabled under the biometrics settings on the phone):

"Error: error generating public private keys"

However, everything seems to work fine when I only have fingerprint unlock enabled (and face recognition disabled) under the biometrics settings on the phone.

Is there a known issue with calling createKeys using face recognition on an android? Thanks.

kokeksibir commented 4 years ago

Same here.

harshithagb commented 4 years ago

I am facing the same issue. Face authentication is not working with even if I have a face registered on my device. I am using Samsung A5 device.

@narayanrahulv Did you get any solution to this issue?

MilkyLatte commented 4 years ago

I am getting the same error.

  const { available } = await ReactNativeBiometrics.isSensorAvailable();

  if (available) {
    const { keysExist } = await ReactNativeBiometrics.biometricKeysExist();
    if (keysExist) {
      await ReactNativeBiometrics.deleteKeys();
    }
    const { success } = await ReactNativeBiometrics.simplePrompt({
      promptMessage: "Confirm Face/FingerPrintId.",
    });
    if (success) {
      const { publicKey } = await ReactNativeBiometrics.createKeys();
      const result = await sendKeyToServer(publicKey, data.prospectId);
      if (!result.success) {
        alert(
          "There was an error setting up biometric login. Please try again after registration complete."
        );
      }
      setDialog(false);
      navigation.navigate("AppLaunchExplainerPage", { data: data });
    }
}` 

await ReactNativeBiometrics.createKeys() this is the line that is failing. Any ideas on how to sort this issue out? @narayanrahulv @harshithagb did you manage to sort it out?

harshithagb commented 4 years ago

Nope.


From: Juan Quintero Ovalle notifications@github.com Sent: Thursday, August 20, 2020 2:39:54 PM To: SelfLender/react-native-biometrics react-native-biometrics@noreply.github.com Cc: Harshitha Basavalingaiah Harshitha.Basavalingaiah@evry.com; Comment comment@noreply.github.com Subject: Re: [SelfLender/react-native-biometrics] Error calling createKeys with face recognition (#120)

I am getting the same error. ` try { const { available } = await ReactNativeBiometrics.isSensorAvailable();

if (available) { const { keysExist } = await ReactNativeBiometrics.biometricKeysExist();

if (keysExist) {
  await ReactNativeBiometrics.deleteKeys();
}

const { success } = await ReactNativeBiometrics.simplePrompt({
  promptMessage: "Confirm Face/FingerPrintId.",
});

if (success) {
  const { publicKey } = await ReactNativeBiometrics.createKeys();

  const result = await sendKeyToServer(publicKey, data.prospectId);

  if (!result.success) {
    alert(
      "There was an error setting up biometric login. Please try again after registration complete."
    );
  }
  setDialog(false);
  navigation.navigate("AppLaunchExplainerPage", { data: data });
}

} }` await ReactNativeBiometrics.createKeys() this is the line that is failing. Any ideas on how to sort this issue out? @narayanrahulv @harshithagb did you manage to sort it out?

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FSelfLender%2Freact-native-biometrics%2Fissues%2F120%23issuecomment-677477383&data=02%7C01%7CHarshitha.Basavalingaiah%40evry.com%7C3af4610d081b4dad2aad08d844e8ddb6%7C40cc2915e2834a2794716bdd7ca4c6e1%7C1%7C0%7C637335114222101293&sdata=72EJFCZOulrLlrOds9iYhhIGbtlmTJoBB1B6%2F0N9PMw%3D&reserved=0, or unsubscribehttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FADVAKPFAD7F4DKLM5ZEFVTTSBTR6FANCNFSM4MTY66RQ&data=02%7C01%7CHarshitha.Basavalingaiah%40evry.com%7C3af4610d081b4dad2aad08d844e8ddb6%7C40cc2915e2834a2794716bdd7ca4c6e1%7C1%7C0%7C637335114222111289&sdata=yyaXDMbfYA3%2BkaPXCrciR%2BB9NnlSomd%2BZtke49gZ8IU%3D&reserved=0.

narayanrahulv commented 3 years ago

I am getting the same error.

  const { available } = await ReactNativeBiometrics.isSensorAvailable();

  if (available) {
    const { keysExist } = await ReactNativeBiometrics.biometricKeysExist();
    if (keysExist) {
      await ReactNativeBiometrics.deleteKeys();
    }
    const { success } = await ReactNativeBiometrics.simplePrompt({
      promptMessage: "Confirm Face/FingerPrintId.",
    });
    if (success) {
      const { publicKey } = await ReactNativeBiometrics.createKeys();
      const result = await sendKeyToServer(publicKey, data.prospectId);
      if (!result.success) {
        alert(
          "There was an error setting up biometric login. Please try again after registration complete."
        );
      }
      setDialog(false);
      navigation.navigate("AppLaunchExplainerPage", { data: data });
    }
}` 

await ReactNativeBiometrics.createKeys() this is the line that is failing. Any ideas on how to sort this issue out? @narayanrahulv @harshithagb did you manage to sort it out?

Sadly no, still getting a certificate error if I've only enabled face recognition on android.

ajaykumar97 commented 3 years ago

Hello guys! Did anyone find a solution?

moroshandmitry commented 3 years ago
  1. Use a real device.
  2. Install your fingerprint in your device.
  3. npm run android

Solved problem for me.

OooCleMooO commented 2 years ago

I have the same issue on a real Android device (Android 12 with FaceID enabled). The ReactNativeBiometrics.createKeys function still doesn't work on Android side. Anyone have found a solution please ?

ekhishigee commented 2 years ago

@OooCleMooO Same here

samuel-gallet commented 2 years ago

Any update? Same issue here. Have you found any workaround?

personalnadir commented 1 year ago

Seeing this issue as well. Face recognition working otherwise

erickcrus commented 1 year ago

Here i'm getting this error when I cancel biometry authentication in iOS: "Key not found: error item authentication failed"

progtarek commented 7 months ago

any updates on this?