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

LoginException('BadAuthentication', None) #56

Closed
darylf opened this issue Feb 8, 2023 · 12 comments
Closed

LoginException('BadAuthentication', None) #56

darylf opened this issue Feb 8, 2023 · 12 comments
Labels
documentation Improvements or additions to documentation duplicate This issue or pull request already exists needs research Deep system issue that needs research

Comments

@darylf
Copy link

darylf commented Feb 8, 2023

I generated an app password, but I can't seem to get it to pass the keep-test.py authentication.

Things I've tried which I found in previous Issues:

  1. following the link in the error message, but I get a 404
  2. pip3 install --upgrade keyrings.alt didn't solve anything

Defaulting to user installation because normal site-packages is not writeable Requirement already satisfied: keyrings.alt in /home/username/.local/lib/python3.11/site-packages (4.2.0) Requirement already satisfied: jaraco.classes in /home/username/.local/lib/python3.11/site-packages (from keyrings.alt) (3.2.3) Requirement already satisfied: more-itertools in /home/username/.local/lib/python3.11/site-packages (from jaraco.classes->keyrings.alt) (9.0.0)

I'm not sure what else I can try to troubleshoot, or what else I can offer to help others understand my issue. Any advice would be welcomed.

@djsudduth
Copy link
Owner

What OS and version are you using? Also, are you using KIM 0.5.0? keep-test.py was deprecated to only providing the token if you needed to copy it.

@djsudduth
Copy link
Owner

djsudduth commented Feb 8, 2023

PS - I just ran it on Debian 11 using 2FA without any issue. Be sure you don't add spaces to the 2FA app password. Also, you may want to try sudoing the script.

@darylf
Copy link
Author

darylf commented Feb 8, 2023

I'm using Fedora 37 with Python 3.11.1

At first I was using a clone of this repo, but I just downloaded the 0.5.0 release zip file and it still isn't working. I see a deprecation warning for imghdr, I'm not sure if that's relevant:

/home/username/Downloads/keep-it-markdown-0.5.0/kim.py:6: DeprecationWarning: 'imghdr' is deprecated and slated for removal in Python 3.13 import imghdr

Stupid question: is a google account username typically an email address? (I'm using my gmail)

I tried running sudo python kim.py, but that didn't work as I was missing the required dependencies. I then ran sudo sh, installed the requirements.txt, and tried python kim.py from the sudo shell, still got the same error.

@djsudduth
Copy link
Owner

Hmmm.....I've seen this happen on Windows but not on Linux before. Do you have any network blocks / antivirus blocks running? Or, do you have multiple browsers on Fedora? PS - I haven't tested on v3.11.x of Python yet - but, assuming that isn't the issue.

@djsudduth
Copy link
Owner

djsudduth commented Feb 8, 2023

Take a look at this comment in the unofficial API -> kiwiz/gkeepapi#81 (comment) (note his instructions say to use pip instead of pip3 - I think that's a typo) - maybe try the venv approach??

I do think there's something device specific that causes this problem - but, I have yet to discover it.

@djsudduth
Copy link
Owner

Tested it on Python v3.11.2 - worked ok

@djsudduth
Copy link
Owner

@darylf - I think using venv might be a good thing to try - or, installing a separate fresh version of python and setting your environment to point to it so it's a clean install.

@djsudduth djsudduth added needs research Deep system issue that needs research cannot reproduce Cannot reproduce the issue or bug labels Feb 15, 2023
@jshph
Copy link

jshph commented Feb 18, 2023

I encountered this on my computer too. Set some breakpoints and found that the browser login was required.

See:
kiwiz/gkeepapi#95
kiwiz/gkeepapi#81

I resolved it according to the second link by generating a temp password as instructed! In my case, I am signed into two Google accounts, probably part of the reason why.

@djsudduth
Copy link
Owner

djsudduth commented Feb 18, 2023

Glad you solved it @jshph!! The 2FA app password seems to work for most. (Note that you don't need to use those links to the gkeepapi - the 2FA temp pw instructions are on this repo's README - for anyone else having this problem - I believe the 0.5.0 download version didn't get the updated README on the github repo page. This will get added in 0.5.1)

@rkallensee
Copy link

I had this issue, too - Ubuntu 22.10, Python 3.10.7, Google account with 2FA, used app password without success. Then I tried it within an ubuntu:20.04 Docker image and a folder shared with the host filesystem where I checked out this repository, ran apt-get install python3.8 python3-pip, installed the requirements via pip and ran python3 kim.py -r. It worked! I could imagine it has something to do with Python 3.8 working but 3.10 not.

@djsudduth
Copy link
Owner

djsudduth commented Mar 24, 2023

@rkallensee very odd! All of my development was on 3.10.x and I tested on 3.11.x. I'm not sure why these login blockers appear sometimes. Maybe something about the packages in an existing environment vs a fresh one? Just not sure...

@djsudduth
Copy link
Owner

See #71 for possible fix to the LoginException('BadAuthentication', None) error

@djsudduth djsudduth added documentation Improvements or additions to documentation duplicate This issue or pull request already exists and removed cannot reproduce Cannot reproduce the issue or bug labels Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation duplicate This issue or pull request already exists needs research Deep system issue that needs research
Projects
None yet
Development

No branches or pull requests

4 participants