Share via


UserConsentVerifierAvailability Enum

Definition

Describes the result of a check for an an authentication device such as a fingerprint reader.

public enum class UserConsentVerifierAvailability
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
enum class UserConsentVerifierAvailability
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
public enum UserConsentVerifierAvailability
var value = Windows.Security.Credentials.UI.UserConsentVerifierAvailability.available
Public Enum UserConsentVerifierAvailability
Inheritance
UserConsentVerifierAvailability
Attributes

Windows requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)

Fields

Name Value Description
Available 0

An authentication device is available.

DeviceNotPresent 1

There is no authentication device available.

NotConfiguredForUser 2

An authentication device is not configured for this user.

DisabledByPolicy 3

Group policy has disabled the authentication device.

DeviceBusy 4

The authentication device is performing an operation and is unavailable.

Examples

The following example shows a method that checks to see if an authentication device is supported for the current user and returns a message that describes the result based on the UserConsentVerifierAvailability value.

public async System.Threading.Tasks.Task<string> CheckDeviceAvailability()
{
    string returnMessage;

    // Check the availability of device authentication.
    var ucvAvailability = await Windows.Security.Credentials.UI.UserConsentVerifier.CheckAvailabilityAsync();

    switch (ucvAvailability)
    {
        case Windows.Security.Credentials.UI.UserConsentVerifierAvailability.Available:
            returnMessage = "Authentication device is available.";
            break;
        case Windows.Security.Credentials.UI.UserConsentVerifierAvailability.DeviceBusy:
            returnMessage = "Authentication device is busy.";
            break;
        case Windows.Security.Credentials.UI.UserConsentVerifierAvailability.DeviceNotPresent:
            returnMessage = "No authentication device found.";
            break;
        case Windows.Security.Credentials.UI.UserConsentVerifierAvailability.DisabledByPolicy:
            returnMessage = "Authentication device verification is disabled by policy.";
            break;
        case Windows.Security.Credentials.UI.UserConsentVerifierAvailability.NotConfiguredForUser:
            returnMessage = "Please go to Account Settings to set up a PIN or other advanced authentication.";
            break;
        default:
            returnMessage = "Authentication device is currently unavailable.";
            break;
    }

    return returnMessage;
}

Remarks

You can use the CheckAvailabilityAsync method to determine if fingerprint authentication is supported for the current computer.

Applies to

See also