Provides a cross-platform implementation of biometric authentication. Continuation of the abandoned Plugin.Fingerprint in the MAUI ecosystem.
MIT License
Provides a cross-platform implementation of biometric authentication. Supports iOS, macOS, Android and Windows. Continuation of the abandoned Plugin.Fingerprint in the MAUI ecosystem.
<PackageReference Include="Oscore.Maui.Biometric" Version="1.0.0" />
NSFaceIDUsageDescription
to your Info.plist to describe the reason your app uses Face ID.<key>NSFaceIDUsageDescription</key>
<string>Need your face to unlock secrets!</string>
AndroidManifest.xml
<uses-permission android:name="android.permission.USE_FINGERPRINT" android:maxSdkVersion="27" />
<uses-permission android:name="android.permission.USE_BIOMETRIC" android:minSdkVersion="28" />
MauiProgram.cs
CreateMauiApp
method:builder
.UseMauiApp<App>()
+ .UseBiometricAuthentication()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Sed:nammibold.ttf", "OpenSansSemibold");
});
BiometricAuthentication.Current
or using IBiometricAuthentication
from DI:var result = await BiometricAuthentication.Current.AuthenticateAsync(
new AuthenticationRequest(
title: "Prove you have fingers!",
reason: "Because without it you can't have access"));
if (result.Authenticated)
{
// do secret stuff :)
}
else
{
// not allowed to do secret stuff :(
}
With the Hardware menu you can
telnet 127.0.0.1 <emulator-id>
(adb devices
prints "emulator-<emulator-id>")finger touch 1
finger touch 1
Sending fingerprint sensor events for testing the plugin can be done with the telnet commands, too.
Note for Windows users: You have to enable telnet: Programs and Features > Add Windows Feature > Telnet Client
It was forked from the xamarin-fingerprint project. xamarin-fingerprint is a project by Sven-Michael Stübe. It was licensed under the MS-PL license. This fork changes the license to MIT with attribution to the original license.