Handling the Same Origin Policy - tsgrp/HPI GitHub Wiki
This page is being moved to the alfresco documentation
Since HPI executes as a JavaScript application in the browser and communicates with OpenContent on the server, you must account for the Same-Origin Policy. There are two ways to handle this:
- Deploy
hpi.war
to the same Application Server that's running OpenContent. This ensures that HPI is sourced from the same server and port as OpenContent. Note - for this to work, the application server port must be accessible to the end user's browser. - Front all communication from HPI to OpenContent through a web server. For example, if HPI runs on server1 on port 9090 and OpenContent runs on server2 port 8080 (could be the same server or different server), you must make both HPI and OpenContent accessible from a single host and port. So:
server1
has an Apache server installed that:- Proxies requests to
server1/hpi
toserver1:9090/hpi
- Proxies requests to
server1/OpenContenet
toserver2:8080/OpenContent
- Proxies requests to
http://server1:9090/hpi
is accessible byhttp://server1/hpi
http://server2:8080/OpenContent
is accessible byhttp://server1/OpenContent