iterative / PyDrive2

Google Drive API Python wrapper library. Maintained fork of PyDrive.
https://docs.iterative.ai/PyDrive2
Other
581 stars 69 forks source link

Unable to authenticate #178

Closed weilueluo closed 2 years ago

weilueluo commented 2 years ago

Hi I am having the same issue as #77

weilueluo commented 2 years ago

The final URL for me is

http://localhost:8090/?code=4/0AX4XfWgdW6akY2jK57Fw7hLrI0SjSkG9XuTptHffgDWQ3R9eNZttUEE_eKktX1Rwex5DSw&scope=https://www.googleapis.com/auth/drive
weilueluo commented 2 years ago

Answer to questions from the issue

Are you sure the python doesn't crash or you're not stopping it in between clicking the first link and trying the final URL?

No, it just stuck on the same line

What happens to the python script that gives you the first URL? It should just sit there waiting?

Yes, it just sit there waiting image

If it is sitting there waiting, did you try popping that final URL in e.g. curl or wget or something, just in case your browser is having some problem with non-https URL's or something like that?

If I reopen the same URL, it will go through the same sign-in process and end up on the same localhost refuse to connect page

weilueluo commented 2 years ago

Ok, not sure what happened, but when I follow the google drive docs' guide to set up the credentials it works

weilueluo commented 2 years ago

Well, I find that it works locally on Jupyter Notebook but not google colab.

weilueluo commented 2 years ago

I find that I can just use the CommandLineAuth instead of LocalWebserverAuth to make it work in google colab.