Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android keystrore error #284

Open
Ritik5Prasad opened this issue Apr 14, 2024 · 4 comments
Open

Android keystrore error #284

Ritik5Prasad opened this issue Apr 14, 2024 · 4 comments

Comments

@Ritik5Prasad
Copy link

export const loginWithBiometrics = async (userID: string) => {
try {
const isBiometricAvailable = await checkBiometrics();
if (!isBiometricAvailable) {
throw new Error("Biometric not available");
}
const { keysExist } = await rnBiometrics.biometricKeysExist();

if (!keysExist) {
  const { publicKey } = await rnBiometrics.createKeys();
  console.log("PUblicKey ", publicKey);
}

const { success, signature } = await rnBiometrics.createSignature({
  promptMessage: "Sign in",
  payload: userID,
  
});

if (!success) {
  throw new Error("Biometrics authentication failed!");
}

console.log(signature);
if (signature) {
  return true;
} else {
  return false;
}

} catch (error) {
console.log("Error@@", JSON.stringify(error));
return false;
}
};

Error@@ {"nativeStackAndroid":[],"userInfo":null,"message":"Error creating signature","code":"Error creating signature: android.security.KeyStoreException: Key user not authenticated (internal Keystore code: -26 message: In KeystoreOperation::finish\n\nCaused by:\n 0: In finish: KeyMint::finish failed.\n 1: Error::Km(ErrorCode(-26))) (public error code: 2 internal Keystore code: -26)"}

@amjadbouhouch
Copy link

+1

3 similar comments
@rick427
Copy link

rick427 commented May 1, 2024

+1

@VladosDosvidos
Copy link

+1

@jamalzkhan
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants