odeke-em / drive

Google Drive client for the commandline
Apache License 2.0
6.69k stars 427 forks source link

Error: redirect_uri_mismatch using URL given by drive init #1033

Open bdklahn opened 6 years ago

bdklahn commented 6 years ago

I paste the unusually long (compared to other clients) URL in the browser, and get the following 400 error:

"The redirect URI in the request, urn:ietf:wg:oauth:2.0:oob, can only be used by a Client ID for native application. It is not allowed for the WEB client type. You can create a Client ID for native application at https://console.developers.google.com/apis/credentials/oauth"

I tried again, with the same result, after updating (e.g. go get -u github.com/odeke-em/drive/cmd/drive)

bdklahn commented 5 years ago

I worked around this bug by "Optionally set the GOOGLE_API_CLIENT_ID and GOOGLE_API_CLIENT_SECRET environment variables to use your own API keys.", from the README.

Apparently this is not optional, as init is broken without doing this. Maybe the OAUTH flow in this app is no longer compliant with the current Google auth API. Google seems to think this is a credential for a web client, vs the standalone or "other" app that it is.