FaceAuthenticator (Deprecated)
Privacy Policy and Terms & Conditions of Use
When using our plugin, please make sure that you agree with our Privacy Policy and our Terms and Conditions of Use.
Pre-requirements
Minimum configuration | Version |
Flutter | 1.12+ |
Dart | 2.12+ |
Minimum Android API | 21+ |
Compile SDK Version | 33 |
iOS | 11.0+ |
If you use Dart in a version below 2.12, check the compatible version here.
Settings
Android
In the file ** ROOT_PROJECT/android/app/build.gradle
**, add:
iOS
In the ROOT_PROJECT/ios/Podfile
, add to the end of the file:
Finally, add the camera permission to the file ROOT_PROJECT/ios/Runner/Info.plist
:
Flutter
Add the plugin to your ROOT_PROJECT/pubspec.yaml
file:
Utilization
Disabling Security Validations for Testing
We are constantly taking actions to make the product more and more secure, mitigating a number of attacks observed in the capture process and, consequently, reducing as many possible identity frauds as possible. The SDK has some blocks that may prevent its execution in certain contexts. To disable them, you can use the methods as shown in the example below:
Attention! Disabling security validations is recommended for test environments only. For publishing your application in production, we recommend using the default settings.
General customizations
FaceAuthenticator |
CPF of the user that will authenticate |
Enables/disables sounds. Allows you to customize the audio used by the SDK. If you want to change the SDK's audio, add the audio file in |
Enables/disables data collection for maximizing anti-fraud information. Default is |
Change the default network settings. Default is |
Customizations only applied on Android |
Customizations only applied on iOS |
Lets you customize the eyes-open validation in the SDK |
|
.setStage(String stage)
Allows you to choose the environment in wich the SDK will run (production or beta). The expected String
values are: "PROD" and "BETA". This setting is not mandatory, by default the SDK will use the production environment.
Each environment (beta and production) requires its own specific mobileToken, generated in the Trust platform of the respective environment.
|
Android
FaceAuthenticatorAndroidSettings constructor |
Activity's Android layout customization |
Stabilization time settings for capturing the selfie |
Customization of the capture sensor settings |
Enables the use of an emulator when |
Enables the use of root devices when |
Allows you to enable or disable the camera flip button. Default is |
Enables/disables device brightness increment on opening the SDK |
Enables/disables the use of the app in debug mode. Default is |
FaceAuthenticatorCustomizationAndroid constructor |
Name of the style resource that defines the colors of the SDK. For example, if you want to change the SDK colors, create a style in |
Name of the layout resource that will replace the default SDK layout. For example, if you want to change the SDK layout, create a layout in |
Name of the drawable resource to replace the default green mask. If you are going to use this parameter, use a mask with the same cutting area, it is important for the detection algorithm. For example, save the mask image in |
Name of the drawable resource to replace the default red mask. If you are going to use this parameter, use a mask with the same cutting area, it is important for the detection algorithm. For example, save the mask image in |
Name of the drawable resource to replace the default white mask. If you are going to use this parameter, use a mask with the same cutting area, it is important for the detection algorithm. For example, save the mask image in |
SensorSettingsAndroid constructor |
Orientation sensor settings to be applied in all SDK steps |
SensorStabilitySettingsAndroid constructor |
Name of the string resource to be shown when the phone is not stable. The default message is "Keep cell phone still". For example, if you want to show the String "Test", create a String in |
How many milliseconds the mobile must stay at the correct threshold to be considered stable. The default is |
Lower threshold between stable/unstable, in m/s² variation between the last two sensor collections. The default is |
iOS
FaceAuthenticatorIosSettings constructor |
Customização visual do SDK |
Duration in milliseconds between the first detection of the face and the actual capture of the picture |
Stability sensor settings to be applied in the SDK |
FaceAuthenticatorCustomizationIos constructor |
The SDK's theme color. For example, if you want to use the color black, use "#000000". |
Name of the image to replace the default green mask. Remember to add the image in |
Name of the image to replace the default white mask. Remember to add the image in |
Name of the image to replace the default red mask. Remember to add the image in |
Name of the image to replace the SDK's close button. Remember to add the image in |
Flag indicating whether to show the label of the current step |
Flag indicating whether to show the current status label |
SensorStabilitySettingsAndroid constructor |
String to be shown when the cell phone is not stable |
Lower threshold between stable/unstable, in m/s² variation between the last two sensor collections. The default is |
Collecting the result
The FaceAuthenticator return object is of abstract type FaceAuthenticatorResult
. It can be an instance of FaceAuthenticatorSuccess
, FaceAuthenticatorFailure
, or FaceAuthenticatorClosed
.
FaceAuthenticatorSuccess
Field | |
Flag indicating whether the user has passed face authentication | |
Signed response from the CAF server that confirmed the face authentication. Use this parameter if you want an extra layer of security by checking that the signature of the response is not broken, caused by an interception of the request. If it is broken, there is a strong indication of request interception | |
Identifier of this run on our servers. If possible, save this field and send it along to our API. This way we will have more data about how the user behaved during the execution | Will be null if the user sets |
FaceAuthenticatorFailure
Field |
Friendly message explaining why the SDK failed |
Type of fault that shut down the SDK |
The existing fault types are:
InvalidTokenReason
: when the token entered is invalid. It should not occur in a production environment;PermissionReason
: when some mandatory permission was not granted by the user. It will only occur in a production environment if your app does not ask the user or the user manually disables it before starting;NetworkReason
: server connection failure. It will occur in production if the user's device is not connected to the Internet;ServerReason
: failure in some request to our servers;SecurityReason
: when the device is not safe to run the SDK;StorageReason
: when the device does not have enough space to capture a photo. This can happen in production;LibraryReason
: when some internal failure made it impossible to run the SDK. It may occur due to project configuration errors, and should not occur in production.
Last updated