-
Notifications
You must be signed in to change notification settings - Fork 113
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.LoginException: NeedsBrowser #20
Comments
Note. I setup the OTP for secure.
After finish the OAuth login, redirect to SOME_NUMBER_HERE, and SOME_TOKEN_HERE is private string. |
can you use an app pass if getpass() isn't already? |
success. thanks! if Error value are equal as "NeedBrowser" then fireing customized warning also help.
|
Added a note to the readme for now. |
I don't have 2-factor enabled. This means also there is no option for me to create an app password. Here they suggest 2 options:
Using a fresh install with Python 3.6 gives me this error:
#24 should address this. What worked for me
|
@hannesfrank Could you submit a PR with this changes? I'm (finally) seeing this behaviour. The server doesn't seem to expose any version info, so detecting this sort of thing is difficult. :/ |
Bad news, the unlock captcha setting appears to be a one thim thing: It works only for the next login attempt. Today I get the same NeedsBrowser error again. Could be that setting up 2-factor and using an app password is the only reliable solution, but I don't want to use that. Another possibility would be to try parsing the Website. But if someone figures out a reliable solution, I'd be happy to make a PR. 😃 |
Facing the same @hannesfrank That gmusicapi approach looks decent to me. I'll test it out, and report. If it works, we would be okay with adding this here, right? A bit unrelated question, but are the keep notes stored on disk somewhere? or are they only in memory? |
I experienced this issue myself when i was trying to test out gkeepapi. Funny thing is, I had disabled two-step authentication and the issue still occurred. So I thought what would happen if I enable two step authentication for my google account to be able to generate app password for my script. It turns out that it worked that way :) Hope this helps someone. |
Hey guys, I'm getting this
|
I'm only getting 'NeedsBrowser' when requesting from heroku/aws. I am able to use app password on home or work isp (att). Exact same code. Maybe this is required when google doesn't recognize the device? |
Can someone test the following code snippet with the information generated from the browser flow? import google_auth_oauthlib.flow
auth = google_auth_oauthlib.flow.Flow.from_client_config(
{'installed': {
'auth_uri': None,
'token_uri': None,
'client_id': CLIENT_ID,
}},
['https://www.google.com/accounts/OAuthLogin']
)
auth.fetch_token(code=OAUTH_CODE)
# Hopefully no exception was thrown |
Hi @kiwiz , It looks like a couple more pieces are needed, and the scope URL you have there looks invalid. Here's what worked for me: from google_auth_oauthlib.flow import Flow
client_cfg = {'installed': {
'auth_uri' : 'https://accounts.google.com/o/oauth2/auth',
'token_uri' : 'https://oauth2.googleapis.com/token',
'client_id' : MY_CLIENT_ID,
'client_secret' : MY_CLIENT_SECRET,
}}
scopes = ['https://www.googleapis.com/auth/userinfo.email', 'https://www.googleapis.com/auth/userinfo.profile']
redir_uri = 'urn:ietf:wg:oauth:2.0:oob'
auth = Flow.from_client_config(client_cfg, scopes, redirect_uri=redir_uri)
print(auth.authorization_url(prompt='consent'))
# Here, I went to the printed URL and consented to obtain OAUTH_CODE
auth.fetch_token(code=OAUTH_CODE)
#Token data successfully returned with access_token, refresh_token, and id_token, along with expires_in (presumably seconds) and expires_at (Unix timestamp) I'm not clear on what scopes you would actually need to make all of this work, though. I haven't read through any of your code yet, but I would really like to help get this working if I can, since it's not working for me! Even with an App Password, I'm always getting the NeedsBrowser error. |
I get the NeedsBrowser error when I try and login from my server, where annoyingly I have no browser. But on my laptop everything runs fine. In fact Google logged something along the way as a critical security error and I had to reset my passwords. I don't have two-factor authentication on and back in the day I ticked the 'allow less secure apps' option. |
@MortimerMcMire315 Thanks for looking into this. I've been unable to repro, but I believe those parameters are correct. We're trying to replicate the parameters described in the second post. |
Same problem just started happening to me. It was working yesterday. My guess is that it may have something to do with changing internet connections? The only code I am using is:
Throws error:
|
You need to allow an application to be added via this URL, it will simulate the recaptcha check: gkeepapi and the packaged used for the Android Application settings don't support recaptcha, and that's how google blocks you initially. |
Is there any resolution or update on this? I'm experiencing the same problem. DisplayUnlockCaptcha works partially. The error appears again after a while. 2-Step verification saddly isn't an option for me right now. Is there something else I should try or test? |
Nothing concrete, unfortunately. The last few comments here might be useful: #69 |
This was what worked for me. I'm using my own test (Google) account with no 2FA mechanism enabled, in case anyone was wondering. |
Consolidated debugging tips here. Closing this for now, but feel free to comment if you continue to have issues. |
The text was updated successfully, but these errors were encountered: