Skip to content

[BUG] Face liveness results not accessible after completing verification #47709

@mahdi-almousawi

Description

@mahdi-almousawi

Library name and version

Azure.AI.Vision.Face 1.0.0-beta.2

Describe the bug

I'm using the Azure.AI.Vision.Face library to create Liveness with Verification Sessions, and everything works fine initially. But when I try to fetch the results for a completed liveness session, I'm getting the following exception:

The requested operation requires an element of type 'String', but the target element has type 'Number'.

This issue occurs only after performing the liveness and verification operation on the mobile SDK. For newly created sessions where results are not yet available, I can retrieve the results without any problems.

It seems that when results are available, additional data or formatting is coming from Azure that is not being handled correctly by the SDK.

Expected behavior

When fetching the results for a completed liveness session using the Azure.AI.Vision.Face library, the library should return the session's results in the expected format without throwing any exceptions.

Actual behavior

When I try to fetch the results for a completed liveness session, I'm getting the following error message from the SDK:

The requested operation requires an element of type 'String', but the target element has type 'Number'.

Please note that this issue occurs only after performing the liveness and verification operation on the mobile SDK. For newly created sessions where results are not yet available, I can retrieve the results without any problems.

Reproduction Steps

The following code creates a new Liveness with Verification session, this works without any issues:

var body = new CreateLivenessWithVerifySessionContent(LivenessOperationMode.Passive) {
      SendResultsToClient = false,
      DeviceCorrelationId = deviceId,
      AuthTokenTimeToLiveInSeconds = authTokenTimeToLiveInSeconds
};

var response = await faceSessionClient.CreateLivenessWithVerifySessionAsync(body, verifyImage);

The following code retrieves the results for the given sessionId, this only works for newly created sessions:

var response = await faceSessionClient.GetLivenessWithVerifySessionResultAsync(sessionId);

Environment

  • Azure.AI.Vision.Face 1.0.0-beta.2
  • JetBrains Rider 2024.2.1

Dotnet Info (running from Docker container)

Host:
  Version:      8.0.10
  Architecture: x64
  Commit:       81cabf2857
  RID:          linux-x64

.NET SDKs installed:
  No SDKs were found.

.NET runtimes installed:
  Microsoft.AspNetCore.App 8.0.10 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 8.0.10 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
  None

Environment variables:
  Not set

global.json file:
  Not found

Metadata

Metadata

Assignees

No one assigned

    Labels

    ClientThis issue is related to a non-management packageCognitive - FaceService AttentionWorkflow: This issue is responsible by Azure service team.customer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions