Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Drive: read-only without authorisation on external site

I have an idea to use Google Drive as a no-database CMS, where clients would put their files in specific folders which is then accessed on an external site. For example, they would upload an image and a script would iterate through that folder for all image files and display them accordingly as a gallery.

I'm very new to the Drive SDK (and APIs in general) and I'm trying to get my head around if it's even possible to make the files read-only without requiring an authorisation for the end user? My initial attempts have required me to authenticate whenever I load the page.

like image 293
Staffan Estberg Avatar asked Dec 07 '25 09:12

Staffan Estberg


1 Answers

It is be possible for a third party app to authorize requests without an access token. You can make requests from an allowed referrer/IP with an API key.

https://developers.google.com/console/help/#generatingdevkeys

Then, you should be allowed to GET the following public file:

GET https://www.googleapis.com/drive/v2/files/1T_fVTiyyBVnfYKd_3gZzVfxqU5NbOhIlEG0nyReYh9w?key=[yourKey]
like image 67
Burcu Dogan Avatar answered Dec 11 '25 08:12

Burcu Dogan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!