Search code examples
azurexero-api

Xero Azure Connector: how to set up the pipeline to refresh the token


I have followed the answer provided by Pratik Lad to this question and now I am stuck in the step "GetBearerToken".

For the authorization header, I tried to create the value string using dynamic content:

@concat('Basic ', 'base64encode(', variables('Clientid'),' + ', variables('APISecret'),')')

However, I am getting invalid client as the error message.

Would anyone know how to fix it? I am retrieving both client id and client secret from Azure Vault.

Thanks


Solution

  • Xero Azure Connector: how to set up the pipeline to refresh the token

    The base64encode('Clientid':'APISecret') expression means it will need ('Clientid':'APISecret') value in base64 format.

    For authorization header you need to specify value like below:

    Basic @{base64(concat(variables('Clientid'), ':', variables('APISecret')))}
    

    So, it will concat and convert Clientid:APISecret to the base64 format.

    For more understanding refer this Document by Martin.