Share via


UserConsentVerificationResult Enum

Definition

Describes the result of a verification operation.

public enum class UserConsentVerificationResult
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
enum class UserConsentVerificationResult
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
public enum UserConsentVerificationResult
var value = Windows.Security.Credentials.UI.UserConsentVerificationResult.verified
Public Enum UserConsentVerificationResult
Inheritance
UserConsentVerificationResult
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
Verified 0

The user was verified.

DeviceNotPresent 1

There is no authentication device available.

NotConfiguredForUser 2

An authentication verifier device is not configured for this user.

DisabledByPolicy 3

Group policy has disabled authentication device verification.

DeviceBusy 4

The authentication device is performing an operation and is unavailable.

RetriesExhausted 5

After 10 attempts, the original verification request and all subsequent attempts at the same verification were not verified.

Canceled 6

The verification operation was canceled.

Examples

The following example shows a method that requests verification from an authentication device and returns a message that describes the result based on the UserConsentVerificationResult value.

private async System.Threading.Tasks.Task<string> RequestConsent(string userMessage)
{
    string returnMessage;

    // Request the logged on user's consent via authentication device.
    var consentResult = await Windows.Security.Credentials.UI.UserConsentVerifier.RequestVerificationAsync(userMessage);

    switch (consentResult)
    {
        case Windows.Security.Credentials.UI.UserConsentVerificationResult.Verified:
            returnMessage = "User verified.";
            break;
        case Windows.Security.Credentials.UI.UserConsentVerificationResult.DeviceBusy:
            returnMessage = "Authentication device is busy.";
            break;
        case Windows.Security.Credentials.UI.UserConsentVerificationResult.DeviceNotPresent:
            returnMessage = "No authentication device found.";
            break;
        case Windows.Security.Credentials.UI.UserConsentVerificationResult.DisabledByPolicy:
            returnMessage = "Authentication device verification is disabled by policy.";
            break;
        case Windows.Security.Credentials.UI.UserConsentVerificationResult.NotConfiguredForUser:
            returnMessage = "Please go to Account Settings to set up PIN or other advanced authentication.";
            break;
        case Windows.Security.Credentials.UI.UserConsentVerificationResult.RetriesExhausted:
            returnMessage = "There have been too many failed attempts. Device authentication canceled.";
            break;
        case Windows.Security.Credentials.UI.UserConsentVerificationResult.Canceled:
            returnMessage = "Device authentication canceled.";
            break;
        default:
            returnMessage = "Authentication device is currently unavailable.";
            break;
    }
    return returnMessage;
}

Applies to

See also