RemoteAdmin:admin authenticate user

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
(Created page with " '''admin_authenticate_user''' remotely allows to authenticate an user remotely. This feature is part of the development branch, after the 0.7.6 OpenSim release. === Enabling a...")
 
m (Examples: Edited PHP example tu use RemoteAdmin PHP class instead of dead module)
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
 
'''admin_authenticate_user''' remotely allows to authenticate an user remotely. This feature is part of the development branch, after the 0.7.6 OpenSim release.
 
'''admin_authenticate_user''' remotely allows to authenticate an user remotely. This feature is part of the development branch, after the 0.7.6 OpenSim release.
  
Line 25: Line 24:
 
| ''user_lastname''
 
| ''user_lastname''
 
| last name of user
 
| last name of user
 +
|
 
|-
 
|-
 
| ''user_password''
 
| ''user_password''
 
| and MD5 hash of the user's password
 
| and MD5 hash of the user's password
 +
|
 
|-
 
|-
 
| ''token_lifetime''
 
| ''token_lifetime''
Line 50: Line 51:
 
|''error''
 
|''error''
 
| the error that occurred (ie: authentication failed messages)
 
| the error that occurred (ie: authentication failed messages)
 +
|
 
|-
 
|-
 
|''token''
 
|''token''
Line 57: Line 59:
  
  
=== Error messages ===
+
=== Error Messages ===
 
''error'' is set to "scene does not exist" in case no scene is available.
 
''error'' is set to "scene does not exist" in case no scene is available.
 +
 
''error'' is set to "avatar FIRSTNAME LASTNAME does not exist" in case the avatar with FIRSTNAME LASTNAME does not exist.
 
''error'' is set to "avatar FIRSTNAME LASTNAME does not exist" in case the avatar with FIRSTNAME LASTNAME does not exist.
 +
 
''error'' is set to "no password provided for FIRSTNAME LASTNAME" in case the call did not include a password for the avatar named FISTNAME LASTNAME.
 
''error'' is set to "no password provided for FIRSTNAME LASTNAME" in case the call did not include a password for the avatar named FISTNAME LASTNAME.
 +
 
''error'' is set to "no token lifetime provided for FISTNAME LASTNAME" if the ''token'' parameter has been omitted from the call.
 
''error'' is set to "no token lifetime provided for FISTNAME LASTNAME" if the ''token'' parameter has been omitted from the call.
 +
 
''error'' is set to "token lifetime longer than 30s for FISTNAME LASTNAME" in case the request asked for ''token_lifetime'' larger than 30.
 
''error'' is set to "token lifetime longer than 30s for FISTNAME LASTNAME" in case the request asked for ''token_lifetime'' larger than 30.
 +
 
''error'' is set to "no authentication module loaded" in case no authentication module could be loaded.
 
''error'' is set to "no authentication module loaded" in case no authentication module could be loaded.
 +
 
''error'' is set to "authentication failed for FIRSTNAME LASTNAME" in case the authentication failed for user FISTNAME LASTNAME.
 
''error'' is set to "authentication failed for FIRSTNAME LASTNAME" in case the authentication failed for user FISTNAME LASTNAME.
  
[[RemoteAdmin]]
+
= Examples =
[[RemoteAdmin:Commands]]
+
 
 +
This example needs the RemoteAdmin PHP Class file available [[RemoteAdmin:RemoteAdmin_Class|here]].
 +
 
 +
<source lang="php">
 +
<?php
 +
 
 +
// Including the RemoteAdmin PHP class.
 +
include('RemoteAdmin.php');
 +
 
 +
// Instantiate the class with parameters identical to the Python example above
 +
$myRemoteAdmin = new RemoteAdmin('127.0.0.1', 9000, 'secret');
 +
 
 +
// Invoke admin_authenticate_user (multiple parameters)
 +
$parameters = array('user_firstname' => 'Kira', 'user_lastname' => 'Komarov',
 +
                    'user_password' => 'secret', 'token_lifetime' => '10');
 +
$myRemoteAdmin->SendCommand('admin_authenticate_user', $parameters);
 +
</source>
 +
 
 +
which sends the request to OpenSim and returns an XML structure documented in the following section.
 +
 
 +
=== Return XML ===
 +
 
 +
''admin_authenticate_user'' returns an XML structure indicating whether an error occurred or if the call was successful.
 +
 
 +
==== Success ====
 +
 
 +
On a successful call to ''admin_authenticate_user'', the following is an example of the returned XML.
 +
 
 +
<source lang="php">
 +
<methodResponse>
 +
