Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oslc-browser gets CORS errors with the IBM jazz-apps #5

Open
jamsden opened this issue Mar 5, 2019 · 0 comments
Open

oslc-browser gets CORS errors with the IBM jazz-apps #5

jamsden opened this issue Mar 5, 2019 · 0 comments

Comments

@jamsden
Copy link

jamsden commented Mar 5, 2019

Getting a CORS error: When running the oslc-browser web app in a different container than the IBM jazz-apps, there will be a CORS error on GET of a IBM ELM resource.

It is possible to configure WebSphere Liberty or Tomcat to enable CORS. Configuring Cross Origin Resource Sharing on a Liberty server should be used for production

Work around: run oslc-browser using https and disable CORS checking in Chrome:

open -n -a Google\ Chrome --args --disable-web-security --user-data-dir
HTTPS=true npm start

Open any ELM resource in order to login and store the authentication tokens in the browser.

Need to configure the App.js to:

  1. support https, SSL, and prompt to accept the self assigned certificate (like the browser does.
  2. handle CORS challenge
  3. Add support for OpenIDConnect to that can be added as a friend to DNG.
  4. Or maybe try adding as a whitelist URL in DNG

https://example.com:9443/rm/rootservices: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed access. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

var myRequest = new Request('flowers.jpg');
var myMode = myRequest.mode; // returns "cors" by default
myRequest.mode = 'no-cors'; // might work ok, but probably not for PUT or POST.

Might be able to use an express middleware component to do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant