Site:API:Authentication

From Metrixstream
Revision as of 17:53, 2 July 2012 by MetrixJustin (Talk | contribs)

Jump to: navigation, search

Contents

Login

Post URL

The login post URL can be generated using the getLoginPostUrl() macro, or posting to getBasePostUrl() with an action of login.

Example:

 <?cs call:getLoginPostUrl() ?>

or

 <?cs call:getBasePostUrl() ?>?action=login

Required Parameters

 Username
 Password

Optional Parameters

 mode
 continue
 retry

Error Handling

A failed form submission will populate MS.error in the retry page HDF with the reason why the form has failed.

Complete Example

 <form action="<?cs call:getLoginPostUrl() ?>" method="post">
    <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>

Signup

Logout

Personal tools