_Auth---OpenID---Server.php.html 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441
  1. <?xml version="1.0" encoding="iso-8859-1"?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <!-- template designed by Marco Von Ballmoos -->
  6. <title>Docs for page Server.php</title>
  7. <link rel="stylesheet" href="../media/stylesheet.css" />
  8. <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
  9. </head>
  10. <body>
  11. <div class="page-body">
  12. <h2 class="file-name">/Auth/OpenID/Server.php</h2>
  13. <a name="sec-description"></a>
  14. <div class="info-box">
  15. <div class="info-box-title">Description</div>
  16. <div class="nav-bar">
  17. <span class="disabled">Description</span> |
  18. <a href="#sec-classes">Classes</a>
  19. | <a href="#sec-includes">Includes</a>
  20. | <a href="#sec-constants">Constants</a>
  21. </div>
  22. <div class="info-box-body">
  23. <!-- ========== Info from phpDoc block ========= -->
  24. <p class="short-description">OpenID server protocol and logic.</p>
  25. <p class="description"><p>Overview</p><p>An OpenID server must perform three tasks:</p><p><ol><li>Examine the incoming request to determine its nature and validity.</li><li>Make a decision about how to respond to this request.</li><li>Format the response according to the protocol.</li></ol> The first and last of these tasks may performed by the <a href="../OpenID/Auth_OpenID_Server.html#methoddecodeRequest">Auth_OpenID_Server::decodeRequest()</a> and Auth_OpenID_Server::encodeResponse methods. Who gets to do the intermediate task -- deciding how to respond to the request -- will depend on what type of request it is.</p><p>If it's a request to authenticate a user (a 'checkid_setup' or 'checkid_immediate' request), you need to decide if you will assert that this user may claim the identity in question. Exactly how you do that is a matter of application policy, but it generally involves making sure the user has an account with your system and is logged in, checking to see if that identity is hers to claim, and verifying with the user that she does consent to releasing that information to the party making the request.</p><p>Examine the properties of the <a href="../OpenID/Auth_OpenID_CheckIDRequest.html">Auth_OpenID_CheckIDRequest</a> object, and if and when you've come to a decision, form a response by calling <a href="../OpenID/Auth_OpenID_CheckIDRequest.html#methodanswer">Auth_OpenID_CheckIDRequest::answer()</a>.</p><p>Other types of requests relate to establishing associations between client and server and verifing the authenticity of previous communications. <a href="../OpenID/Auth_OpenID_Server.html">Auth_OpenID_Server</a> contains all the logic and data necessary to respond to such requests; just pass it to <a href="../OpenID/Auth_OpenID_Server.html#methodhandleRequest">Auth_OpenID_Server::handleRequest()</a>.</p><p>OpenID Extensions</p><p>Do you want to provide other information for your users in addition to authentication? Version 1.2 of the OpenID protocol allows consumers to add extensions to their requests. For example, with sites using the Simple Registration Extension (http://www.openidenabled.com/openid/simple-registration-extension/), a user can agree to have their nickname and e-mail address sent to a site when they sign up.</p><p>Since extensions do not change the way OpenID authentication works, code to handle extension requests may be completely separate from the <a href="../OpenID/Auth_OpenID_Request.html">Auth_OpenID_Request</a> class here. But you'll likely want data sent back by your extension to be signed. <a href="../OpenID/Auth_OpenID_ServerResponse.html">Auth_OpenID_ServerResponse</a> provides methods with which you can add data to it which can be signed with the other data in the OpenID signature.</p><p>For example:</p><p><pre> // when request is a checkid_* request
  26. $response = $request->answer(true);
  27. // this will a signed 'openid.sreg.timezone' parameter to the response
  28. response.addField('sreg', 'timezone', 'America/Los_Angeles')</pre></p><p>Stores</p><p>The OpenID server needs to maintain state between requests in order to function. Its mechanism for doing this is called a store. The store interface is defined in Interface.php. Additionally, several concrete store implementations are provided, so that most sites won't need to implement a custom store. For a store backed by flat files on disk, see <a href="../OpenID/Auth_OpenID_FileStore.html">Auth_OpenID_FileStore</a>. For stores based on MySQL, SQLite, or PostgreSQL, see the <a href="../OpenID/Auth_OpenID_SQLStore.html">Auth_OpenID_SQLStore</a> subclasses.</p><p>Upgrading</p><p>The keys by which a server looks up associations in its store have changed in version 1.2 of this library. If your store has entries created from version 1.0 code, you should empty it.</p><p>PHP versions 4 and 5</p><p>LICENSE: See the COPYING file included in this distribution.</p></p>
  29. <ul class="tags">
  30. <li><span class="field">author:</span> JanRain, Inc. &lt;<a href="mailto:openid@janrain.com">openid@janrain.com</a>&gt;</li>
  31. <li><span class="field">copyright:</span> 2005-2008 Janrain, Inc.</li>
  32. <li><span class="field">license:</span> <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache</a></li>
  33. </ul>
  34. </div>
  35. </div>
  36. <a name="sec-classes"></a>
  37. <div class="info-box">
  38. <div class="info-box-title">Classes</div>
  39. <div class="nav-bar">
  40. <a href="#sec-description">Description</a> |
  41. <span class="disabled">Classes</span>
  42. | <a href="#sec-includes">Includes</a>
  43. | <a href="#sec-constants">Constants</a>
  44. </div>
  45. <div class="info-box-body">
  46. <table cellpadding="2" cellspacing="0" class="class-table">
  47. <tr>
  48. <th class="class-table-header">Class</th>
  49. <th class="class-table-header">Description</th>
  50. </tr>
  51. <tr>
  52. <td style="padding-right: 2em; vertical-align: top">
  53. <a href="../OpenID/Auth_OpenID_ServerError.html">Auth_OpenID_ServerError</a>
  54. </td>
  55. <td>
  56. An error class which gets instantiated and returned whenever an OpenID protocol error occurs. Be prepared to use this in place of an ordinary server response.
  57. </td>
  58. </tr>
  59. <tr>
  60. <td style="padding-right: 2em; vertical-align: top">
  61. <a href="../OpenID/Auth_OpenID_NoReturnToError.html">Auth_OpenID_NoReturnToError</a>
  62. </td>
  63. <td>
  64. Error returned by the server code when a return_to is absent from a request.
  65. </td>
  66. </tr>
  67. <tr>
  68. <td style="padding-right: 2em; vertical-align: top">
  69. <a href="../OpenID/Auth_OpenID_MalformedReturnURL.html">Auth_OpenID_MalformedReturnURL</a>
  70. </td>
  71. <td>
  72. An error indicating that the return_to URL is malformed.
  73. </td>
  74. </tr>
  75. <tr>
  76. <td style="padding-right: 2em; vertical-align: top">
  77. <a href="../OpenID/Auth_OpenID_MalformedTrustRoot.html">Auth_OpenID_MalformedTrustRoot</a>
  78. </td>
  79. <td>
  80. This error is returned when the trust_root value is malformed.
  81. </td>
  82. </tr>
  83. <tr>
  84. <td style="padding-right: 2em; vertical-align: top">
  85. <a href="../OpenID/Auth_OpenID_Request.html">Auth_OpenID_Request</a>
  86. </td>
  87. <td>
  88. The base class for all server request classes.
  89. </td>
  90. </tr>
  91. <tr>
  92. <td style="padding-right: 2em; vertical-align: top">
  93. <a href="../OpenID/Auth_OpenID_CheckAuthRequest.html">Auth_OpenID_CheckAuthRequest</a>
  94. </td>
  95. <td>
  96. A request to verify the validity of a previous response.
  97. </td>
  98. </tr>
  99. <tr>
  100. <td style="padding-right: 2em; vertical-align: top">
  101. <a href="../OpenID/Auth_OpenID_PlainTextServerSession.html">Auth_OpenID_PlainTextServerSession</a>
  102. </td>
  103. <td>
  104. A class implementing plaintext server sessions.
  105. </td>
  106. </tr>
  107. <tr>
  108. <td style="padding-right: 2em; vertical-align: top">
  109. <a href="../OpenID/Auth_OpenID_DiffieHellmanSHA1ServerSession.html">Auth_OpenID_DiffieHellmanSHA1ServerSession</a>
  110. </td>
  111. <td>
  112. A class implementing DH-SHA1 server sessions.
  113. </td>
  114. </tr>
  115. <tr>
  116. <td style="padding-right: 2em; vertical-align: top">
  117. <a href="../OpenID/Auth_OpenID_DiffieHellmanSHA256ServerSession.html">Auth_OpenID_DiffieHellmanSHA256ServerSession</a>
  118. </td>
  119. <td>
  120. A class implementing DH-SHA256 server sessions.
  121. </td>
  122. </tr>
  123. <tr>
  124. <td style="padding-right: 2em; vertical-align: top">
  125. <a href="../OpenID/Auth_OpenID_AssociateRequest.html">Auth_OpenID_AssociateRequest</a>
  126. </td>
  127. <td>
  128. A request to associate with the server.
  129. </td>
  130. </tr>
  131. <tr>
  132. <td style="padding-right: 2em; vertical-align: top">
  133. <a href="../OpenID/Auth_OpenID_CheckIDRequest.html">Auth_OpenID_CheckIDRequest</a>
  134. </td>
  135. <td>
  136. A request to confirm the identity of a user.
  137. </td>
  138. </tr>
  139. <tr>
  140. <td style="padding-right: 2em; vertical-align: top">
  141. <a href="../OpenID/Auth_OpenID_ServerResponse.html">Auth_OpenID_ServerResponse</a>
  142. </td>
  143. <td>
  144. This class encapsulates the response to an OpenID server request.
  145. </td>
  146. </tr>
  147. <tr>
  148. <td style="padding-right: 2em; vertical-align: top">
  149. <a href="../OpenID/Auth_OpenID_WebResponse.html">Auth_OpenID_WebResponse</a>
  150. </td>
  151. <td>
  152. A web-capable response object which you can use to generate a user-agent response.
  153. </td>
  154. </tr>
  155. <tr>
  156. <td style="padding-right: 2em; vertical-align: top">
  157. <a href="../OpenID/Auth_OpenID_Signatory.html">Auth_OpenID_Signatory</a>
  158. </td>
  159. <td>
  160. Responsible for the signature of query data and the verification of OpenID signature values.
  161. </td>
  162. </tr>
  163. <tr>
  164. <td style="padding-right: 2em; vertical-align: top">
  165. <a href="../OpenID/Auth_OpenID_Encoder.html">Auth_OpenID_Encoder</a>
  166. </td>
  167. <td>
  168. Encode an <a href="../OpenID/Auth_OpenID_ServerResponse.html">Auth_OpenID_ServerResponse</a> to an <a href="../OpenID/Auth_OpenID_WebResponse.html">Auth_OpenID_WebResponse</a>.
  169. </td>
  170. </tr>
  171. <tr>
  172. <td style="padding-right: 2em; vertical-align: top">
  173. <a href="../OpenID/Auth_OpenID_SigningEncoder.html">Auth_OpenID_SigningEncoder</a>
  174. </td>
  175. <td>
  176. An encoder which also takes care of signing fields when required.
  177. </td>
  178. </tr>
  179. <tr>
  180. <td style="padding-right: 2em; vertical-align: top">
  181. <a href="../OpenID/Auth_OpenID_Decoder.html">Auth_OpenID_Decoder</a>
  182. </td>
  183. <td>
  184. Decode an incoming query into an Auth_OpenID_Request.
  185. </td>
  186. </tr>
  187. <tr>
  188. <td style="padding-right: 2em; vertical-align: top">
  189. <a href="../OpenID/Auth_OpenID_EncodingError.html">Auth_OpenID_EncodingError</a>
  190. </td>
  191. <td>
  192. An error that indicates an encoding problem occurred.
  193. </td>
  194. </tr>
  195. <tr>
  196. <td style="padding-right: 2em; vertical-align: top">
  197. <a href="../OpenID/Auth_OpenID_AlreadySigned.html">Auth_OpenID_AlreadySigned</a>
  198. </td>
  199. <td>
  200. An error that indicates that a response was already signed.
  201. </td>
  202. </tr>
  203. <tr>
  204. <td style="padding-right: 2em; vertical-align: top">
  205. <a href="../OpenID/Auth_OpenID_UntrustedReturnURL.html">Auth_OpenID_UntrustedReturnURL</a>
  206. </td>
  207. <td>
  208. An error that indicates that the given return_to is not under the given trust_root.
  209. </td>
  210. </tr>
  211. <tr>
  212. <td style="padding-right: 2em; vertical-align: top">
  213. <a href="../OpenID/Auth_OpenID_Server.html">Auth_OpenID_Server</a>
  214. </td>
  215. <td>
  216. I handle requests for an OpenID server.
  217. </td>
  218. </tr>
  219. </table>
  220. </div>
  221. </div>
  222. <a name="sec-includes"></a>
  223. <div class="info-box">
  224. <div class="info-box-title">Includes</div>
  225. <div class="nav-bar">
  226. <a href="#sec-description">Description</a> |
  227. <a href="#sec-classes">Classes</a>
  228. | <span class="disabled">Includes</span>
  229. | <a href="#sec-constants">Constants</a>
  230. </div>
  231. <div class="info-box-body">
  232. <a name="_Auth/OpenID/KVForm_php"><!-- --></a>
  233. <div class="oddrow">
  234. <div>
  235. <span class="include-title">
  236. <span class="include-type">require_once</span>
  237. (<span class="include-name">"Auth/OpenID/KVForm.php"</span>)
  238. (line <span class="line-number">100</span>)
  239. </span>
  240. </div>
  241. <!-- ========== Info from phpDoc block ========= -->
  242. </div>
  243. <a name="_Auth/OpenID/ServerRequest_php"><!-- --></a>
  244. <div class="evenrow">
  245. <div>
  246. <span class="include-title">
  247. <span class="include-type">require_once</span>
  248. (<span class="include-name"><a href="../OpenID/_Auth---OpenID---ServerRequest.php.html">"Auth/OpenID/ServerRequest.php"</a></span>)
  249. (line <span class="line-number">102</span>)
  250. </span>
  251. </div>
  252. <!-- ========== Info from phpDoc block ========= -->
  253. </div>
  254. <a name="_Auth/OpenID/DiffieHellman_php"><!-- --></a>
  255. <div class="oddrow">
  256. <div>
  257. <span class="include-title">
  258. <span class="include-type">require_once</span>
  259. (<span class="include-name">"Auth/OpenID/DiffieHellman.php"</span>)
  260. (line <span class="line-number">99</span>)
  261. </span>
  262. </div>
  263. <!-- ========== Info from phpDoc block ========= -->
  264. </div>
  265. <a name="_Auth/OpenID_php"><!-- --></a>
  266. <div class="evenrow">
  267. <div>
  268. <span class="include-title">
  269. <span class="include-type">require_once</span>
  270. (<span class="include-name"><a href="../OpenID/_Auth---OpenID.php.html">"Auth/OpenID.php"</a></span>)
  271. (line <span class="line-number">95</span>)
  272. </span>
  273. </div>
  274. <!-- ========== Info from phpDoc block ========= -->
  275. <p class="short-description">Required imports</p>
  276. </div>
  277. <a name="_Auth/OpenID/TrustRoot_php"><!-- --></a>
  278. <div class="oddrow">
  279. <div>
  280. <span class="include-title">
  281. <span class="include-type">require_once</span>
  282. (<span class="include-name">"Auth/OpenID/TrustRoot.php"</span>)
  283. (line <span class="line-number">101</span>)
  284. </span>
  285. </div>
  286. <!-- ========== Info from phpDoc block ========= -->
  287. </div>
  288. <a name="_Auth/OpenID/Message_php"><!-- --></a>
  289. <div class="evenrow">
  290. <div>
  291. <span class="include-title">
  292. <span class="include-type">require_once</span>
  293. (<span class="include-name"><a href="../OpenID/_Auth---OpenID---Message.php.html">"Auth/OpenID/Message.php"</a></span>)
  294. (line <span class="line-number">103</span>)
  295. </span>
  296. </div>
  297. <!-- ========== Info from phpDoc block ========= -->
  298. </div>
  299. <a name="_Auth/OpenID/Nonce_php"><!-- --></a>
  300. <div class="oddrow">
  301. <div>
  302. <span class="include-title">
  303. <span class="include-type">require_once</span>
  304. (<span class="include-name"><a href="../OpenID/_Auth---OpenID---Nonce.php.html">"Auth/OpenID/Nonce.php"</a></span>)
  305. (line <span class="line-number">104</span>)
  306. </span>
  307. </div>
  308. <!-- ========== Info from phpDoc block ========= -->
  309. </div>
  310. <a name="_Auth/OpenID/BigMath_php"><!-- --></a>
  311. <div class="evenrow">
  312. <div>
  313. <span class="include-title">
  314. <span class="include-type">require_once</span>
  315. (<span class="include-name">"Auth/OpenID/BigMath.php"</span>)
  316. (line <span class="line-number">98</span>)
  317. </span>
  318. </div>
  319. <!-- ========== Info from phpDoc block ========= -->
  320. </div>
  321. <a name="_Auth/OpenID/CryptUtil_php"><!-- --></a>
  322. <div class="oddrow">
  323. <div>
  324. <span class="include-title">
  325. <span class="include-type">require_once</span>
  326. (<span class="include-name">"Auth/OpenID/CryptUtil.php"</span>)
  327. (line <span class="line-number">97</span>)
  328. </span>
  329. </div>
  330. <!-- ========== Info from phpDoc block ========= -->
  331. </div>
  332. <a name="_Auth/OpenID/Association_php"><!-- --></a>
  333. <div class="evenrow">
  334. <div>
  335. <span class="include-title">
  336. <span class="include-type">require_once</span>
  337. (<span class="include-name"><a href="../OpenID/_Auth---OpenID---Association.php.html">"Auth/OpenID/Association.php"</a></span>)
  338. (line <span class="line-number">96</span>)
  339. </span>
  340. </div>
  341. <!-- ========== Info from phpDoc block ========= -->
  342. </div>
  343. </div>
  344. </div>
  345. <a name="sec-constants"></a>
  346. <div class="info-box">
  347. <div class="info-box-title">Constants</div>
  348. <div class="nav-bar">
  349. <a href="#sec-description">Description</a> |
  350. <a href="#sec-classes">Classes</a>
  351. | <a href="#sec-includes">Includes</a>
  352. | <span class="disabled">Constants</span>
  353. </div>
  354. <div class="info-box-body">
  355. <a name="defineAUTH_OPENID_HTTP_ERROR"><!-- --></a>
  356. <div class="oddrow">
  357. <div>
  358. <span class="const-title">
  359. <span class="const-name">AUTH_OPENID_HTTP_ERROR</span> = 400
  360. (line <span class="line-number">108</span>)
  361. </span>
  362. </div>
  363. <!-- ========== Info from phpDoc block ========= -->
  364. </div>
  365. <a name="defineAUTH_OPENID_HTTP_OK"><!-- --></a>
  366. <div class="evenrow">
  367. <div>
  368. <span class="const-title">
  369. <span class="const-name">AUTH_OPENID_HTTP_OK</span> = 200
  370. (line <span class="line-number">106</span>)
  371. </span>
  372. </div>
  373. <!-- ========== Info from phpDoc block ========= -->
  374. </div>
  375. <a name="defineAUTH_OPENID_HTTP_REDIRECT"><!-- --></a>
  376. <div class="oddrow">
  377. <div>
  378. <span class="const-title">
  379. <span class="const-name">AUTH_OPENID_HTTP_REDIRECT</span> = 302
  380. (line <span class="line-number">107</span>)
  381. </span>
  382. </div>
  383. <!-- ========== Info from phpDoc block ========= -->
  384. </div>
  385. </div>
  386. </div>
  387. <p class="notes" id="credit">
  388. Documentation generated on Tue, 21 Apr 2009 11:31:32 -0700 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.3.2</a>
  389. </p>
  390. </div></body>
  391. </html>