azure authentication via 'HTTP Client POST' operation.

I'm trying to authenticate against the azure endpoint using the http client post operation but I'm unable to get it working correctly.

The request looks like this

URL :${subscriptionid}/oauth2/token

Header : Content-Type: application/x-www-form-urlencoded, Accept: application/json

Body: grant_type=client_credentials&client_id=${client_id}&client_secret=${client_secret}&resource=${audiences}

Works fine in postman and returns a json response but I recieve a html form response when performing it with the http cllient post action.

/Base [1.10.0]/Library/Operations/HTTP Client/v2.0/Http Client Post

What I get when using the OO Action is a form response


<form method="POST" name="hiddenform" action="*******************/oauth2/authorize">
<input type="hidden" name="grant_type" value="client_credentials" />
<input type="hidden" name="client_id" value="*****************************" />
<input type="hidden" name="client_secret" value="*********************" />
<input type="hidden" name="resource" value="****************************" />
<p>Script is disabled. Click Submit to continue</p>
<input type="submit" value="Submit" />
<script language="javascript">window.setTimeout('document.forms[0].submit()', 0);</script>


Any ideas on where I can go with this? I saw another person mention that they have to use a powershell rest invoke instead, but I'm doing this mainly to avoid using powershell.


edit : the cloud content pack has an auth operation but only supports username/password not applications for credentials.