kiwiz / gkeepapi

An unofficial client for the Google Keep API.
MIT License
1.53k stars 114 forks source link

Failed to authenticate #163

Closed sirEgghead closed 6 months ago

sirEgghead commented 6 months ago

Please make sure you've done the following before submitting your issue:

Additionally, please provide the following information:

I'm using resume.py as my test bed, with no alterations.

I have 2FA on my Google account. I created an app password at https://myaccount.google.com/apppasswords. Using that app password, with or without the given spaces, I receive:

[INFO] https://accounts.google.com/signin/continue?sarp=1&scc=1&continue=https://accounts.google.com/o/android/auth?(truncated) [ERROR] Failed to authenticate

I tried following the notes at the bottom of #81 linking me to @rukins method of manually obtaining an oAuth token, and I very quickly attempted to use that token in keep.resume() receiving [INFO] Invalid token as a result.

Using the password method, judging by the response that I got, it appears that gkeepapi isn't handling the callback and allowing me to 2FA? Not certain, but this is where I'm at. :)

TarasShu commented 6 months ago

having same problem

sirEgghead commented 6 months ago

Forgot to reference:

(venv)  ~/dev/project  pip show gpsoauth
Name: gpsoauth
Version: 1.0.4
Summary: A python client library for Google Play Services OAuth.
Home-page: https://github.com/simon-weber/gpsoauth
Author: Simon Weber
Author-email: simon@simonmweber.com
License: MIT
Location: /home/user/dev/project/venv/lib/python3.12/site-packages
Requires: pycryptodomex, requests, urllib3
Required-by: gkeepapi
(venv)  ~/dev/project  pip show gkeepapi
Name: gkeepapi
Version: 0.15.1
Summary: An unofficial Google Keep API client
Home-page: 
Author: 
Author-email: Kai <z@kwi.li>
License: 
Location: /home/user/dev/project/venv/lib/python3.12/site-packages
Requires: future, gpsoauth
Required-by: 
kiwiz commented 6 months ago

I just uploaded 0.16.0. There's no changes to the resume() logic, but try updating and redoing the whole flow.

sirEgghead commented 6 months ago

I'm still stuck in the same boat. I can't retrieve the master token, only the "quick" auth token. Still trying to figure that out.

kiwiz commented 6 months ago

Just to double check, are you passing that token directly to resume() or generating a master token per https://gkeepapi.readthedocs.io/en/latest/#obtaining-a-master-token ?

sirEgghead commented 6 months ago

@kiwiz there ya go! Thanks a ton! Following the instructions at https://github.com/simon-weber/gpsoauth#alternative-flow nabbed me the master token and I was able to authenticate with gkeepapi. Thanks! :)