Delpin Susai Raj Wednesday, 17 February 2021

Xamarin.Forms - Fingerprint Authentication in your App

In this blog post, you will learn how to implement fingerprint, password and face-lock Authentication in your XamarinApp.

Introduction

Xamarin.Forms code runs on multiple platforms - each of which has its own filesystem. This means that reading and writing files is most easily done using the native file APIs on each platform. Alternatively, embedded resources are a simpler solution to distribute data files with an app.

Plugin.Fingerprint

Authenticate a user via fingerprint, face id or any other biometric / local authentication method from a cross platform API.

Prerequisites

  • Visual Studio 2017 or later (Windows or Mac)

Setting up a Xamarin.Forms Project

Start by creating a new Xamarin.Forms project. You wíll learn more by going through the steps yourself.Create a new or existing Xamarin forms(.Net standard) Project. With Android and iOS Platform. 

Nuget

Install the following Nuget from Nuget Manager In your Visual Studio.

Plugin.Fingerprint

iOS Setup

Add NSFaceIDUsageDescription to your Info.plist to describe the reason your app uses Face ID. Otherwise the App will crash when you start a Face ID authentication on iOS 11.3+.

<key>NSFaceIDUsageDescription</key>

<string>Need your face to unlock secrets!</string>

Android Setup

Request the permission in AndroidManifest.xml

<uses-permission android:name="android.permission.USE_FINGERPRINT" />

Add below code in MainActivity.cs OnCreate Method.


Install Android X Migration

Since version 2, this plugin uses Android X. You have to install Xamarin.AndroidX.Migration in your Android project.

FingerPrint Authentication


Enable AlternativeAuthentication

If need to allow alternate authentication such as Pin, Pattern and password set AlternativeAuthentication=true

Full code

Run



I hope you have understood you will learn how to implement fingerprint, password and facelock Authentication in your XamarinApp.

Thanks for reading. Please share your comments and feedback. Happy Coding :)

5 comments:

  1. amazing information,i appreciate your effort,

    ReplyDelete
  2. https://www.buyprimeaccount.com/
    https://www.buyprimeaccount.com/
    https://www.buyprimeaccount.com/
    https://www.buyprimeaccount.com/
    CSGO have two account type now after they were introduce their update in 2016. They started it for upgrading valve matchmaking system. If you sign up in steam and make private rank 21 then you will get prime status or you have to buy the game from steam store.

    ReplyDelete
  3. Great resource. Thanks Raj. I will be happy if you give me any suggestions for our Fingerprinting service business.

    ReplyDelete
  4. Nice blog! I really loved reading through this Blog... Thanks for sharing such a very interesting post with us and keep blogging.
    Visit our website-
    web and app development company
    hire xamarin developer
    hire ABP.io developer
    hire android developer

    ReplyDelete