How to authorize Google API without user interaction in 2020? - python

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.

Related

Python Outlook Oauth2 possible without Azure account?

We're trying to develop an integration exploring Python libraries for Oauth2, but in every single one of them when it's related to Outlook accounts they require client ID and client secret, data extracted of course, from Azure. thing is, we got no Azure account available now. is it indeed impossible to achieve this without Azure? any workarounds?

OKTA AWS CLI Using Python to Connect to Athena

My company uses Okta Authentication for all corporate applications. Is there a way or a workaround to circumvent the OKTA Authentication while connecting to AWS Athena? I'm trying to automate a Python Script that connects to Athena and it requires me to Okta Verify every time after the short-lived token expires. However, Google Suite (Docs, Sheets, Drive) API's doesn't require this type of AUTH verification method and it never requests one when I connect Python to Google Suites although our Google Suite use Okta Authentication for login.
Any help or references would be much appreciated. Thank you!

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.

Python - google drive authentication using email and password

I'm creating a simple python 2.7 application that uploads files to Google drive.
I've used PyDrive examples and they work quite well.
But in all the examples they all require the client to get their authentication secret key from their Google account and add it to the client_secrets file.
Is there a way to authenticate to Google drive in Python using Client email and password credentials?
I know this is possible using google spreadsheet (API unavailable)

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