simplenote-vim / simplenote.vim

vim plugin to interact with the simplenote service
http://www.vim.org/scripts/script.php?script_id=3582
MIT License
368 stars 31 forks source link

Authentication stopped working #103

Closed m1foley closed 5 years ago

m1foley commented 5 years ago

Simplenote#authenticate started raising an exception when I log in. I'm guessing Simplenote changed their API because simplenote.vim hasn't changed in a while, and I've verified my user/pass still works via the Simplenote Mac app and their website.

The only info I could find from HTTPError is 400 BAD REQUEST.

atomicules commented 5 years ago

Weird... I have seen some intermittent issues recently, but none that persisted. Just checked now and I am getting a Login Failed in simplenote.vim and yet doing something direct in simplenote.py worked.

Strange.

atomicules commented 5 years ago

This is odd. Will probably need to contact Simplenote/Simperium... wonder if our API token has been revoked?

atomicules commented 5 years ago

Boo hiss...

< Server: nginx
< Date: Wed, 09 Jan 2019 09:45:39 GMT
< Content-Type: application/json; charset=UTF-8
< Transfer-Encoding: chunked
< Connection: keep-alive
< Access-Control-Allow-Origin: *
< X-Frame-Options: SAMEORIGIN
< Access-Control-Allow-Credentials: true
<
* Connection #0 to host auth.simperium.com left intact
rate limited

Will have to ask Simplenote/Simperium about it. Rate limiting for auth is... annoying.

For simplenote.vim I could definitely look to cache an auth token.

atomicules commented 5 years ago

As a work-around... I could add a setting so we can provide an auth token from elsewhere (the web app) and use that if available.

atomicules commented 5 years ago

I'm thinking something like that ^

Although will look to cache a token as well.

atomicules commented 5 years ago

Simplenote support had a look and found this:

It does look like someone was trying to use a pwned user list with that token (unsuccessfully). We made some tweaks to the rate limiting and how it ties to the ip address. This should allow your users to sign in without hitting the limit. Let me know if you still see it happening though!

I have also learnt the tokens have no expiry though so I will work on adding caching asap.

louwers commented 5 years ago

Also getting 'Login Failed' with correct login details.

atomicules commented 5 years ago

If that's still happening then your only option is obtain a token from elsewhere (i.e the web app) and use it with that branch I've pushed. See the commit comment for how to get that token.

Still working on merging that in and caching a token (which I can do so we can manually edit that "cache" and add a token from elsewhere).

atomicules commented 5 years ago

Once I've bumped simplenote.py to handle errors from invalid tokens ^ and then made changes here I think we can close this out.

atomicules commented 5 years ago

Closing this out now with: https://github.com/mrtazz/simplenote.vim/commit/c79ca3f982b3cfe547d93e42907f1b1f527ebd82