OHIF Authorization

I am relatively new to OHIF and integrate OHIF Viewer with an Angular application using iframe. I’ve come across the DICOM JSON article which allows the loading of dcm images by passing the url and other metadata.

But I am getting a 401 unauthorized. How do I pass the Auth related headers along with it so it can fetch the dcm image from our server and load it in the viewer ?

Any help or inputs will be appreciated.

Thanks.

You are right

Look here

extensions/default/src/DicomWebDataSource/index.js

It should show how to grab auth stuff

getAuthrorizationHeader = () => {
const xhrRequestHeaders = {};
const authHeaders = userAuthenticationService.getAuthorizationHeader();
if (authHeaders && authHeaders.Authorization) {
xhrRequestHeaders.Authorization = authHeaders.Authorization;
}
return xhrRequestHeaders;
};

maybe create a PR for us to fix this in json data source