0

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.

mahen23
  • 720
  • 2
  • 11
  • 24

2 Answers2

1

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"

sheriff123
  • 151
  • 1
  • 3
  • 10
  • In fact I did not understand the flow how biometrics works. Here's how its supposed to go: 1. User logins, we ask to register for biometrics. 2. IF user agrees, we ask for fingerprints scan. 3. Once approved, we store username / password as a hash and store it in local storage. 4. That same hash is sent to the user's database and stored there. 5. Next time user's logs in, we ask for biometrics. 6. If SUCCESS we send the hash found in localstorage to server and logs in the user. – mahen23 Feb 22 '22 at 04:45
  • Yeah. that is another way of it. so yeah what you don't understand in that? – sheriff123 Feb 22 '22 at 11:01
  • lol that question was 2 months ago. Product has already been designed / implemented and shipped. Maybe i should delete the question... – mahen23 Feb 22 '22 at 11:52
1

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

DallasO
  • 51
  • 1
  • 7