Hello, I attempting to use the HTTP client destination to send data to a could platform which uses OAuth2 for authentication. I’ve appended the headers that should be sent to the API to receive the token.
"Password" grant REQUEST
Request URL: https://api.incontact.com/InContactAuthorizationServer/Token Request Method: POSTRequest Headers: POST /InContactAuthorizationServer/Token HTTP/1.1Host: api.incontact.comConnection: keep-aliveContent-Length: 98Origin: http://myapp.example.com Authorization: basic U3VwZXJXaWRnZXRAV2lkZ2V0c0luYy5jb206MTIzNDU2 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11 Content-Type: application/json; charset=UTF-8 Accept: application/json, text/javascript, */*; q=0.01 Referer: http://myapp.example.com/mainPage Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3Request Payload: { "grant_type" : "password", "username" : "myuser@mydomain.com", "password" : "myP@ssw0rd", "scope" : "" }
My question is, which options in the HTTP client sets the Authorization: basic header?
The SaaS provider requests that the parameter after Authorization: basic be encoded in Base64. I assume we would need to set authentication type to Basic and manually encode the data. However when I do so, and place it in the username field under credentials, the API returns "error":"invalid_request","error_description":"Unable to decode Authorization header. Can't find \"app-name@vendor-name\".","status_code":400. As an fyi the data that should be encoded is in the format app-name@vendorname:BU.
as an fyi, I have attached a PHP version of the token request if it would be helpful
thank you for your help in advance.