File: _Auth---OpenID---Server.php.html

package info (click to toggle)
php-openid 2.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 3,284 kB
  • ctags: 6,733
  • sloc: php: 20,482; python: 346; xml: 333; sh: 130; perl: 103; makefile: 31
file content (442 lines) | stat: -rw-r--r-- 18,250 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
<?xml version="1.0" encoding="iso-8859-1"?>
<!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>
			<!-- template designed by Marco Von Ballmoos -->
			<title>Docs for page Server.php</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
		</head>
		<body>
			<div class="page-body">			

<h2 class="file-name">/Auth/OpenID/Server.php</h2>

<a name="sec-description"></a>
<div class="info-box">
	<div class="info-box-title">Description</div>
	<div class="nav-bar">
					<span class="disabled">Description</span> |
							<a href="#sec-classes">Classes</a>
			|							<a href="#sec-includes">Includes</a>
			|							<a href="#sec-constants">Constants</a>
										</div>
	<div class="info-box-body">	
		<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">OpenID server protocol and logic.</p>
<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
  $response = $request->answer(true);
  // this will a signed 'openid.sreg.timezone' parameter to the response
  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>
	<ul class="tags">
				<li><span class="field">author:</span> JanRain, Inc. &lt;<a href="mailto:openid@janrain.com">openid@janrain.com</a>&gt;</li>
				<li><span class="field">copyright:</span> 2005 Janrain, Inc.</li>
				<li><span class="field">license:</span> <a href="http://www.gnu.org/copyleft/lesser.html">LGPL</a></li>
			</ul>
		
			</div>
