Site:API:Authentication

From Metrixstream
(Difference between revisions)
Jump to: navigation, search
(Complete Example)
(Error Handling)
Line 20: Line 20:
  
 
== Error Handling ==
 
== Error Handling ==
A failed form submission will populate MS.error in the retry page HDF
+
A failed form submission will populate MS.error in the retry page HDF with the reason why the form has failed.
  
 
== Complete Example ==
 
== Complete Example ==

Revision as of 17:52, 2 July 2012

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>
Personal tools