Skip to main content
Solved

CORS error when calling IFS APIs via imported OpenAPI spec in .NET Web API


Forum|alt.badge.img+1

I imported an OpenAPI spec from IFS API Explorer into my .NET Web API project to expose the IFS APIs through Swagger UI.

When I try to call the APIs from Swagger, I get a CORS error in the browser.

Is there a way to enable CORS in the IFS environment so that these API calls can work from a browser? or another alternative approch to use swagger ui to call REST endpoints?

Best answer by dsj

Hi ​@dileepam 

 

One alternative is to setup a proxy API which would expose to your app instead of directly calling the IFS projections. Having proper API setup will benefit you in the future when expanding the integration with best practices so it adds may benefits in addition to resolving CORS errors :)

Refer this forum thread for more details on this:

Handling Cross-Origin Resource Sharing (CORS) using an API Manager in integrations | IFS Community

 

Cheers!

Damith

View original

dsj
Ultimate Hero (Partner)
Forum|alt.badge.img+22
  • Ultimate Hero (Partner)
  • May 20, 2025

Hi ​@dileepam 

 

One alternative is to setup a proxy API which would expose to your app instead of directly calling the IFS projections. Having proper API setup will benefit you in the future when expanding the integration with best practices so it adds may benefits in addition to resolving CORS errors :)

Refer this forum thread for more details on this:

Handling Cross-Origin Resource Sharing (CORS) using an API Manager in integrations | IFS Community

 

Cheers!

Damith


Forum|alt.badge.img+1
  • Do Gooder (Partner)
  • May 27, 2025

@dsj  Thank you very much for the answer! I tried setting up a proxy API as suggested, and it worked. Appreciate the guidance!


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings