2017-05-03 4 views
0

私たちは、ログインに電子メール+パスワードを使用するアプリを持っています。快適性のために、4桁のPINコードロジックを実装しました。このロジックはすべて自己作成であり、内蔵されたMicrosoftの機能は使用していません。UWPおよびWindowsストア8.1生体認証

1台のデバイスで多くのユーザーがいる可能性があります。私たちはバイオメトリック認証の可能性も実装したいと考えています。

私は情報を探せば、すべての生体認証オプションはMicrosoftアカウントに基づいているようです。

私のようなものを想像した:

var hash = GetBiometricHash(); 
// reuqest user to make biometric authorization and the hash we could store on our servers. 

は、そのような可能性があるのか​​、私たちは、Microsoftが使用をアカウントに統合する必要がありますか?

答えて

0

fingerprint biometricsをユニバーサルWindowsプラットフォーム(UWP)アプリケーションに追加するには、次のコードを使用します。ユーザーが特定の操作に同意する必要があるときに指紋認証要求を含めると、アプリのセキュリティが向上します。しかし、あなたの指紋情報がない別のデバイスに変更した場合。アプリケーションはあなたの指紋を認証することができません。現在、自分のWebサービスにあなたの指紋情報を保存するためのAPIはありません。したがって、Microsoft accountsの使用方法を統合することができます。

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; 
} 
関連する問題