I am working with Xamarin on a Cross Platform application. There is an existing log in feature that takes in a username and password. I was tasked with adding a feature where users may log in using Touch ID or Face ID. I have read through the documentation on Local Authorization, as well as a slew of other tutorials, but I can't get over a major hurdle, which is how can I link Biometric information with user account information if Local Authorization has a system set in place which disallows said information from being stored anywhere other than the device's hardware.
void AuthenticateMe(object sender, EventArgs e)
{
var context = new LAContext();
NSError AuthError;
var myReason = new NSString("To Sign In to App");
if (context.CanEvaluatePolicy(LAPolicy.DeviceOwnerAuthenticationWithBiometrics, out AuthError))
{
var replyHandler = new LAContextReplyHandler((success, error) =>
{
Device.BeginInvokeOnMainThread(() =>
{
if (success)
//If Bob123's fingerprint worked
{
//Goes to Bob123's home page
SetCurrentMainPage();
}
else
{
//Redirects to login page where Bob can login as Bob123
// Show fallback mechanism here
}
});
});
context.EvaluatePolicy(LAPolicy.DeviceOwnerAuthenticationWithBiometrics, myReason, replyHandler);
};
}
E.g. How can Bob123 login with both his fingerprint and his username?