Previous topic

llsd_sender

Next topic

message

This Page

login

class pyogp.lib.base.login.OGPLoginParams(firstname, lastname, password)

an OGP plain password credential

initialize this credential

serialize()
return a dictionary of login params
class pyogp.lib.base.login.Login(settings=None, handler=None)

logs into a login endpoint

There are 2 cases here: ‘legacy’ login and ‘OGP’ login.
Legacy = standard Second Life/OpenSim login OGP = Open Grid Protocol enabled grid, where one logs into an agent domain

Example (legacy oriented):

The login type is determined by parsing the login uri ‘legacy’ = login.cgi ‘ogp’ = auth.cgi

Initialize the login class >>> login = Login()

Setup some login parameters. >>> login_params = LegacyLoginParams(‘firstname’, ‘lastname’, ‘password’) >>> login_params = login_params.serialize()

login stores & returns the response from the loginuri (in our example a mock response) >>> login.login(‘http://localhost:12345/login.cgi‘, login_params, ‘region’) {‘login’: ‘true’, ‘seed_capability’: ‘http://127.0.0.1:12345/seed_cap‘}

>>> login.response['login']
true

Sample implementations: examples/sample_login.py Tests: tests/login.txt, tests/test_legacy_login.py, tests/test_ogp_login.py

initialize the login object

login(loginuri=None, login_params=None, start_location=None, handler=None)
high level login initiator, returns the login response as a dict
class pyogp.lib.base.login.LegacyLoginParams(firstname, lastname, password)

a legacy plain password credential

initialize this credential

serialize()
return a dictionary of login params