Information Classification: External Restricted.
See https://www.chili-publish.com/security
JavaScript Security Considerations
Embedding the CHILI Editor and communicating using JavaScript is a trivial thing to set up.
However, when the embedded editor is loaded from a different domain (or even sub-domain), there are security limitations to what the browsers will allow. This is due to same-origin policy, which blocks JavaScript between <iframe>
 and the window
 unless they have the same origin.
You can solve all these problems by utilizing the PublisherConnector library. Please see:
Â
Warning
CHILI publisher Online does not support REST API calls from client browser to your environment. Typically, this is called an AJAX request. Trying to do this from the client browser will cause a cross-origin resource sharing preflight request. If the origin is not the same, the request will fail, and so will your AJAX request.
This means all REST API calls must be routed from the client server to a backend system and then to CHILI.
There are security reasons why this behavior is not currently supported.
Â
There are three possibilities:
1: The portal and CHILI are hosted on the same full domain (as different sub-applications/folders)
For example:
portal =Â http://www.my-web-shop.com/PORTAL
CHILI =Â Â http://www.my-web-shop.com/CHILI
Solution:
In this case, there is no issue at all. However, this is not possible with CHILI publish Online without having a reverse proxy. We do not officially support reverse proxies.
2. The portal and CHILI are hosted on the same main domain, but different sub-domains
For example:
portal = http://portal.my-web-shop.com/
CHILI =Â http://chili.my-web-shop.com/
Solution:
In this case, you should use PublisherConnector.
3. The portal and CHILI are hosted on completely different domains
For example:
portal = http://www.my-web-shop.com/
Solution:
In this case, you should use PublisherConnector.
Â
Summary
For the situations listed above, you should use the PublisherConnector library. This library uses postMessage()
to allow communication between the window
and the <iframe>
. However, below we list two historical solutions. Keep in mind that these solutions are not officially supported.
Working on different sub-domains
URL Forwarding
All information on this page must be treated as External Restricted, or more strict. https://www.chili-publish.com/security