Auth_OpenID_Server.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  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 Class Auth_OpenID_Server</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="class-name">Class Auth_OpenID_Server</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-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
  19. </div>
  20. <div class="info-box-body">
  21. <!-- ========== Info from phpDoc block ========= -->
  22. <p class="short-description">I handle requests for an OpenID server.</p>
  23. <p class="description"><p>Some types of requests (those which are not checkid requests) may be handed to my <a href="../OpenID/Auth_OpenID_Server.html#methodhandleRequest">handleRequest</a> method, and I will take care of it and return a response.</p><p>For your convenience, I also provide an interface to <a href="../OpenID/Auth_OpenID_Decoder.html#methoddecode">Auth_OpenID_Decoder::decode()</a> and <a href="../OpenID/Auth_OpenID_SigningEncoder.html#methodencode">Auth_OpenID_SigningEncoder::encode()</a> through my methods <a href="../OpenID/Auth_OpenID_Server.html#methoddecodeRequest">decodeRequest</a> and <a href="../OpenID/Auth_OpenID_Server.html#methodencodeResponse">encodeResponse</a>.</p><p>All my state is encapsulated in an <a href="../OpenID/Auth_OpenID_OpenIDStore.html">Auth_OpenID_OpenIDStore</a>.</p><p>Example:</p><p><pre> $oserver = new Auth_OpenID_Server(Auth_OpenID_FileStore($data_path),
  24. "http://example.com/op");
  25. $request = $oserver->decodeRequest();
  26. if (in_array($request->mode, array('checkid_immediate',
  27. 'checkid_setup'))) {
  28. if ($app->isAuthorized($request->identity, $request->trust_root)) {
  29. $response = $request->answer(true);
  30. } else if ($request->immediate) {
  31. $response = $request->answer(false);
  32. } else {
  33. $app->showDecidePage($request);
  34. return;
  35. }
  36. } else {
  37. $response = $oserver->handleRequest($request);
  38. }
  39. $webresponse = $oserver->encode($response);</pre></p></p>
  40. <p class="notes">
  41. Located in <a class="field" href="_Auth---OpenID---Server.php.html">/Auth/OpenID/Server.php</a> (line <span class="field">1673</span>)
  42. </p>
  43. <pre></pre>
  44. </div>
  45. </div>
  46. <a name="sec-method-summary"></a>
  47. <div class="info-box">
  48. <div class="info-box-title">Method Summary</span></div>
  49. <div class="nav-bar">
  50. <a href="#sec-description">Description</a> |
  51. <span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
  52. </div>
  53. <div class="info-box-body">
  54. <div class="method-summary">
  55. <div class="method-definition">
  56. <span class="method-result">Auth_OpenID_Server</span>
  57. <a href="#Auth_OpenID_Server" title="details" class="method-name">Auth_OpenID_Server</a>
  58. (<span class="var-type"></span>&nbsp;<span class="var-name">&$store</span>, [<span class="var-type"></span>&nbsp;<span class="var-name">$op_endpoint</span> = <span class="var-default">null</span>])
  59. </div>
  60. <div class="method-definition">
  61. <span class="method-result">void</span>
  62. <a href="#decodeRequest" title="details" class="method-name">decodeRequest</a>
  63. ([<span class="var-type"></span>&nbsp;<span class="var-name">$query</span> = <span class="var-default">null</span>])
  64. </div>
  65. <div class="method-definition">
  66. <span class="method-result">void</span>
  67. <a href="#encodeResponse" title="details" class="method-name">encodeResponse</a>
  68. (<span class="var-type"></span>&nbsp;<span class="var-name">&$response</span>)
  69. </div>
  70. <div class="method-definition">
  71. <span class="method-result"><a href="../OpenID/Auth_OpenID_ServerResponse.html">Auth_OpenID_ServerResponse</a></span>
  72. <a href="#handleRequest" title="details" class="method-name">handleRequest</a>
  73. (<span class="var-type"><a href="../OpenID/Auth_OpenID_Request.html">Auth_OpenID_Request</a></span>&nbsp;<span class="var-name">$request</span>)
  74. </div>
  75. <div class="method-definition">
  76. <span class="method-result">void</span>
  77. <a href="#openid_associate" title="details" class="method-name">openid_associate</a>
  78. (<span class="var-type"></span>&nbsp;<span class="var-name">&$request</span>)
  79. </div>
  80. <div class="method-definition">
  81. <span class="method-result">void</span>
  82. <a href="#openid_check_authentication" title="details" class="method-name">openid_check_authentication</a>
  83. (<span class="var-type"></span>&nbsp;<span class="var-name">&$request</span>)
  84. </div>
  85. </div>
  86. </div>
  87. </div>
  88. <a name="sec-methods"></a>
  89. <div class="info-box">
  90. <div class="info-box-title">Methods</div>
  91. <div class="nav-bar">
  92. <a href="#sec-description">Description</a> |
  93. <a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
  94. </div>
  95. <div class="info-box-body">
  96. <A NAME='method_detail'></A>
  97. <a name="methodAuth_OpenID_Server" id="Auth_OpenID_Server"><!-- --></a>
  98. <div class="oddrow">
  99. <div class="method-header">
  100. <span class="method-title">Constructor Auth_OpenID_Server</span> (line <span class="line-number">1674</span>)
  101. </div>
  102. <!-- ========== Info from phpDoc block ========= -->
  103. <div class="method-signature">
  104. <span class="method-result">Auth_OpenID_Server</span>
  105. <span class="method-name">
  106. Auth_OpenID_Server
  107. </span>
  108. (<span class="var-type"></span>&nbsp;<span class="var-name">&$store</span>, [<span class="var-type"></span>&nbsp;<span class="var-name">$op_endpoint</span> = <span class="var-default">null</span>])
  109. </div>
  110. <ul class="parameters">
  111. <li>
  112. <span class="var-type"></span>
  113. <span class="var-name">&$store</span> </li>
  114. <li>
  115. <span class="var-type"></span>
  116. <span class="var-name">$op_endpoint</span> </li>
  117. </ul>
  118. </div>
  119. <a name="methoddecodeRequest" id="decodeRequest"><!-- --></a>
  120. <div class="evenrow">
  121. <div class="method-header">
  122. <span class="method-title">decodeRequest</span> (line <span class="line-number">1747</span>)
  123. </div>
  124. <!-- ========== Info from phpDoc block ========= -->
  125. <p class="short-description">Decodes a query args array into the appropriate <a href="../OpenID/Auth_OpenID_Request.html">Auth_OpenID_Request</a> object.</p>
  126. <div class="method-signature">
  127. <span class="method-result">void</span>
  128. <span class="method-name">
  129. decodeRequest
  130. </span>
  131. ([<span class="var-type"></span>&nbsp;<span class="var-name">$query</span> = <span class="var-default">null</span>])
  132. </div>
  133. <ul class="parameters">
  134. <li>
  135. <span class="var-type"></span>
  136. <span class="var-name">$query</span> </li>
  137. </ul>
  138. </div>
  139. <a name="methodencodeResponse" id="encodeResponse"><!-- --></a>
  140. <div class="oddrow">
  141. <div class="method-header">
  142. <span class="method-title">encodeResponse</span> (line <span class="line-number">1738</span>)
  143. </div>
  144. <!-- ========== Info from phpDoc block ========= -->
  145. <p class="short-description">Encodes as response in the appropriate format suitable for sending to the user agent.</p>
  146. <div class="method-signature">
  147. <span class="method-result">void</span>
  148. <span class="method-name">
  149. encodeResponse
  150. </span>
  151. (<span class="var-type"></span>&nbsp;<span class="var-name">&$response</span>)
  152. </div>
  153. <ul class="parameters">
  154. <li>
  155. <span class="var-type"></span>
  156. <span class="var-name">&$response</span> </li>
  157. </ul>
  158. </div>
  159. <a name="methodhandleRequest" id="handleRequest"><!-- --></a>
  160. <div class="evenrow">
  161. <div class="method-header">
  162. <span class="method-title">handleRequest</span> (line <span class="line-number">1695</span>)
  163. </div>
  164. <!-- ========== Info from phpDoc block ========= -->
  165. <p class="short-description">Handle a request. Given an <a href="../OpenID/Auth_OpenID_Request.html">Auth_OpenID_Request</a> object, call the appropriate <a href="../OpenID/Auth_OpenID_Server.html">Auth_OpenID_Server</a> method to process the request and generate a response.</p>
  166. <ul class="tags">
  167. <li><span class="field">return:</span> A response object capable of generating a user-agent reply.</li>
  168. </ul>
  169. <div class="method-signature">
  170. <span class="method-result"><a href="../OpenID/Auth_OpenID_ServerResponse.html">Auth_OpenID_ServerResponse</a></span>
  171. <span class="method-name">
  172. handleRequest
  173. </span>
  174. (<span class="var-type"><a href="../OpenID/Auth_OpenID_Request.html">Auth_OpenID_Request</a></span>&nbsp;<span class="var-name">$request</span>)
  175. </div>
  176. <ul class="parameters">
  177. <li>
  178. <span class="var-type"><a href="../OpenID/Auth_OpenID_Request.html">Auth_OpenID_Request</a></span>
  179. <span class="var-name">$request</span><span class="var-description">: An <a href="../OpenID/Auth_OpenID_Request.html">Auth_OpenID_Request</a> returned by <a href="../OpenID/Auth_OpenID_Server.html#methoddecodeRequest">Auth_OpenID_Server::decodeRequest()</a>.</span> </li>
  180. </ul>
  181. </div>
  182. <a name="methodopenid_associate" id="openid_associate"><!-- --></a>
  183. <div class="oddrow">
  184. <div class="method-header">
  185. <span class="method-title">openid_associate</span> (line <span class="line-number">1715</span>)
  186. </div>
  187. <!-- ========== Info from phpDoc block ========= -->
  188. <p class="short-description">The callback for 'associate' messages.</p>
  189. <div class="method-signature">
  190. <span class="method-result">void</span>
  191. <span class="method-name">
  192. openid_associate
  193. </span>
  194. (<span class="var-type"></span>&nbsp;<span class="var-name">&$request</span>)
  195. </div>
  196. <ul class="parameters">
  197. <li>
  198. <span class="var-type"></span>
  199. <span class="var-name">&$request</span> </li>
  200. </ul>
  201. </div>
  202. <a name="methodopenid_check_authentication" id="openid_check_authentication"><!-- --></a>
  203. <div class="evenrow">
  204. <div class="method-header">
  205. <span class="method-title">openid_check_authentication</span> (line <span class="line-number">1707</span>)
  206. </div>
  207. <!-- ========== Info from phpDoc block ========= -->
  208. <p class="short-description">The callback for 'check_authentication' messages.</p>
  209. <div class="method-signature">
  210. <span class="method-result">void</span>
  211. <span class="method-name">
  212. openid_check_authentication
  213. </span>
  214. (<span class="var-type"></span>&nbsp;<span class="var-name">&$request</span>)
  215. </div>
  216. <ul class="parameters">
  217. <li>
  218. <span class="var-type"></span>
  219. <span class="var-name">&$request</span> </li>
  220. </ul>
  221. </div>
  222. </div>
  223. </div>
  224. <p class="notes" id="credit">
  225. 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>
  226. </p>
  227. </div></body>
  228. </html>