<params>
 +
  <param>
 +
    <value>
 +
      <struct>
 +
        <member>
 +
          <name>success</name>
 +
          <value>
 +
            <boolean>1</boolean>
 +
          </value>
 +
        </member>
 +
        <member>
 +
          <name>token</name>
 +
          <value>
 +
            <string>670962bb-7942-4d66-b7dc-b669b97e842e</string>
 +
          </value>
 +
        </member>
 +
      </struct>
 +
    </value>
 +
  </param>
 +
</params>
 +
</methodResponse>
 +
</source>
 +
 
 +
==== Failure ====
 +
 
 +
On an unsuccessful call to ''admin_authenticate_user'', the following is an example of the returned XML.
 +
 
 +
<source lang="xml">
 +
<methodResponse>
 +
<params>
 +
  <param>
 +
    <value>
 +
      <struct>
 +
        <member>
 +
          <name>success</name>
 +
          <value>
 +
            <boolean>0</boolean>
 +
          </value>
 +
        </member>
 +
        <member>
 +
          <name>error</name>
 +
          <value>
 +
            <string>authentication failed for Kira Komarov</string>
 +
          </value>
 +
        </member>
 +
      </struct>
 +
    </value>
 +
  </param>
 +
</params>
 +
</methodResponse>
 +
 
 +
</source>
 +
 
 +
 
 +
 
 +
[[Category:RemoteAdmin]]
 +
[[Category:RemoteAdmin Commands]]

Latest revision as of 12:09, 16 March 2021

admin_authenticate_user remotely allows to authenticate an user remotely. This feature is part of the development branch, after the 0.7.6 OpenSim release.


Contents

[edit] Enabling admin_authenticate_user

If not all functions are enabled, use admin_authenticate_user to enable the function in the [RemoteAdmin] section

enabled_methods = admin_authenticate_user,...


[edit] Parameters

[edit] Required Parameters

These parameters are required

parameter Description Values
user_firstname first name of user
user_lastname last name of user
user_password and MD5 hash of the user's password
token_lifetime the lifetime of the authentication token (max: 30s)

[edit] Returned Parameters

[edit] Returned Parameters

These parameters are returned by Remote Admin

parameter Description Values
success true when successful true, false
error the error that occurred (ie: authentication failed messages)
token the authentication token


[edit] Error Messages

error is set to "scene does not exist" in case no scene is available.

error is set to "avatar FIRSTNAME LASTNAME does not exist" in case the avatar with FIRSTNAME LASTNAME does not exist.

error is set to "no password provided for FIRSTNAME LASTNAME" in case the call did not include a password for the avatar named FISTNAME LASTNAME.

error is set to "no token lifetime provided for FISTNAME LASTNAME" if the token parameter has been omitted from the call.

error is set to "token lifetime longer than 30s for FISTNAME LASTNAME" in case the request asked for token_lifetime larger than 30.

error is set to "no authentication module loaded" in case no authentication module could be loaded.

error is set to "authentication failed for FIRSTNAME LASTNAME" in case the authentication failed for user FISTNAME LASTNAME.

[edit] Examples

This example needs the RemoteAdmin PHP Class file available here.

<?php
 
// Including the RemoteAdmin PHP class.
include('RemoteAdmin.php');
 
// Instantiate the class with parameters identical to the Python example above
$myRemoteAdmin = new RemoteAdmin('127.0.0.1', 9000, 'secret');
 
// Invoke admin_authenticate_user (multiple parameters)
$parameters = array('user_firstname' => 'Kira', 'user_lastname' => 'Komarov', 
                    'user_password' => 'secret', 'token_lifetime' => '10');
$myRemoteAdmin->SendCommand('admin_authenticate_user', $parameters);

which sends the request to OpenSim and returns an XML structure documented in the following section.

[edit] Return XML

admin_authenticate_user returns an XML structure indicating whether an error occurred or if the call was successful.

[edit] Success

On a successful call to admin_authenticate_user, the following is an example of the returned XML.

<methodResponse>
<params>
  <param>
    <value>
      <struct>
        <member>
          <name>success</name>
          <value>
            <boolean>1</boolean>
          </value>
        </member>
        <member>
           <name>token</name>
           <value>
             <string>670962bb-7942-4d66-b7dc-b669b97e842e</string>
           </value>
        </member>
      </struct>
    </value>
  </param>
 </params>
</methodResponse>

[edit] Failure

On an unsuccessful call to admin_authenticate_user, the following is an example of the returned XML.

<methodResponse>
<params>
  <param>
    <value>
      <struct>
        <member>
          <name>success</name>
          <value>
            <boolean>0</boolean>
          </value>
        </member>
        <member>
           <name>error</name>
           <value>
             <string>authentication failed for Kira Komarov</string>
           </value>
        </member>
      </struct>
    </value>
  </param>
 </params>
</methodResponse>
Personal tools
General
About This Wiki