Home > Software engineering >  Azure Logic Apps - Http connector omits custom response headers
Azure Logic Apps - Http connector omits custom response headers

Time:10-12

We have third party rest api which returns some custom information as part of response headers and we are calling this api from azure logic app http connector.

We noticed that, logic app http connector omits the custom response headers.

From postman it works fine and it returns "Authorization" custom header as shown in below screen shot, but logic app http connector removes it.

Please suggest if there is any solution for this.

enter image description here

CodePudding user response:

To add the http custom connector header in azure logic app http connector.

follow the bellow steps

  1. Open the logic app code and in place of actions add the below code. Which will be displayed in http connector code view.
"actions": {
"http": {
    "type": "Http",
    "inputs": {
        "method": "POST",
        "uri": "your URI",
        "headers": {
            "Content-Type": "application/json",
            "Authorization": "Basic *your base64 password*",
            "other header": "other value"
        }
    },
    "conditions": []
}
},

it looks like the below screenshot enter image description here

Refer the SO for further information.

Also check the Custom Connector document on how to add custom connectors to logic apps.

CodePudding user response:

Indeed, the Authorization header is removed from the response, no doubt because of some security considerations.

I don't think you can get around this issue without introducing some proxy, e.g.

  • The Logic App sends a request to an Azure Function, which redirects it to your third party REST API and returns its response to the Logic App, but using a different (not Authorization) header to hold the value from the Authorization header of the third party response. It's all a bit silly.
  • If you are using an API Management (which is quite expensive) then it could be easily set up there: create an API (back-end is your third party) and configure it to set a response header with a custom name (but the value taken from the Authorization header), which you would then be able to read in your Logic App.
  • etc.
  • Related