Skip to content

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

@jamsden

Description

@jamsden

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions