Skip to main content
Solved

Anyone know how to get around the CORS issue with REST

  • Jun 23, 2021 1:36 PM UTC
  • 7 replies
  • 439 views

Forum|alt.badge.img+1

Hello:We deployed a REST based IFS web service and when we test an app against the web server we are getting CORS errors. I can run Chrome --disable-web-security to get around it in testing but we need our users to use it on their browsers.CORS-Cross Origin Resource Sharing.

Best answer by luca.puccini

I have just solved it!

You have to insert a new rule into the HTTP Response header: Access-Control-Allow-Origin *. Please note that, instead of using the * that means everyone, you can specify a list of knowed url.

View original
This topic has been closed for replies.

7 replies

Forum|alt.badge.img+1
  • Author
  • Do Gooder
  • Jun 23, 2021 2:20 PM UTC

I think we solved it on our own. It’s not really an IFS question.


Forum|alt.badge.img+9
  • Sidekick (Partner)
  • Jul 11, 2021 3:43 AM UTC

I think we solved it on our own. It’s not really an IFS question.

Hi @julfeng 

I’m interested to know how you solved it, as I am facing a similar issue when trying to access an IFS web service.

Thanks
Miraj


Forum|alt.badge.img+8
  • Do Gooder (Customer)
  • Answer
  • Jul 12, 2021 11:50 AM UTC

I have just solved it!

You have to insert a new rule into the HTTP Response header: Access-Control-Allow-Origin *. Please note that, instead of using the * that means everyone, you can specify a list of knowed url.


Forum|alt.badge.img+1
  • Author
  • Do Gooder
  • Jul 19, 2021 5:44 PM UTC

Sorry I got back so late, been busy. I agree with Luca’s response also you can create a server based API that calls the IFS Rest, instead of the client going directly to the IFS REST call, that’s what we ended up doing. It’s a security issue when a browser directly calls a REST API from IFS I believe. In short, If you create your own API on the same server that calls the IFS API it will also solve the problem.


Forum|alt.badge.img+6
  • Do Gooder (Customer)
  • Nov 8, 2021 10:53 PM UTC

I’m not following what I need to do.  Is the Response Header in an XML file somewhere or is it accessible from the IFS Middleware Console?  If so where?  


Forum|alt.badge.img+3
  • Do Gooder (Customer)
  • Nov 9, 2021 3:00 PM UTC

I’m in the same boat.  I need to know where to put this information to pass along to the server team.


khajeewak
Sidekick (Partner)
Forum|alt.badge.img+3
  • Sidekick (Partner)
  • Nov 15, 2021 6:30 PM UTC

I am also having the same issue, We couldnt get this ‘ Access-Control-Allow-Origin * ‘ worked? did this’ Access-Control-Allow-Origin *  work for anyone?

/Jeewan