Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to authenticate following documentation instructions #77

Closed
sirgarfieldc opened this issue Jan 27, 2021 · 2 comments
Closed

Unable to authenticate following documentation instructions #77

sirgarfieldc opened this issue Jan 27, 2021 · 2 comments
Labels
question Further information is requested

Comments

@sirgarfieldc
Copy link

I followed all of this:

Go to APIs Console and make your own project.

Search for ‘Google Drive API’, select the entry, and click ‘Enable’.

Select ‘Credentials’ from the left menu, click ‘Create Credentials’, select ‘OAuth client ID’.

Now, the product name and consent screen need to be set -> click ‘Configure consent screen’ and follow the instructions. Once finished:

Select ‘Application type’ to be Web application.

Enter an appropriate name.

Input http://localhost:8080/ for ‘Authorized redirect URIs’.

Click ‘Create’.

Credential set up as instruceted.

Screen Shot 2021-01-27 at 3 52 52 PM

Then calling this:

from pydrive2.auth import GoogleAuth

gauth = GoogleAuth()
# Create local webserver and auto handles authentication.
gauth.LocalWebserverAuth()

Produces a URL

http://localhost:8080/?code=4/0AY0e-g6Kb25Ny1axE1CV21UlS_EoP7xaMFC4R9SMcGM48R81Ui4jgvUIX5gJhITufVSYbg&scope=https://www.googleapis.com/auth/drive

Which lead to 5 screens below before error out
Screen Shot 2021-01-27 at 3 52 28 PM

Screen Shot 2021-01-27 at 3 52 33 PM

Screen Shot 2021-01-27 at 3 52 38 PM

Screen Shot 2021-01-27 at 3 55 13 PM

Final url is this

http://localhost:8080/?code=4/0AY0e-g6Kb25Ny1axE1CV21UlS_EoP7xaMFC4R9SMcGM48R81Ui4jgvUIX5gJhITufVSYbg&scope=https://www.googleapis.com/auth/drive
@shcheklein shcheklein added the question Further information is requested label Jan 27, 2021
@mozboz
Copy link

mozboz commented Jan 28, 2021

@NakedKoala Seems very strange as the code listening on localhost:8080 clearly worked for the first URL to work. 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?

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

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?

@shcheklein
Copy link
Member

closing since there is no response. @NakedKoala please feel free to reopen it if you have more info to share!

thanks @mozboz for taking a look 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants