lr_azure_ad_client_get_token

Fetches a bearer type token from the Azure API Service.

C Language

int lr_azure_ad_client_get_token("param1=value1","param2=value2",LAST);

Arguments

NameComments
ResultParamNameName of the parameter which is used to save the token.
TenantIDThe Azure Active Directory tenant ID.
ClientIDThe ID of the application (client) registered in the Azure Active Directory.
ClientSecretThe secret to connect to on this client.

Return Values

C Language: Returns 0 on success, or 1 for an error.

Parameterization

All string input arguments can be passed using standard parameterization.

Example

Copy code
Action ()
{
    int   rc;
    rc = lr_azure_set_service_port(16888);

    rc = lr_azure_ad_client_get_token("ResultParamName=token1",
                                       "TenantID=xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx",
                                       "ClientID=xxxxxxx-xxxx-xxxx-xxxxx-xxxxxxxxxx",
                                       "ClientSecret=xxxxxxxxxxxxxxxx", LAST);
    

        lr_output_message("token value is %s",lr_eval_string("{token1}"));

    rc = lr_azure_kv_get_secret("ResultParamName=secret1",
                                 "VaultURL=https://xxxxkeyvtest.vault.azure.net",
                                 "SecretName=ProductSecret",
                                 "Token={token1}", LAST);
    
       lr_output_message("secret1 value is %s",lr_eval_string("{secret1}"));

}