vitalyrodnenko / geeknote

Console client for Evernote.
2.1k stars 332 forks source link

Two Factor authentication broken #236

Open blueberrycake opened 9 years ago

blueberrycake commented 9 years ago

Platform: OS X Yosemite with Python 2.7.6

Issue: Running "geeknote login" when two factor authentication is enabled throws the following error:

'''

: Allow Access...Traceback (most recent call last): File "/Library/Python/2.7/site-packages/geeknote-0.2a-py2.7.egg/geeknote/geeknote.py", line 851, in main User().login(*_ARGS) File "/Library/Python/2.7/site-packages/geeknote-0.2a-py2.7.egg/geeknote/geeknote.py", line 34, in wrapper return func(_args, **kwargs) File "/Library/Python/2.7/site-packages/geeknote-0.2a-py2.7.egg/geeknote/geeknote.py", line 338, in login if self.getEvernote().auth(): File "/Library/Python/2.7/site-packages/geeknote-0.2a-py2.7.egg/geeknote/geeknote.py", line 141, in auth self.authToken = GNA.getToken() File "/Library/Python/2.7/site-packages/geeknote-0.2a-py2.7.egg/geeknote/oauth.py", line 133, in getToken self.allowAccess() File "/Library/Python/2.7/site-packages/geeknote-0.2a-py2.7.egg/geeknote/oauth.py", line 243, in allowAccess responseData = self.parseResponse(response.location) File "/Library/Python/2.7/site-packages/geeknote-0.2a-py2.7.egg/geeknote/oauth.py", line 124, in parseResponse return dict(item.split('=', 1) for item in data.split('?')[-1].split('&')) ValueError: dictionary update sequence element #0 has length 1; 2 is required '''

If two factor authentication is disabled, then the login works fine

immerzeel commented 9 years ago

Application password with 2FA doesn't seem to be a viable workaround, but it could be the firewall at work.

Hope they will fix it shortly.

weierophinney commented 9 years ago

I just did the following:

Evernote indicates that next login via Geeknote will require 2FA -- but because the authorization token is already present, it appears to work without a problem.

At best, it's a workaround. From the limited debugging I did, it appeared that the redirect URL returned from submitting the 2FA credentials is a maintenance page (pointed to https://maintenance.evernote.com/maintenance.html - which is why geeknote/oauth.py line 124 fails -- no query string present), which tells me that likely something subtle changed in the Evernote OAuth2 workflow, leading to the current breakage.