googlearchive/PyDrive

Failure: install PyDrive on windows subsystem for linux

Opened this issue · 1 comments

I'm trying to install PyDrive.
I did "Quickstart" step by step in the url below.

https://pythonhosted.org/PyDrive/quickstart.html

I went to step5 in 'Authentication'.
I created quickstart.py and ran it.
Then, this program generates the url below.

https://accounts.google.com/o/oauth2/auth?client_id=588119618537-98mu73ca1gd0eq9emes7njll0q47jidq.apps.googleusercontent.com&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2F&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive&access_type=offline&response_type=code

I went to the url,
however an error occured below.

400. That’s an error.

Error: redirect_uri_mismatch
The redirect URI in the request, http://localhost:8080/, does not match the ones authorized for the OAuth client. To update the authorized redirect URIs, visit: https://console.developers.google.com/apis/credentials/oauthclient/588119618537-98mu73ca1gd0eq9emes7njll0q47jidq.apps.googleusercontent.com?project=588119618537

The error said mismatch the URLs.
I checked ‘Authorized JavaScript origins’ and ‘Authorized redirect URIs’,
but they are both 'http://localhost:8080'.

Could you investigate it?

My enviroments below.
OS: kali linux on windows subsystem for linux
Python: 3.7.4
PyDrive: 1.3.1

Could it be an issue with the trailing slash missing? Are you sure you are using the same client ID? You could also try creating a client ID of type "Other" instead of "Web App". That type is automatically whitelisted for all localhost redirects URIs.