I have a Microsoft Azure runbook which I am triggering using a webhook URL.
Using n8n’s HTTP Request node, I am able to make a POST request to the webhook, after which I receive a jobID in response.
I am supposed to be able to be able to GET the output of the previous request via the following URL
https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobID}/output?api-version=2019-06-01
but a subsequent HTTP Request node fails due to either “Authorization failed - please check your credentials” or “Authentication failed. The ‘Authorization’ header is missing.” when I use either Microsoft OAuth 2.0 or Microsoft Entra ID credentials for the request.
This indicates that the refresh token is invalid, even though the OAuth 2.0 credentials were used previously to invoke the first HTTP Request.
How can I capture the refresh token and add it as a “Authorization : Bearer ____________” token in the header?
Or if I am otherwise going about this all wrong, how can I achieve what I need to do? (A similar flow I’ve built works in Okta Workflows, but not n8n).
My workflow is as follows:
- n8n version: 1.5.1
- Running via: Docker Compose
- Operating system: Ubuntu Server