title: Using PDF.js viewer to display a pdf served by a protected resource
body: <p>I'm investigating how to use the pdfjs viewer to serve a PDF that is behind a protected resource.</p>
  
  <p>From my understanding, this would work if the resource allowed anonymous access:
  <code>https://app.com/pdf.js/web/viewer.html?file=https://app.com/pdf/{id}</code></p>
  
  <p>The resource <code>https://app.com/pdf/{id}</code> returns a response with content type <code>application/pdf</code>.</p>
  
  <p>However, that resource requres a OAuth2 token to be present in the authorization header.
  So is it possible to modify the headers created by the viewer, to include a authorization header and pass the token of the user?</p>