Invalid_client: OAuth client not found. python

I have an old project that is trying to extract data from Google Analytics.

It does not work, so I'm trying to figure out what is wrong.

Found a sample code for working with Analytics on the server side.

scope = ['https://www.googleapis.com/auth/analytics.readonly'] key_file_location = 'secrets.json' credentials = ServiceAccountCredentials.from_json_keyfile_name(key_file_location, scopes=scope) http = credentials.authorize(httplib2.Http()) service = build('analytics', 'v3', http=http) accounts = service.management().accounts().list().execute() print (accounts) 

It works with a secrets file for my test account. But it does not work for the secrets file of the old project. I get the following error:

 oauth2client.client.HttpAccessTokenRefreshError: invalid_client: The OAuth client was not found. 

What is the problem? Is the secrets file out of date? If so, can I get another without access to google account?

+2
python google-analytics-api
Jan 10 '17 at 11:47 on
source share
1 answer

When you registered the application in the Google Developer Console, you created several OAuth credentials.

invalid_client: OAuth client not found

means the client id you are using no longer exists, someone may have deleted it. You will need to create new credentials.

+2
Jan 10 '17 at 11:54 on
source share



All Articles