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 Touch ID.
Classes
| Name | Description |
|---|---|
| LAAuthenticationRequirement | |
| LABiometryFallbackRequirement | |
| LAContext |
The context in which authentication policies are evaluated. |
| LADomainState | |
| LADomainStateBiometry | |
| LADomainStateCompanion | |
| LAEnvironment | |
| LAEnvironmentMechanism | |
| LAEnvironmentMechanismBiometry | |
| LAEnvironmentMechanismCompanion | |
| LAEnvironmentMechanismUserPassword | |
| LAEnvironmentObserver |
This is a class that implements the interface ILAEnvironmentObserver (for the protocol Subclass this class to easily create a type that implements the protocol. An alternative is to create a subclass of NSObject and then implemented the interface ILAEnvironmentObserver. |
| LAEnvironmentState | |
| LAPersistedRight | |
| LAPrivateKey | |
| LAPublicKey | |
| LARight | |
| LARightStore | |
| LASecret | |
| LAStatusExtensions |
Extension methods for the LAStatus enumeration. |
Interfaces
| Name | Description |
|---|---|
| ILAEnvironmentObserver |
This interface represents the Objective-C protocol |
Enums
| Name | Description |
|---|---|
| LAAccessControlOperation |
Enumerates access control operations for the EvaluateAccessControl(SecAccessControl, LAAccessControlOperation, String, Action<Boolean,NSError>) method. |
| LABiometryType |
Enumerates supported biometric authentication types. |
| LACompanionType | |
| LACredentialType |
Enumerates local authentication credential types. |
| LAPolicy |
Authentication policies. |
| LARightState | |
| LAStatus |
Status and error codes returned by methods in LocalAuthentication. |
Delegates
| Name | Description |
|---|---|
| LAContextReplyHandler |
Signature for a function to be invoked in response to a EvaluatePolicy(LAPolicy, String, LAContextReplyHandler) invocation. |
| LAPrivateKeyCompletionHandler | |
| LAPublicKeyCompletionHandler | |
| LAPublicKeyVerifyDataCompletionHandler | |
| LARightAuthorizeCompletionHandler | |
| LARightStoreCompletionHandler | |
| LARightStoreRemoveRightCompletionHandler | |
| LASecretCompletionHandler | |
Remarks
The LocalAuthentication namespace allows the app to require the user to authenticate with Touch ID, as shown in the following example:
btn.TouchUpInside += async (s, e) => {
var ctxt = new LAContext();
if (ctxt.CanEvaluatePolicy(LAPolicy.DeviceOwnerAuthenticationWithBiometrics, out var error))
{
var authenticated = await ctxt.EvaluatePolicyAsync(LAPolicy.DeviceOwnerAuthenticationWithBiometrics, "Authenticate to confirm message");
if (authenticated)
{
//etc.
}
}
}