Preview for google authenticated URL's

Background

Items in GCS(Google Cloud Storage) can securely be accessed via a google authenticated link. What that means is anyone who is currently logged into Google in the browser will be cross verified with the allowed emails in the GCS. If the logged-in user’s email exists in allowed emails, then browser they can access the document stored at the URL.

Now we are using google authenticated URLs in our DB to make sure no one can access those documents even if they got a hold of the link. So these documents do not preview well most times(sometimes they may be due to caching or something). Is there any proper fix on this issue given clicking on URL still does work for all our users as they are always logged into the google with whitelisted email

Expected behavior

It shows the document preview

Actual behavior

Failure Logs

Hi @BK42,

Could you provide the HTTP response (With sensible data omitted) of the call for the document preview ?
I’m guessing that the issue might come from the fact that theses links could contains multiples redirections that we currently don’t handle when previewing document.

A potential solution would be to handle theses via a smart field I guess, allowing to manually handle the preview using theses GCS authenticated URL.

Thank you @jeffladiray

This bug happens most of the time but not always. There are also some pdf documents where this bug doesn’t happen, and it renders fine.

Yes, it has one 307:

The last response is embedded HTML instead of base64 data. I guess that is where it is failing:

Following is the first request’s headers:

Let me know if you need any more info :slight_smile:

Hi @BK42,

A few questions to understand the context of your issue:

  • Does the broken preview happen always on the same PDF files or is this an issue that sometimes happens and sometimes not on a given PDF file?
  • The second screenshot you shared with the HTML response, is that the response content of the last call on the list ?

Thank you

  1. It looks like it finally gets fixed if you open preview multiple times for the same file.
  2. Yes, that was the last call.

Hi @BK42,

Could you share that HTML response please ?
And the pdf always display if you open the record a second time ?