Skip to main content
Solved

Any solution to CORS issue with Projection?

  • Nov 15, 2021 8:00 PM UTC
  • 4 replies
  • 361 views

khajeewak
Sidekick (Partner)
Forum|alt.badge.img+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

Best answer by ngCorey

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?

View original
This topic has been closed for replies.

4 replies

Manoj Ruwanhewa
Superhero (Partner)
Forum|alt.badge.img+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


Forum|alt.badge.img+3
  • Do Gooder (Customer)
  • Answer
  • Nov 16, 2021 2:15 PM UTC

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?


Manoj Ruwanhewa
Superhero (Partner)
Forum|alt.badge.img+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

khajeewak
Sidekick (Partner)
Forum|alt.badge.img+3
  • Author
  • Sidekick (Partner)
  • Feb 18, 2022 2:27 PM UTC

Thank you @Manoj Ruwanhewa  @ngCorey