twisted.cred.portal.Portal

Package twisted :: Package cred :: Module portal :: Class Portal |
[frames | no frames]

## Class Portal

Method Summary
| ``__init__`(self, realm, checkers)` Create a Portal to a `IRealm`.
| ``listCredentialsInterfaces`(self)` Return list of credentials interfaces that can be used to login.
| ``login`(self, credentials, mind, *interfaces)` Return a deferred which will fire a tuple of (interface, avatarAspect, logout).
| `registerChecker(self, checker, *credentialInterfaces)`

Method Details

### __init__(self, realm, checkers=()) (Constructor) Create a Portal to a `IRealm`.

### listCredentialsInterfaces(self) Return list of credentials interfaces that can be used to login.

### login(self, credentials, mind, *interfaces) Parameters: `credentials` - an implementor of twisted.cred.credentials.ICredentials `mind` - an object which implements a client-side interface for your particular realm. In many cases, this may be None, so if the word 'mind' confuses you, just ignore it. `interfaces` - list of interfaces for the perspective that the mind wishes to attach to. Usually, this will be only one interface, for example IMailAccount. For highly dynamic protocols, however, this may be a list like (IMailAccount, IUserChooser, IServiceInfo). To expand: if we are speaking to the system over IMAP, any information that will be relayed to the user MUST be returned as an IMailAccount implementor; IMAP clients would not be able to understand anything else. Any information about unusual status would have to be relayed as a single mail message in an otherwise-empty mailbox. However, in a web-based mail system, or a PB-based client, the ``mind'' object inside the web server (implemented with a dynamic page-viewing mechanism such as woven) or on the user's client program may be intelligent enough to respond to several ``server''-side interfaces. Returns: A deferred which will fire a tuple of (interface, avatarAspect, logout). The interface will be one of the interfaces passed in the 'interfaces' argument. The 'avatarAspect' will implement that interface. The 'logout' object is a callable which will detach the mind from the avatar. It must be called when the user has conceptually disconnected from the service. Although in some cases this will not be in connectionLost (such as in a web-based session), it will always be at the end of a user's interactive session.

Generated by Epydoc 2.0 on Sat May 15 20:08:55 2004 | http://epydoc.sf.net