Nikhil
Nikhil

Reputation: 31

Error - Failed to add 'SAP-Connectivity-Authentication' header for on-premise connectivity

I am connecting an On-premise S/4 HANA with SAP Cloud Platform trial account. I am using SAP Cloud SDK to fetch all Business Partners from S/4 HANA.

  1. My Cloud Connector is set
  2. My Destination at Sub-Account level is set and can ping to my on-premise system
  3. My Service instances - XSUAA/Destination/Connectivity is set with the application

But I have the following error

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

The code which I am using is -

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

It seems AppRouter is the recommended for Authorization and Access and hence I tried implementing one- but my approuter shows - Not Found

Approuter App -Name - approuter-demo Below is the xs-app.json

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

The Manifest file is as below:

---
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

Kindly guide me. Thanks.

Upvotes: 3

Views: 1595

Answers (2)

Emdee
Emdee

Reputation: 1693

Reading your question again I can identify two issues:

  • This error message in your log:
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

It may be that this error message is actually superfluous and hence indicating a problem which is actually none. In your case this header is possibly not necessary and the SAP Cloud SDK should not try to add it. But in any case, this will not influence the actual connection, so this error message is at most confusing, but not harmful in the sense of altering functionality.

Still, I am asking you to add the stack trace of this exception to your question to be very sure here.

  • Your app router shows "Not Found":

Here I am missing more information. When does what exactly show "Not Found"? Is it that your browser cannot find your app router, or can your app router not find the target URL of the application?

Upvotes: 0

dotchuZ
dotchuZ

Reputation: 2651

Your destination type might be wrong. The authorization header is set via the destination. Try other types in sap cp -> connectivity.

Upvotes: 0

Related Questions