UserConsentVerificationResult 列挙型

定義

検証操作の結果について説明します。

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
継承
UserConsentVerificationResult
属性

Windows の要件

デバイス ファミリ
Windows 10 (10.0.10240.0 で導入)
API contract
Windows.Foundation.UniversalApiContract (v1.0 で導入)

フィールド

Canceled 6

検証操作が取り消されました。

DeviceBusy 4

生体認証検証ツール デバイスは操作を実行しており、使用できません。

DeviceNotPresent 1

利用できる生体認証検証ツール デバイスはありません。

DisabledByPolicy 3

グループ ポリシーで生体認証検証ツール デバイスが無効になっています。

NotConfiguredForUser 2

このユーザーに対して生体認証検証デバイスが構成されていません。

RetriesExhausted 5

10 回の試行後、元の検証要求と、同じ検証での後続のすべての試行は検証されませんでした。

Verified 0

指紋が検証されました。

次の例は、指紋認証を要求し、UserConsentVerificationResult 値に基づいて結果を記述するメッセージを返すメソッドを示しています。

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

    if (String.IsNullOrEmpty(userMessage))
    {
        userMessage = "Please provide fingerprint verification.";
    }

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

        switch (consentResult)
        {
            case Windows.Security.Credentials.UI.UserConsentVerificationResult.Verified:
                returnMessage = "Fingerprint verified.";
                break;
            case Windows.Security.Credentials.UI.UserConsentVerificationResult.DeviceBusy:
                returnMessage = "Biometric device is busy.";
                break;
            case Windows.Security.Credentials.UI.UserConsentVerificationResult.DeviceNotPresent:
                returnMessage = "No biometric device found.";
                break;
            case Windows.Security.Credentials.UI.UserConsentVerificationResult.DisabledByPolicy:
                returnMessage = "Biometric verification is disabled by policy.";
                break;
            case Windows.Security.Credentials.UI.UserConsentVerificationResult.NotConfiguredForUser:
                returnMessage = "The user has no fingerprints registered. Please add a fingerprint to the " +
                                "fingerprint database and try again.";
                break;
            case Windows.Security.Credentials.UI.UserConsentVerificationResult.RetriesExhausted:
                returnMessage = "There have been too many failed attempts. Fingerprint authentication canceled.";
                break;
            case Windows.Security.Credentials.UI.UserConsentVerificationResult.Canceled:
                returnMessage = "Fingerprint authentication canceled.";
                break;
            default:
                returnMessage = "Fingerprint authentication is currently unavailable.";
                break;
        }
    }
    catch (Exception ex)
    {
        returnMessage = "Fingerprint authentication failed: " + ex.ToString();
    }

    return returnMessage;
}

適用対象

こちらもご覧ください