Solved

Any solution to CORS issue with Projection?

  • 15 November 2021
  • 4 replies
  • 267 views

Badge +3

We are getting CORS issue when sending a request from a web application client to IFS projection? is there any solution to get around this issue?

is there any way to change the response header from projection?

Thank you,

/Jeewan

icon

Best answer by ngCorey 16 November 2021, 15:15

View original

This topic has been closed for comments

4 replies

Badge +15

Hi @khajeewak ,

CORS is a browser security feature that restricts cross-origin HTTP requests that are initiated from scripts running in the browser. 

It might be a security issue when a browser directly calls IFS REST APIs

This can be solved by creating a new server based API that calls the IFS Rest API while both are in on the same server.

Moreover, you can create a new rule into the HTTP Response header: Access-Control-Allow-Origin *

Regards

Manoj

Badge +3

But what if you’re on localhost on your development computer and wish to run the projections from localhost?  They cannot be on the same machine.  Where would you drop the Access-Control-Allow-Origin * entry to allow access from all domains?  On the web server? On the middle ware server?

Badge +15

Hi @ngCorey ,

I didn't find a place to change the http header in the MWS configurations. 

But I think for localhost you can try below

For IIS6

  1. Open Internet Information Service (IIS) Manager
  2. Right click the site you want to enable CORS for and go to Properties
  3. Change to the HTTP Headers tab
  4. In the Custom HTTP headers section, click Add
  5. Enter Access-Control-Allow-Origin as the header name
  6. Enter * as the header value
  7. Click Ok twice
Badge +3

Thank you @Manoj Ruwanhewa  @ngCorey