Skip to main content

Authentication

Generating API Access Token

In order to authenticate and be granted authorization to access the ADMA Solution Inference APIs, clients need to generate a JWT access token. Please consult the ADMA generate access token for complete documentation.

In order to generate the token, you will need the following parameters configured in your request.

ParameterDescription
Tenant IDTenant ID in Azure AD generated in the app registration for accessing ADMA APIs
Client IDThe application (service principal) ID of the application you registered for accessing ADMA APIs
Client SecretThe secret generated for the application you registered for accessing ADMA APIs.

Here is how you would configure the request to generate an access token:

  curl -X POST -H 'Content-Type: application/x-www-form-urlencoded' \
-d 'grant_type=client_credentials&client_id={CLIENT_ID}&resource=https://farmbeats.azure.net&client_secret={CLIENT_SECRET}' \
https://login.microsoftonline.com/{TENANT_ID}/oauth2/token

The response should look like:

{
"token_type": "Bearer",
"expires_in": "3599",
"ext_expires_in": "3599",
"expires_on": "1622530779",
"not_before": "1622526879",
"resource": "https://farmbeats.azure.net",
"access_token": "eyJ0eXAiOiJKV1QiLC......tpZCI6InZhcF9"
}