0
votes

I'm using a the same destination on a number of apps, which are connecting fine.

Created a new app (using the same SAP WEB IDE template).

The Service is retrieved fine when selecting New/OData service from the project menu, proving my Destination credentials are fine.

Now, when I run the app. I'm getting a basic authentication window. Cancelling this means I can't connect to the metadata of the service and therefore can't retrieve any data.

https://webidetesting0837185-s0015641139trial.dispatcher.hanatrial.ondemand.com/SAPUI5-ABAP-SFI/sap/opu/odata/sap/ZSV_SURVEY_SRV/$metadata?sap-language=EN 401 (Unauthorized)

My username and password is not being accepted even though it's correct.

Any ideas?

3
Do you enter the name and password from the right account? (from a service) but not HCP.Andrii Naumovych

3 Answers

0
votes

If you User/Password is not accepted I think you missing some configuration in the backend, check the logs like ST22 or SLG1 for authorization issues. Also check if your destinations in Cloud Connector work properly.

To solve this in generell not using basic authentication, you need to work with SAP CP's destination service. Retrieving from onPremise or via AppToAppSSO as Type/Mode of the destination OR work with API Service on SAP CP. For first way change (destination service) reference in your SAPUI5 instead of relative paths in neo-app.json like this:

{
  "routes": [
    {
      "path": "/destinations/SFSF_ODATA_PROXY",
      "target": {
        "type": "destination",
        "name": "sap_hcmcloud_core_odata"
      },
      "description": "SFSF Proxy OData"
    }
  ],
   "cacheControl": [
    {
      "directive": "public",
      "maxAge": 0
    }
  ]
}
0
votes

Make sure you enter the credentials for your backend (and not for your CP account for example). You can also try and maintain the credentials in the destination itself by setting AuthenticationType as BasicAuthentication.

0
votes

I have already solved this issue with change Authentication as Basic Authentication