Forum - Getting around the “Same Origin Policy” browser restriction to use Aleph REST API

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #33929
    Anonymous
    Inactive

    Hi Aleph People

    Have any of you encountered the problem of trying to make an AJAX call to the Aleph API but you are blocked by be the Same Origin Policy of the browser?

    We have our Aleph API running on an alternate port and it answers calls well and delivers XML responses as expected. But the browser can’t retrieve them.

    We would like to work around this restriction by implementing CORS (Cross-Origin Resource Sharing) but how can we configure the JBOSS web server to include the proper HTTP header?

    Ref:
    Enabling CORS on various web servers http://enable-cors.org/server.html
    Same Origin Policy http://en.wikipedia.org/wiki/Same-origin_policy
    CORS http://en.wikipedia.org/wiki/Cross-Origin_Resource_Sharing
    example Header we want to add: Access-Control-Allow-Origin http://catalog.university.edu:1891

    TIA

    #35289
    Anonymous
    Inactive

    We were not able to enable CORS. We have come up with an alternative method of using the Aleph API which involves using PHP to make the API call rather than making the API call directly from the browser with Javascript.

    #35995
    Anonymous
    Inactive

    A bit late but … have you tried in javascript: fetch(url, {mode: ‘no-cors’})?

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.