3

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.

PlusInfosys
  • 3,416
  • 1
  • 19
  • 33
Nikhil
  • 31
  • 2
  • What do you mean by „I tried implementing one“? – Emdee Dec 24 '19 at 10:22
  • And where does what show „not found“? – Emdee Dec 24 '19 at 10:24
  • Not Found is shown when I open the approuter application. I expect the approuter should open my web application since I have mentioned target URL in the xs-app.json – Nikhil Dec 24 '19 at 12:53
  • Kindly tell us which SAP Cloud SDK version you're using and share us the stack trace of your exception. – Emdee Dec 30 '19 at 07:51

2 Answers2

0

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

dotchuZ
  • 2,621
  • 11
  • 39
  • 65
  • we cannot use another type. it is an HTTP connectivity. Kindly suggest. – Nikhil Dec 24 '19 at 13:58
  • I can only guess. Provide some information on your destination. The type of authorisation was meant to be changed. Your error error says that a security token is not provided. The only configuration possibility is the destination. Otherwise you need to provide the authorization header manually. Bearer is a kind of security mechanism to connect to the system you read data, normally the destination is simply not configured correct even if the ping works. – dotchuZ Dec 24 '19 at 15:39
  • `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` – Nikhil Dec 24 '19 at 17:20
  • The destination details are as above – Nikhil Dec 24 '19 at 17:21
  • Change basic auth with another mechanism by searching the right thing for your data source https://github.com/techpmsap/S4HC_Leonardo_PW2018/blob/master/Day1/Exercise_18/Exercise_18.md – dotchuZ Dec 24 '19 at 20:08
  • I would say OAuth is the right, this is using bearer authentication – dotchuZ Dec 25 '19 at 07:19
  • Great comment Emdee – dotchuZ Dec 30 '19 at 12:01
  • Right, that was not precise. I mean the chosen destination type is not causing the error message mentioned in the question above. – Emdee Dec 30 '19 at 15:19
0

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?

Emdee
  • 1,689
  • 5
  • 22
  • 35