mahen23
mahen23

Reputation: 737

Issues capacitor-native-biometric cannot retreive credentials

Anyone used epicshaggy / capacitor-native-biometric plugin and have been able to make it work. I have just been able to trigger the NativeBiometric.verifyIdentity( function and make it recognize my biometrics, but that's about it.

I've crawled the internet and haven't found a complete example of how to use it. To summarize, i just want to understand how can i use biometrics to login a user. How do i make my server uniquely identify a user and provides login token.

Upvotes: 0

Views: 3720

Answers (2)

DallasO
DallasO

Reputation: 51

According to the CapacitorJs docs, and epicshaggy/capacitor-native-biometric, the correct way to work with user credentials is with the provided methods:

  • NativeBiometric.setCredentials()
  • NativeBiometric.getCredentials()
  • NativeBiometric.deleteCredentials()

These methods

Securely stores user's credentials in Keychain (iOS) or encypts them using Keystore (Android)

These methods are also only available on native devices, hence "method not implemented" when attempting to run in a browser, and must be behind Capacitor.isNativePlatform().

Providing an updated answer because this is still a top result when trying to implement biometrics with CapacitorJs

Upvotes: 1

sheriff123
sheriff123

Reputation: 321

did you found any solution to this so far? I think your own problem is how to recognize a user? there is actually how I used to do this in react native. First of. you need to have some kind of extra "local storage key" that stored values or user credentials when they log in through the inputs. keep in mind that you are not clearing the "key" even if the user "log out" of the app. so in that case. before they could be able to use biometrics users need to sign in the proper way with the inputs so you could save their credentials like email or any unique values or whatever to use later.

Now, my problem is all the functions are not even working for me ah. it keeps saying "method not implemented"

Upvotes: 1

Related Questions