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:
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}
/>