Same-Origin Policy
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 webpage to access data in a second webpage, but only if both webpages have the same origin.
It's a critical security mechanism for isolating potentially malicious documents. This raises an issue, as your users are trying to access live data from a different origin (domain) than SAP Analytics Cloud.
CORS
Live connections from SAP Analytics Cloud to various on-premise data sources are created using direct connections with CORS.
SAP Analytics Cloud stores the metadata information required to generate queries for building stories.
Some examples of metadata information:
- Measure names
- Columns names
- Filter values
Basically, the metadata lets SAP Analytics Cloud rebuild the query. The actual data, not even the query results or part of the results, such as totals, are sent to SAP Analytics Cloud. Metadata is transferred to your browser and encrypted in memory. Throughout the whole process, the browser is actually interacting with direct live connection (CORS), which, in turn, sends out the requests to SAP Analytics Cloud or the remote data source, depending on the path of each request.

CORS Workflow
CORS is a mechanism that allows restricted resources on a webpage to be requested from another domain outside the domain from which the first resource was served. A webpage may freely embed cross-origin webpages, images, style sheets, scripts, iframes, and videos.
CORS is a way to let your users successfully access live data in an SAP Analytics Cloud page from their browser. In a live connection, the user's browser has to access both SAP Analytics Cloud, for metadata, and the on-premise data source. The results of those queries are returned to your browser, where visualizations are rendered. If your query was a list of profits per customer, for example, none of that information would actually return to or be stored in SAP Analytics Cloud.

Get/Resource: When a domain is requesting to interact with a resource on another domain, request headers are added from the first domain in order to use the cross-origin resource sharing feature.
These are the HTTP request headers that may be associated with the requesting domain:
- Origin
- Access-Control-Request-Method
- Access-Control-Request-Headers
Response: The domain from which resources are being requested can respond to the first domain with the following HTTP response headers based on what configuration options are set:
- Access-Control-Allow-Origin
- Access-Control-Allow-Credentials
- Access-Control-Expose-Headers
- Access-Control-Max-Age
- Access-Control-Allow-Methods
- Access-Control-Allow-Headers
Benefits of CORS
For live data connections to on-premise data sources, SAP recommends a configuration using CORS.
- You 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.
- There are no additional devices, a direct connection enables better performance.
Prerequisites and Limitations
Your users' browser needs some settings allowed:
- Allow third-party cookies from the data source server's domain.
- CORS does not work in a mixed HTTPS/HTTP scenario. The SSL server certificate of the data source must be a valid one that is trusted by your organization's web browsers, and it must match the data source system's fully qualified domain name.