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

Loggin issue with AppPassword #144

Closed
rhalaly opened this issue Jun 27, 2023 · 21 comments
Closed

Loggin issue with AppPassword #144

rhalaly opened this issue Jun 27, 2023 · 21 comments

Comments

@rhalaly
Copy link

rhalaly commented Jun 27, 2023

I'm using Windows 11 and Python 3.7. I have Google account with 2-Step authentication, so I generated AppPassword. But when I use it I still get

gkeepapi.LoginException: ('NeedsBrowser', 'To access your account, you must sign in on the web. Touch Next to start browser sign-in.')

What can I do further? I already created an AppPassword named gkeepapi but it still not working...

@jkitching
Copy link
Contributor

I encountered this error running an old version of gpsoauth. Looks like the fix was published in gpsoauth==1.0.1:

simon-weber/gpsoauth#37

@Cris70
Copy link

Cris70 commented Oct 18, 2023

@jkitching if I use your docker image (see here) I get the same error (NeedsBrowser).

If I use your glogin.py script in my virtualenv I get {"Error": "BadAuthentication"}.

My virtualenv has these components:

  • python 3.11.5
  • future==0.18.3
  • gkeepapi==0.15.0
  • gpsoauth==1.0.3
  • pycryptodomex==3.19.0
  • requests==2.31.0

@jalukii
Copy link

jalukii commented Nov 29, 2023

I am facing the same problem, but it is more strange. Yesterday, when I started implementing my thing with gkeepapi, I got gkeepapi.exception.BrowserLoginRequiredException: https://accounts.google.com/signin/continue?sarp=1&scc=1&continue=https://accounts.google.com/o/android/auth?hl%3Den_us%26xoauth_display_name%3DAndroid%2BLogin%2BService%26source%3DAndroid%2BLogin&plt=...

Strangely enough, it suddenly started working, so I finished my thing. Today I woke up, ran my script and it broke again. Same error, but the same configuration. Are there some Google changes? Or where can be the problem?
I figured out, the auth post failed DEBUG:urllib3.connectionpool:https://android.clients.google.com:443 "POST /auth HTTP/1.1" 403 None but I don't change any credentials. I tried to generate a new AppPassword, but won't work.

@vojtechmarek-dev
Copy link

Hi I am having same problem with trying to login to Gkeep via app password i get
gkeepapi.exception.BrowserLoginRequiredException

is there a solution for this?

@robin-pham
Copy link

robin-pham commented Dec 8, 2023

Same, ran into this "gkeepapi.exception.BrowserLoginRequiredException" issue yesterday as well (am currently using an AppPassword with 2FA). Wondering if Google changed something

@derekantrican
Copy link

derekantrican commented Dec 14, 2023

