Snobby
Snobby

Reputation: 1155

invalid_client: The OAuth client was not found. Python

I have an old project, that is trying to retrieve data from google analytics.

It is not working, so I am trying to figure out what's wrong.

Found an example code to work with Analytics on 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 is working with secrets file for my test account. But it's not working for secrets file of an old project. I recieve the following error:

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

What's the problem? The secrets file is out of date? If it is, am I able to recieve another one without access to the google account?

Upvotes: 3

Views: 12077

Answers (1)

Linda Lawton - DaImTo
Linda Lawton - DaImTo

Reputation: 116868

When you registered the application on Google developer console you created some OAuth credentials.

invalid_client: The OAuth client was not found

means that the client id you are using isn't there anymore someone probably deleted it. You will need to create new credentials.

Upvotes: 4

Related Questions