【发布时间】:2021-05-22 20:26:19
【问题描述】:
我目前正在开发一个 Hololens 应用程序,该应用程序应该适用于 Hololens 1st gen 和 2。 我们的安全要求之一是在应用加载之前请求用户同意(使用 windows hello)。
我已经实现了与链接here 中描述的以下内容非常相似的方法。
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 第一代。虽然类描述说它支持所有类型的验证:
- 检查验证设备(例如 Microsoft Passport PIN、Windows Hello 生物识别或指纹读取器)和 执行验证。
【问题讨论】:
-
感谢您将此问题报告为在第一代 HoloLens 上调用 UserConsentVerifier.RequestVerificationAsync 时出现意外 0x8009002A 错误的失败。我们正在尝试与相应的团队取得联系,并稍后为您提供更新。谢谢!
标签: c# windows unity3d authentication hololens