google-oauth

Can I using Google Sheet API only with API Key or using Client ID and Client secret, but without client_secret.json?

Can I using Google Sheet API only with API Key or using Client ID and Client secret, but without client_secret.json? Question: In this provided Python code in this quickstart, it using credentials.json such in this line: flow = InstalledAppFlow.from_client_secrets_file(‘credentials.json’, SCOPES) I have enabled the Sheet and Drive API. I created credentials from the APIs & …

Total answers: 2

Google OAuth error 400: redirect_uri_mismatch in Python

Google OAuth error 400: redirect_uri_mismatch in Python Question: first time using OAuth here and I am stuck. I am building a web app that needs to make authorized calls to the YouTube Data API. I am testing the OAuth flow from my local computer. I am stuck receiving Error 400: redirect_uri_mismatch when I try to …

Total answers: 4

How to auto refresh Google calendar token in python

How to auto refresh Google calendar token in python Question: I’m using the following script in order to get all today’s events from a specific google calendar. the code works for me. The only thing is that the token expires after ~60 min. How can I make the token refresh automatically? import requests import json …

Total answers: 1

In python, is there any way I can store a 'Resource' object so I can use it later?

In python, is there any way I can store a 'Resource' object so I can use it later? Question: I am writing a program about the YouTube API flow = google_auth_oauthlib.flow.InstalledAppFlow.from_client_secrets_file(client_secrets_file, scopes) credentials = flow.run_console() youtube_analytics = googleapiclient.discovery.build("youtubeAnalytics", "v2", credentials=credentials) Finally it will return a ‘Resource’ object, can I store this object? So that I …

Total answers: 2

Using gmail through python without smtp

Using gmail through python without smtp Question: As of may 30th, smtp is no longer accepted. https://support.google.com/accounts/answer/6010255?hl=en&ref_topic=7188673 What is the new way to make a simple python emailer rather than a full application with the "login with google" option? Not sure why I was asked for the code and error, given that I already diagnosed …

Total answers: 2

Import "google_auth_oauthlib.flow" could not be resolved

Import "google_auth_oauthlib.flow" could not be resolved Question: In VSCODE using these specifications: pip 21.3.1 from C:userscomputadorappdatalocalprogramspythonpython39libsite-packagespip (python 3.9) I’m using this path for installation: pip install –upgrade google-api-python-client google-auth-httplib2 google-auth-oauthlib But when I try to add the flow import, it keeps saying could not be resolved, several videos use this model to work and none …

Total answers: 2

Oauth redirects to localhost when hosted on server

Oauth redirects to localhost when hosted on server Question: I hope you can help. This script works locally for Google Analytics Auth, but when I put it on my server & run it with python3 xxx.py and go to the auth URL it redirects to localhost, which fails because it’s on the server. Does anyone …

Total answers: 1

Google Photos API + python: Working non-deprecated example

Google Photos API + python: Working non-deprecated example Question: I’ve been finding such a mix of code examples. But nothing with a maintained library (google-auth) + full working example. google-api-python-client and oauth2client are no longer supported (https://github.com/googleapis/google-api-python-client/issues/651). Here’s a working example with deprecated libraries, but I’d like to see some examples that allow full access …

Total answers: 1