This guide provides step-by-step instructions to access Face Liveness SDK release artifacts from Azure.
- An Azure Subscription ID approved for Face Liveness Detection (complete the Face Recognition intake form).
- Azure account with Cognitive Services Contributor role for permissions:
- Microsoft.CognitivesServices/accounts/listKeys/action
- Microsoft.CognitiveServices/accounts/regenerateKey/action
Two endpoints are available for token queries and regeneration:
- Token Query Endpoint (GET):
https://face-sdk-gating-helper.azurewebsites.net/sdk/subscriptions/{subscriptionId}/tokens?id={tokenId}
- Token Regeneration Endpoint (POST):
https://face-sdk-gating-helper.azurewebsites.net/sdk/subscriptions/{subscriptionId}/tokens?id={tokenId}
Parameters:
- subscriptionId: Azure Subscription ID that has been registered for Face API Limited Access.
- tokenId: Optionally needed for the GET endpoint. An integer (0 or 1) for primary or secondary tokens. This allows you to generate primary and secondary keys that can be used while rotating secrets in build-automations.
Note: The GET endpoint lists all tokens if tokenId
isn't specified. Use POST to generate tokens if none exist.
Install Azure Command-Line Interface (CLI) as per the documentation here.
-
Open your command-line tool (e.g., Bash in Linux/MacOS, PowerShell in Windows).
-
Run the following commands:
For Linux/MacOS:
bearerToken=$(az account get-access-token -o tsv | cut -f1) curl -X GET --header "Authorization: Bearer $bearerToken" "https://face-sdk-gating-helper.azurewebsites.net/sdk/subscriptions/{subscriptionId}/tokens?id={tokenId}"
For Windows:
$bearerToken = $(az account get-access-token -o tsv).split()[0]; Invoke-WebRequest -Uri "https://face-sdk-gating-helper.azurewebsites.net/sdk/subscriptions/{subscriptionId}/tokens?id={tokenId}" -Method GET -Headers @{"Authorization"="Bearer $bearerToken"}
-
Use the same command-line tool as above.
-
Execute the following commands:
For Linux/MacOS:
bearerToken=$(az account get-access-token -o tsv | cut -f1) curl -X POST --header "Authorization: Bearer $bearerToken" "https://face-sdk-gating-helper.azurewebsites.net/sdk/subscriptions/{subscriptionId}/tokens?id={tokenId}"
For Windows:
$bearerToken = $(az account get-access-token -o tsv).split()[0]; Invoke-RestMethod -Uri "https://face-sdk-gating-helper.azurewebsites.net/sdk/subscriptions/{subscriptionId}/tokens?id={tokenId}" -Method POST -Headers @{"Authorization"="Bearer $bearerToken"}