OHIF DCM4CHEE SECURE CORS ERROR

193 views
Skip to first unread message

Pablo Bravo

unread,
Nov 6, 2023, 12:09:12 PM11/6/23
to dcm4che
Hi everyone,

I am getting the CORS error when I tried to implement secure dcm4chee with OHIF. I have mapped app-config.js with the following lines:

window.config = {
  routerBasename: '/',
  servers: {
    dicomWeb: [
    {
      name: 'DCM4CHEE',
      wadoUriRoot: "https://192.168.0.109:8443/dcm4chee-arc/aets/DCM4CHEE/wado",
      qidoRoot: "https://192.168.0.109:8443/dcm4chee-arc/aets/DCM4CHEE/rs",
      wadoRoot: "https://192.168.0.109:8443/dcm4chee-arc/aets/DCM4CHEE/rs",
      qidoSupportsIncludeField: false,
      imageRendering: 'wadors',
      thumbnailRendering: 'wadors',
      enableStudyLazyLoad: true,
      supportsFuzzyMatching: true,
  },
  ],
},

// This is an array, but we'll only use the first entry for now
oidc: [
  {

    // ~ REQUIRED
    // Authorization Server URL
    authority: 'https://192.168.0.109:8843/auth/realms/dcm4che',
    client_id: 'ohif-viewer',
    redirect_uri: 'https://192.168.0.109:3000/callback', // `OHIFStandaloneViewer.js`
    // "Authorization Code Flow"
    // Resource: https://medium.com/@darutk/diagrams-of-all-the-openid-connect-flows-6968e3990660
    response_type: 'code',
    scope: 'openid', // email profile openid
    // ~ OPTIONAL
    post_logout_redirect_uri: '/logout-redirect.html',
  },
],
};

Using F12 tools, I just have the next error:

Sin título.jpg 

I created the  ohif-viewer client in the Keycloak panel, with this configuration:

Sin título.jpg

Anyone can help me?

Thanks.

Andy Linton

unread,
Jan 28, 2024, 10:10:01 AM1/28/24
to dcm4che
I had the same issue, here is how I resolved it:      
change the URL for authority in the oidc section for app-config.js to the following

authority: 'https://<host address>:8843/realms/dcm4che',

Andy Linton

unread,
Jan 28, 2024, 10:10:41 AM1/28/24
to dcm4che
Reply all
Reply to author
Forward
0 new messages