Page 1 of 1

Cross Domain Requests Support?

PostPosted: Tue Feb 21, 2017 1:30 pm
by jwarren
Hi

We have a federated system working but I'm currently using frames for this and not the javascript method that we use for internal requests. This is a pain. So I'd like to start using CORS.

Was just after documentation or tips on using OMERO with cross origin/domain javascript requests both on the client side and the server side?

Does the javascript api support adding cors headers?
e.g. GET /cors HTTP/1.1
Origin: http://api.bob.com
Host: api.alice.com
Accept-Language: en-US
Connection: keep-alive
User-Agent: Mozilla/5.0...

I'm assuming server side header responses from the webgateway have to be set up the same way or similarly to any django web app?

Any pointers appreciated!

Thanks

Jonathan.

Re: Cross Domain Requests Support?

PostPosted: Wed Feb 22, 2017 10:09 am
by atarkowska
Hi,

Some of OMERO.web views are decorated with JSONP so you don't need to worry about CORS, see the example doc of how to embed image viewer into your website https://www.openmicroscopy.org/site/sup ... wPort.html and JSfiddle https://jsfiddle.net/aleksandratarkowska/25hyc85x/. Although that is only limited to the following read-only urls http://downloads.openmicroscopy.org/ome ... teway.urls

If you are planning to list the data like it is exposed in OMERO.webclient you have to enable CORS Headers, for example like https://github.com/crs4/ome_seadragon/wiki/Enable-Django-CORS-(Cross-Origin-Resource-Sharing)-Headers-configuration.

Hope that helps

Ola