Solved

Anyone know how to get around the CORS issue with REST

  • 23 June 2021
  • 4 replies
  • 43 views

Badge +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.

icon

Best answer by luca.puccini 12 July 2021, 13:50

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

4 replies

Badge +1

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

Userlevel 3
Badge +4

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

Userlevel 1
Badge +2

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.

Badge +1

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.

Reply