</div>
		
	<a name="sec-classes"></a>	
	<div class="info-box">
		<div class="info-box-title">Classes</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
			<span class="disabled">Classes</span>
			|							<a href="#sec-includes">Includes</a>
				|										<a href="#sec-constants">Constants</a>
															</div>
		<div class="info-box-body">	
			<table cellpadding="2" cellspacing="0" class="class-table">
				<tr>
					<th class="class-table-header">Class</th>
					<th class="class-table-header">Description</th>
				</tr>
								<tr>
					<td style="padding-right: 2em; vertical-align: top">
						<a href="../OpenID/Auth_OpenID_ServerError.html">Auth_OpenID_ServerError</a>
					</td>
					<td>
											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.
										</td>
				</tr>
								<tr>
					<td style="padding-right: 2em; vertical-align: top">
						<a href="../OpenID/Auth_OpenID_NoReturnToError.html">Auth_OpenID_NoReturnToError</a>
					</td>
					<td>
											Error returned by the server code when a return_to is absent from a  request.
										</td>
				</tr>
								<tr>
					<td style="padding-right: 2em; vertical-align: top">
						<a href="../OpenID/Auth_OpenID_MalformedReturnURL.html">Auth_OpenID_MalformedReturnURL</a>
					</td>
					<td>
											An error indicating that the return_to URL is malformed.
										</td>
				</tr>
								<tr>
					<td style="padding-right: 2em; vertical-align: top">
						<a href="../OpenID/Auth_OpenID_MalformedTrustRoot.html">Auth_OpenID_MalformedTrustRoot</a>
					</td>
					<td>
											This error is returned when the trust_root value is malformed.
										</td>
				</tr>
								<tr>
					<td style="padding-right: 2em; vertical-align: top">
						<a href="../OpenID/Auth_OpenID_Request.html">Auth_OpenID_Request</a>
					</td>
					<td>
											The base class for all server request classes.
										</td>
				</tr>
								<tr>
					<td style="padding-right: 2em; vertical-align: top">
						<a href="../OpenID/Auth_OpenID_CheckAuthRequest.html">Auth_OpenID_CheckAuthRequest</a>
					</td>
					<td>
											A request to verify the validity of a previous response.
										</td>
				</tr>
								<tr>
					<td style="padding-right: 2em; vertical-align: top">
						<a href="../OpenID/Auth_OpenID_PlainTextServerSession.html">Auth_OpenID_PlainTextServerSession</a>
					</td>
					<td>
											A class implementing plaintext server sessions.
										</td>
				</tr>
								<tr>
					<td style="padding-right: 2em; vertical-align: top">
						<a href="../OpenID/Auth_OpenID_DiffieHellmanSHA1ServerSession.html">Auth_OpenID_DiffieHellmanSHA1ServerSession</a>
					</td>
					<td>
											A class implementing DH-SHA1 server sessions.
										</td>
				</tr>
								<tr>
					<td style="padding-right: 2em; vertical-align: top">
						<a href="../OpenID/Auth_OpenID_DiffieHellmanSHA256ServerSession.html">Auth_OpenID_DiffieHellmanSHA256ServerSession</a>
					</td>
					<td>
											A class implementing DH-SHA256 server sessions.
										</td>
				</tr>
								<tr>
					<td style="padding-right: 2em; vertical-align: top">
						<a href="../OpenID/Auth_OpenID_AssociateRequest.html">Auth_OpenID_AssociateRequest</a>
					</td>
					<td>
											A request to associate with the server.
										</td>
				</tr>
								<tr>
					<td style="padding-right: 2em; vertical-align: top">
						<a href="../OpenID/Auth_OpenID_CheckIDRequest.html">Auth_OpenID_CheckIDRequest</a>
					</td>
					<td>
											A request to confirm the identity of a user.
										</td>
				</tr>
								<tr>
					<td style="padding-right: 2em; vertical-align: top">
						<a href="../OpenID/Auth_OpenID_ServerResponse.html">Auth_OpenID_ServerResponse</a>
					</td>
					<td>
											This class encapsulates the response to an OpenID server request.
										</td>
				</tr>
								<tr>
					<td style="padding-right: 2em; vertical-align: top">
						<a href="../OpenID/Auth_OpenID_WebResponse.html">Auth_OpenID_WebResponse</a>
					</td>
					<td>
											A web-capable response object which you can use to generate a  user-agent response.
										</td>
				</tr>
								<tr>
					<td style="padding-right: 2em; vertical-align: top">
						<a href="../OpenID/Auth_OpenID_Signatory.html">Auth_OpenID_Signatory</a>
					</td>
					<td>
											Responsible for the signature of query data and the verification of  OpenID signature values.
										</td>
				</tr>
								<tr>
					<td style="padding-right: 2em; vertical-align: top">
						<a href="../OpenID/Auth_OpenID_Encoder.html">Auth_OpenID_Encoder</a>
					</td>
					<td>
											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>.
										</td>
				</tr>
								<tr>
					<td style="padding-right: 2em; vertical-align: top">
						<a href="../OpenID/Auth_OpenID_SigningEncoder.html">Auth_OpenID_SigningEncoder</a>
					</td>
					<td>
											An encoder which also takes care of signing fields when required.
										</td>
				</tr>
								<tr>
					<td style="padding-right: 2em; vertical-align: top">
						<a href="../OpenID/Auth_OpenID_Decoder.html">Auth_OpenID_Decoder</a>
					</td>
					<td>
											Decode an incoming query into an Auth_OpenID_Request.
										</td>
				</tr>
								<tr>
					<td style="padding-right: 2em; vertical-align: top">
						<a href="../OpenID/Auth_OpenID_EncodingError.html">Auth_OpenID_EncodingError</a>
					</td>
					<td>
											An error that indicates an encoding problem occurred.
										</td>
				</tr>
								<tr>
					<td style="padding-right: 2em; vertical-align: top">
						<a href="../OpenID/Auth_OpenID_AlreadySigned.html">Auth_OpenID_AlreadySigned</a>
					</td>
					<td>
											An error that indicates that a response was already signed.
										</td>
				</tr>
								<tr>
					<td style="padding-right: 2em; vertical-align: top">
						<a href="../OpenID/Auth_OpenID_UntrustedReturnURL.html">Auth_OpenID_UntrustedReturnURL</a>
					</td>
					<td>
											An error that indicates that the given return_to is not under the  given trust_root.
										</td>
				</tr>
								<tr>
					<td style="padding-right: 2em; vertical-align: top">
						<a href="../OpenID/Auth_OpenID_Server.html">Auth_OpenID_Server</a>
					</td>
					<td>
											I handle requests for an OpenID server.
										</td>
				</tr>
							</table>
		</div>
	</div>

	<a name="sec-includes"></a>	
	<div class="info-box">
		<div class="info-box-title">Includes</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
							<a href="#sec-classes">Classes</a>
				|						<span class="disabled">Includes</span>
			|							<a href="#sec-constants">Constants</a>
															</div>
		<div class="info-box-body">	
			<a name="_Auth/OpenID/KVForm_php"><!-- --></a>
