Connect OHIF Viewer to dcm4chee-arc-light secured.

2,666 views
Skip to first unread message

Bhavesh Pandey

unread,
Mar 17, 2021, 7:06:32 AM3/17/21
to dcm4che
Hi, we recently shifted from dcm4chee-arc-light to dcm4chee-arc-light secured where all restful services are secured. We have OHIF viewer connected to that (https://github.com/OHIF/Viewers). The config file where we configure wadoUriRoot is at https://github.com/OHIF/Viewers/blob/master/platform/viewer/public/config/default.js

We can also generate token from keycloak as described here: https://www.keycloak.org/docs/latest/securing_apps/index.html#authorization-code

How do we put this token in OHIF viewer so that it can get access to images through secured wadoUri too? Is there any documentation specific to this.

toufic...@gmail.com

unread,
May 2, 2022, 2:26:07 PM5/2/22
to dcm4che
Dear,
Were you able to make it work?

Renuka Prasad

unread,
Jun 5, 2022, 7:46:20 PM6/5/22
to dcm4che
Hi,

I am also looking for the solution, I set up   dcm4chee-arc-light 5.0.26 secured version. I also built OHIF Viewer latest version with modfied default.js as below. But loading the viewer using http://localhost:3000/ get me 401 error  (Please see the below screenshot) Any help is appreciated

default.js config 

servers: {
    dicomWeb: [
      {
        name: 'DCM4CHEE',
        /*wadoUriRoot: 'https://server.dcmjs.org/dcm4chee-arc/aets/DCM4CHEE/wado',
        qidoRoot: 'https://server.dcmjs.org/dcm4chee-arc/aets/DCM4CHEE/rs',
        wadoRoot: 'https://server.dcmjs.org/dcm4chee-arc/aets/DCM4CHEE/rs',
        qidoSupportsIncludeField: true,*/
        wadoUriRoot: 'https://localhost:8443/dcm4chee-arc/aets/DCM4CHEE/wado',
        qidoRoot: 'https://localhost:8443/dcm4chee-arc/aets/DCM4CHEE/rs',
        wadoRoot: 'http://localhost: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://localhost:8843/auth/realms/dcm4che',
      client_id: 'ohif-viewer',
      redirect_uri: 'http://loalhost: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',
    },
  ]
  }, 

OHIF Viewer 401 error:

2022-06-05_18-42-13.png

toufic...@gmail.com

unread,
Jun 6, 2022, 2:01:53 AM6/6/22
to dcm4che

Hi.

try to Remove the duplicate record:

    qidoRoot: 'https://server.dcmjs.org/dcm4chee-arc/aets/DCM4CHEE/rs',
        wadoRoot: 'https://server.dcmjs.org/dcm4chee-arc/aets/DCM4CHEE/rs',

        qidoSupportsIncludeField: true,*/
        wadoUriRoot: 'https://localhost:8443/dcm4chee-arc/aets/DCM4CHEE/wado',
        qidoRoot: 'https://localhost:8443/dcm4chee-arc/aets/DCM4CHEE/rs',
        wadoRoot: 'http://localhost:8443/dcm4chee-arc/aets/DCM4CHEE/rs',


and in the wadoRoot you are using http (not https).. The keycloack should be therefore http

Renuka Prasad

unread,
Jun 6, 2022, 6:09:07 AM6/6/22
to dcm...@googlegroups.com
Thank you for the reply,

The duplicate is the commented out part and there is only one entry in the default.js.
This is the type in the email but the actual dafult.js is having https
The keyCloak is also https. The DCM4CHEE works fine with Secured setup and from the postman Rest HTTPS also works if I pass the bearer token.
I am unable to load the images only when I configure OHIF Viewer to use secure dcm4chee installation.

Thanks
Renukaprasad

--
You received this message because you are subscribed to the Google Groups "dcm4che" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dcm4che+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dcm4che/bc77ab1c-d2ad-48ec-9010-95b80c246400n%40googlegroups.com.

F Yoshimoto

unread,
Aug 4, 2022, 8:49:41 PM8/4/22
to dcm4che
Did you get this to work?  I am having the same issue.

Renuka Prasad

unread,
Aug 4, 2022, 9:11:00 PM8/4/22
to dcm...@googlegroups.com
Yes, I was able to build the OHIF Viewer from scratch to make it to work. 
Steps are  
 1) Checkout the source code https://github.com/OHIF/Viewers
 2) Follow the build instructions from the Readme.md file
 3) Update Platform/Viewer/public/config/default.js file to update the dicomWeb links
 4) Build the viewer and use the new packages. 


Toufic N. MOKBEL

unread,
Aug 4, 2022, 11:36:38 PM8/4/22
to dcm...@googlegroups.com
Hi Renuka,

Could you share the default.js of how it connected to the secure archive?

Thank you.

You received this message because you are subscribed to a topic in the Google Groups "dcm4che" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dcm4che/Mu4jcNH-dqI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dcm4che+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dcm4che/CAD%2B9t_S8xYD15kJWhRTgpR5krW1gnPgjj7MirOqmof34oiuwQg%40mail.gmail.com.

Marcelo Díaz O.

unread,
Oct 9, 2022, 12:28:18 PM10/9/22
to dcm4che
Hi, same issue CORS,  

default.js of how it connected to the secure archive?

Thanks!  

Elamathi S

unread,
Oct 11, 2022, 3:05:05 AM10/11/22
to dcm4che
Hi,

We also used secure DCM4CHEE to connect to the OHIF viewer but we were not able to do so and got CORS issue. Are there any changes we have to do when we create a user?

Thank you!

AkaB

unread,
Sep 6, 2023, 7:27:51 AM9/6/23
to dcm4che
Hello,

How to modify default.js to connect OHIF to dcm4chee arc light secured? I am getting the black screen and CORS  issue. 

Thank you,

Armin Berger

unread,
Nov 13, 2023, 5:29:10 PM11/13/23
to dcm4che
Dear community, has anyone been able to resolve the black screen/CORS issue with the current Docker images?
Thanks and best regards.

armin
Message has been deleted

Andy Linton

unread,
Jan 28, 2024, 10:05:13 AM1/28/24
to dcm4che
Hi,

I spent hours trying to get this to work and experiencing CORS errors as described above. I found an error in the authentication URL in the section for OHIF app-config.js.
It should be:       authority: 'https://localhost:8843/realms/dcm4che',
(note the removal of auth in the URL)

So the section to add to your OHIF app-config.js (after the datasources section) is as follows:


  oidc: [
    {
      // ~ REQUIRED
      // Authorization Server URL
      authority: 'https://<host ip address>:8843/realms/dcm4che',
      client_id: 'ohif-viewer',
      redirect_uri: 'https://<host ip address>:3003/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',
    },
  ],

I'm running OHIF using SSL on port 3003. You may need to adjust this.

You also need to configure an OIDC client called "ohif-viewer" in Keycloak, see other posts on this forum about how to do that.

Hope that helps
Andy

Reply all
Reply to author
Forward
0 new messages