1
<?xml version="1.0" encoding="utf-8"?>
3
PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN'
4
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
5
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
1
<?xml version="1.0" encoding="utf-8"?><!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'><html lang="en" xmlns="http://www.w3.org/1999/xhtml">
7
3
<title>Twisted Documentation: Authentication with Perspective Broker</title>
8
4
<link href="stylesheet.css" rel="stylesheet" type="text/css"/>
309
305
<p>This technique also relies upon the fact that the
310
306
<code>pb.Referenceable</code> reference can <em>only</em> come from someone
311
307
who holds a corresponding <code>pb.RemoteReference</code>. The design of the
312
serialization mechanism (implemented in <code class="API"><a href="http://twistedmatrix.com/documents/9.0.0/api/twisted.spread.jelly.html" title="twisted.spread.jelly">twisted.spread.jelly</a></code>: pb, jelly, spread.. get it? Look for
308
serialization mechanism (implemented in <code class="API"><a href="http://twistedmatrix.com/documents/10.0.0/api/twisted.spread.jelly.html" title="twisted.spread.jelly">twisted.spread.jelly</a></code>: pb, jelly, spread.. get it? Look for
313
309
<q>banana</q>, too. What other networking framework
314
310
can claim API names based on sandwich ingredients?) makes it impossible for
315
311
a client to obtain a reference that they weren't explicitly given.
1234
1230
<p>pbAnonServer.py implements a server based on pb6server.py, extending it to
1235
1231
permit anonymous logins in addition to authenticated logins. A
1236
<code class="API"><a href="http://twistedmatrix.com/documents/9.0.0/api/twisted.cred.checkers.AllowAnonymousAccess.html" title="twisted.cred.checkers.AllowAnonymousAccess">AllowAnonymousAccess</a></code>
1237
checker and a <code class="API"><a href="http://twistedmatrix.com/documents/9.0.0/api/twisted.cred.checkers.
1232
<code class="API"><a href="http://twistedmatrix.com/documents/10.0.0/api/twisted.cred.checkers.AllowAnonymousAccess.html" title="twisted.cred.checkers.AllowAnonymousAccess">AllowAnonymousAccess</a></code>
1233
checker and a <code class="API"><a href="http://twistedmatrix.com/documents/10.0.0/api/twisted.cred.checkers.
1238
1234
.html" title="twisted.cred.checkers.
1240
1236
InMemoryUsernamePasswordDatabaseDontUse</a></code> checker are registered and the
1241
1237
client's choice of credentials object determines which is used to authenticate
1242
1238
the login. In either case, the realm will be called on to create an avatar for
1243
1239
the login. <code>AllowAnonymousAccess</code> always produces an <code>avatarId
1244
</code> of <code class="API"><a href="http://twistedmatrix.com/documents/9.0.0/api/twisted.cred.checkers.ANONYMOUS.html" title="twisted.cred.checkers.ANONYMOUS">ANONYMOUS</a></code>.</p>
1240
</code> of <code class="API"><a href="http://twistedmatrix.com/documents/10.0.0/api/twisted.cred.checkers.ANONYMOUS.html" title="twisted.cred.checkers.ANONYMOUS">ANONYMOUS</a></code>.</p>
1246
1242
<p>On the client side, the only change is the use of an instance of
1247
<code class="API"><a href="http://twistedmatrix.com/documents/9.0.0/api/twisted.cred.credentials.Anonymous.html" title="twisted.cred.credentials.Anonymous">Anonymous</a></code> when calling
1248
<code class="API"><a href="http://twistedmatrix.com/documents/9.0.0/api/twisted.spread.pb.PBClientFactory.login.html" title="twisted.spread.pb.PBClientFactory.login">PBClientFactory.login</a></code>.</p>
1243
<code class="API"><a href="http://twistedmatrix.com/documents/10.0.0/api/twisted.cred.credentials.Anonymous.html" title="twisted.cred.credentials.Anonymous">Anonymous</a></code> when calling
1244
<code class="API"><a href="http://twistedmatrix.com/documents/10.0.0/api/twisted.spread.pb.PBClientFactory.login.html" title="twisted.spread.pb.PBClientFactory.login">PBClientFactory.login</a></code>.</p>
1251
1247
<h2>Using Avatars<a name="auto12"/></h2>
1432
1428
<h3>Viewable<a name="auto17"/></h3> <a name="viewable" shape="rect"/>
1434
1430
<p>Once you have <code>IPerspective</code> objects (i.e. the Avatar) to
1435
represent users, the <code class="API"><a href="http://twistedmatrix.com/documents/9.0.0/api/twisted.spread.flavors.Viewable.html" title="twisted.spread.flavors.Viewable">Viewable</a></code> class can come into play. This
1431
represent users, the <code class="API"><a href="http://twistedmatrix.com/documents/10.0.0/api/twisted.spread.flavors.Viewable.html" title="twisted.spread.flavors.Viewable">Viewable</a></code> class can come into play. This
1436
1432
class behaves a lot like <code>Referenceable</code>: it turns into a
1437
1433
<code>RemoteReference</code> when sent over the wire, and certain methods
1438
1434
can be invoked by the holder of that reference. However, the methods that
1722
1718
backwards-compatibility.</span></a></li></ol></div>
1724
1720
<p><a href="index.html">Index</a></p>
1725
<span class="version">Version: 9.0.0</span>
1721
<span class="version">Version: 10.0.0</span>
b'\\ No newline at end of file'