Search code examples
ionic-frameworkcapacitorbiometricsandroid-biometric

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.


Solution

  • 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