<div class="oddrow">
	
	<div>
		<span class="include-title">
			<span class="include-type">require_once</span>
			(<span class="include-name">"Auth/OpenID/KVForm.php"</span>)
			(line <span class="line-number">100</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	
</div>
<a name="_Auth/OpenID/ServerRequest_php"><!-- --></a>
<div class="evenrow">
	
	<div>
		<span class="include-title">
			<span class="include-type">require_once</span>
			(<span class="include-name"><a href="../OpenID/_Auth---OpenID---ServerRequest.php.html">"Auth/OpenID/ServerRequest.php"</a></span>)
			(line <span class="line-number">102</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	
</div>
<a name="_Auth/OpenID/DiffieHellman_php"><!-- --></a>
<div class="oddrow">
	
	<div>
		<span class="include-title">
			<span class="include-type">require_once</span>
			(<span class="include-name">"Auth/OpenID/DiffieHellman.php"</span>)
			(line <span class="line-number">99</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	
</div>
<a name="_Auth/OpenID_php"><!-- --></a>
<div class="evenrow">
	
	<div>
		<span class="include-title">
			<span class="include-type">require_once</span>
			(<span class="include-name"><a href="../OpenID/_Auth---OpenID.php.html">"Auth/OpenID.php"</a></span>)
			(line <span class="line-number">95</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Required imports</p>
	
</div>
<a name="_Auth/OpenID/TrustRoot_php"><!-- --></a>
<div class="oddrow">
	
	<div>
		<span class="include-title">
			<span class="include-type">require_once</span>
			(<span class="include-name">"Auth/OpenID/TrustRoot.php"</span>)
			(line <span class="line-number">101</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	
</div>
<a name="_Auth/OpenID/Message_php"><!-- --></a>
<div class="evenrow">
	
	<div>
		<span class="include-title">
			<span class="include-type">require_once</span>
			(<span class="include-name"><a href="../OpenID/_Auth---OpenID---Message.php.html">"Auth/OpenID/Message.php"</a></span>)
			(line <span class="line-number">103</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	
</div>
<a name="_Auth/OpenID/Nonce_php"><!-- --></a>
<div class="oddrow">
	
	<div>
		<span class="include-title">
			<span class="include-type">require_once</span>
			(<span class="include-name"><a href="../OpenID/_Auth---OpenID---Nonce.php.html">"Auth/OpenID/Nonce.php"</a></span>)
			(line <span class="line-number">104</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	
</div>
<a name="_Auth/OpenID/BigMath_php"><!-- --></a>
<div class="evenrow">
	
	<div>
		<span class="include-title">
			<span class="include-type">require_once</span>
			(<span class="include-name">"Auth/OpenID/BigMath.php"</span>)
			(line <span class="line-number">98</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	
</div>
<a name="_Auth/OpenID/CryptUtil_php"><!-- --></a>
<div class="oddrow">
	
	<div>
		<span class="include-title">
			<span class="include-type">require_once</span>
			(<span class="include-name">"Auth/OpenID/CryptUtil.php"</span>)
			(line <span class="line-number">97</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	
</div>
<a name="_Auth/OpenID/Association_php"><!-- --></a>
<div class="evenrow">
	
	<div>
		<span class="include-title">
			<span class="include-type">require_once</span>
			(<span class="include-name"><a href="../OpenID/_Auth---OpenID---Association.php.html">"Auth/OpenID/Association.php"</a></span>)
			(line <span class="line-number">96</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	
</div>
		</div>
	</div>
	
	<a name="sec-constants"></a>	
	<div class="info-box">
		<div class="info-box-title">Constants</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
							<a href="#sec-classes">Classes</a>
				|										<a href="#sec-includes">Includes</a>
				|						<span class="disabled">Constants</span>
											</div>
		<div class="info-box-body">	
			<a name="defineAUTH_OPENID_HTTP_ERROR"><!-- --></a>
<div class="oddrow">
	
	<div>
		<span class="const-title">
			<span class="const-name">AUTH_OPENID_HTTP_ERROR</span> = 400
			(line <span class="line-number">108</span>)
		</span>
	</div>
	
	<!-- ========== Info from phpDoc block ========= -->
	
		
</div>
<a name="defineAUTH_OPENID_HTTP_OK"><!-- --></a>
<div class="evenrow">
	
	<div>
		<span class="const-title">
			<span class="const-name">AUTH_OPENID_HTTP_OK</span> = 200
			(line <span class="line-number">106</span>)
		</span>
	</div>
	
	<!-- ========== Info from phpDoc block ========= -->
	
		
</div>
<a name="defineAUTH_OPENID_HTTP_REDIRECT"><!-- --></a>
<div class="oddrow">
	
	<div>
		<span class="const-title">
			<span class="const-name">AUTH_OPENID_HTTP_REDIRECT</span> = 302
			(line <span class="line-number">107</span>)
		</span>
	</div>
	
	<!-- ========== Info from phpDoc block ========= -->
	
		
</div>
		</div>
	</div>
	
	
	
	<p class="notes" id="credit">
		Documentation generated on Wed, 05 Dec 2007 14:02:13 -0800 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.3.2</a>
	</p>
	</div></body>
</html>