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

App Password Issue #68

Closed
stephenaustin opened this issue Aug 2, 2023 · 22 comments
Closed

App Password Issue #68

stephenaustin opened this issue Aug 2, 2023 · 22 comments
Labels
duplicate This issue or pull request already exists question Further information is requested

Comments

@stephenaustin
Copy link

Apologies if I'm missing something. The installation of Keep-it-markdown needs the app to use the App Password function on Google security. I'm familiar with this as I had to use this to get Thunderbird to work.

However this feature is no longer here. Therefore trying to install keep-it-markdown using my usual google password results in the following
Username or password is incorrect (AttributeError("module 'urllib3.util.ssl_' has no attribute 'DEFAULT_CIPHERS'"))
Could not excute KIM

Thanks for any suggestions

@djsudduth
Copy link
Owner

Hi! See issue #62 for the fix for this.

@stephenaustin
Copy link
Author

Great Don. Thanks!

@stephenaustin
Copy link
Author

As suggested I ran the following
PS C:\users\steph\downloads\keep-it-markdown-0.5.2> pip install urllib3==1.26.1
Requirement already satisfied: urllib3==1.26.1 in c:\users\steph\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (1.26.1)

Now I'm getting a 'bad authentication' error

Username or password is incorrect (LoginException('BadAuthentication'))
Could not excute KIM
PS C:\users\steph\downloads\keep-it-markdown-0.5.2> python --version
Python 3.10.11
PS C:\users\steph\downloads\keep-it-markdown-0.5.2>

@djsudduth
Copy link
Owner

Device and OS? There seems to be this issue tied to various pre-configured python and OS installations. Can you try setting up a virtual machine or a venv for a fresh install? Also, pyenv might work to try 3.11 or 3.9.

@djsudduth
Copy link
Owner

PS - see #56 for more info

@stephenaustin
Copy link
Author

Using Windows 11 Home, Version 10.0.22621 Build 22621. I tried using a virtual Ubuntu machine and got the following error.

Username or password is incorrect (NoKeyringError('No recommended backend was available. Install a recommended 3rd party backend package; or, install the keyrings.alt package if you want to use the non-recommended backends. See https://pypi.org/project/keyring for details.'))
Could not excute KIM

@stephenaustin
Copy link
Author

PS. With sudo it's:

Traceback (most recent call last):
File "/mnt/c/Users/steph/Downloads/keep-it-markdown-0.5.2/kim.py", line 2, in
import gkeepapi
ModuleNotFoundError: No module named 'gkeepapi'

@djsudduth
Copy link
Owner

djsudduth commented Aug 6, 2023

Be sure to run requirements.txt in the new virtual environment to install gkeepapi. You also need to install a linux keyring. See issue #37 for that.

@stephenaustin
Copy link
Author

Thanks for your help and patience. Have run pip install -r requirements.txt. Have Successfully installed jaraco.classes-3.3.0 keyrings.alt-5.0.0. Have Successfully installed urllib3-1.26.1.

Unfortunately still getting 'Username or password is incorrect (LoginException('BadAuthentication'))'

@djsudduth
Copy link
Owner

Did you regen the Google 2FA password again? Once you've tried one it expires. Try creating a new one. See issue #42 for a thread on retrying Google 2FA.

@djsudduth djsudduth added duplicate This issue or pull request already exists question Further information is requested labels Aug 16, 2023
@stephenaustin
Copy link
Author

Late reply. I tried again on a Asus Zen book with Pop OS. Tried with 2FA turned on, and off. Just got:
Username or password is incorrect (LoginException('BadAuthentication'))
Could not excute KIM

@djsudduth
Copy link
Owner

@stephenaustin - it is such a bummer that Google auth is difficult like this. The Keep API is available only for paid workspace users - but, I'm hoping that will change in the future. For now, this 3rd party API is all we have.

Try this, log out of all applications. Make sure Chrome is the default browser on the OS, reboot, turn 2FA on, log into your Google account in Chrome, regen the 2FA password and try again (if you have time).

@ooker777
Copy link

ooker777 commented Aug 22, 2023

I have a main account and yesterday I was still able to login with it. Today I try my other two accounts and both get:

Username or password is incorrect (LoginException('BadAuthentication'))
Could not execute KIM

The main account work on my main machine (as the credetial is already stored) and not on the another one (both are Windows 11). I then decide to try python kim.py -r and then using my new app password on my main account on my main machine. This time it says:

Login attempt failed
 Technical Error Message: LoginException('BadAuthentication', None)
Please start your browser and copy-paste this URL in the address bar: https://accounts.google.com/DisplayUnlockCaptcha - then, try logging in again.

Open the link it says:

This website is no longer available
To better protect your account, Google no longer allows account access with this website.
If you have trouble signing in, try again from a familiar device or location.

Do you have any better ideas?

@djsudduth
Copy link
Owner

@ooker777 did you save a copy of the key before running the -r flag?

@ooker777
Copy link

It's here, but I deleted it in the paddles manager page...

@Nomadjackalope
Copy link

Nomadjackalope commented Nov 8, 2023

I ran into this issue not being able to find the App Passwords but I did find it.

How you sign in to Google -> 2-Step Verification -> At the bottom is App passwords

https://myaccount.google.com/apppasswords

Edit: I missed that issue #42 had those instructions.

@djsudduth
Copy link
Owner

@Nomadjackalope So all is good now?

@stephenaustin
Copy link
Author

@stephenaustin - it is such a bummer that Google auth is difficult like this. The Keep API is available only for paid workspace users - but, I'm hoping that will change in the future. For now, this 3rd party API is all we have.

Try this, log out of all applications. Make sure Chrome is the default browser on the OS, reboot, turn 2FA on, log into your Google account in Chrome, regen the 2FA password and try again (if you have time).

Sorry for this again. When you say 'regen the 2FA password' do you mean a) the App Password or b) my main Google password'? Thanks.

@djsudduth
Copy link
Owner

djsudduth commented Jan 26, 2024

@stephenaustin - a couple of things. As of Jan 2024, Google changed their auth again. There is only one way now to get your Keep token. I'm working on new instructions in version 0.6.0 - but for now here are the steps:

  1. You won't need an app password for now
  2. You must be on Python 3.10+
  3. You can either run the Docker image to get the Keep token, or, run on your PC in a new venv if you have Python 3.10 or later
  4. The Docker image and instructions are in issue 72 -> FIX to -> Username or password is incorrect (LoginException('BadAuthentication')) #72 (comment)
  5. If you choose to try it on your own PC - then you'll need git installed and run the last pip command in the new venv in Issue 72 -> pip install git+https://github.com/simon-weber/gpsoauth.git@8a5212481f80312e06ba6e0a29fbcfca1f210fd1
    (This must be done in a fresh Python 3.10+ install or a new venv)
  6. Follow the instructions in the last comment of issue 72 to get your Keep token and save it on your PC using the kim.py script - once you have it you're good from that point on.

gpsoauth is the key library here for logging into Keep. Right now the current package version doesn't have the Jan 2024 fix. That's why you have to download the latest code from github using git. My assumption is that gpsoauth 1.0.5 will be released soon.

@djsudduth
Copy link
Owner

@stephenaustin - version 0.6.0 is out with the new instructions on how to get the Keep Token.

@stephenaustin
Copy link
Author

Thanks Don. Am checking it out

@djsudduth
Copy link
Owner

@stephenaustin Thx! Let me know if you have any issues!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants