Mikescher/AlephNote

StandardNotes, status 410

sn3akyb3ar opened this issue · 7 comments

I guess they changed something?

AlephNote.Plugins.StandardNote.StandardNoteAPIException: Server returned status 410.
Message: 'Please update your client application.' ---> AlephNote.PluginInterface.Exceptions.RestStatuscodeException: Server sync.standardnotes.org returned status code: 410 : Gone
   at AlephNote.Common.Network.SimpleJsonRest.GenericTwoWay[TResult](Object body, String path, HttpMethod method, Int32[] allowedStatusCodes, String[] parameter)
   at AlephNote.Common.Network.SimpleJsonRest.PostTwoWay[TResult](Object body, String path, String[] parameter)
   at AlephNote.Plugins.StandardNote.StandardNoteAPI.Authenticate004(ISimpleJsonRest web, APIResultAuthParams apiparams, String mail, String uip, AlephLogger logger)
   --- End of inner exception stack trace ---
   at AlephNote.Plugins.StandardNote.StandardNoteAPI.Authenticate004(ISimpleJsonRest web, APIResultAuthParams apiparams, String mail, String uip, AlephLogger logger)
   at AlephNote.Plugins.StandardNote.StandardNoteAPI.Authenticate(ISimpleJsonRest web, String mail, String password, AlephLogger logger)
   at AlephNote.Plugins.StandardNote.StandardNoteConnection.RefreshToken(StandardNoteData dat)
   at AlephNote.Plugins.StandardNote.StandardNoteConnection.CreateAuthenticatedClient(StandardNoteData dat)
   at AlephNote.Plugins.StandardNote.StandardNoteConnection.StartSync(IRemoteStorageSyncPersistance idata, List`1 ilocalnotes, List`1 localdeletednotes)
   at AlephNote.Common.Repository.SynchronizationThread.DoSync(Boolean isImmediateResync)

Jep I get the same error:

Send:
{
  "email": ".....",
  "password": "......",
  "api": "20200115"
}

---------------------

Recieved:
{"error":{"message":"Please update your client application."}}

will look into it this weekend

btw sorry I didn't respond earlier - it seems github stopped sending me emails when issues are created?

The cli project has the same issue: jonhadfield/sn-cli#33

Ok seems like the new flow seems to be (taken from the web app):

  • Create a random nonce and call it codeVerifier
  • codeChallenge = base64(sha256(codeVerifier))
  • Send code_challenge: "..." in json body of request to /login-params
  • Send code_verifier: "..." in json body of request to /login

Then everything should work again - kinda annoying that this is not a new api version and is not even documented anywhere...

Okay, it really looks like SN changed even more in the auth flow - this sucks....

(don't try the newest pre release, it doesn't work either)

Latest version v1.7.13 fixes it - it is a pretty ugly hack... but for the real solution we have to wait for the SN ticket