OHIF / Viewers

OHIF zero-footprint DICOM viewer and oncology specific Lesion Tracker, plus shared extension packages
https://docs.ohif.org/
MIT License
3.35k stars 3.36k forks source link

dicomLoaderService does not add header tokens #997

Closed MuriloSchaefer closed 5 years ago

MuriloSchaefer commented 5 years ago

Hi, I'm having an issue with tokens, in my config file I have a token that needs to be passed to every request to my data server (metadata and images itself). But the function fetchIt inside dicomLoaderService.js does not pass any requestOptions object to the function DICOMWeb.getAuthenticationHeader() so it considers it hasn't a token or has a user logged in. But in my case, I need a token to fetch images and there is no logged user.

and also I couldn't find a way to put the server config on it, how can I add the server configs in there?

EDIT: I need to add the server auth config in this request to getAuthenticationHeader(), but I can't have access to server config in there, so how can I do it?

const wadorsRetriever = (
  url,
  studyInstanceUID,
  seriesInstanceUID,
  sopInstanceUID,
  headers = DICOMWeb.getAuthorizationHeader()
) => {
  const config = {
    url,
    headers,
  };
  const dicomWeb = new api.DICOMwebClient(config);

  return dicomWeb.retrieveInstance({
    studyInstanceUID,
    seriesInstanceUID,
    sopInstanceUID,
  });
};
swederik commented 5 years ago

Related: https://github.com/OHIF/Viewers/pull/928

dannyrb commented 5 years ago

@MuriloSchaefer, has #928 resolved your issue?

and also I couldn't find a way to put the server config on it, how can I add the server configs in there?

Have you read the deployment docs, or our docs on configuration?

MuriloSchaefer commented 5 years ago

It solved my issue :) Thx