google / skicka

Command-line utility for working with Google Drive. Join the mailing list at https://groups.google.com/forum/#!forum/skicka-users.
Apache License 2.0
1.3k stars 118 forks source link

OAuth error #111

Closed kmarchand closed 7 years ago

kmarchand commented 7 years ago

When I run skicka ls it opens the browser but after clicking "Allow" I get an error:

skicka: attempting to launch browser to authorize.
(Re-run skicka with the -no-browser-auth option to authorize directly.)
skicka: error with OAuth2 Authorization: oauth2: cannot fetch token: 400 Bad Request
Response: {
  "error" : "invalid_request",
  "error_description" : "Could not determine client ID from request."
}

I then tried skicka -no-browser-auth ls, click "Allow", get the verification code and paste it in and then still get an error:

skicka: error with OAuth2 Authorization: oauth2: cannot fetch token: 400 Bad Request
Response: {
  "error" : "invalid_request",
  "error_description" : "Could not determine client ID from request."
}

Same result when using Terminal or iTerm2, with Safari, Chrome and Firefox.

go version go1.7.5 darwin/amd64 macOS Sierra 10.12.2

Any ideas?

ghoulr commented 7 years ago

Same issue, on linux and mac, with or without browsers.

benlipp commented 7 years ago

I also have this issue on Ubuntu 16.04.

ErwinP commented 7 years ago

Exactly the same problem as kmarchand, on a Raspberry Pi 3 running Rasbian.

Thanks in advance!

DanielHSM commented 7 years ago

Same issue here, on the same setup as ErwinP. Any ideas? Thanks.

mmp commented 7 years ago

Interesting. This worked fine on my system until I updated to the latest version of the golang.org/x/oauth2 package. Digging now.

mmp commented 7 years ago

I believe that this is a bug in that package, but need to finish chasing it down and file a bug report with them.

As a work-around, if you run:

% cd $GOPATH/src/golang.org/x/oauth2
% git checkout 314dd2c0bf3ebd592ec0d20847d27e79d0dbe8dd
% go install .
% cd ../../../github.com/google/skicka
% go install .

Then skicka should work again.

benlipp commented 7 years ago

Let me test it out. Will report back with findings.

Yep! Totally works on Ubuntu 16.04.3.

mmp commented 7 years ago

https://github.com/golang/oauth2/issues/220

whaozl commented 7 years ago

@mmp ,it works! thank you!

GEverding commented 7 years ago

Hi, tried to set up skicka (fresh install of golang-1.6 and skicka) today and go the above error. the fix worked for me but it seems like this is still a issue.

mmp commented 7 years ago

Happily, the fix has been applied in golang.org/x/oauth2. I've just confirmed that at top of tree, everything works as expected. Running:

% go get -u golang.org/x/oauth2
% cd $GOPATH/src/github/google/skicka
% go install .

Should fix things if you're running into this.