Wednesday, 31 January 2018

Establishing the Live HANA on-premise Connection from SAP Analytics Cloud using CORS

The HANA CORS (Cross Origin Resource Sharing) configuration is straight forward but as the old saying goes, a picture paints a thousand words.  Such a shame that the SAP documentation policy is does not allow screenshots.  I have therefore tried to capture the configuration steps here.

SAP Analytics Cloud Version 2018.1.0
SAP HANA Version 1.00.111 (SPS 11).

This new CORS setup is really as simple as 1, 2, 3.

1. Configure HANA HTTPS (SSL)
2. INA (Information Access)
3. CORS Configuration


1. Configure HANA HTTPS (SSL)


The Configuration of the SSL certificate is within the Web Dispatcher at

http://<WebServerHost>:80<SAPHANAinstance>/sap/hana/xs/wdisp/admin/

For me that is http://ivml2152.wdf.sap.corp:8024/sap/hana/xs/wdisp/admin/public/default.html

SAP HANA Tutorials and Materials, SAP HANA Certifications, SAP HANA Guides, SAP HANA Learning
Once completed you must be able to access XS classic via HTTPS, without any security pop-ups or certificate errors. Usually this is port 4300, if your SAP HANA instance number is 00, but 24 in my case, therefore port 4324.

SAP HANA Tutorials and Materials, SAP HANA Certifications, SAP HANA Guides, SAP HANA Learning

2. Information Access (INA)


Verify INA is installed and you have rights to access this service.

https://<hana-hostname>:43<SAPHANAinstance>/sap/bc/ina/service/v2/GetServerInfo

For me that is https://ivml2152.wdf.sap.corp:4324/sap/bc/ina/service/v2/GetServerInfo

SAP HANA Tutorials and Materials, SAP HANA Certifications, SAP HANA Guides, SAP HANA Learning

The response from INA is in JSON, using a JSON browser extension makes the response more readable.  If INA is not working for you should check the INA package is installed and your user has access to this package via the sap.bc.ina.service.v2.userRole::INA_USER role.

3. CORS Configuration


Login to your XS (classic) admin site, the URL would be something like

https://<hana-hostname>:43<SAPHANAinstance>/sap/hana/xs/admin/#/package/sap.bc.ina.service.v2

For me that becomes https://ivml2152.wdf.sap.corp:4324/sap/hana/xs/admin/#/package/sap.bc.ina.service.v2

Verify that Basic Authentication is allowed as below

SAP HANA Tutorials and Materials, SAP HANA Certifications, SAP HANA Guides, SAP HANA Learning
Configure CORS, with the Allowed Origins, Allowed Headers and Exposed Headers as specified below.

SAP HANA Tutorials and Materials, SAP HANA Certifications, SAP HANA Guides, SAP HANA Learning

# Allowed Headers
accept authorization content-type x-csrf-token x-request-with x-sap-cid

# Exposed Headers
x-csrf-token

SAP Analytics Cloud


With the CORS configuration now completed we can establish the Live Direct HANA connection within SAP Analytics Cloud.

SAP HANA Tutorials and Materials, SAP HANA Certifications, SAP HANA Guides, SAP HANA Learning