Getting Error: Oauth Client from Service account

Error: failed to make Fs to list Shared Drives: drive: failed when making oauth client: failed to create oauth client from service account: error processing credentials: google: read JWT from JSON credentials: 'type' field is "" (expected "service_account")

I am getting this while configuring service accounts any body pls help me

It looks like the file you've used for a service account is in the wrong format.

It should be a JSON file and look something like this

{
  "type": "service_account",
  "project_id": "XXX",
  "private_key_id": "XXX",
  "private_key": "-----BEGIN PRIVATE KEY-----\nXXXn-----END PRIVATE KEY-----\n",
  "client_email": "XXX@XXX.iam.gserviceaccount.com",
  "client_id": "XXX",
  "auth_uri": "https://accounts.google.com/o/oauth2/auth",
  "token_uri": "https://accounts.google.com/o/oauth2/token",
  "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
  "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/XXX.iam.gserviceaccount.com"
}

Hi! I have the same issue. I suppuse that the Google Cloud Console is generating a JSON secret in a new format.

{
"installed": {
"client_id": "xxxxx.apps.googleusercontent.com",
"project_id": "yyyy",
"auth_uri": "Anmelden – Google Konten",
"token_uri": "https ://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https ://www.googleapis.com/oauth2/v1/certs",
"client_secret": "xxxx",
"redirect_uris": [
"http ://localhost"
]
}
}

It looks more like a Oauth2 configuration, a private key is missing there.

Anybody has an idea how to generate a secret in valid format?

Bump :wink: :smiley: :slight_smile:
I cannot configure backups synchronization to second location :frowning:

I ran through it, got the same format as @ncw

No issues making a key through the Google Admin console.

Perhaps contact Google support if you are getting the same format.

1 Like

@Animosity022 Could you please write the steps you "clicked" to get the proper format? :slight_smile: I must be doing something wrong.

Just the docs:

I need to configure Google Cloud Storage not Google Drive :slight_smile:

EDIT:
I went through the procedure again and now I get the proper format, weird but I don't know why the result is different. Thanks so much for your help and time :slight_smile:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.