簡體   English   中英

Hololens - UserConsentVerifier 不適用於 Hololens 第一代

[英]Hololens - UserConsentVerifier not working on Hololens 1st Generation

我目前正在開發一個 Hololens 應用程序,該應用程序應該適用於 Hololens 1st gen 和 2。我們的安全要求之一是在應用程序加載之前請求用戶同意(使用 windows hello)。

我已經實現了與此處鏈接中描述的以下內容非常相似的方法。

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;}

Everithin 在 Hololens 2 上運行良好,盡管在 Hololens 1 上沒有明確的原因我在這條線上得到以下異常:

var consentResult = await Windows.Security.Credentials.UI.UserConsentVerifier.RequestVerificationAsync(userMessage);

{“沒有更多數據可用。(HRESULT 異常:0x8009002A)”}

我想知道我是不是做錯了什么,或者這個 API 根本不支持第一代 Hololens。 雖然 class 描述說它支持所有類型的驗證:

  • 檢查驗證設備(例如 Microsoft Passport PIN、Windows Hello 生物識別或指紋讀取器)的可用性並執行驗證。

由於未實現的底層依賴性,UserConsentVerifier 將始終在 HoloLens(第一代)上返回 NTE_NO_MORE_ITEMS (0x8009002A)。 這在 HoloLens 2 上已修復。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM