Site:API:Authentication

From Metrixstream
(Difference between revisions)
Jump to: navigation, search
(Login)
(Login)
Line 1: Line 1:
= Login =
+
= Authentication =
  
== Post URL ==
+
== Login ==
  
The login post URL can be generated using the getLoginPostUrl() macro, or posting to getBasePostUrl() with an action of login.
+
This API call is responsible for logging in a user.
  
Example:
+
=== Authentication Restrictions ===
  <?cs call:getLoginPostUrl() ?>
+
or
+
  <?cs call:getBasePostUrl() ?>?action=login
+
  
== Required Parameters ==
+
None.
  Username
+
  Password
+
  
== Optional Parameters ==
+
=== Required Parameters ===
  mode
+
  continue
+
  retry
+
  
== Error Handling ==
+
* <code>action=login</code>
A failed form submission will populate MS.error in the retry page HDF with the reason why the form has failed.
+
* <code>username</code>: the username of the user
 +
* <code>password</code>: the password of the user
  
== Complete Example ==
+
=== Successful Response ===
  
  <nowiki><form action="<?cs call:getLoginPostUrl() ?>" method="post">
+
* <code>status=ok</code>
    <input type="hidden" name="continue" value="<?cs call:getPageUrl('successPage') ?>" />
+
    <input type="hidden" name="retry" value="<?cs call:getPageUrl('retryPage') ?>" />
+
 
+
    <?cs if:MS.error ?>
+
      <div id="error"><?cs var:MS.error ?></div>
+
    <?cs /if ?>
+
 
+
    <label>Username</label>
+
    <input type="text" name="username" value="" />
+
 
+
    <label>Password</label>
+
    <input type="text" name="password" value="" />
+
 
+
    <input type="submit" value="Login" />
+
  </form></nowiki>
+
  
 
= Signup =
 
= Signup =
  
 
= Logout =
 
= Logout =

Revision as of 22:21, 8 January 2013

Contents

Authentication

Login

This API call is responsible for logging in a user.

Authentication Restrictions

None.

Required Parameters

  • action=login
  • username: the username of the user
  • password: the password of the user

Successful Response

  • status=ok

Signup

Logout

Personal tools