<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>Wt: Wt::Auth::AuthService Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> </head> <body> <div id="top"><!-- do not remove this div! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">Wt  <span id="projectnumber">3.2.3</span> </div> </td> </tr> </tbody> </table> </div> <!-- Generated by Doxygen 1.7.5.1 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class List</span></a></li> <li><a href="inherits.html"><span>Class Hierarchy</span></a></li> <li><a href="functions.html"><span>Class Members</span></a></li> </ul> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="namespaceWt.html">Wt</a> </li> <li class="navelem"><a class="el" href="namespaceWt_1_1Auth.html">Auth</a> </li> <li class="navelem"><a class="el" href="classWt_1_1Auth_1_1AuthService.html">AuthService</a> </li> </ul> </div> </div> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> | <a href="#pro-methods">Protected Member Functions</a> </div> <div class="headertitle"> <div class="title">Wt::Auth::AuthService Class Reference<div class="ingroups"><a class="el" href="group__auth.html">Authentication module (Wt::Auth)</a></div></div> </div> </div> <div class="contents"> <!-- doxytag: class="Wt::Auth::AuthService" --> <p>Basic authentication service. <a href="classWt_1_1Auth_1_1AuthService.html#details">More...</a></p> <p><code>#include <Wt/Auth/AuthService></code></p> <p><a href="classWt_1_1Auth_1_1AuthService-members.html">List of all members.</a></p> <table class="memberdecls"> <tr><td colspan="2"><h2><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9e2bcf05b58e1b2b9282b04f731cc2a1"></a><!-- doxytag: member="Wt::Auth::AuthService::AuthService" ref="a9e2bcf05b58e1b2b9282b04f731cc2a1" args="()" -->  </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Auth_1_1AuthService.html#a9e2bcf05b58e1b2b9282b04f731cc2a1">AuthService</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Constructor. <br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5e8d54401a87bb4220ebe76d606445c6"></a><!-- doxytag: member="Wt::Auth::AuthService::~AuthService" ref="a5e8d54401a87bb4220ebe76d606445c6" args="()" --> virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Auth_1_1AuthService.html#a5e8d54401a87bb4220ebe76d606445c6">~AuthService</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Destructor. <br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Auth_1_1AuthService.html#aa53b495589aeb0618125faccddbce891">setRandomTokenLength</a> (int length)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Sets the token length. <a href="#aa53b495589aeb0618125faccddbce891"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Auth_1_1AuthService.html#a753e6b14790cae24a2cb422b6560baaa">randomTokenLength</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the token length. <a href="#a753e6b14790cae24a2cb422b6560baaa"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Auth_1_1AuthService.html#aefb84d11c1dbc0c335b406ca9d3e3572">setIdentityPolicy</a> (<a class="el" href="group__auth.html#ga8ce12bbc04d68d5687f08abf2a209436">IdentityPolicy</a> policy)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Configures the identity policy. <a href="#aefb84d11c1dbc0c335b406ca9d3e3572"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__auth.html#ga8ce12bbc04d68d5687f08abf2a209436">IdentityPolicy</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Auth_1_1AuthService.html#a9f4dbd3fdba972e0e4500064de9c5617">identityPolicy</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the identity policy. <a href="#a9f4dbd3fdba972e0e4500064de9c5617"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classWt_1_1Auth_1_1User.html">User</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Auth_1_1AuthService.html#a754bc3e4a15e3dbbf1a2d413926f9de7">identifyUser</a> (const <a class="el" href="classWt_1_1Auth_1_1Identity.html">Identity</a> &identity, <a class="el" href="classWt_1_1Auth_1_1AbstractUserDatabase.html">AbstractUserDatabase</a> &users) const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Tries to match the identity to an existing user. <a href="#a754bc3e4a15e3dbbf1a2d413926f9de7"></a><br/></td></tr> <tr><td colspan="2"><div class="groupHeader">Authentication token support</div></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Auth_1_1AuthService.html#a863f6b1c7c5586ca6075983d8c5070a5">setAuthTokensEnabled</a> (bool enabled, const std::string &cookieName="wtauth")</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Configures authentication token support. <a href="#a863f6b1c7c5586ca6075983d8c5070a5"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Auth_1_1AuthService.html#a0da404df0c11f795e44b8b61644242a8">authTokensEnabled</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns whether authentication tokens are enabled. <a href="#a0da404df0c11f795e44b8b61644242a8"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">std::string </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Auth_1_1AuthService.html#ae1ad019161db71c56a2ef7500d8025eb">authTokenCookieName</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the authentication token cookie name. <a href="#ae1ad019161db71c56a2ef7500d8025eb"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Auth_1_1AuthService.html#a2f7bbeba49691c5fd9f974b1d559fe9c">setTokenHashFunction</a> (<a class="el" href="classWt_1_1Auth_1_1HashFunction.html">HashFunction</a> *function)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Sets the token hash function. <a href="#a2f7bbeba49691c5fd9f974b1d559fe9c"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classWt_1_1Auth_1_1HashFunction.html">HashFunction</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Auth_1_1AuthService.html#a3025be95a68e2c6abcfad0eefa0dc080">tokenHashFunction</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the token hash function. <a href="#a3025be95a68e2c6abcfad0eefa0dc080"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">std::string </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Auth_1_1AuthService.html#a43560f963856a0d7f8849be343fad578">createAuthToken</a> (const <a class="el" href="classWt_1_1Auth_1_1User.html">User</a> &user) const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Creates and stores an authentication token for the user. <a href="#a43560f963856a0d7f8849be343fad578"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classWt_1_1Auth_1_1AuthTokenResult.html">AuthTokenResult</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Auth_1_1AuthService.html#af830912428ce28663ab6da56f74ff03e">processAuthToken</a> (const std::string &token, <a class="el" href="classWt_1_1Auth_1_1AbstractUserDatabase.html">AbstractUserDatabase</a> &users) const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Processes an authentication token. <a href="#af830912428ce28663ab6da56f74ff03e"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Auth_1_1AuthService.html#a53c56267c8588a58affe3d6ed66edeb6">setAuthTokenValidity</a> (int minutes)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Configures the duration for an authenticaton to remain valid. <a href="#a53c56267c8588a58affe3d6ed66edeb6"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Auth_1_1AuthService.html#a0c9f813ffe37804f21d0e2660f2ecbb5">authTokenValidity</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the authentication token validity. <a href="#a0c9f813ffe37804f21d0e2660f2ecbb5"></a><br/></td></tr> <tr><td colspan="2"><div class="groupHeader">Email verification</div></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Auth_1_1AuthService.html#a545208b47b73bc8f4d736753fd967eec">setEmailVerificationEnabled</a> (bool enabled)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Configures email verification. <a href="#a545208b47b73bc8f4d736753fd967eec"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Auth_1_1AuthService.html#a7b2c813faf0eb91aa8befc13420707a1">emailVerificationEnabled</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns wheter email verification is configured. <a href="#a7b2c813faf0eb91aa8befc13420707a1"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Auth_1_1AuthService.html#ac1ce625114817d88f32b041473e5cfcf">setEmailRedirectInternalPath</a> (const std::string &internalPath)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Sets the internal path used to present tokens in emails. <a href="#ac1ce625114817d88f32b041473e5cfcf"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">std::string </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Auth_1_1AuthService.html#a404acdd869b69127d7ca01cfe6cd6f53">emailRedirectInternalPath</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the internal path used for email tokens. <a href="#a404acdd869b69127d7ca01cfe6cd6f53"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual std::string </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Auth_1_1AuthService.html#ae0fb1366eb2dc99ef6c098abdf6cf1e5">parseEmailToken</a> (const std::string &internalPath) const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Parses the emailtoken from an internal path. <a href="#ae0fb1366eb2dc99ef6c098abdf6cf1e5"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Auth_1_1AuthService.html#a4c34af5f36ba29b35cd457744fbd4bfe">verifyEmailAddress</a> (const <a class="el" href="classWt_1_1Auth_1_1User.html">User</a> &user, const std::string &emailAddress) const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Verifies an email address. <a href="#a4c34af5f36ba29b35cd457744fbd4bfe"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Auth_1_1AuthService.html#ae296f0f6cf5d481d3442724ca813b05d">lostPassword</a> (const std::string &emailAddress, <a class="el" href="classWt_1_1Auth_1_1AbstractUserDatabase.html">AbstractUserDatabase</a> &users) const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Implements lost password functionality. <a href="#ae296f0f6cf5d481d3442724ca813b05d"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classWt_1_1Auth_1_1EmailTokenResult.html">EmailTokenResult</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Auth_1_1AuthService.html#a0c09fb5aa0e54aa1da0069ad7b116436">processEmailToken</a> (const std::string &token, <a class="el" href="classWt_1_1Auth_1_1AbstractUserDatabase.html">AbstractUserDatabase</a> &users) const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Processes an email token. <a href="#a0c09fb5aa0e54aa1da0069ad7b116436"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Auth_1_1AuthService.html#ad184b5136649e3af107dab3153eb9374">setEmailTokenValidity</a> (int minutes)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Configures the duration for an email token to remain valid. <a href="#ad184b5136649e3af107dab3153eb9374"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Auth_1_1AuthService.html#a2ba65075ee8cb376ff83acc6e4083a86">emailTokenValidity</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the duration for an email token to remain valid. <a href="#a2ba65075ee8cb376ff83acc6e4083a86"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Auth_1_1AuthService.html#a122b753f1984e837f9352b89afefcc38">sendMail</a> (const <a class="el" href="classWt_1_1Mail_1_1Message.html">Mail::Message</a> &message) const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Sends an email. <a href="#a122b753f1984e837f9352b89afefcc38"></a><br/></td></tr> <tr><td colspan="2"><h2><a name="pro-methods"></a> Protected Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Auth_1_1AuthService.html#a746494212f7bb5d360169df39cc60abd">sendConfirmMail</a> (const std::string &address, const <a class="el" href="classWt_1_1Auth_1_1User.html">User</a> &user, const std::string &token) const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Sends a confirmation email to the user to verify his email address. <a href="#a746494212f7bb5d360169df39cc60abd"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Auth_1_1AuthService.html#af3dfd72946e563772e201420d4856ebe">sendLostPasswordMail</a> (const std::string &address, const <a class="el" href="classWt_1_1Auth_1_1User.html">User</a> &user, const std::string &token) const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Sends an email to the user to enter a new password. <a href="#af3dfd72946e563772e201420d4856ebe"></a><br/></td></tr> </table> <hr/><a name="details" id="details"></a><h2>Detailed Description</h2> <div class="textblock"><p>Basic authentication service. </p> <p>This class presents an basic authentication service, which offers authentication functionality that is not specific to an authentication mechanism (such as password authentication or OAuth authentication).</p> <p>Like all <b>service classes</b>, this class holds only configuration state. Thus, once configured, it can be safely shared between multiple sessions since its state (the configuration) is read-only. A "const AuthService" object is thus thread-safe.</p> <p>The class provides the following services (and relevant configuration):</p> <ul> <li>settings for generating random tokens:<ul> <li><a class="el" href="classWt_1_1Auth_1_1AuthService.html#aa53b495589aeb0618125faccddbce891" title="Sets the token length.">setRandomTokenLength()</a></li> </ul> </li> <li>authentication tokens, used by e.g. remember-me functionality:<ul> <li><a class="el" href="classWt_1_1Auth_1_1AuthService.html#a863f6b1c7c5586ca6075983d8c5070a5" title="Configures authentication token support.">setAuthTokensEnabled()</a></li> <li><a class="el" href="classWt_1_1Auth_1_1AuthService.html#af830912428ce28663ab6da56f74ff03e" title="Processes an authentication token.">processAuthToken()</a></li> </ul> </li> <li>email tokens, for email verification and lost password functions:<ul> <li><a class="el" href="classWt_1_1Auth_1_1AuthService.html#a545208b47b73bc8f4d736753fd967eec" title="Configures email verification.">setEmailVerificationEnabled()</a></li> <li><a class="el" href="classWt_1_1Auth_1_1AuthService.html#ae296f0f6cf5d481d3442724ca813b05d" title="Implements lost password functionality.">lostPassword()</a></li> <li><a class="el" href="classWt_1_1Auth_1_1AuthService.html#a4c34af5f36ba29b35cd457744fbd4bfe" title="Verifies an email address.">verifyEmailAddress()</a></li> <li><a class="el" href="classWt_1_1Auth_1_1AuthService.html#a0c09fb5aa0e54aa1da0069ad7b116436" title="Processes an email token.">processEmailToken()</a> </li> </ul> </li> </ul> </div><hr/><h2>Member Function Documentation</h2> <a class="anchor" id="ae1ad019161db71c56a2ef7500d8025eb"></a><!-- doxytag: member="Wt::Auth::AuthService::authTokenCookieName" ref="ae1ad019161db71c56a2ef7500d8025eb" args="() const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">std::string Wt::Auth::AuthService::authTokenCookieName </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </div> <div class="memdoc"> <p>Returns the authentication token cookie name. </p> <p>This is the default cookie name used for storing the authentication token in the user's browser.</p> <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1Auth_1_1AuthService.html#a863f6b1c7c5586ca6075983d8c5070a5" title="Configures authentication token support.">setAuthTokensEnabled()</a> </dd></dl> </div> </div> <a class="anchor" id="a0da404df0c11f795e44b8b61644242a8"></a><!-- doxytag: member="Wt::Auth::AuthService::authTokensEnabled" ref="a0da404df0c11f795e44b8b61644242a8" args="() const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool Wt::Auth::AuthService::authTokensEnabled </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </div> <div class="memdoc"> <p>Returns whether authentication tokens are enabled. </p> <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1Auth_1_1AuthService.html#a863f6b1c7c5586ca6075983d8c5070a5" title="Configures authentication token support.">setAuthTokensEnabled()</a> </dd></dl> </div> </div> <a class="anchor" id="a0c9f813ffe37804f21d0e2660f2ecbb5"></a><!-- doxytag: member="Wt::Auth::AuthService::authTokenValidity" ref="a0c9f813ffe37804f21d0e2660f2ecbb5" args="() const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int Wt::Auth::AuthService::authTokenValidity </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </div> <div class="memdoc"> <p>Returns the authentication token validity. </p> <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1Auth_1_1AuthService.html#a53c56267c8588a58affe3d6ed66edeb6" title="Configures the duration for an authenticaton to remain valid.">setAuthTokenValidity()</a> </dd></dl> </div> </div> <a class="anchor" id="a43560f963856a0d7f8849be343fad578"></a><!-- doxytag: member="Wt::Auth::AuthService::createAuthToken" ref="a43560f963856a0d7f8849be343fad578" args="(const User &user) const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">std::string Wt::Auth::AuthService::createAuthToken </td> <td>(</td> <td class="paramtype">const <a class="el" href="classWt_1_1Auth_1_1User.html">User</a> & </td> <td class="paramname"><em>user</em></td><td>)</td> <td> const</td> </tr> </table> </div> <div class="memdoc"> <p>Creates and stores an authentication token for the user. </p> <p>This creates and stores a new authentication token for the given user.</p> <p>The returned value is the token that may be used to re-identify the user in <a class="el" href="classWt_1_1Auth_1_1AuthService.html#af830912428ce28663ab6da56f74ff03e" title="Processes an authentication token.">processAuthToken()</a>. </p> </div> </div> <a class="anchor" id="a404acdd869b69127d7ca01cfe6cd6f53"></a><!-- doxytag: member="Wt::Auth::AuthService::emailRedirectInternalPath" ref="a404acdd869b69127d7ca01cfe6cd6f53" args="() const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">std::string Wt::Auth::AuthService::emailRedirectInternalPath </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </div> <div class="memdoc"> <p>Returns the internal path used for email tokens. </p> <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1Auth_1_1AuthService.html#ac1ce625114817d88f32b041473e5cfcf" title="Sets the internal path used to present tokens in emails.">setEmailRedirectInternalPath()</a> </dd></dl> </div> </div> <a class="anchor" id="a2ba65075ee8cb376ff83acc6e4083a86"></a><!-- doxytag: member="Wt::Auth::AuthService::emailTokenValidity" ref="a2ba65075ee8cb376ff83acc6e4083a86" args="() const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int Wt::Auth::AuthService::emailTokenValidity </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </div> <div class="memdoc"> <p>Returns the duration for an email token to remain valid. </p> <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1Auth_1_1AuthService.html#ad184b5136649e3af107dab3153eb9374" title="Configures the duration for an email token to remain valid.">setEmailTokenValidity()</a> </dd></dl> </div> </div> <a class="anchor" id="a7b2c813faf0eb91aa8befc13420707a1"></a><!-- doxytag: member="Wt::Auth::AuthService::emailVerificationEnabled" ref="a7b2c813faf0eb91aa8befc13420707a1" args="() const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool Wt::Auth::AuthService::emailVerificationEnabled </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </div> <div class="memdoc"> <p>Returns wheter email verification is configured. </p> <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1Auth_1_1AuthService.html#a545208b47b73bc8f4d736753fd967eec" title="Configures email verification.">setEmailVerificationEnabled()</a> </dd></dl> </div> </div> <a class="anchor" id="a754bc3e4a15e3dbbf1a2d413926f9de7"></a><!-- doxytag: member="Wt::Auth::AuthService::identifyUser" ref="a754bc3e4a15e3dbbf1a2d413926f9de7" args="(const Identity &identity, AbstractUserDatabase &users) const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classWt_1_1Auth_1_1User.html">User</a> Wt::Auth::AuthService::identifyUser </td> <td>(</td> <td class="paramtype">const <a class="el" href="classWt_1_1Auth_1_1Identity.html">Identity</a> & </td> <td class="paramname"><em>identity</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classWt_1_1Auth_1_1AbstractUserDatabase.html">AbstractUserDatabase</a> & </td> <td class="paramname"><em>users</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const<code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Tries to match the identity to an existing user. </p> <p>When authenticating using a 3rd party <a class="el" href="classWt_1_1Auth_1_1Identity.html" title="A class that represents a user identity.">Identity</a> Provider, the identity is matched against the existing users, based on the id (with <a class="el" href="classWt_1_1Auth_1_1AbstractUserDatabase.html#ad86157a5d896af38825d9575fa8f8eae" title="Finds a user with a given identity.">AbstractUserDatabase::findWithIdentity()</a>), or if not matched, based on whether there is a user with the same verified email address as the one indicated by the identity. </p> </div> </div> <a class="anchor" id="a9f4dbd3fdba972e0e4500064de9c5617"></a><!-- doxytag: member="Wt::Auth::AuthService::identityPolicy" ref="a9f4dbd3fdba972e0e4500064de9c5617" args="() const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="group__auth.html#ga8ce12bbc04d68d5687f08abf2a209436">IdentityPolicy</a> Wt::Auth::AuthService::identityPolicy </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </div> <div class="memdoc"> <p>Returns the identity policy. </p> <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1Auth_1_1AuthService.html#aefb84d11c1dbc0c335b406ca9d3e3572" title="Configures the identity policy.">setIdentityPolicy()</a> </dd></dl> </div> </div> <a class="anchor" id="ae296f0f6cf5d481d3442724ca813b05d"></a><!-- doxytag: member="Wt::Auth::AuthService::lostPassword" ref="ae296f0f6cf5d481d3442724ca813b05d" args="(const std::string &emailAddress, AbstractUserDatabase &users) const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Wt::Auth::AuthService::lostPassword </td> <td>(</td> <td class="paramtype">const std::string & </td> <td class="paramname"><em>emailAddress</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classWt_1_1Auth_1_1AbstractUserDatabase.html">AbstractUserDatabase</a> & </td> <td class="paramname"><em>users</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const<code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Implements lost password functionality. </p> <p>If email address verification is enabled, then a user may recover his password (or rather, chose a new password) using a procedure which involves sending an email to a verified email address.</p> <p>This method triggers this process, starting from an email address, if this email address corresponds to a verified email address in the database. The current password is not invalidated.</p> <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1Auth_1_1AuthService.html#a0c09fb5aa0e54aa1da0069ad7b116436" title="Processes an email token.">processEmailToken()</a> </dd></dl> </div> </div> <a class="anchor" id="ae0fb1366eb2dc99ef6c098abdf6cf1e5"></a><!-- doxytag: member="Wt::Auth::AuthService::parseEmailToken" ref="ae0fb1366eb2dc99ef6c098abdf6cf1e5" args="(const std::string &internalPath) const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">std::string Wt::Auth::AuthService::parseEmailToken </td> <td>(</td> <td class="paramtype">const std::string & </td> <td class="paramname"><em>internalPath</em></td><td>)</td> <td> const<code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Parses the emailtoken from an internal path. </p> <p>This method parses an internal path and if it matches the email redirection path, it returns the token contained.</p> <p>It returns an empty string if the internal path does not contain an email token. </p> </div> </div> <a class="anchor" id="af830912428ce28663ab6da56f74ff03e"></a><!-- doxytag: member="Wt::Auth::AuthService::processAuthToken" ref="af830912428ce28663ab6da56f74ff03e" args="(const std::string &token, AbstractUserDatabase &users) const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classWt_1_1Auth_1_1AuthTokenResult.html">AuthTokenResult</a> Wt::Auth::AuthService::processAuthToken </td> <td>(</td> <td class="paramtype">const std::string & </td> <td class="paramname"><em>token</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classWt_1_1Auth_1_1AbstractUserDatabase.html">AbstractUserDatabase</a> & </td> <td class="paramname"><em>users</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const<code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Processes an authentication token. </p> <p>This verifies an authentication token, and considers whether it matches with a token hash value stored in database. If it matches, the token is removed and a new token is created for the identified user. </p> </div> </div> <a class="anchor" id="a0c09fb5aa0e54aa1da0069ad7b116436"></a><!-- doxytag: member="Wt::Auth::AuthService::processEmailToken" ref="a0c09fb5aa0e54aa1da0069ad7b116436" args="(const std::string &token, AbstractUserDatabase &users) const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classWt_1_1Auth_1_1EmailTokenResult.html">EmailTokenResult</a> Wt::Auth::AuthService::processEmailToken </td> <td>(</td> <td class="paramtype">const std::string & </td> <td class="paramname"><em>token</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classWt_1_1Auth_1_1AbstractUserDatabase.html">AbstractUserDatabase</a> & </td> <td class="paramname"><em>users</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const<code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Processes an email token. </p> <p>This processes a token received through an email. If successful, the token is removed from the database.</p> <p>This may return two successful results:</p> <ul> <li><a class="el" href="classWt_1_1Auth_1_1EmailTokenResult.html#a02d298e2e759bf496a1648feec3d5eafa1a3e804bef16c7265a75b6401e10cf94" title="A The token was presented which verifies the email address.">EmailTokenResult::EmailConfirmed</a>: a token was presented which proves that the user is tied to the email address.</li> <li><a class="el" href="classWt_1_1Auth_1_1EmailTokenResult.html#a02d298e2e759bf496a1648feec3d5eafa3923ca0fd4c0d28ce792c544d3888c5d" title="A token was presented which requires the user to enter a new password.">EmailTokenResult::UpdatePassword</a>: a token was presented which requires the user to enter a new password.</li> </ul> <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1Auth_1_1AuthService.html#a4c34af5f36ba29b35cd457744fbd4bfe" title="Verifies an email address.">verifyEmailAddress()</a> </dd> <dd> <a class="el" href="classWt_1_1Auth_1_1AuthService.html#ae296f0f6cf5d481d3442724ca813b05d" title="Implements lost password functionality.">lostPassword()</a> </dd></dl> </div> </div> <a class="anchor" id="a753e6b14790cae24a2cb422b6560baaa"></a><!-- doxytag: member="Wt::Auth::AuthService::randomTokenLength" ref="a753e6b14790cae24a2cb422b6560baaa" args="() const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int Wt::Auth::AuthService::randomTokenLength </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </div> <div class="memdoc"> <p>Returns the token length. </p> <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1Auth_1_1AuthService.html#aa53b495589aeb0618125faccddbce891" title="Sets the token length.">setRandomTokenLength()</a> </dd></dl> </div> </div> <a class="anchor" id="a746494212f7bb5d360169df39cc60abd"></a><!-- doxytag: member="Wt::Auth::AuthService::sendConfirmMail" ref="a746494212f7bb5d360169df39cc60abd" args="(const std::string &address, const User &user, const std::string &token) const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Wt::Auth::AuthService::sendConfirmMail </td> <td>(</td> <td class="paramtype">const std::string & </td> <td class="paramname"><em>address</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="classWt_1_1Auth_1_1User.html">User</a> & </td> <td class="paramname"><em>user</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const std::string & </td> <td class="paramname"><em>token</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const<code> [protected, virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Sends a confirmation email to the user to verify his email address. </p> <p>Sends a confirmation email to the given address.</p> <p>The email content is provided by the following string keys:</p> <ul> <li>subject: tr("Wt.auth.verification-mail.subject")</li> <li>body: tr("Wt.auth.verification-mail.body") with {1} a place holder for the identity, and {2} a placeholder for the redirection URL.</li> <li>HTML body: tr("Wt.auth.verification-mail.htmlbody") with the same place holders. </li> </ul> </div> </div> <a class="anchor" id="af3dfd72946e563772e201420d4856ebe"></a><!-- doxytag: member="Wt::Auth::AuthService::sendLostPasswordMail" ref="af3dfd72946e563772e201420d4856ebe" args="(const std::string &address, const User &user, const std::string &token) const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Wt::Auth::AuthService::sendLostPasswordMail </td> <td>(</td> <td class="paramtype">const std::string & </td> <td class="paramname"><em>address</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="classWt_1_1Auth_1_1User.html">User</a> & </td> <td class="paramname"><em>user</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const std::string & </td> <td class="paramname"><em>token</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const<code> [protected, virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Sends an email to the user to enter a new password. </p> <p>This sends a lost password email to the given <code>address</code>, with a given <code>token</code>.</p> <p>The default implementation will call <a class="el" href="classWt_1_1Auth_1_1AuthService.html#a122b753f1984e837f9352b89afefcc38" title="Sends an email.">sendMail()</a> with the following message:</p> <ul> <li>tr("Wt.Auth.lost-password-mail.subject") as subject,</li> <li>tr("Wt.Auth.lost-password-mail.body") as body to which it passes user.identity() and token as arguments.</li> <li>tr("Wt.Auth.lost-password-mail.htmlbody") as HTML body to which it passes user.identity() and token as arguments. </li> </ul> </div> </div> <a class="anchor" id="a122b753f1984e837f9352b89afefcc38"></a><!-- doxytag: member="Wt::Auth::AuthService::sendMail" ref="a122b753f1984e837f9352b89afefcc38" args="(const Mail::Message &message) const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Wt::Auth::AuthService::sendMail </td> <td>(</td> <td class="paramtype">const <a class="el" href="classWt_1_1Mail_1_1Message.html">Mail::Message</a> & </td> <td class="paramname"><em>message</em></td><td>)</td> <td> const<code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Sends an email. </p> <p>Sends an email to the given address with subject and body.</p> <p>The default implementation will consult configuration properties to add a sender address if it hasn't already been set:</p> <ul> <li>"auth-mail-sender-name": the sender name, with default value "Wt Auth module"</li> <li>"auth-mail-sender-address": the sender email address, with default value "noreply-auth@www.webtoolkit.eu"</li> </ul> <p>Then it uses <a class="el" href="classWt_1_1Mail_1_1Client.html" title="An SMTP mail client.">Mail::Client</a> to send the message, using default the default client settings. </p> </div> </div> <a class="anchor" id="a863f6b1c7c5586ca6075983d8c5070a5"></a><!-- doxytag: member="Wt::Auth::AuthService::setAuthTokensEnabled" ref="a863f6b1c7c5586ca6075983d8c5070a5" args="(bool enabled, const std::string &cookieName="wtauth")" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Wt::Auth::AuthService::setAuthTokensEnabled </td> <td>(</td> <td class="paramtype">bool </td> <td class="paramname"><em>enabled</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const std::string & </td> <td class="paramname"><em>cookieName</em> = <code>"wtauth"</code> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Configures authentication token support. </p> <p>This method allows you to configure whether authentication tokens are in use. Authentication tokens are used for the user to bypass a more elaborate authentication method, and are a secret shared with the user's user agent, usually in a cookie. They are typically presented in the user interfaces as a "remember me" option.</p> <p>Whenever a valid authentication token is presented in processToken(), it is invalidated a new token is generated and stored for the user.</p> <p>The tokens are generated and subsequently hashed using the token hash function. Only the hash values are stored in the user database so that a compromised user database does not compromise these tokens.</p> <p>Authentication tokens are disabled by default.</p> <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1Auth_1_1AuthService.html#a2f7bbeba49691c5fd9f974b1d559fe9c" title="Sets the token hash function.">setTokenHashFunction()</a>, <a class="el" href="classWt_1_1Auth_1_1AuthService.html#a53c56267c8588a58affe3d6ed66edeb6" title="Configures the duration for an authenticaton to remain valid.">setAuthTokenValidity()</a> </dd></dl> </div> </div> <a class="anchor" id="a53c56267c8588a58affe3d6ed66edeb6"></a><!-- doxytag: member="Wt::Auth::AuthService::setAuthTokenValidity" ref="a53c56267c8588a58affe3d6ed66edeb6" args="(int minutes)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Wt::Auth::AuthService::setAuthTokenValidity </td> <td>(</td> <td class="paramtype">int </td> <td class="paramname"><em>minutes</em></td><td>)</td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Configures the duration for an authenticaton to remain valid. </p> <p>The default duration is two weeks (14 * 24 * 60 minutes). </p> </div> </div> <a class="anchor" id="ac1ce625114817d88f32b041473e5cfcf"></a><!-- doxytag: member="Wt::Auth::AuthService::setEmailRedirectInternalPath" ref="ac1ce625114817d88f32b041473e5cfcf" args="(const std::string &internalPath)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Wt::Auth::AuthService::setEmailRedirectInternalPath </td> <td>(</td> <td class="paramtype">const std::string & </td> <td class="paramname"><em>internalPath</em></td><td>)</td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Sets the internal path used to present tokens in emails. </p> <p>The default path is "/auth/mail/". </p> </div> </div> <a class="anchor" id="ad184b5136649e3af107dab3153eb9374"></a><!-- doxytag: member="Wt::Auth::AuthService::setEmailTokenValidity" ref="ad184b5136649e3af107dab3153eb9374" args="(int minutes)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Wt::Auth::AuthService::setEmailTokenValidity </td> <td>(</td> <td class="paramtype">int </td> <td class="paramname"><em>minutes</em></td><td>)</td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Configures the duration for an email token to remain valid. </p> <p>The default duration is three days (3 * 24 * 60 minutes). Three is a divine number. </p> </div> </div> <a class="anchor" id="a545208b47b73bc8f4d736753fd967eec"></a><!-- doxytag: member="Wt::Auth::AuthService::setEmailVerificationEnabled" ref="a545208b47b73bc8f4d736753fd967eec" args="(bool enabled)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Wt::Auth::AuthService::setEmailVerificationEnabled </td> <td>(</td> <td class="paramtype">bool </td> <td class="paramname"><em>enabled</em></td><td>)</td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Configures email verification. </p> <p>Email verification is useful for a user to recover a lost password, or to be able to confidently confirm other events with this user (such as order processing). </p> </div> </div> <a class="anchor" id="aefb84d11c1dbc0c335b406ca9d3e3572"></a><!-- doxytag: member="Wt::Auth::AuthService::setIdentityPolicy" ref="aefb84d11c1dbc0c335b406ca9d3e3572" args="(IdentityPolicy policy)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Wt::Auth::AuthService::setIdentityPolicy </td> <td>(</td> <td class="paramtype"><a class="el" href="group__auth.html#ga8ce12bbc04d68d5687f08abf2a209436">IdentityPolicy</a> </td> <td class="paramname"><em>policy</em></td><td>)</td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Configures the identity policy. </p> <p>The identity policy has an impact on the login and registration procedure. </p> </div> </div> <a class="anchor" id="aa53b495589aeb0618125faccddbce891"></a><!-- doxytag: member="Wt::Auth::AuthService::setRandomTokenLength" ref="aa53b495589aeb0618125faccddbce891" args="(int length)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Wt::Auth::AuthService::setRandomTokenLength </td> <td>(</td> <td class="paramtype">int </td> <td class="paramname"><em>length</em></td><td>)</td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Sets the token length. </p> <p>Configures the length used for random tokens. Random tokens are generated for authentication tokens, and email tokens.</p> <p>The default length is 32 characters.</p> <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WRandom.html#a2f1e001a0ec6641f0fa70c57cc2b48f0" title="A utility method to generate a random id.">WRandom::generateId()</a> </dd></dl> </div> </div> <a class="anchor" id="a2f7bbeba49691c5fd9f974b1d559fe9c"></a><!-- doxytag: member="Wt::Auth::AuthService::setTokenHashFunction" ref="a2f7bbeba49691c5fd9f974b1d559fe9c" args="(HashFunction *function)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Wt::Auth::AuthService::setTokenHashFunction </td> <td>(</td> <td class="paramtype"><a class="el" href="classWt_1_1Auth_1_1HashFunction.html">HashFunction</a> * </td> <td class="paramname"><em>function</em></td><td>)</td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Sets the token hash function. </p> <p>Sets the hash function used to safely store authentication tokens in the database. Ownership of the hash function is transferred.</p> <p>The default token hash function is an <a class="el" href="classWt_1_1Auth_1_1MD5HashFunction.html" title="A cryptograhpic hash function implemented using MD5.">MD5HashFunction</a>. </p> </div> </div> <a class="anchor" id="a3025be95a68e2c6abcfad0eefa0dc080"></a><!-- doxytag: member="Wt::Auth::AuthService::tokenHashFunction" ref="a3025be95a68e2c6abcfad0eefa0dc080" args="() const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classWt_1_1Auth_1_1HashFunction.html">HashFunction</a> * Wt::Auth::AuthService::tokenHashFunction </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </div> <div class="memdoc"> <p>Returns the token hash function. </p> <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1Auth_1_1AuthService.html#a2f7bbeba49691c5fd9f974b1d559fe9c" title="Sets the token hash function.">setTokenHashFunction()</a> </dd></dl> </div> </div> <a class="anchor" id="a4c34af5f36ba29b35cd457744fbd4bfe"></a><!-- doxytag: member="Wt::Auth::AuthService::verifyEmailAddress" ref="a4c34af5f36ba29b35cd457744fbd4bfe" args="(const User &user, const std::string &emailAddress) const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Wt::Auth::AuthService::verifyEmailAddress </td> <td>(</td> <td class="paramtype">const <a class="el" href="classWt_1_1Auth_1_1User.html">User</a> & </td> <td class="paramname"><em>user</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const std::string & </td> <td class="paramname"><em>emailAddress</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const<code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Verifies an email address. </p> <p>This registers a new email token with the user.</p> <p>Then it sends an email to the user's unverified email address with instructions that redirect him to this site, using sendConfirmEmail().</p> <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1Auth_1_1AuthService.html#a0c09fb5aa0e54aa1da0069ad7b116436" title="Processes an email token.">processEmailToken()</a> </dd></dl> </div> </div> </div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark"> </span>Enumerator</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <hr size="1"><address style="text-align: right; margin: 3px"><small> Generated on Thu Nov 1 2012 for <a href="http://www.webtoolkit.eu/wt">the C++ Web Toolkit (Wt)</a> by <a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" border="0" style="vertical-align: middle; display: inline-block; height: 2em"></a> 1.7.5.1</small></address> </body> </html>