Log in

No account? Create an account
LiveJournal Client Discussions [entries|archive|friends|userinfo]
LiveJournal Client Discussions

[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

XML-RPC challenge clarification? [Apr. 6th, 2005|09:57 am]
LiveJournal Client Discussions



I've been working on a posting-only client written in Ruby, designed to be used as a 'filter' called from text editors. While what I have appears to be working, I started running into strange issues yesterday.

The client right now does the following:

  • Sends LJ.XMLRPC.getchallenge call
  • Computes response
  • Sends LJ.XMLRPC.login call
  • Verifies security and journal write access
  • Sends LJ.XMLRPC.postevent call

You can see in this process it only computes the response once, and sends the same one for both the login and postevent XML calls.

The strange issue is that this process consistently works on the test account on test.livejournal.org, and on Monday it did work posting to my real LiveJournal account... but yesterday (when I was ready to release the client, no less) and this morning it's produced an "invalid password" error. The password, however, is correct. And, to add further strangeness, if I comment out the login call, then the postevent call will work correctly.

So: is the problem here that I need to execute a second getchallenge call and compute a new response before I send the postevent call? And if so, why does it work on the test server, and why has it sometimes worked on the production one? (Is the challenge only good for a second or two?)


[User Picture]From: int
2005-04-06 05:19 pm (UTC)
I'm pretty sure you have to get a new challenge every single time you hit the server; no idea why it isn't that way on the test server.
(Reply) (Thread)
[User Picture]From: marksmith
2005-04-06 06:40 pm (UTC)
Yes, you need a new challenge for every request. No idea why the test server would be any different.
(Reply) (Thread)
From: m_leprae
2005-04-07 01:53 am (UTC)
I had some timing issues when I was first developing my own code (both flat and XMLRPC). I suspect you have something similar and also that the load on the real server is sometimes causing enough of a delay that it doesn't quite get around to handling your session prior to the challenge expiring.
(Reply) (Thread)