Site:API:Authentication
From Metrixstream
(Difference between revisions)
MetrixJustin (Talk | contribs) (→Login) |
MetrixJustin (Talk | contribs) (→Complete Example) |
||
Line 24: | Line 24: | ||
== Complete Example == | == Complete Example == | ||
− | <form action="<?cs call:getLoginPostUrl() ?>" method="post"> | + | <nowiki><form action="<?cs call:getLoginPostUrl() ?>" method="post"> |
<input type="hidden" name="continue" value="<?cs call:getPageUrl('successPage') ?>" /> | <input type="hidden" name="continue" value="<?cs call:getPageUrl('successPage') ?>" /> | ||
<input type="hidden" name="retry" value="<?cs call:getPageUrl('retryPage') ?>" /> | <input type="hidden" name="retry" value="<?cs call:getPageUrl('retryPage') ?>" /> | ||
Line 39: | Line 39: | ||
<input type="submit" value="Login" /> | <input type="submit" value="Login" /> | ||
− | </form> | + | </form></nowiki> |
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 ?> <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>