UserConsentVerifier class

Applies to Windows only

Checks for availability of a biometric (fingerprint) verifier device and performs a biometric verification.

Syntax


var userConsentVerifier = Windows.Security.Credentials.UI.UserConsentVerifier;

Attributes

[MarshalingBehavior(Agile)]
[Threading(Both)]
[Version(0x06030000)]

Members

The UserConsentVerifier class has these types of members:

Methods

The UserConsentVerifier class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.

MethodDescription
CheckAvailabilityAsync Checks to see whether a biometric (fingerprint) verifier device is available.
RequestVerificationAsync Performs a fingerprint (biometric) verification.

 

Remarks

You can use the UserConsentVerifier class to enhance the security of your app by including a request for fingerprint (biometric) verification whenever the user is required to consent to a particular action. For example, you can require fingerprint authentication before authorizing an in-app purchase, or access to restricted resources. You can use the UserConsentVerifier class to determine if fingerprint authentication is supported for the current computer using the CheckAvailabilityAsync method, and then request user consent from a fingerprint scan using the RequestVerificationAsync method.

The following example shows a method that requests fingerprint verification and returns a message that describes the result.


function requestConsent(userMessage) {
    if (!userMessage) {
        userMessage = "Please provide fingerprint verification.";
    }

    try {
        // Request the logged on user's consent via fingerprint swipe.
        Windows.Security.Credentials.UI.UserConsentVerifier.requestVerificationAsync(userMessage) 
        .then(
            function (consentResult) { 
                switch (consentResult) {
                    case Windows.Security.Credentials.UI.UserConsentVerificationResult.verified:
                        outputDiv.innerHTML = "<br/>Fingerprint verified.";
                        break;
                    case Windows.Security.Credentials.UI.UserConsentVerificationResult.deviceBusy:
                        outputDiv.innerHTML = "<br/>Biometric device is busy.";
                        break;
                    case Windows.Security.Credentials.UI.UserConsentVerificationResult.deviceNotPresent:
                        outputDiv.innerHTML = "<br/>No biometric device found.";
                        break;
                    case Windows.Security.Credentials.UI.UserConsentVerificationResult.disabledByPolicy:
                        outputDiv.innerHTML = "<br/>Biometric verification is disabled by policy.";
                        break;
                    case Windows.Security.Credentials.UI.UserConsentVerificationResult.notConfiguredForUser:
                        outputDiv.innerHTML = "<br/>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:
                        outputDiv.innerHTML = "<br/>There have been too many failed attempts. Fingerprint authentication canceled.";
                        break;
                    case Windows.Security.Credentials.UI.UserConsentVerificationResult.canceled:
                        outputDiv.innerHTML = "<br/>Fingerprint authentication canceled.";
                        break;
                    default:
                        outputDiv.innerHTML = "<br/>Fingerprint authentication is currently unavailable.";
                        break;
                }
            });
    }
    catch (ex) {
        outputDiv.innerHTML = "<br/>Fingerprint authentication failed: " + ex.toString();
    }
}


Requirements

Minimum supported client

Windows 8.1 [Windows Store apps only]

Minimum supported server

Windows Server 2012 R2 [Windows Store apps only]

Minimum supported phone

None supported

Namespace

Windows.Security.Credentials.UI
Windows::Security::Credentials::UI [C++]

Metadata

Windows.winmd

See also

Fingerprint (biometric) authentication
UserConsentVerifier sample
Windows.Security.Credentials.UI
Authentication and User Identity

 

 

Show:
© 2014 Microsoft