Open hansgv opened 2 years ago
@carstentrink Thanks for the suggestion!
I managed to compile and install https://github.com/msfjarvis/gdrive. When I run gdrive it asks to re-authorize by visiting a Google URL (I suppose my old .gdrive/token_v2.json doesn't work with this fork). Visiting the URL I get:
Authorization Error Error 400: invalid_request Missing required parameter: client_id
In msfjarvis/gdrive you need to place the json file with clientId
and clientSecret
from https://console.cloud.google.com/ in some place (I also do not know which location to place it). Either way it will NOT work as it is NOT in production.
self advertising
Just see the README in https://github.com/carstentrink/gdrive
clientId
and clientSecret
in the file handlers_drive.go
.@carstentrink THANK YOU! 🙌🏻
For other dummies like myself, here's what I did:
handlers_drive.go
to include my credentials, as instructed in READMEgo build
in the gdrive-main
directorygdrive
binary to /usr/local/bin/
gdrive version
for the first time to get a Verification URL and Authorization Code prompt@carstentrink
Please clarify. I was looking at https://developers.google.com/identity/protocols/oauth2/resources/oob-migration#inspect-your-application-code but the 'RedirectURL' line in auth/oauth.go is still type 'oob'. As far as I understood this type will stop working after 3 days, as commented https://developers.google.com/identity/protocols/oauth2/resources/oob-migration#desktop-client Thanks
Edit: Please change to production as described in README
One small change to hansgv's comment. In step 6 I executed gdrive about
for the Verification URL.
Someone messed with @carstentrink code and we can't compile now.
# github.com/msfjarvis/gdrive
./handlers_drive.go:369:74: undefined: auth.AuthCodeHTTP
Please try again with ./compile
. I have fixed it. I am using go1.19.1 version.
(If you need linux device then try https://console.cloud.google.com/home/dashboard?cloudshell=true)
Hi, I'm using a headless linux box but can't sign in to google with my user using browsh.
I tried compiling on MacOS without any errors, but got the following when trying to run the ./gdrive about
command:
Failed to get about: Get "https://www.googleapis.com/drive/v3/about?alt=json&fields=maxImportSizes%2CmaxUploadSize%2CstorageQuota%2Cuser&prettyPrint=false": oauth2: cannot fetch token: 400 Bad Request
Response: {
"error": "invalid_grant",
"error_description": "Token has been expired or revoked."
}
Any ideas on how to sign in?
I would like to use this in a CI system, but I think the token will keep expiring…
@juliusspencer
Authorise it locally then copy both linux binary
and .config/gdrive/something.json
to the remote box.
Thanks, yeah I did just that, I just need to update the variable that stores the token as it updates as the docker container overwrites it. I'm almost there.
May be this repo has some actions that are useful. https://github.com/marufshidiq/gdrive-cli-builder/blob/master/.github/workflows/build.yml
This is great, and everything works, except ~/.config/gdrive/USERNAME_v2.json
is not created. I created the folder structure ~/.config/gdrive/
and then the file USERNAME_v2.json
was created correctly.
I received an email from Google saying I "have OAuth clients that used the OAuth OOB flow in the past."
Is this something that has been or can be fixed in gdrive?