The LoginID Flutter Plugin SDK enables you to add FIDO-certified authentication in your Flutter application without having to redirect the user to any pages outside your application.
For more robust functionality, it is likely that you will need to also leverage a Server SDK. The Server SDK makes requests to LoginID's API easier by leveraging your API Credential. Check out the LoginID Server SDK for a simplified integration.
The LoginID Flutter Plugin SDK is currently supprted on Flutter version >= 1.12.13+hotfix.5.. You will need additional setups for iOS and Android described below.
An application must be created on the LoginID Dashboard in order to correctly configure the React Native SDK.
Once logged into the dashboard, navigate to the Applications tab in the sidebar, select “Add Application,” then select Native.
In the resulting form, you must create a name for your application. We generate a Client ID and Base URL for your application, which you will use to configure the SDK.
After entering your application name, you will be prompted to create an API credential. If you have a client-side only application, please skip this step. Otherwise, create an API credential in order to make protected API calls.
An API service token must be included on all requests once an API credential is assigned to an application.
Add flutter login sdk to your pubspec.yaml dependencies
Update your project's AndroidManifest.xml file to include the USE_FINGERPRINT permissions:
This plugin requires the use of FragmentActivity instead of Activity. You need to change your MainActivity to use FlutterFragmentActivity instead of FlutterActivity.
Override of configureFlutterEngine is required as of Flutter version (1.12 - 1.17). However, this may not be required in future update
The following fix is required for devices running Android API <28. You will received the error:
You need to use a Theme.AppCompat theme (or descendant) with this activity while using default flutter LaunchTheme. (found in flutter version 1.12 - 1.17)
To change default LaunchTheme go to your flutter app
To dark theme biometric prompt:
Or to light theme biometric prompt:
For IOS build, add NSFaceIDUsageDescription (Privacy - Face ID Usage Description) key/value to app's
info.plist. You can find the info.plist file in your project ios/Runner of your Flutter application.
This is a privacy description for accessing FaceID feature on iOS. On device with FaceID like iPhoneX + user will be prompted with permission dialog based on this description about why faceID is needed for the app.
First import Flutter plugin SDK
Configure clientId and baseURL obtained from the developer console. You should configure Fido login at the init state of your flutter application.