0

I have an application where documents can be viewed. These documents exist in my Google Drive and viewers are not allowed to download (or screenshot) the documents, since I use this code while uploading a document to the Drive.

fileToUpload.copyRequiresWriterPermission = true;

Now the thing is, that I want to introduce the option to download the document, but since users don't have this permission, my Google Drive account's access token has to be used to download the document. I'm not sure if that's possible since access token has an expiry date and even if the refresh token is used, it can be used 30 times max according to google documentation.

So my question is, Is there a secure way to provide the user or client-side with my access token just to download that one file ? would you suggest any other way of implementing this feature?

Abdul Malik
  • 1,158
  • 6
  • 15
  • Although I'm not sure about your actual goal, for example, when the file is publicly shared, the file can be downloaded using the API key. Or, when you don't want to publicly share the file and you can use the service account, the access token for downloading the file can be retrieved from the service account without using the authorization code. But if those were not the direction you expect, I apologize. – Tanaike Dec 31 '20 at 01:26
  • @Tanaike Thank you for the reply, i'll check this out. – Abdul Malik Dec 31 '20 at 05:13

0 Answers0