Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Accessing a public google drive without authentication
Started by sharongirl21 Oct 22 2017 02:14 PM

7 replies to this topic
google google api google drive public access
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

sharongirl21

[GLOBAL: userInfoPane.html]
sharongirl21
  • Enthusiast

  • 43 posts
  • Corona SDK

I have two public folders in my google drive and I want my app to be able read images from one folder and read and write images to another folder. Is there a way to do this using the google api or any GET method and hopefully without needing to authorize or authenticate the user's google account? Thank you!



[TOPIC: post.html]
#2

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,481 posts
  • Corona SDK

I'm pretty sure you'll have to use authentication for writing.

 

Have you looked through the marketplace?



[TOPIC: post.html]
#3

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,481 posts
  • Corona SDK

I can't think of any storage service you can write to w/o authentication, but reading can be done on a AWS S3 bucket that was marked 'public'.

 

Note: You really don't want to have write-able target anywhere that doesn't require authentication.  Bad-actors will use it for their own purposes and you'll end up paying for it somehow.  It is just a bad idea.

 

You can set up a unsecured S3 bucket on AWS or a poorly secured slice on Digital Ocean and it will be discovered in seconds.  The bad-actors out there know the address ranges of AWS and other major providers and troll them all day long using automated mechanisms.  So, don't believe for a second you won't get hacked.  


Edited by roaminggamer, 22 October 2017 - 09:33 PM.


[TOPIC: post.html]
#4

sharongirl21

[GLOBAL: userInfoPane.html]
sharongirl21
  • Enthusiast

  • 43 posts
  • Corona SDK

I can't think of any storage service you can write to w/o authentication, but reading can be done on a AWS S3 bucket that was marked 'public'.

 

Note: You really don't want to have write-able target anywhere that doesn't require authentication.  Bad-actors will use it for their own purposes and you'll end up paying for it somehow.  It is just a bad idea.

 

You can set up a unsecured S3 bucket on AWS or a poorly secured slice on Digital Ocean and it will be discovered in seconds.  The bad-actors out there know the address ranges of AWS and other major providers and troll them all day long using automated mechanisms.  So, don't believe for a second you won't get hacked.  

 

Thanks for your response but I was asked for this project to use a google drive folder, I'm perfectly fine with removing the write feature, that was just my own idea, so then is there a way to just read images from the folder? maybe as a Json of download links or something? I know I can get data from a public google sheet or calendar without any form of authentication, so I wanted to know if the same is possible with a google drive folder. Thanks!



[TOPIC: post.html]
#5

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,481 posts
  • Corona SDK

You said you wanted to download images right?

 

Step 1. Figure out how to set this up so that simply typing the URL into a browser will download and/or show the image in the browser.  (without having logged in or authenticated).

 

Step 2. Use that same URL with this function: https://docs.coronalabs.com/api/library/network/download.html

 

Step 3. When the download is complete, use the image.

 

The same applies to all other file types.

 

PS - Don't forget, Android and iPhone both have build.settings required for networking and in the case of iPhone if you're reading http and not https links, you have to set up ATS. 

https://docs.coronalabs.com/guide/hardware/appleATS/index.html



[TOPIC: post.html]
#6

sharongirl21

[GLOBAL: userInfoPane.html]
sharongirl21
  • Enthusiast

  • 43 posts
  • Corona SDK

You said you wanted to download images right?

 

Step 1. Figure out how to set this up so that simply typing the URL into a browser will download and/or show the image in the browser.  (without having logged in or authenticated).

 

Step 2. Use that same URL with this function: https://docs.coronalabs.com/api/library/network/download.html

 

Step 3. When the download is complete, use the image.

 

The same applies to all other file types.

 

PS - Don't forget, Android and iPhone both have build.settings required for networking and in the case of iPhone if you're reading http and not https links, you have to set up ATS. 

https://docs.coronalabs.com/guide/hardware/appleATS/index.html

 

It was more of downloading and showing all images in a specific folder, would this still work?



[TOPIC: post.html]
#7

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,481 posts
  • Corona SDK

You need someway to know the file names.  You can't simply go to a GoogleDrive (or other) folder and get the file names like this.

 

You need to use a library (i.e. a plugin).

 

Again, go take a look in the marketplace.  Your best bet is to use one of the plugins there AND you are going to have to bite the bullet and deal with authenticating.  I'm not sure why you don't want to, but the plugins will have APIs for doing it on whatever service the plugin is for.



[TOPIC: post.html]
#8

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,481 posts
  • Corona SDK

If you don't mind dealing with this entirely manually, then yes you could:

 

1. Set up a AWS S3 bucket.  (You may need someone to give you 1:1 help with this. I don't know your level of expertise.)

2. Write a index file with the names of the files in it.  Formatted as plain text of a JSON encoded table.

3. Add the files to the bucket.

4. Then later.... download the index file, do some string magic... download the files, one by one.


Edited by roaminggamer, 23 October 2017 - 01:43 PM.



[topic_controls]
[/topic_controls]