Just started seeing this after the new keep update (#153). My code was working fine until I pulled the latest version of the gkeepapi library, then I started seeing this issue. I'm also using an app password on a 2FA account like a few others here.

I put the link (like @jalukii shared) into my browser, went through a couple auth prompts, then hit an endless "please wait a moment" screen. So not as simple as following the link.

@flecmart
Copy link

Hey,

I am also currently trying to resolve this for my own project and I just leave my findings and thoughts here - maybe they help someone.

The only combination of requirements that still works for me is:

urllib3<2
gpsoauth==1.0.2
gkeepapi==0.14.2

Additionaly you need to have openssl version 1 on OS level. I achieve this for example by using python:3.11-bullseye image for docker.

As soon as you upgrade your openssl version you will get Bad Authentication exception and as soon as I upgrade gpsoauth to a more recent version I get exactly the same behavior that you are describing in this issue.

@kiwiz
What environment are you developing/testing on? I would like to bump gkeepapi and gpsoauth but I cannot get it to work and I am out of ideas at this moment.

@rchampion
Copy link

I can't seem to get any combination of python versions or requirements to login. Hoping a solution is presented soon!

@robin-pham
Copy link

I gave up completely on using Google Keep, as this authentication method seems to break every other year or so. If anyone was using this library for personal reasons I recommend something with actual official/OAuth support like Google Tasks (though who knows how long Google will keep this around either 😂).

@derekantrican
Copy link

derekantrican commented Dec 17, 2023

I would love to move to something else, but I use this library because Google Assistant has moved to exclusively using Keep for notes & lists (I use the "Note to Self" command a lot). They used to provide the option to set your own notes app, but they took that away. So now I use this library to mirror my notes to my email.

@robin-pham
Copy link

robin-pham commented Dec 17, 2023

Yeah that's exactly why I was using this library as well, for Google Assistant mirroring! I found out that if you use the "Add task" command, it adds to Google Tasks, so I no longer have to use note to self or add to my todo list/shopping list and no longer have to deal with Google Keep.

@rchampion
Copy link

I would love to move to something else, but I use this library because Google Assistant has moved to exclusively using Keep for notes & lists (I use the "Note to Self" command a lot). They used to provide the option to set your own notes app, but they took that away. So now I use this library to mirror my notes to my email.

Same. I have a script that takes Keep Notes and puts them in a bullet point list in Notion for me. Then I have GA devices all over my house, my watch, and my phone so I can voice note from anywhere. This API is literally the only way to accomplish this core part of my day to day.

@robin-pham
Copy link

Funny that we've all been using this library for a similar purpose, i.e. Google Assistant devices -> Make a Keep note with voice -> Sync to some other service.

Just FYI, I succesfully migrated my flow to Google Tasks, since it has an API officially supported by Google and has an easy OAuth method to manage personal auth, and their underlying model/API is very similar to Keep. Basically the same voice command except instead of "note to self"/"add to todo", it's "Add Task ___".

@viertel97
Copy link

Just FYI, I succesfully migrated my flow to Google Tasks, since it has an API officially supported by Google and has an easy OAuth method to manage personal auth, and their underlying model/API is very similar to Keep. Basically the same voice command except instead of "note to self"/"add to todo", it's "Add Task ___".

Could you elaborate that a little bit? (Not sure if this is the right place for it) Does it also have the same functionality regarding different lists? Eg. Add Task to List "Shopping List" or "ToDo-List"? And do you have a source regarding using the API via Python?

@robin-pham
Copy link

Could you elaborate that a little bit?

Python quickstart guide + code.

^ has the instructions on how to get an app running. You do need a Google Cloud project, but the API itself costs nothing so I haven't been getting charged. Basically I have a background worker script that polls Tasks, once it sees a new one, mirrors the tasks in my other service, then deletes the Task so I don't get reminders.

Does it also have the same functionality regarding different lists? Eg. Add Task to List "Shopping List" or "ToDo-List"?

The Tasks app itself has different lists, but the voice commands don't work with being able to add to a specific list, it'll always add tasks to the default list sadly.

@derekantrican
Copy link

For me, the "Add a task" flow always gives a second prompt of "When do you want to be reminded?". So it's not really a drop-in replacement

@derekantrican
Copy link

I just my original code working and wanted to share the solution. This is similar to @flecmart 's post above and I got it from a consumer of this project: djsudduth/keep-it-markdown#72

I ran the following:

  • pip install urllib3==1.25.1
  • pip install gpsoauth==1.0.2

After this, my original code worked with the latest version of gkeepapi

@viertel97
Copy link

I just my original code working and wanted to share the solution. This is similar to @flecmart 's post above and I got it from a consumer of this project: djsudduth/keep-it-markdown#72

I ran the following:

  • pip install urllib3==1.25.1
  • pip install gpsoauth==1.0.2

After this, my original code worked with the latest version of gkeepapi

I can confirm this!
I used that djsudduth/keep-it-markdown#72 (comment) code to gather the master token and then could login with keep.resume(GOOGLE_MAIL, TOKEN) and the following dependencies:

gpsoauth==1.0.4
gkeepapi==0.15.1

@csimpf
Copy link

csimpf commented Dec 27, 2023

Hey @derekantrican @viertel97 I attempted those steps but was still getting the same BrowserLoginRequiredException I was getting with gkeepapi and wasn't able to get further. Do you have any pointers for this?

(Either way - I was able to keep using my existing version of gkeepapi; v0.14.2 by deleting tags from my notes as per #155 (comment))

@Cris70
Copy link

Cris70 commented Dec 28, 2023

I just my original code working and wanted to share the solution. This is similar to @flecmart 's post above and I got it from a consumer of this project: djsudduth/keep-it-markdown#72
I ran the following:

  • pip install urllib3==1.25.1
  • pip install gpsoauth==1.0.2

After this, my original code worked with the latest version of gkeepapi

I can confirm this! I used that djsudduth/keep-it-markdown#72 (comment) code to gather the master token and then could login with keep.resume(GOOGLE_MAIL, TOKEN) and the following dependencies:

gpsoauth==1.0.4
gkeepapi==0.15.1

Worked for me too!!!
Thank you!

@kiwiz
Copy link
Owner

kiwiz commented Jan 19, 2024

Closing in favor of #81

@kiwiz kiwiz closed this as completed Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests