Web login code/python

From Second Life Wiki
Revision as of 16:16, 6 December 2007 by Saijanai Kuhn (talk | contribs) (started the page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This code accesses the new login webpage and returns various items. Thus far (as of RC client (6), the only important item is the web_login_key which is used in place of the md5 encrypted password in the [example python login code].

Basically, replace:

"password": md5_password

with:

"web_login_key": <output UUID from this code associated with web login key>


#!/usr/bin/python

import urllib2, urllib

data={
    'username' : 'Firstname',
    'lastname' : 'Lastname',
    'password' : 'password secret psst!',
    'continuation' : '',
    'grid'      : 'agni',
    'location'  : 'home',
}

d = urllib.urlencode(data)

import httplib
headers = {"Content-type": "application/x-www-form-urlencoded",
            "Accept": "text/plain"}
conn = httplib.HTTPSConnection("secure-web14.secondlife.com")
conn.request("POST", "/inworld/go.php", d, headers)
response = conn.getresponse()
print response.status, response.reason
print response.getheaders()
data = response.read()
conn.close()