API Demo

This is a copy from my misposting on the Client forum.

I don't know if it was a security update or whatever but the API demo won't log into my server anymore. 

Shane

Comments

  • Well, I think I figured it out, so never mind.
  • Or not.  It works ok without a password, but when you create an account it says bad password.
  • Strange. Authentification did not change since it was created, but did not have time so far to retest the demo.

    Is password/user creation in api because creating an user in gui is no problem. If so what is your call to find error.
  • edited February 2020
    Yeah I thought so too.  All I'm trying to do is log in, I was going to add multiple camera choices to the Cura plugin now that I have an extra camera, but it wouldn't let me log in.   It used to work, which is the oddity.  If I remove my user it seems to work ok.  I tested in Raspberry Pi and Ubuntu.  
  • Ok I have tested it and it did not work in deed. Problem is timing between loginRequired and response from first command where we fetched the session. So session required for login was set after login which fails for using wrong session id in authentification. See this socket communication:

    {"action":"listPrinter","data":{},"printer":"","callback_id":1}63
    12:19:06.111
    {"callback_id":-1,"data":[{"data":{"session":"dHq2Mpcle!W!2iIGFO5!neg!e8TO2#u6"},"event":"loginRequired","printer":""}],"eventList":true}137
    12:19:06.213
    {"action":"login","data":{"login":"repetier","password":"5668967689678689"},"printer":"","callback_id":2}121
    12:19:06.214
    {"callback_id":1,"data":{"permissionDenied":true},"session":"dHq2Mpcle!W!2iIGFO5!neg!e8TO2#u6"}95
    12:19:06.216

    Solution is to use the session already provided in the loginRequired event so we definitively use the correct one.

    I have updated the demo accordingly.
  • Thank you sir!
Sign In or Register to comment.