Skip to content

Latest commit

 

History

History

optional-self-hosted-backend

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Getting Started

This is an example of how to consume a CAP service with authentication from on SAP Fiori app.

The managed-html5-runtime-fiori-launchpad-mta sample consumes the Northwind odata.org service, this is a public service without any kind of authentication.

This project mocks the Northwind service, the service is exposed as a CAP service with required authentication. Deploy of this package override the URL of the original Northwind destination with the URL of the mockup service and set the property HTML5.ForwardAuthToken necessary to forward the authentication user from the SAP Fiori app to the CAP service. This property is documented at Configure Destinations

The MTA file bind the CAP service to the xsuaa service already created by the managed-html5-runtime-fiori-mta package.

Deployment

  1. Deploy the managed-html5-runtime-fiori-mta to you BTP subaccount as explained in the package documentation
  2. Add the entitlement hana hdi-shared to your subaccount if you haven't done so before
  3. Build the project:
    mbt build
    
  4. Deploy in the same subaccount/space of the managed-html5-runtime-fiori-mta package:
    cf deploy mta_archives/cap-service_1.0.0.mtar
    

Check the Result

Check the HTML5 App

To be sure to use the new mock service open an incognito browser window and then access the URL of the HTML5 App of the managed-html5-runtime-fiori-mta package, you should see the same data, however the product name of the first product will be Hello from CAP, this is the mark that the data are read from the CAP service.

image