Create a new liveness session with verify. Provide the verify image during session creation.

Changed on

A session is best for client device scenarios where developers want to authorize a client device to perform only a liveness detection without granting full access to their resource. Created sessions have a limited life span and only authorize clients to perform the desired action before access is expired.

Permissions includes...

    • A token lifetime of 10 minutes.

[!NOTE]

    • Client access can be revoked by deleting the session using the Delete Liveness With Verify Session operation.
    • To retrieve a result, use the Get Liveness With Verify Session.
    • To audit the individual requests that a client has made to your resource, use the List Liveness With Verify Session Audit Entries.
post/detectLivenessWithVerify-sessions

Request

  • Base URL
    {endpoint}/face/{apiVersion}
  • Auth
    • API key in header Ocp-Apim-Subscription-Key
    • or OAuth 2
      Authorization codehttps://api.example.com/oauth2/authorize
      Token URLhttps://api.example.com/oauth2/token
      Scopeshttps://cognitiveservices.azure.com/.default

Request body multipart/form-data

livenessOperationMode'Passive' | 'PassiveActive' required

Type of liveness mode the client should follow.

deviceCorrelationIdSetInClientboolean

Whether or not to allow client to set their own 'deviceCorrelationId' via the Vision SDK. Default is false, and 'deviceCorrelationId' must be set in this request body.

enableSessionImageboolean

Whether or not store the session image.

livenessModelVersion'2024-11-15'

The model version used for liveness classification. This is an optional parameter, and if this is not specified, then the latest supported model version will be chosen

returnVerifyImageHashboolean

Whether or not return the verify image hash.

verifyConfidenceThresholdnumber float
verifyImagestring binary required

The image stream for verify. Content-Disposition header field for this part must have filename.

deviceCorrelationIdstring

Unique Guid per each end-user device. This is to provide rate limiting and anti-hammering. If 'deviceCorrelationIdSetInClient' is true in this request, this 'deviceCorrelationId' must be null.

authTokenTimeToLiveInSecondsinteger

Seconds the session should last for. Range is 60 to 86400 seconds. Default value is 600.

numberOfClientAttemptsAllowedinteger

The number of times a client can attempt a liveness check using the same authToken. Default value is 1. Maximum value is 3.

Response

A successful call create a session for a client device and provide an authorization token for use by the client application for a limited purpose and time.

sessionIdstring required

The unique ID to reference this session.

authTokenstring required

Bearer token to provide authentication for the Vision SDK running on a client application. This Bearer token has limited permissions to perform only the required action and expires after the TTL time. It is also auditable.

status'NotStarted' | 'Running' | 'Succeeded' | 'Failed' | 'Canceled' required

Enum describing allowed operation states.

modelVersion'2024-11-15'

The model version used for liveness classification.

isAbuseMonitoringEnabledobject

Denotes if the abuse monitoring feature was enabled during this session.

expectedClientIpAddressstring

The expected IP address or CIDR block of the client that runs the liveness check.

Changes