简体   繁体   English

Azure 逻辑应用程序 - Http 连接器省略自定义响应标头

[英]Azure Logic Apps - Http connector omits custom response headers

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.我们有第三方 rest api,它返回一些自定义信息作为响应标头的一部分,我们从 azure 逻辑应用程序 http 连接器调用此 api。

We noticed that, logic app http connector omits the custom response headers.我们注意到,逻辑应用 http 连接器省略了自定义响应标头。

From postman it works fine and it returns "Authorization" custom header as shown in below screen shot, but logic app http connector removes it.从 postman 开始,它工作正常并返回“授权”自定义 header,如下图所示,但逻辑应用程序 http 连接器将其删除。

Please suggest if there is any solution for this.请建议是否有任何解决方案。

在此处输入图像描述

To add the http custom connector header in azure logic app http connector.在 azure 逻辑应用 http 连接器中添加 http 自定义连接器 header。

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.这将显示在 http 连接器代码视图中。
"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它看起来像下面的截图在此处输入图像描述

Refer the SO for further information.有关详细信息,请参阅SO

Also check the Custom Connector document on how to add custom connectors to logic apps.另请查看自定义连接器文档,了解如何将自定义连接器添加到逻辑应用。

Indeed, the Authorization header is removed from the response, no doubt because of some security considerations.实际上, Authorization header 已从响应中删除,这无疑是出于某些安全考虑。

I don't think you can get around this issue without introducing some proxy, eg我不认为你可以在不引入一些代理的情况下解决这个问题,例如

  • 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.逻辑应用程序向 Azure Function 发送请求,它将其重定向到您的第三方 REST API 并将其响应返回给逻辑应用程序,但使用不同的(不是Authorization )header 来保存来自第三方 8080653 的Authorization 808 的值回复。 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.如果您使用的是API Management (这非常昂贵),那么它可以很容易地在那里设置:创建一个 API(后端是您的第三方)并将其配置为使用自定义名称设置响应 header (但值取自Authorization标头),然后你就可以在你的逻辑应用程序中读取它。
  • etc.等等

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Azure 逻辑应用程序 - Oracle 连接器 - 执行查询 - Azure Logic Apps - Oracle Connector - Execute a query Azure ServiceNow 连接器的逻辑应用程序:用户未通过身份验证 - Azure Logic Apps to ServiceNow connector: User Not Authenticated 将一个 Http 请求的响应数据传递给 Azure 逻辑应用程序中的另一个 Http 请求 - Pass response data of one Http request to another Http request in Azure Logic Apps 在 Azure 逻辑应用(标准)中找不到自定义连接器 - Custom connector not found in Azure logic app(Standard) Azure 逻辑应用返回多重响应 - Azure logic apps to return multiple response Azure 逻辑应用程序:通过条件更改 HTTP 请求正文 - Azure Logic Apps: Change HTTP request body via condition Azure 逻辑应用程序:Unitill 循环使用响应 Header 值 - Azure Logic Apps : Unitill loop using Response Header Value 创建嵌套逻辑应用程序时,缺少逻辑应用程序标准工作流中的逻辑应用程序连接器操作 - Missing Logic Apps connector action from Logic Apps Standard Workflow when creating nested Logic apps Azure DFS 上的逻辑应用程序文件系统连接器 - Azure Logic App File System Connector on DFS 如何将 Postman HTTP POST 导入到 Azure Logic Apps HTTP 操作中? - How do I import a Postman HTTP POST into Azure Logic Apps HTTP action?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM