pyxmpp.sasl.digest_md5.DigestMD5ClientAuthenticator

Package pyxmpp :: Package sasl :: Module digest_md5 :: Class DigestMD5ClientAuthenticator |
[show private | hide private]
[frames | no frames]

## Class DigestMD5ClientAuthenticator

    ClientAuthenticator --+
                          |
                         DigestMD5ClientAuthenticator

Provides PLAIN SASL authentication for a client.

Method Summary
| ``__init__`(self, password_manager)` Initialize a `DigestMD5ClientAuthenticator` object.
`sasl.Response` or `sasl.Failure` | ``challenge`(self, challenge)` Process a challenge and return the response.
`sasl.Success` or `sasl.Failure` | ``finish`(self, data)` Process success indicator from the server.
`sasl.Response` or `sasl.Failure` | ``start`(self, username, authzid)` Start the authentication process initializing client state.
`sasl.Response` or `sasl.Failure` | ``_final_challenge`(self, challenge)` Process the second challenge from the server and return the response.
| ``_get_password`(self)` Retrieve user's password from the password manager.
`str` or `Failure` | ``_get_realm`(self, realms, charset)` Choose a realm from the list specified by the server.
`sasl.Response` or `sasl.Failure` | ``_make_response`(self, charset, realms, nonce)` Make a response for the first challenge from the server.

Instance Variable Summary
| `password`: current authentication password
| `pformat`: current authentication password format
| `realm`: current authentication realm

Method Details

### __init__(self, password_manager) (Constructor) Initialize a `DigestMD5ClientAuthenticator` object. Parameters: `password_manager` - name of the password manager object providing authentication credentials. (type=`PasswordManager`) Overrides: `pyxmpp.sasl.core.ClientAuthenticator.__init__`

### challenge(self, challenge) Process a challenge and return the response. Parameters: `challenge` - the challenge from server. (type=`str`) Returns: the response or a failure indicator. (type=`sasl.Response` or `sasl.Failure`) Overrides: `pyxmpp.sasl.core.ClientAuthenticator.challenge`

### finish(self, data) Process success indicator from the server. Process any addicional data passed with the success. Fail if the server was not authenticated. Parameters: `data` - an optional additional data with success. (type=`str`) Returns: success or failure indicator. (type=`sasl.Success` or `sasl.Failure`) Overrides: `pyxmpp.sasl.core.ClientAuthenticator.finish`

### start(self, username, authzid) Start the authentication process initializing client state. Parameters: `username` - username (authentication id). (type=`unicode`) `authzid` - authorization id. (type=`unicode`) Returns: the (empty) initial response (type=`sasl.Response` or `sasl.Failure`) Overrides: `pyxmpp.sasl.core.ClientAuthenticator.start`

### _final_challenge(self, challenge) Process the second challenge from the server and return the response. Parameters: `challenge` - the challenge from server. (type=`str`) Returns: the response or a failure indicator. (type=`sasl.Response` or `sasl.Failure`)

### _get_password(self) Retrieve user's password from the password manager. Set `self.password` to the password and `self.pformat` to its format name ('plain' or 'md5:user:realm:pass').

### _get_realm(self, realms, charset) Choose a realm from the list specified by the server. Parameters: `realms` - the realm list. (type=`list` of `str`) `charset` - encoding of realms on the list. (type=`str`) Returns: the realm chosen or a failure indicator. (type=`str` or `Failure`)

### _make_response(self, charset, realms, nonce) Make a response for the first challenge from the server. Parameters: `charset` - charset name from the challenge. (type=`str`) `realms` - realms list from the challenge. (type=`str`) `nonce` - nonce value from the challenge. (type=`str`) Returns: the response or a failure indicator. (type=`sasl.Response` or `sasl.Failure`)

Instance Variable Details

### password current authentication password

### pformat current authentication password format

### realm current authentication realm