-
Notifications
You must be signed in to change notification settings - Fork 114
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
gkeepapi.exception.LoginException: ('BadAuthentication', None) #81
Comments
I get the very same error, I am trying to login with my email address and password. Less secure apps are enables in my google settings. Is there any solution for this? File "/usr/local/lib/python3.7/site-packages/gkeepapi/init.py", line 693, in login |
I'm getting the same error with both account password without 2fa and app password with 2fa. Please help anyone?? I tried to modify script and get oauth token by "legal" ways of oauth2, but to use that token for API, that particular API must be enabled for your account account, and as Google Keep API is not supported officially, there is no way to enable it for the token. Here is the error I'm getting while using oauth2
|
Here is the script I used to get API token (if anyone needs it)
|
@kiwiz gkeepapi has been working pretty fine for the last 3,4 weeks and now suddenly I got this error! Could anyone please suggest a fix for this, because my app really depends on gkeepapi, and without this working, its really affecting me! |
I've been getting the same issue. does this mean a google keep api is coming? |
try using python3.7.7 |
also getting this, just now addressing it. last successful login was April 9. I've tried regenerating the app password, and also clean installing latest version on a different system. running python 3.5.3 on a pi3 for one install and 3.5.2 on an Xenial pine64 for the other. is 3.7 really the solution for this? doesn't seem like it should matter. |
@wilsonmfg - see issue #86 to fix this. |
I'm using python 3, and it's a new clean install. I'm not sure how that "fix" applies |
@wilsonmfg - hmmmm.....I had the same issue. So what I did was upgrade my Anaconda install to Python 3.7.7 and also updated this library to the latest version (pip install --upgrade gkeepapi) and that fixed the issue. |
which goes back to my question, is 3.7 actually needed or just 3.x? 3.7 is not an easy fix on a Pi. |
agreed! seems the python version shouldn't make any difference. @kiwiz - any thoughts here? |
This solved it for me, i used pyenv to manage the python versions and made sure the latest version of python was being used (3.8.5). https://opensource.com/article/19/5/python-3-default-macac was helpful - see the 'what we should do section in particular' |
that link doesn't work. |
No luck here either. |
Try testing on another system/another account to see if you can isolate the cause of the issues. As for why Py3 is being suggested, see #69 for more details. |
I did. #81 (comment) #69 doesn't answer why python 3.7 would work any better than 3.5 |
@wilsonmfg One potential cause for these issues is described here. Updating to a newer version of Python might change your TLS fingerprint enough to get through the check. Additionally, try checking out the FAQ for other suggestions to maintain access. |
Installing a new python 3.7 env did solve it for me. |
This didn't work for me with either
|
@givanse - when you did your tests - were you logged into your Google account on your default browser? And, did you try using the step to UnlockCaptcha manually link at all after you first authenticated? I tried a fresh Debian install recently and it worked fine. |
Hadn't thought about the potential for issues if more than one account is logged in, I'll check on that, thanks. |
Got the same issue here... running on python 3.9, followed all instructions in the FAQ. Anything new? EDIT: It doesn't work on macOS, but it does on linux (on python 3.8.6). Hope this can help. |
Has anyone found a solution? Also does not work
|
Mines intermittent, every 4 in 5 reboots of Home Assistant nets this error, however it does still work if I keep rebooting it enough. When it does succeed, it works completely fine. I've tried using 0.13.1 and it doesn't appeared to have made it any better. |
Having the same issue (using HA. Started seeing after upgrading to 0.118).
Using 2FA; I even created a new app password for testing reasons; Tried the Unlock Captcha idea - doesn't work:
Shooting in the dark, as I'm not a python developer. Could there be an issue with the get_mac() function?
|
Here's how I solved it for now for Windows 10 with Python >= 3.10.x without Docker. I used v3.9.1 to save the key in keyring and then reverted back to 3.10/3.11:
Now all works in Python 3.10.x and 3.11.x when my app loads the token from keyring (You could, of course, just use pyenv for multiple versions without all this rigamarole!) :) |
Any chance you could expand on the keyring portion of this a bit? I am new to this authentication stuff, but it seems like it is just storing my password. Is there a credential/login token you are saving to keyring as well? I seem to have it semi-working but it will not log me in once I swap back to 3.11 Thank you! |
@wilsxt - when you login with gkeepapi via Python 3.9 with the Google App pw, Keep returns a long token key. That is the value you want to save in the keystore via keyring. Then, retrieve that to login with 3.10+ versions. You only need the token and no pw from that point on. |
A sample implementation for storing the master token can be found here. I have a pending PR (simon-weber/gpsoauth#41) that I can update with (#137) in a couple of days. |
@kiwiz - now caught in an unsuccessful loop. Authentication was working on python 3.9.x with the pinned gpsoauth and urllib3 packages. But, with your recent 0.15.1 change - gkeepapi doesn't run on python 3.9.x anymore. You can't get a token with python 3.10+ and the Google app pw - it just won't work (tried multiple debian and ubuntu images). So we're stuck now. Is there any way you can make 0.15.1 compatible with python 3.9 (is seems you're using the new python "|" that won't work on 3.9). |
@djsudduth Given the persistent issues people have been experiencing with user/pass authentication, I'd like to deprecate it in favor of using sudo docker run --rm -it --entrypoint /bin/sh python:3 -c 'pip install git+https://github.com/simon-weber/gpsoauth.git@8a5212481f80312e06ba6e0a29fbcfca1f210fd1; python3 -c '\''print(__import__("gpsoauth").exchange_token(input("Email: "), input("OAuth Token: "), input("Android ID: ")))'\' Instructions:
|
Any update here? |
AndroidID can be whatever. You can make it MAC addressy if you want. |
Yeah, right, it can be even empty. |
For others - here's the Docker image I created: Get an OAuth ID using @rukins "Second way" instructions: https://github.com/rukins/gpsoauth-java?tab=readme-ov-file - or log into your Google account via https://accounts.google.com/EmbeddedSetup and use the Chrome extension called "Cookie Tab Viewer" to retrieve the Log into the Docker image, paste this script, and run: Enter your Google Email ID, the OAuth ID and any value for the Android ID (I used a fake Mac address) The Keep Token will display at the top of the returned data array |
Maybe its time to create A Dockerfile, for example with the content of @djsudduth, and add it to this repo or even dockerhub so not everyone has to create its own Dockerfile and find this issue. What do you think about this? |
@kiwiz - do you happen to know when gpsoauth commit 8a52124 will be packaged and in pypi? I'm assuming it will be in 1.0.5 |
How can I make gkeepapi work for the time being before the relevant releases are made for its pip module and for gpsauth? I have read through much but not all of the above thread and it was not clear how to proceed despite the fact that it seems a partial solution has been arrived at. I have tried both running
many thx! :) |
@distbit0 try installing only the latest gpsoauth from github in a fresh python 3.10+ venv (pip install git+https://github.com/simon-weber/gpsoauth.git@8a5212481f80312e06ba6e0a29fbcfca1f210fd1) using the manual instructions (@rukins "Second way" instructions: https://github.com/rukins/gpsoauth-java?tab=readme-ov-file) to get the Keep token in my comment above. Then install gkeepapi and use that token with your code. |
Thanks that worked! Although only when I provided by google username (i.e. everything before @gmail.com) to the python command, and provided an empty string for android id. However I am not sure how to actually "use that token with your code" given that the standard login function accepts a username and password rather than a master key. Would you mind elaborating on how to do this? many thx again :) |
Ah nvm I figured it out by looking at: https://github.com/kiwiz/gkeepapi/blob/main/examples/resume.py
|
This works. |
So far mine has lasted for several months without having to be updated @artur-pf. Seems to never expire |
@kiwiz looks like gpsoauth 1.1.0 was released yesterday with the manual token exchange added - FYI! https://github.com/simon-weber/gpsoauth/blob/master/CHANGELOG.md I haven't tested it yet |
I've released version |
Closing this one out. If there are any new issues with authentication, please open an issue. |
I tried to run this code , it gives me the error above.
I tried with the Gmail login and password, then with my email login and an "app password" following these step:
other
, I named itgkeepapi
and I generated a password.The text was updated successfully, but these errors were encountered: