How to set HTTP OAuth 2.0 Authorization with BASIC or NONE HTTP connection

Document created by Rabia_Sozkesen Employee on Jun 10, 2015Last modified by Adam Arrowsmith on Apr 18, 2016
Version 3Show Document
  • View in full screen mode
While it is recommended to use the HTTP Client Connector's native support for OAuth 2.0 authentication, it is possible to achieve the same outcome using two separate HTTP calls. This approach was more common prior to being supported natively within the connector.


Create the first HTTP client with Send action. If your HTTP Client Connection requires credentials to be entered set the Authentication Type as 'Basic'. If nothing is necessary, you can set the Authentication type as 'None'. The purpose of the initial call is to get the access token to be referenced in subsequent HTTP requests. For that reason, you should be making this call to a URL that will provide you the token. It can be something like "https://......./oauth-api/rest/v1/token". Set the HTTP Client Operation settings according to your needs, the response will look like below:


     "access_token": "eb1876f9f4da0c75259ac62eafce3051dac0c6f701c2bad3a92cd21ec55af2beaf7c977e02",
     "expires_in": "1800",
     "token_type": "Bearer"


Then create a second HTTP Client Operation. Add a Request Header named "Authorization" marked as a replacement variable. Configure the rest of the operation as necessary for your call.



Before the second HTTP connector shape, use a Set Properties shape to set a dynamic document property named "Authorization" to the value of the access_token profile element. Important: the dynamic document property name must match the HTTP operation's replacement variable name exactly to override the value.




3 people found this helpful