google-drive-ruby icon indicating copy to clipboard operation
google-drive-ruby copied to clipboard

Issue with Authentication Doc

Open liberom opened this issue 5 years ago • 2 comments

Sorry to open an issue for this, but I haven't found online a solution to this issue. This is my first time trying to use Google API and I'm using the google_drive gem and following the documentation.

However I am unable to accomplish a successful authorization and I was wondering if perhaps there was any change to the Google UI that could require an update of the gem's documentation.

image

I'm trying to use a service_account, but when I try to "create credentials" there is only the option "service account" and not "service account key". Also when I do create a service account there no JSON to be downloaded.

The only JSON available is in the OAuth2 section, but if I try using it, it doesn't work for the service account. I have even tried to create more than one project to see if I had chosen something wrong by mistake, but it's all the same.

Can anyone point me to the right direction? If there was a change in Google's UI, would there be an update to the Authorization documentation?

Thank you

liberom avatar Apr 21 '21 00:04 liberom

go to https://console.cloud.google.com/iam-admin/serviceaccounts?project=your_id Click on three dots in Action column and then manage keys. Create a key and you get the json file. Im good till this but when i try to list files from google docs i get empty array.

danielschlegel avatar May 01 '21 09:05 danielschlegel

go to https://console.cloud.google.com/iam-admin/serviceaccounts?project=your_id Click on three dots in Action column and then manage keys. Create a key and you get the json file.

Thanks for figuring it out!

Im good till this but when i try to list files from google docs i get empty array.

This is expected. A service account is treated as its own account, not you (a human account who created it). If you want your program to access Google Drive on behalf of you, choose the first (or maybe the second) option in the Authorization doc instead.

gimite avatar May 04 '21 04:05 gimite