Can't Authenticate Service Account on Computing Device

The generated service account file on the server. I ran the command successfully:

gcloud auth activate-service-account --project myproj -key file MYPROJ-xxxxxxx.json

Bigquery authentication

credentials = GoogleCredentials.get_application_default()
service = build('bigquery', 'v2', credentials=credentials)

      

But as soon as I do execute

as requested, I get an error:

googleapiclient.errors.HttpError: https://www.googleapis.com/bigquery/v2/projects/myproj/jobs?alt=json "Invalid credentials">

Why doesn't this work on a computing computer?

Also, everything works fine with p12 key, we'll just refactor the json auth method. And it works on my machine

+3


source to share





All Articles