Class DatavalidFaceVerifier
- Namespace
- NuvTools.Security.Biometrics.Serpro
- Assembly
- NuvTools.Security.Biometrics.Serpro.dll
Verifies a captured face through SERPRO Datavalid, which compares it with the face on government record for the CPF. The credentials and the token never leave the server.
public sealed class DatavalidFaceVerifier : IFaceVerifier
- Inheritance
-
DatavalidFaceVerifier
- Implements
- Inherited Members
Constructors
DatavalidFaceVerifier(HttpClient, DatavalidAccessTokenProvider, IOptions<DatavalidOptions>, ILogger<DatavalidFaceVerifier>)
Verifies a captured face through SERPRO Datavalid, which compares it with the face on government record for the CPF. The credentials and the token never leave the server.
public DatavalidFaceVerifier(HttpClient httpClient, DatavalidAccessTokenProvider tokenProvider, IOptions<DatavalidOptions> options, ILogger<DatavalidFaceVerifier> logger)
Parameters
httpClientHttpClientClient used to call the validation endpoint.
tokenProviderDatavalidAccessTokenProviderSource of the gateway's access token.
optionsIOptions<DatavalidOptions>Datavalid configuration.
loggerILogger<DatavalidFaceVerifier>Logger for diagnostics.
Methods
VerifyAsync(FaceVerificationRequest, CancellationToken)
Compares the captured face with the one on record.
public Task<FaceVerification> VerifyAsync(FaceVerificationRequest request, CancellationToken cancellationToken = default)
Parameters
requestFaceVerificationRequestWhose face it should be, and the capture.
cancellationTokenCancellationTokenToken to cancel the operation.
Returns
- Task<FaceVerification>
The verification result. An invalid document, an unusable image or a communication failure yields Matched =
false(fail-closed).