Local installation: access with proxy verbs/urls not working due to CORS
See original GitHub issueAs a developer, I want to set up OIH locally, using Minikube on Docker for Desktop (under Windows), to get started swiftly.
When working through the instructions for setting up the OIH in the getting started guide at
https://openintegrationhub.github.io/docs/Getting Started/LocalInstallationGuide.html
I get stuck at the step “Host Rules Setup”: Should all hostnames really point to one and the same IP address? That seems unlikely, although I’m by no means a K8s expert.
I tried to get the admin token by
- Running
kubectl proxy
in a terminal and - Using the URL http://localhost:8001/api/v1/namespaces/oih-dev-ns/services/iam/proxy/login in Postman
However, I get a 500 with response
{
"message": "Not allowed by CORS"
}
Refer to the attached screenshot.
It’s quite likely I just got something wrong… could you please advise on how exactly to invoke the OIH apis in the local minikube setup w/o tinkering around with the HOSTS file?
Any help is highly appreciated!
Thanks and kind regards, Valentin
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (4 by maintainers)
Top GitHub Comments
Hi @weberjm,
Thanks again for the extensive explanations! I had a look at the docs in the dev-tools folder, there are several caveats mentioned when trying to get OIH up and running locally on Windows…
I disabled the Kubernetes embedded in my Docker-Desktop installation and succeeded in running
wsl bash oih\dev-tools\minikube\setup.sh
(effectively usingminikube
andkubectl
from within wsl2) in my wsl2 default distro (a Ubuntu 16.04).Like others I stumbled on the issue of e.g. opening the K8s dashboard (see https://github.com/kubernetes/minikube/issues/5392) or any other URL from Windows… which does not work for some strange reason. However, using a browser from within wsl2 in conjunction with a Windows X-Server (like VcXsrv) does the trick. That setup enables me to follow the instructions for running OIH the “Minikube way”.
Summary: Using
kubectl proxy
works (on my machine 😃) if you use 127.0.0.1 as hostname, since this is contained in the whitelist out of the box