Solved

Anyone know how to get around the CORS issue with REST

  • 23 June 2021
  • 7 replies
  • 324 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

View original

This topic has been closed for comments

7 replies

Userlevel 3
Badge +8

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.

Userlevel 3
Badge +6

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?  

Userlevel 4
Badge +9

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

Badge +3

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

Badge +1

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

Badge +3

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