Fingerprint Authentication with Huawei FIDO Plugin in Flutter Apps

Sinan Aktepe
Huawei Developers
Published in
2 min readJul 5, 2021

--

Hello everyone,

In this article we’re going to learn how to implement fingerprint authentication using Huawei FIDO Plugin in our Flutter applications.

Introduction

HUAWEI FIDO provides your app with FIDO2 based on the WebAuthn standard. It provides Android Java APIs for apps and browsers, and allows users to complete authentication through roaming authenticators (USB, NFC, and Bluetooth authenticators) and platform authenticators (fingerprint and 3D face authenticator). In addition, FIDO provides your app with powerful local biometric authentication capabilities, including fingerprint authentication and 3D facial authentication. It allows your app to provide secure and easy-to-use password-free authentication for users while ensuring reliable authentication results.

Configurations

Registering as a Developer

To benefit from Huawei FIDO Plugin, you need to create a Huawei Developer account and complete the identity verification. For details, please refer to Registering a Huawei Id.

AppGallery Connect Configuration & Flutter Integration

  • Create a project with your developer account, you can find the details in this document.
  • After you created the project, follow these steps to integrate the FIDO Plugin to your Flutter app.

Alright, that was the boring part. We’re ready to code now!

Using Fingerprint Authentication

  • The first thing we want to do here is to detect whether the device has ability of fingerprint authentication or not. Let’s see how we can achieve that with HmsBioAuthnManager class.
  • Then we want to set an informing message about the authentication. So the users won’t be confused. We’re going to use help of HmsBioAuthnPromptInfo class here.
  • Now we can setup a listener for the authentication events and perform the fingerprint authentication via HmsBioAuthnPrompt class.

To learn more about Huawei FIDO Plugin abilities, please refer to the API Reference Document.

deviceCredentialAllowed is set to true on the right

There we have the fingerprint authentication functionality, quite simple! You can find the demo app here.

Conclusion

Huawei FIDO Flutter Plugin has a lot more to provide along with the functionality we’ve learned about in this very article. Dont forget to check out the documents for more details.

References & Further Reading

--

--