Package pyxmpp2 :: Package sasl :: Module scram :: Class SCRAMClientAuthenticator
[hide private]

Class SCRAMClientAuthenticator


Provides SCRAM SASL authentication for a client.
Nested Classes [hide private]

Inherited from core.ClientAuthenticator: __metaclass__

Instance Methods [hide private]
 
__init__(self, hash_name, channel_binding)
Initialize a SCRAMClientAuthenticator object.
 
start(self, properties)
Start the authentication process.
sasl.Response or sasl.Failure
challenge(self, challenge)
Process a challenge and return the response.
sasl.Response or sasl.Failure
_make_response(self, nonce, salt, iteration_count)
Make a response for the first challenge from the server.
sasl.Response or sasl.Failure
_final_challenge(self, challenge)
Process the second challenge from the server and return the response.
sasl.Success or sasl.Failure
finish(self, data)
Process success indicator from the server.

Inherited from SCRAMOperations: H, HMAC, Hi

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods [hide private]
 
are_properties_sufficient(cls, properties)
Check if the provided properties are sufficient for this authentication mechanism.
Static Methods [hide private]

Inherited from SCRAMOperations: Normalize, XOR, escape, unescape

Class Variables [hide private]
  __abstractmethods__ = frozenset([])
  _abc_cache = <_weakrefset.WeakSet object at 0xf60e5b90>
  _abc_negative_cache = <_weakrefset.WeakSet object at 0xf60dc030>
Instance Variables [hide private]
  password
current authentication password
  pformat
current authentication password format
  realm
current authentication realm
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, hash_name, channel_binding)
(Constructor)

 
Initialize a SCRAMClientAuthenticator object.
Parameters:
  • hash_function_name (unicode) - hash function name, e.g. "SHA-1"
  • channel_binding (bool) - True to enable channel binding
Overrides: object.__init__

are_properties_sufficient(cls, properties)
Class Method

 
Check if the provided properties are sufficient for
this authentication mechanism.

If `are_properties_sufficient` returns False for given `properties`
mapping, the `start` method of `cls` instance will also fail with
such argument.

:Parameters:
    - `properties`: the `authentication properties`_
:Types:
    - `properties`: mapping

:Return: if the mechanism can be used with those properties

Overrides: core.ClientAuthenticator.are_properties_sufficient
(inherited documentation)

start(self, properties)

 
Start the authentication process.

:Parameters:
    - `properties`: the `authentication properties`_
:Types:
    - `properties`: mapping

:return: the initial response to send to the server or a failuer
    indicator.
:returntype: `Response` or `Failure`

Overrides: core.ClientAuthenticator.start
(inherited documentation)

challenge(self, challenge)

 
Process a challenge and return the response.
Parameters:
  • challenge (bytes) - the challenge from server.
Returns: sasl.Response or sasl.Failure
the response or a failure indicator.
Overrides: core.ClientAuthenticator.challenge

_make_response(self, nonce, salt, iteration_count)

 
Make a response for the first challenge from the server.
Returns: sasl.Response or sasl.Failure
the response or a failure indicator.

_final_challenge(self, challenge)

 
Process the second challenge from the server and return the response.
Parameters:
  • challenge (bytes) - the challenge from server.
Returns: sasl.Response or sasl.Failure
the response or a failure indicator.

finish(self, data)

 

Process success indicator from the server.

Process any addiitional data passed with the success. Fail if the server was not authenticated.

Parameters:
  • data (bytes) - an optional additional data with success.
Returns: sasl.Success or sasl.Failure
success or failure indicator.
Overrides: core.ClientAuthenticator.finish