Understanding the Same-Origin Policy and CORS
Cross-origin resource sharing (CORS) is a way to let your users successfully access live data in an SAP Analytics Cloud page from their Web browser.
The same-origin policy is an important concept in the Web application security model. Under the policy, a Web browser permits scripts contained in a first web page to access data in a second web page, but only if both Web pages have the same origin. It is a critical security mechanism for isolating potentially malicious documents. This raises an issue, since your users are trying to access live data from a different origin (domain) than SAP Analytics Cloud!
In a live connection, your browser has to access both SAP Analytics Cloud for metadata and backend data sources (SAP HANA, SAP BW, S4/HANA or SAP Universe).
Cross-origin resource sharing (CORS) is a mechanism that allows restricted resources on a Web page to be requested from another domain outside the domain from which the first resource was served. A Web page may freely embed cross-origin Web pages, images, stylesheets, scripts, iframes, and videos.
Benefits of CORS
SAP recommends a configuration using CORS for these reasons:
-
You will have direct connectivity with no additional devices required. Your browser directly connects SAP Analytics Cloud, your IdP, and backend data sources by securely unlocking the same-origin policy.
-
Because there are no additional devices, a direct connection enables better performance.
-
This configuration is easy to set up.
Network and Security Settings
-
In this configuration, when your browser is in a public domain, the on-premise data source's server address has to be allowlisted, and inbound access has to be authorized.
-
Outbound access from your domain to SAP Analytics Cloud and SAP Cloud Identity have to be opened.
Prerequisites and Limitations
-
Your users' browser needs some settings allowed:
-
Allow pop-up windows from your SAP Analytics Cloud domain. For example: [*.]sapanalytics.cloud, [*.]hanacloudservices.cloud.sap, [*.]hcs.cloud.sap, or [*.]analytics.sapcloud.cn
-
Allow third-party cookies from the SAP HANA server's domain.
-
-
CORS does not work in a mixed HTTPS/HTTP scenario. The SSL server certificate of the SAP HANA XS system must be a valid one that is trusted by your organization's Web browsers, and it must match the SAP HANA system's fully qualified domain name.
-
SAP HANA: CORS has to be enabled in the SAP HANA database.