PDF.js Express Viewer not working via reverse proxies

Which product are you using?
PDF.js Express Viewer

PDF.js Express Version
@pdftron/pdfjs-express-viewer: 8.1.1

Detailed description of issue
We have replaced react-pdfwith pdfjs-express-viewer on our website https://edu.digitaltheatreplus.com. It is working for most of our customers, except for those that use our website via a reverse proxy (which has a different domain name) for example: https://edu-digitaltheatreplus-com.eu1.proxy.openathens.net

We have examined HAR files from customers, and see that the request to GET /auth.pdfjs.express/
returns a 200 and a key, however, users do not see the PDF, they see the following:

Screenshot 2021-12-09 at 23.11.55

My assumption is that the problem is that the key doesn’t validate the domain/referrer, is that correct? Is there a way to generate a key that allows for the same website to work via reverse proxy/different domains?

Any ideas of advice would be gratefully received, this was implemented by a developer in haste before they left our business, so I’m left with the decision of finding a way to make PDF.js Express Viewer work via reverse proxy, or roll back to our old react-pdf implementation.

Expected behaviour
PDF document is displayed

Does your issue happen with every document, or just one?
Every document when loaded by a reverse proxy (we have about 1500 customers using either OpenAthens, WAM Proxy or EZProxy)

Link to document
Unfortunately they are behind a paywall, also, you’d need to be using a reverse proxy to reproduce issue.

Code snippet

const PdfViewer = dynamic(
  () => import('../../../media/components/pdf-viewer'),
  { ssr: false }
);
...
        <PdfViewer
            key={[
              guide.media.url,
              printAndDownloadDisabled,
              outlineHidden,
            ].join()}
            pdfUrl={guide.media.url}
            pdfTitle={guide.name}
            disablePrintAndDownload={printAndDownloadDisabled !== 'off'}
            hideOutline={outlineHidden}
          />

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:APIs:Forums:

Hey there!

All requests made to our authentication server must come from the domain/host that is specified on the license key. In your case when using a reverse proxy, the requests no longer come from your configured host which is why the viewer will not load.

I’ll DM you with some things we can do.

Logan

HI there. We have the same issue as this - we allow customers to set a custom domain which is vanity URL over our provided URL. PDF Express has stopped working for those custom domains as the domain differs from the host for our licence key. CAn you please DM us with possible suggestions too. Thanks, David