FaceSessionClient.CreateLivenessWithVerifySessionAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Create a new liveness session with verify. Provide the verify image during session creation.
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.AI.Vision.Face.CreateLivenessWithVerifySessionResult>> CreateLivenessWithVerifySessionAsync (Azure.AI.Vision.Face.CreateLivenessSessionContent createLivenessSessionContent, System.IO.Stream verifyImage, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateLivenessWithVerifySessionAsync : Azure.AI.Vision.Face.CreateLivenessSessionContent * System.IO.Stream * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.AI.Vision.Face.CreateLivenessWithVerifySessionResult>>
override this.CreateLivenessWithVerifySessionAsync : Azure.AI.Vision.Face.CreateLivenessSessionContent * System.IO.Stream * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.AI.Vision.Face.CreateLivenessWithVerifySessionResult>>
Public Overridable Function CreateLivenessWithVerifySessionAsync (createLivenessSessionContent As CreateLivenessSessionContent, verifyImage As Stream, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of CreateLivenessWithVerifySessionResult))
Parameters
- createLivenessSessionContent
- CreateLivenessSessionContent
Parameters for liveness with verify session creation.
- verifyImage
- Stream
Image binary data for verify image, can be provided as session creation time or during the /detectLivenessWithVerify/singleModal
- cancellationToken
- CancellationToken
The cancellation token to use.
Returns
Exceptions
createLivenessSessionContent
is null.
Remarks
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... > * * Ability to call /detectLivenessWithVerify/singleModal for up to 3 retries. * 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.
Recommended Option: VerifyImage is provided during session creation. Alternative Option: Client device submits VerifyImage during the /detectLivenessWithVerify/singleModal call. > [!NOTE] > Extra measures should be taken to validate that the client is sending the expected VerifyImage.
Applies to
Azure SDK for .NET