UserAccountService

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
(Created page with "Not properly documented yet, but some calling information can be found at UserManipulation.")
 
Line 1: Line 1:
 +
=Introduction=
 +
 +
The OpenSimulator user account service stores data such as name, UUID (PrincipalID), UserLevel, etc.data (object items, notecard items, folders, etc.).
 +
 +
This documentation is not complete yet - some more information can be found at [[UserManipulation]].
 +
 +
'''TODO: Document remaining operations'''.
 +
 +
=API=
 +
 
Not properly documented yet, but some calling information can be found at [[UserManipulation]].
 
Not properly documented yet, but some calling information can be found at [[UserManipulation]].
 +
 +
== Calls ==
 +
=== createuser ===
 +
 +
This is only available if you have explicitly set
 +
 +
[UserAccountService]
 +
AllowCreateUser = true
 +
 +
in Robust.ini.  This can currently only safely be done on closed grids (i.e. where you control all simulators).
 +
 +
Here's an example python program to call this.  It assumes that your ROBUST services are running on localhost.
 +
 +
<source lang="python">
 +
#!/usr/bin/python
 +
 +
import httplib
 +
import urllib
 +
 +
params = urllib.urlencode({'METHOD':'createuser', 'FirstName':'Jon', 'LastName':'Snow', 'Password':'test', 'PrincipalID':'3a1c8128-908f-4455-8157-66c96a46f75e'})
 +
conn = httplib.HTTPConnection("localhost", 8003);
 +
conn.request("POST", "/accounts", params)
 +
response = conn.getresponse()
 +
print response.read();
 +
</source>
 +
 +
PrincipalID is the unique ID of the user.
 +
 +
If everything goes well, you should get back
 +
 +
<source lang="xml">
 +
<?xml version="1.0"?>
 +
<ServerResponse>
 +
  <result type="List">
 +
    <FirstName>Jon</FirstName>
 +
    <LastName>Snow</LastName>
 +
    <Email/>
 +
    <PrincipalID>3a1c8128-908f-4455-8157-66c96a46f75e</PrincipalID>
 +
    <ScopeID>00000000-0000-0000-0000-000000000000</ScopeID>
 +
    <Created>1318974501</Created>
 +
    <UserLevel>0</UserLevel>
 +
    <UserFlags>0</UserFlags>
 +
    <ServiceURLs>HomeURI*;GatekeeperURI*;InventoryServerURI*;AssetServerURI*;</ServiceURLs>
 +
  </result>
 +
</ServerResponse>
 +
</source>
 +
 +
Don't worry about ScopeID, this is used for allow multiple grids to co-exist inside a single database.  Created is a unix timestamp of the time the user was created.  UserLevel determines whether the user is a god (>= 200) or can log in at all (<0).  ServiceURLs are HyperGrid related and do not concern us here.
 +
 +
If the call fails you will get the response
 +
 +
<source lang="xml">
 +
<?xml version="1.0"?>
 +
<ServerResponse>
 +
  <result>Failure</result>
 +
</ServerResponse>
 +
</source>

Revision as of 17:32, 31 October 2012

Contents

Introduction

The OpenSimulator user account service stores data such as name, UUID (PrincipalID), UserLevel, etc.data (object items, notecard items, folders, etc.).

This documentation is not complete yet - some more information can be found at UserManipulation.

TODO: Document remaining operations.

API

Not properly documented yet, but some calling information can be found at UserManipulation.

Calls

createuser

This is only available if you have explicitly set

[UserAccountService]
AllowCreateUser = true

in Robust.ini. This can currently only safely be done on closed grids (i.e. where you control all simulators).

Here's an example python program to call this. It assumes that your ROBUST services are running on localhost.

#!/usr/bin/python
 
import httplib
import urllib
 
params = urllib.urlencode({'METHOD':'createuser', 'FirstName':'Jon', 'LastName':'Snow', 'Password':'test', 'PrincipalID':'3a1c8128-908f-4455-8157-66c96a46f75e'})
conn = httplib.HTTPConnection("localhost", 8003);
conn.request("POST", "/accounts", params)
response = conn.getresponse()
print response.read();

PrincipalID is the unique ID of the user.

If everything goes well, you should get back

<?xml version="1.0"?>
<ServerResponse>
  <result type="List">
    <FirstName>Jon</FirstName>
    <LastName>Snow</LastName>
    <Email/>
    <PrincipalID>3a1c8128-908f-4455-8157-66c96a46f75e</PrincipalID>
    <ScopeID>00000000-0000-0000-0000-000000000000</ScopeID>
    <Created>1318974501</Created>
    <UserLevel>0</UserLevel>
    <UserFlags>0</UserFlags>
    <ServiceURLs>HomeURI*;GatekeeperURI*;InventoryServerURI*;AssetServerURI*;</ServiceURLs>
  </result>
</ServerResponse>

Don't worry about ScopeID, this is used for allow multiple grids to co-exist inside a single database. Created is a unix timestamp of the time the user was created. UserLevel determines whether the user is a god (>= 200) or can log in at all (<0). ServiceURLs are HyperGrid related and do not concern us here.

If the call fails you will get the response

<?xml version="1.0"?>
<ServerResponse>
  <result>Failure</result>
</ServerResponse>
General
About This Wiki