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
ncw
(Nick Craig-Wood)
February 4, 2023, 10:22am
2
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?
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? I must be doing something wrong.
I need to configure Google Cloud Storage not Google Drive
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
system
(system)
Closed
March 29, 2023, 5:19am
10
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.