We have been working on a web service (http://www.genomespace.org/) that allows computational biology tools that implement our REST API to, among other things, read and write files stored on "The Cloud".
Our default file storage is a common Amazon S3 bucket
, but we now allow users to mount their own private S3 bucket
as well as files on Dropbox
.
We are now trying to enable similar functionality for Google Drive
and have run into some problems unique to Google Drive
that we have not encountered with S3
or Dropbox
.
Only way to allow clients that are not Google-authenticated to read files unobtrusively is to make the files
"Public"
. Our preference would be that once the user has authorized access to our application viaOAuth2
, the user files could remain"Private"
inGoogle Drive
.
However, even though the user has already authorized our web service to offline access to their"Private"
files, we have not found a way to generate a URL that a client authorized by our system can use to GET the file directly without the client being logged into Google as well. The closest we have come to this functionality has been to change the file permissions to"Anyone with Link"
, except that for files greater than 20MB Google insists on returning an intermediate web page warning that the file has not been scanned for viruses. In addition to having to mess with file permissions, this would break our existing clients. Only when the file is"Public"
and we utilize URLs of the formhttps://googledrive.com/host/PARENT_FOLDER_ID/FILENAME
can non-Google clients read the files without interference.Have not found any way for clients that are not
Google-authenticated
to upload a file toGoogle Drive
. Our API allows our authorized clients to PUT files directly to the backing file storage using URLs provided by our server. However, even if a folder is marked"Public"
, the client requires Google authentication credentials to save to Google Drive. We could deal with both of these issues with intermediate hops through our system (e.g., our web server would first download the file from Google Drive and then allow the client to GET it) however this would be woefully inefficient and, hopefully, unnecessary. These problems have been discussed multiple times before on stackoverflow (e.g. here and here and have read the responses very carefully, but have not seen any recent discussion.
The Google folks direct their API users to post on stackoverflow for support, so I am hoping for a fresh look from insiders.