Unable to send requests from other platform due to CORS

Problem:
Unable to send requests via Chrome due to CORS.

Expected outcome:
The ability to add a domain to the trusted CORS list.

Foreman and Proxy versions:
1.24.2

Foreman and Proxy plugin versions:
Katello 3.14.1

Distribution and version:

Other relevant data:
We’re developing a React app for an enhanced UI that interacts with Foreman/Katello Content Views. When trying to send requests to Foreman, they’re blocked by CORS.
I added the below to /etc/foreman/settings.yaml and restarted the entire server without success.
:cors_domains:
- https://localhost

I’d recommend using --foreman-cors-domains https://example.com.

Thanks for the response! Could you clarify where we should run this?

We’re all new to Foreman and aren’t very familiar with it yet.

@uml-cs that would be foreman-installer --foreman-cors-domains https://example.com as the sudo user on your Foreman server.

1 Like

Thanks @iballou and @ekohl!

For anyone else looking at this, I also had to specify the port I was running on. The exact command was foreman-installer --foreman-cors-domains http://localhost:3000.

2 Likes