<!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"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>liblinphone: Managing authentication: userid and passwords</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">liblinphone  <span id="projectnumber">3.5.2</span> </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.1.2 --> <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="annotated.html"><span>Data Structures</span></a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="summary"> <a href="#typedef-members">Typedefs</a> | <a href="#func-members">Functions</a> </div> <div class="headertitle"> <div class="title">Managing authentication: userid and passwords</div> </div> </div><!--header--> <div class="contents"> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2><a name="typedef-members"></a> Typedefs</h2></td></tr> <tr class="memitem:ga0f8289c1aab407992864a68869107f4f"><td class="memItemLeft" align="right" valign="top">typedef struct _LinphoneAuthInfo </td><td class="memItemRight" valign="bottom"><a class="el" href="group__authentication.html#ga0f8289c1aab407992864a68869107f4f">LinphoneAuthInfo</a></td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2><a name="func-members"></a> Functions</h2></td></tr> <tr class="memitem:gada5caa494ea0c9320b42be28a69bea1b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__authentication.html#ga0f8289c1aab407992864a68869107f4f">LinphoneAuthInfo</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__authentication.html#gada5caa494ea0c9320b42be28a69bea1b">linphone_auth_info_new</a> (const char *username, const char *userid, const char *passwd, const char *ha1, const char *realm)</td></tr> <tr class="memitem:ga20d4a160ba0bdead384f975a119e0b4a"><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__authentication.html#ga20d4a160ba0bdead384f975a119e0b4a">linphone_auth_info_get_username</a> (const <a class="el" href="group__authentication.html#ga0f8289c1aab407992864a68869107f4f">LinphoneAuthInfo</a> *i)</td></tr> <tr class="memitem:ga802adebbf9ccfae54321e45d3a892815"><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__authentication.html#ga802adebbf9ccfae54321e45d3a892815">linphone_auth_info_get_passwd</a> (const <a class="el" href="group__authentication.html#ga0f8289c1aab407992864a68869107f4f">LinphoneAuthInfo</a> *i)</td></tr> <tr class="memitem:ga004d3d5228cb74697df157e4ae93f6c7"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__authentication.html#ga004d3d5228cb74697df157e4ae93f6c7">linphone_auth_info_set_passwd</a> (<a class="el" href="group__authentication.html#ga0f8289c1aab407992864a68869107f4f">LinphoneAuthInfo</a> *info, const char *passwd)</td></tr> <tr class="memitem:ga36c0b48f8ce1b1b3e632f00d301ea4c7"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__authentication.html#ga36c0b48f8ce1b1b3e632f00d301ea4c7">linphone_auth_info_set_username</a> (<a class="el" href="group__authentication.html#ga0f8289c1aab407992864a68869107f4f">LinphoneAuthInfo</a> *info, const char *username)</td></tr> <tr class="memitem:gaceda2fc2a33f5e5ea05d16bc0ecd2167"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__authentication.html#gaceda2fc2a33f5e5ea05d16bc0ecd2167">linphone_auth_info_set_userid</a> (<a class="el" href="group__authentication.html#ga0f8289c1aab407992864a68869107f4f">LinphoneAuthInfo</a> *info, const char *userid)</td></tr> <tr class="memitem:ga814df254ea5005e5bb04d4247688e09f"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__authentication.html#ga814df254ea5005e5bb04d4247688e09f">linphone_auth_info_destroy</a> (<a class="el" href="group__authentication.html#ga0f8289c1aab407992864a68869107f4f">LinphoneAuthInfo</a> *obj)</td></tr> <tr class="memitem:ga8c1ba7e88f7591386e5fffa2db4f0cfb"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="group__authentication.html#ga0f8289c1aab407992864a68869107f4f">LinphoneAuthInfo</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__authentication.html#ga8c1ba7e88f7591386e5fffa2db4f0cfb">linphone_core_find_auth_info</a> (<a class="el" href="group__initializing.html#gaa5cf635b82dd338e7ee2dd3599d05f0a">LinphoneCore</a> *lc, const char *realm, const char *username)</td></tr> <tr class="memitem:ga62ac5bb34f0342f7edc733c42473b7aa"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__authentication.html#ga62ac5bb34f0342f7edc733c42473b7aa">linphone_core_add_auth_info</a> (<a class="el" href="group__initializing.html#gaa5cf635b82dd338e7ee2dd3599d05f0a">LinphoneCore</a> *lc, const <a class="el" href="group__authentication.html#ga0f8289c1aab407992864a68869107f4f">LinphoneAuthInfo</a> *info)</td></tr> <tr class="memitem:gabf1213372f4ff87b4e2bbfcc241f0901"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__authentication.html#gabf1213372f4ff87b4e2bbfcc241f0901">linphone_core_abort_authentication</a> (<a class="el" href="group__initializing.html#gaa5cf635b82dd338e7ee2dd3599d05f0a">LinphoneCore</a> *lc, <a class="el" href="group__authentication.html#ga0f8289c1aab407992864a68869107f4f">LinphoneAuthInfo</a> *info)</td></tr> <tr class="memitem:gafb8037a3bbee6f04458c354d8c1ca83e"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__authentication.html#gafb8037a3bbee6f04458c354d8c1ca83e">linphone_core_remove_auth_info</a> (<a class="el" href="group__initializing.html#gaa5cf635b82dd338e7ee2dd3599d05f0a">LinphoneCore</a> *lc, const <a class="el" href="group__authentication.html#ga0f8289c1aab407992864a68869107f4f">LinphoneAuthInfo</a> *info)</td></tr> <tr class="memitem:ga3dbc544171ef06a1901b5031fde91e6f"><td class="memItemLeft" align="right" valign="top">const MSList * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__authentication.html#ga3dbc544171ef06a1901b5031fde91e6f">linphone_core_get_auth_info_list</a> (const <a class="el" href="group__initializing.html#gaa5cf635b82dd338e7ee2dd3599d05f0a">LinphoneCore</a> *lc)</td></tr> <tr class="memitem:ga62979ce470f66cf8545e1e999875e903"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__authentication.html#ga62979ce470f66cf8545e1e999875e903">linphone_core_clear_all_auth_info</a> (<a class="el" href="group__initializing.html#gaa5cf635b82dd338e7ee2dd3599d05f0a">LinphoneCore</a> *lc)</td></tr> </table> <a name="details" id="details"></a><h2>Detailed Description</h2> <h2>Typedef Documentation</h2> <a class="anchor" id="ga0f8289c1aab407992864a68869107f4f"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">typedef struct _LinphoneAuthInfo <a class="el" href="group__authentication.html#ga0f8289c1aab407992864a68869107f4f">LinphoneAuthInfo</a></td> </tr> </table> </div><div class="memdoc"> <p>Object holding authentication information.</p> <dl class="section note"><dt>Note</dt><dd>The object's fields should not be accessed directly. Prefer using the accessor methods.</dd></dl> <p>In most case, authentication information consists of a username and password. Sometimes, a userid is required by proxy, and realm can be useful to discriminate different SIP domains.</p> <p>Once created and filled, a LinphoneAuthInfo must be added to the LinphoneCore in order to become known and used automatically when needed. Use <a class="el" href="group__authentication.html#ga62ac5bb34f0342f7edc733c42473b7aa">linphone_core_add_auth_info()</a> for that purpose.</p> <p>The LinphoneCore object can take the initiative to request authentication information when needed to the application through the auth_info_requested callback of the LinphoneCoreVTable structure.</p> <p>The application can respond to this information request later using <a class="el" href="group__authentication.html#ga62ac5bb34f0342f7edc733c42473b7aa">linphone_core_add_auth_info()</a>. This will unblock all pending authentication transactions and retry them with authentication headers. </p> </div> </div> <h2>Function Documentation</h2> <a class="anchor" id="gada5caa494ea0c9320b42be28a69bea1b"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="group__authentication.html#ga0f8289c1aab407992864a68869107f4f">LinphoneAuthInfo</a>* linphone_auth_info_new </td> <td>(</td> <td class="paramtype">const char * </td> <td class="paramname"><em>username</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const char * </td> <td class="paramname"><em>userid</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const char * </td> <td class="paramname"><em>passwd</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const char * </td> <td class="paramname"><em>ha1</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const char * </td> <td class="paramname"><em>realm</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Create a LinphoneAuthInfo object with supplied information.</p> <p>The object can be created empty, that is with all arguments set to NULL. Username, userid, password and realm can be set later using specific methods. </p> </div> </div> <a class="anchor" id="ga20d4a160ba0bdead384f975a119e0b4a"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">const char* linphone_auth_info_get_username </td> <td>(</td> <td class="paramtype">const <a class="el" href="group__authentication.html#ga0f8289c1aab407992864a68869107f4f">LinphoneAuthInfo</a> * </td> <td class="paramname"><em>i</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Returns username. </p> </div> </div> <a class="anchor" id="ga802adebbf9ccfae54321e45d3a892815"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">const char* linphone_auth_info_get_passwd </td> <td>(</td> <td class="paramtype">const <a class="el" href="group__authentication.html#ga0f8289c1aab407992864a68869107f4f">LinphoneAuthInfo</a> * </td> <td class="paramname"><em>i</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Returns password. </p> </div> </div> <a class="anchor" id="ga004d3d5228cb74697df157e4ae93f6c7"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void linphone_auth_info_set_passwd </td> <td>(</td> <td class="paramtype"><a class="el" href="group__authentication.html#ga0f8289c1aab407992864a68869107f4f">LinphoneAuthInfo</a> * </td> <td class="paramname"><em>info</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const char * </td> <td class="paramname"><em>passwd</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Sets the password. </p> </div> </div> <a class="anchor" id="ga36c0b48f8ce1b1b3e632f00d301ea4c7"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void linphone_auth_info_set_username </td> <td>(</td> <td class="paramtype"><a class="el" href="group__authentication.html#ga0f8289c1aab407992864a68869107f4f">LinphoneAuthInfo</a> * </td> <td class="paramname"><em>info</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const char * </td> <td class="paramname"><em>username</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Sets the username. </p> </div> </div> <a class="anchor" id="gaceda2fc2a33f5e5ea05d16bc0ecd2167"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void linphone_auth_info_set_userid </td> <td>(</td> <td class="paramtype"><a class="el" href="group__authentication.html#ga0f8289c1aab407992864a68869107f4f">LinphoneAuthInfo</a> * </td> <td class="paramname"><em>info</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const char * </td> <td class="paramname"><em>userid</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Sets userid. </p> </div> </div> <a class="anchor" id="ga814df254ea5005e5bb04d4247688e09f"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void linphone_auth_info_destroy </td> <td>(</td> <td class="paramtype"><a class="el" href="group__authentication.html#ga0f8289c1aab407992864a68869107f4f">LinphoneAuthInfo</a> * </td> <td class="paramname"><em>obj</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Destroys a LinphoneAuthInfo object. </p> </div> </div> <a class="anchor" id="ga8c1ba7e88f7591386e5fffa2db4f0cfb"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">const <a class="el" href="group__authentication.html#ga0f8289c1aab407992864a68869107f4f">LinphoneAuthInfo</a>* linphone_core_find_auth_info </td> <td>(</td> <td class="paramtype"><a class="el" href="group__initializing.html#gaa5cf635b82dd338e7ee2dd3599d05f0a">LinphoneCore</a> * </td> <td class="paramname"><em>lc</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const char * </td> <td class="paramname"><em>realm</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const char * </td> <td class="paramname"><em>username</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Retrieves a LinphoneAuthInfo previously entered into the LinphoneCore. </p> </div> </div> <a class="anchor" id="ga62ac5bb34f0342f7edc733c42473b7aa"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void linphone_core_add_auth_info </td> <td>(</td> <td class="paramtype"><a class="el" href="group__initializing.html#gaa5cf635b82dd338e7ee2dd3599d05f0a">LinphoneCore</a> * </td> <td class="paramname"><em>lc</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="group__authentication.html#ga0f8289c1aab407992864a68869107f4f">LinphoneAuthInfo</a> * </td> <td class="paramname"><em>info</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Adds authentication information to the LinphoneCore.</p> <p>This information will be used during all SIP transacations that require authentication. </p> </div> </div> <a class="anchor" id="gabf1213372f4ff87b4e2bbfcc241f0901"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void linphone_core_abort_authentication </td> <td>(</td> <td class="paramtype"><a class="el" href="group__initializing.html#gaa5cf635b82dd338e7ee2dd3599d05f0a">LinphoneCore</a> * </td> <td class="paramname"><em>lc</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="group__authentication.html#ga0f8289c1aab407992864a68869107f4f">LinphoneAuthInfo</a> * </td> <td class="paramname"><em>info</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>This method is used to abort a user authentication request initiated by LinphoneCore from the auth_info_requested callback of LinphoneCoreVTable. </p> </div> </div> <a class="anchor" id="gafb8037a3bbee6f04458c354d8c1ca83e"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void linphone_core_remove_auth_info </td> <td>(</td> <td class="paramtype"><a class="el" href="group__initializing.html#gaa5cf635b82dd338e7ee2dd3599d05f0a">LinphoneCore</a> * </td> <td class="paramname"><em>lc</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="group__authentication.html#ga0f8289c1aab407992864a68869107f4f">LinphoneAuthInfo</a> * </td> <td class="paramname"><em>info</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Removes an authentication information object. </p> </div> </div> <a class="anchor" id="ga3dbc544171ef06a1901b5031fde91e6f"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">const MSList* linphone_core_get_auth_info_list </td> <td>(</td> <td class="paramtype">const <a class="el" href="group__initializing.html#gaa5cf635b82dd338e7ee2dd3599d05f0a">LinphoneCore</a> * </td> <td class="paramname"><em>lc</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Returns an unmodifiable list of currently entered LinphoneAuthInfo. </p> </div> </div> <a class="anchor" id="ga62979ce470f66cf8545e1e999875e903"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void linphone_core_clear_all_auth_info </td> <td>(</td> <td class="paramtype"><a class="el" href="group__initializing.html#gaa5cf635b82dd338e7ee2dd3599d05f0a">LinphoneCore</a> * </td> <td class="paramname"><em>lc</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Clear all authentication information. </p> </div> </div> </div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.1.2 </small></address> </body> </html>