question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Local installation: access with proxy verbs/urls not working due to CORS

See original GitHub issue

As 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

  1. Running kubectl proxy in a terminal and
  2. 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

27-11-_2020_09-20-33

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
hubervcommented, Dec 1, 2020

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 using minikube and kubectl 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”.

2reactions
hubervcommented, Nov 27, 2020

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

3 Ways to Fix the CORS Error — and How the Access-Control ...
Fix one: install the Allow-Control-Allow-Origin plugin. The quickest fix you can make is to install the moesif CORS extension .
Read more >
cors-backdoor - GitHub Pages
This tool creates a local proxy server which handles CORS requests properly and provides a work around for accessing cross-origin resources without having ......
Read more >
Fixing CORS errors with Angular CLI proxy - Level Up Coding
Trying to access an API endpoint while building on localhost can be traumatizing, especially when this error “No 'Access-Control-Allow-Origin' ...
Read more >
How to Solve CORS using a Proxy Server and Koa
The Problem. Let's suppose you're building a Single-Page Application, and it's running fine in your local environment http://localhost:8000 .
Read more >
How to resolve CORS errors by using Angular Proxy?
When we integrate API's into our angular application on our local development environment then we face some CORS policy issues. Due to this ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found