Using My Self Google Drive Api Without Oauth - python

I am using Google Drive Api for my Python/Flask App. This app is analyzing the picture and hiding the pictures it will analyze on google drive. The pictures already exist on my own google account.
I am using Oauth2 to access these images. But since I already have my own drive account, Oauth2 is pretty useless.
How do I get to drive outside Oauth2?

Please familiarize yourself with OAuth2 before judging the quality of the protocol.
You have to use OAuth2 with the Google Drive API in order to give permission to your application to perform actions on your behalf.
Think of OAuth2 as a "log-in" mechanism for your application into Google's products, like Drive.
Also, familiarize yourself with the Python Quickstart to understand how to do this.

Related

Reading and writing a public google sheet with python

I have a public google sheet that has a bunch of license keys. I am trying to automate the read and write process from said sheet. eg. take code, run it, mark it as used.
After reading https://medium.com/analytics-vidhya/how-to-read-and-write-data-to-google-spreadsheet-using-python-ebf54d51a72c
as well as the Google's tutorial https://developers.google.com/workspace/guides/create-project
Both of those instructed me to create a google cloud platform account. Since the sheet is public, has anyone managed to read/write without it?
To make requests to a Google Workspace API with a Python command-line application, you need to complete a couple of steps in the Google Cloud Platform Console. In this case if you're using the Google Sheets API to access a Google Sheet even if is public, you need the following prerequisites which asks you to have a Google Cloud Platform project with the API enabled and create credentials for your application in the GCP console.

How to authorize Google API without user interaction in 2020?

I am using a simple script to transfer data to google drive. The script is managed by Cron (independently of the user). How to authenticate google api without user interaction? There used to be a oauth2client (SignedJwtAssertionCredentials) library in Python, but it is no longer supported.

How to authenticate a google vision API on cloud inside a python script?

I am trying to build a python script and deploy it as an HTTP function/Serverless cloud function on Pivotal cloud foundry or GKE, but I have gone through several articles and most of them mention using an SA and download Json key, setup env variable to JSON key location and run the script.
But how can I provide local downloaded JSON key file when I deploy it on cloud?
I have gone through below links but I couldn't understand as I am new to GCP, can anyone provide me an elaborated anws on how can I achieve this?
Google Cloud Vision API - Python
Google cloud vision api- OCR
https://cloud.google.com/vision/docs/quickstart-client-libraries#client-libraries-usage-python
According to docs, during function execution, Cloud Functions uses the service account PROJECT_ID#appspot.gserviceaccount.com as its identity. For instance, when making requests to Google Cloud Platform services using the Google Cloud Client Libraries, Cloud Functions can automatically obtain and use tokens to authorize the services this identity has permissions to use.
By default, the runtime service account has the Editor role, which lets it access many GCP services. In your case, you will need to enable the Vision API and grant the default service account with necessary permissions. Check out the Function Identity Docs for more details.
Instead of a SA json file, you could use an api key if that's easier for you. However, if you use an api key, you will only be able to send image bytes or specify a public image.

Logging with google acount in Flask

I'm starting a web project (in flask) in which the user needs to authenticate with his google account to later save data files in his Google Drive using PyDrive
Flask has a few libraries to authenticate but reading their doc, not all of them support OAuth2. The following 2 libraries DO support Oauth2 though.
Flask-OpenID
Flask-GoogleLogin
My question is, what is the best form to authenticate the google account? Or there is some extension for Google to make an even easier logging?

How to authenticate as myself for Google Drive API?

I have not found a satisfactory answer/tutorial for this, but I'm sure it must be out there. My goal is to access Google Drive programmatically using my credentials. A secondary and lower-priority goal is to do this properly and that means using OAuth rather than ClientLogin.
Thus: How do you authenticate with the Google Drive API using your own credentials for your own Google Drive (without creating an application on the Google Developers Console)?
All of the documentation assumes an application, but what I'm writing is merely helper scripts in Python 2.7 for my own benefit.
"How do you authenticate with the Google Drive API using your own credentials for your own Google Drive (without creating an application on the Google Developers Console)?"
You can't. The premise of OAuth is that the user is granting access to the application, and so the application must be registered. In Google's case, that's the API/Cloud Console.
In your case, there is no need to register each application that uses your helper scripts. Just create an app called helper_scripts, embed the client Id in your script source, and then reuse those scripts in as many applications as you like.

Categories

Resources