?

Log in

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

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

Problem [Mar. 27th, 2002|01:58 pm]
LiveJournal Client Discussions

lj_clients

[jingoro]
I'm trying something as simple as...

mode=login&user=jingoro&password= . . .

And it keeps telling me Invalid Password. (I've checked that I'm using my correct password a dozen times) Any clues? Must we use hpassword now?

Rumor is there are other protocols than /flat . . . any truth to this? If so, they aren't documented in the developer's area.

Thank you.

Update:
Problem solved. I should not send a CRLF pair following the password. Thought I'd tried that, but just tried it again and got some success! Thanks all who put up with me.
linkReply

Comments:
From: andyroid
2002-03-27 11:00 am (UTC)
If the password contains any characters other than letters and numbers, you must encode them in %hex format. In other words, instead of saying "secret*password", you have to say "secret%2Epassword".
Hope this helps.
(Reply) (Thread)
[User Picture]From: jingoro
2002-03-27 11:06 am (UTC)
No, the password has been properly encoded. Thank you though.
(Reply) (Parent) (Thread)
From: opiummmm
2002-03-27 11:31 am (UTC)
http://www.livejournal.com/interface/flat?mode=login&user=test&password=test

You can still login and such using a plain password, so I'm not sure what problem you're encountering.

As for the other protocol, its XMLRPC, and you can read up on it (for now) at: http://goathack.livejournal.org:8006/doc/hack/csp.xml-rpc.protocol.html
(Reply) (Thread)
[User Picture]From: jingoro
2002-03-27 11:39 am (UTC)
You're absolutely right... works great if I type it in as a URL. That makes it my bad somewhere. Lord knows where. Thank you.
(Reply) (Parent) (Thread)
[User Picture]From: jingoro
2002-03-27 12:08 pm (UTC)
Oh nice... is XMLRPC supported by the real (non-Goathack) LJ server? Is XMLRPC the same as SOAP? Is there a .wsdl description of the interface?

Are any LJ Clients currently in production using this to communicate with the servers?
(Reply) (Parent) (Thread)
From: andyroid
2002-03-27 12:09 pm (UTC)
Which programming language are you using?
I can show you the code I use in my client thingy if you want.
(Reply) (Thread)
[User Picture]From: jingoro
2002-03-27 12:19 pm (UTC)
VB.NET with heavy utilization of System.Net for HTTP communications. I'm pretty sure System.Net is !@#$ing with my request.

The relevant code, if anyone's interested:


    sBuffer = "mode=login&user=test&password=test"

    '
    ' Set up request headers
    '
    objRequest.Method = "POST"
    objRequest.Headers.Set("pragma", "no-cache")
    objRequest.ContentType = "application/x-www-form-urlencoded"
    objRequest.ContentLength = sBuffer.Length() + 2

    '
    ' Write command to request buffer
    '
    objStream = objRequest.GetRequestStream
    objWriter = New System.IO.StreamWriter(objStream, System.Text.Encoding.ASCII)
    objWriter.WriteLine(sBuffer)
    objWriter.Close()

    '
    ' Execute Request
    '
    objResponse = objRequest.GetResponse()


The code fails identically whether I use WriteLine (adds CR/LF at the end of the request body) or Write (remove the +2 in the Content Length if you switch to Write in your tests).
(Reply) (Parent) (Thread)
[User Picture]From: jingoro
2002-03-27 12:27 pm (UTC)
I'm such a fool... Write() does solve the problem. I don't know why I had a false-negative when I tested that earlier.
(Reply) (Parent) (Thread)
From: andyroid
2002-03-27 12:30 pm (UTC)
By the way, the content-length should not include the carriage return/linefeed added to the end of the string sent to the server.
(Reply) (Parent) (Thread)
[User Picture]From: jingoro
2002-03-27 12:47 pm (UTC)
It must, however, reflect what is written to the .NET HttpRequest object's buffer... hence, if I write the CRLF by calling WriteLine, it will throw an exception if I don't add two bytes to content length to reflect the extra space.

All this is irrelevant to LJ... you should not use WriteLine, and hence not add two bytes to content length, when contacting LiveJournal as I so humbly have discovered.

Thank you!
(Reply) (Parent) (Thread)