Site:API:Authentication
From Metrixstream
(Difference between revisions)
MetrixJustin (Talk | contribs) (→Login) |
MetrixJustin (Talk | contribs) (→Login) |
||
Line 2: | Line 2: | ||
== Post URL == | == 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 == | == Required Parameters == | ||
+ | Username | ||
+ | Password | ||
== Optional Parameters == | == Optional Parameters == | ||
+ | mode | ||
+ | continue | ||
+ | retry | ||
== Error Handling == | == Error Handling == | ||
+ | A failed form submission will populate MS.error in the retry page HDF | ||
+ | |||
+ | == 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> |
Revision as of 17:51, 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
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 ?>
<?cs var:MS.error ?>
<?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>