I’m not sure if I’m missing something or if this is just not possible.
I have PDF blobs stored in a database and I use a doGet Python resourced in the WebDev module to serve them to a Perspective PDF Viewer component. This all works.
This is my dilemma. I want 2 things:
- Let a user who is logged into a Perspective session see the PDF on a page.
- Not expose the PDF to just anyone on the network that happens to obtain the correct url.
I could require authentication on the handler so that someone with the correct url cannot just type it into the browser and get the file but will be prompted to authenticate. However, this also prompts the (already logged in) user to authenticate in the Perspective Session as well... which is terrible for user experience.
As far as I can tell there is no way to pass the Perspective authentication through with the GET request. I can think of ways to hack together the use of some "middle man" service account perhaps if I were scripting this, but not really using a PDF viewer.
What is the best practice here?