ljr/livejournal/doc/raw/build/protocol/sessiongenerate.mode.xml

109 lines
2.8 KiB
XML
Raw Permalink Normal View History

2019-02-05 21:49:12 +00:00
<method name="sessiongenerate">
<shortdes>
Generate a session cookie.
</shortdes>
<des>
In order to interact with some web based parts of the site, such as the
comment exporter, it is often useful to be able to generate a login cookie
without having to actually post login information to the login.bml page.
This mode will, with proper authentication, provide you with a session
cookie to use for authentication purposes.
</des>
<arguments><struct count="1">
&authInfo;
<key name="expiration" count="opt">
<scalar><des>
Sessions can either expire in a short amount of time or last for a long period
of time. You can specify either "short" or "long" as the value of this parameter.
</des></scalar>
</key>
<key name="ipfixed" count="opt">
<scalar><des>
If specified and true, this will cause the server to generate a session that is
only valid from the IP address the sessiongenerate request was sent from. If you
leave out this value, it will default to allowing any IP address to use this
session information.
</des></scalar>
</key>
</struct></arguments>
<expost>
POST /interface/xmlrpc HTTP/1.0
User-Agent: XMLRPC Client 1.0
Host: www.livejournal.com
Content-Type: text/xml
Content-Length: 542
&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;methodCall&gt;
&lt;methodName&gt;LJ.XMLRPC.sessiongenerate&lt;/methodName&gt;
&lt;params&gt;
&lt;param&gt;
&lt;value&gt;&lt;struct&gt;
&lt;member&gt;&lt;name&gt;username&lt;/name&gt;
&lt;value&gt;&lt;string&gt;test&lt;/string&gt;&lt;/value&gt;
&lt;/member&gt;
&lt;member&gt;&lt;name&gt;password&lt;/name&gt;
&lt;value&gt;&lt;string&gt;test&lt;/string&gt;&lt;/value&gt;
&lt;/member&gt;
&lt;member&gt;&lt;name&gt;ver&lt;/name&gt;
&lt;value&gt;&lt;int&gt;1&lt;/int&gt;&lt;/value&gt;
&lt;/member&gt;
&lt;member&gt;&lt;name&gt;expiration&lt;/name&gt;
&lt;value&gt;&lt;string&gt;long&lt;/string&gt;&lt;/value&gt;
&lt;/member&gt;
&lt;member&gt;&lt;name&gt;ipfixed&lt;/name&gt;
&lt;value&gt;&lt;string&gt;1&lt;/string&gt;&lt;/value&gt;
&lt;/member&gt;
&lt;/struct&gt;&lt;/value&gt;
&lt;/param&gt;
&lt;/params&gt;
&lt;/methodCall&gt;
</expost>
<!--===================[ RETURN ]==============================-->
<returns><struct count="1">
<key name="ljsession" count="1">
<scalar><des>
The session generated.
</des></scalar>
</key>
</struct></returns>
<exreturn>
HTTP/1.1 200 OK
Connection: close
Content-length: 228
Content-Type: text/xml
Date: Fri, 26 Mar 2004 18:14:17 GMT
Server: Apache/1.3.4 (Unix)
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;methodResponse&gt;
&lt;params&gt;
&lt;param&gt;
&lt;value&gt;&lt;struct&gt;
&lt;member&gt;&lt;name&gt;ljsession&lt;/name&gt;
&lt;value&gt;&lt;string&gt;ws:test:124:zfFG136kSz&lt;/string&gt;
&lt;/value&gt;&lt;/member&gt;
&lt;/struct&gt;&lt;/value&gt;
&lt;/param&gt;
&lt;/params&gt;
&lt;/methodResponse&gt;
</exreturn>
</method>