I'm wondering if it's possible to, say, open up a jsfiddle on a random computer and log in and authenticate and use the drive API, without having to have a local server running all the time? And how exactly does one go about setting this up? I'm sorry if this is a simple question but I'm just sorta lost because the instructions that I've found so far are unclear.
Edit:
So far I have, following from here and here:
- Created a project via the Google Developers Console.
- Opened up that project there, navigated to APIs under APIs & auth, and ensured that Drive API was enabled
- Went into credentials, and clicked on "Create a new Client ID"
- Selected "Web Application"
- Set authorized javascript origins to http://localhost:4567
- Deleted any contents in Redirect URI's and left it blank, then pressed "Create Client ID."
- Took a sample like this, this, or this, and stored it in a local file named named index.html.
- This wouldn't run by simply opening in a brower, so I had to host a local server
- I navigated into that directory in the command line and then typed "python -m SimpleHTTPServer 4567" (without the quotes) and this hosted a local server
- Opened http://localhost:4567 in my web brower, and all of these samples work fine, after copying the newly created client ID into these files where they ask for it.
I also have made a python application, to use pydrive I:
- Clicked on "Create a new Client ID", then "Installed Application" and "Other", then "Create Client ID."
- Next I went to the Old Google APIs Console, clicked on API Access, found that client ID, and clicked Download JSON.
- I placed this client_secrets.json next to my python application, and this allowed pydrive to authenticate successfully and I could access and modify my google drive files anywhere using that client ID. Though of course I deleted this client_secrets.json before giving the application to another person, and showed them how to do this process as well.
However, beyond this, I'm a little unsure about, specifically:
- How one can use the drive api in web applications without having to set up a local server, say simply by running code in jsfiddle and having requests sent through my project via using a Client ID, and
- If a local server is set up that can be accessed by anyone on the web, how one can modify the above steps to allow any client to open that server's webpage to use the google drive API?
I know that I most likely need to set up a Public API access in the developers console, but am not entirely sure what Referers I should use as well. So is there a simple way to do any of this?
I also know that gspread can open google excell spreadsheets only using the client's username and password, so I'm suspecting that what I'm looking for is possible, but I'm not sure.