LocalAuthentication Namespace
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
The LocalAuthentication namespace provides support for TouchID.
LAContext |
The context in which authentication policies are evaluated. |
LAStatus |
Extension methods for the LocalAuthentication.LAStatus enumeration. |
LAAccess |
Enumerates access control operations for the EvaluateAccessControl(SecAccessControl, LAAccessControlOperation, String, Action<Boolean,NSError>) method. |
LABiometry |
Enumerates supported biometric authentication types. |
LACredential |
Enumerates local authentication credential types. |
LAPolicy |
Authentication policies. |
LAStatus |
Status and error codes returned by methods in LocalAuthentication. |
LAContext |
Signature for a function to be invoked in response to a EvaluatePolicy(LAPolicy, String, LAContextReplyHandler) invocation. |
The LocalAuthentication namespace, introduced in iOS 8, allows the app to require the user to authenticate with TouchID, as shown in the following example:
btn.TouchUpInside += async(s,e) => {
var ctxt = new LAContext();
var error = new NSError();
if(ctxt.CanEvaluatePolicy (LAPolicy.DeviceOwnerAuthenticationWithBiometrics, out error))
{
var authenticated = await ctxt.EvaluatePolicyAsync(LAPolicy.DeviceOwnerAuthenticationWithBiometrics, "Authenticate to confirm message");
if (authenticated)
{
//etc.
}
}
}