【问题标题】:Error - Failed to add 'SAP-Connectivity-Authentication' header for on-premise connectivity错误 - 无法为本地连接添加“SAP-Connectivity-Authentication”标头
【发布时间】:2020-01-02 15:19:23
【问题描述】:

我正在将本地 S/4 HANA 与 SAP Cloud Platform 试用帐户相关联。我正在使用 SAP Cloud SDK 从 S/4 HANA 获取所有业务合作伙伴。

  1. 我的云连接器已设置
  2. 我的子帐户级别的目的地已设置,并且可以 ping 到我的本地系统
  3. 我的服务实例 - XSUAA/Destination/Connectivity 已通过应用程序设置

但是我有以下错误

未能为本地连接添加“SAP-Connectivity-Authentication”标头:在请求的“授权”标头中找不到 JWT 承载。继续没有标题。可能无法连接到本地系统

我使用的代码是 -

 final List<BusinessPartner> businessPartners =
                    new DefaultBusinessPartnerService()
                            .getAllBusinessPartner()
                            .select(BusinessPartner.BUSINESS_PARTNER)
                            .execute(destination);

似乎 AppRouter 是推荐用于授权和访问,因此我尝试实现一个 - 但我的 approuter 显示 - Not Found

Approuter App -Name - approuter-demo 下面是 xs-app.json

{
  "routes": [
    {
      "source": "^/s4ext/(.*)",
      "target": "/s4ext/$1",
      "destination": "******"
    }
  ]
}

Manifest 文件如下:

---
applications:

- name: approuter-demo
  routes:
   - route: approuter-demo-*****trial.cfapps.eu10.hana.ondemand.com
  path: approuter
  memory: 128M
  env:
    TENANT_HOST_PATTERN: 'approuter-demo-(.*).cfapps.eu10.hana.ondemand.com'
    destinations: '[{"name":"******", "url" :"https://s4ext-***.cfapps.eu10.hana.ondemand.com", "forwardAuthToken": true }]'
  services:
    - xsuaa-demo
    - connectivity-demo
    - destination-demo

请指导我。谢谢。

【问题讨论】:

  • “我尝试实现一个”是什么意思?
  • 在哪里显示“未找到”?
  • 当我打开 approuter 应用程序时显示未找到。我希望 approuter 应该打开我的 Web 应用程序,因为我在 xs-app.json 中提到了目标 URL
  • 请告诉我们您正在使用哪个 SAP Cloud SDK 版本,并与我们分享您的异常的堆栈跟踪。

标签: sap-cloud-platform sap-cloud-sdk sap-cloud-foundry


【解决方案1】:

您的目的地类型可能有误。授权标头是通过目标设置的。 在 sap cp -> 连接中尝试其他类型。

【讨论】:

  • 我们不能使用其他类型。这是一个 HTTP 连接。请提出建议。
  • 我只能猜测。提供有关您的目的地的一些信息。授权的类型是要改变的。您的错误错误表明未提供安全令牌。唯一的配置可能性是目的地。否则,您需要手动提供授权标头。 Bearer 是一种连接到你读取数据的系统的安全机制,通常即使 ping 正常,目的地也只是配置不正确。
  • Description=TST destination Type=HTTP Authentication=BasicAuthentication WebIDEUsage=odata_abap,ui5_execute_abap,dev_abap Name=TST WebIDEEnabled=true URL=http\://XXXXX\:8001 ProxyType=OnPremise sap-client=100 User=XXXX WebIDESystem=TST
  • 目的地详情如上
  • 通过为您的数据源搜索正确的东西github.com/techpmsap/S4HC_Leonardo_PW2018/blob/master/Day1/…,使用另一种机制更改基本身份验证
【解决方案2】:

再次阅读您的问题,我可以确定两个问题:

  • 您的日志中出现此错误消息:
Failed to add 'SAP-Connectivity-Authentication' header for on-premise connectivity: no JWT bearer found in the 'Authorization' header of the request. Continuing without a header. Connecting to on-premise systems may not be possible

这个错误消息可能实际上是多余的,因此表明实际上没有问题。在您的情况下,此标头可能不是必需的,SAP Cloud SDK 不应尝试添加它。但无论如何,这不会影响实际的连接,所以这个错误信息最多是令人困惑的,但在改变功能的意义上是无害的。

不过,我还是要求您将此异常的堆栈跟踪添加到您的问题中,以便在此处非常确定。

  • 您的应用路由器显示“未找到”:

在这里我缺少更多信息。什么时候确切显示“未找到”?是您的浏览器找不到您的应用路由器,还是您的应用路由器找不到应用程序的目标URL?

【讨论】:

    猜你喜欢
    • 2021-04-26
    • 1970-01-01
    • 2011-10-03
    • 1970-01-01
    • 2015-11-01
    • 2019-08-27
    • 1970-01-01
    • 2010-09-29
    • 2020-06-05
    相关资源
    最近更新 更多