class documentation

class twisted.words.protocols.jabber.sasl.SASLInitiatingInitializer(xmlstream.BaseFeatureInitiatingInitializer): (source)

View In Hierarchy

Stream initializer that performs SASL authentication.

The supported mechanisms by this initializer are DIGEST-MD5, PLAIN and ANONYMOUS. The ANONYMOUS SASL mechanism is used when the JID, set on the authenticator, does not have a localpart (username), requesting an anonymous session where the username is generated by the server. Otherwise, DIGEST-MD5 and PLAIN are attempted, in that order.

Class Variable feature Undocumented
Method setMechanism Select and setup authentication mechanism.
Instance Variable mechanism Undocumented
Method start Start SASL authentication exchange.
Method sendAuth Initiate authentication protocol exchange.
Method sendResponse Send response to a challenge.
Method onChallenge Parse challenge and send response from the mechanism.
Method onSuccess Clean up observers, reset the XML stream and send a new header.
Method onFailure Clean up observers, parse the failure and errback the deferred.
Instance Variable _deferred Undocumented

Inherited from BaseFeatureInitiatingInitializer:

Instance Variable required whether the stream feature is required to be advertized by the receiving entity.
Method __init__ Undocumented
Instance Variable xmlstream The associated XML stream
Method initialize Initiate the initialization.
_deferred = (source)

Undocumented

def setMechanism(self): (source)

Select and setup authentication mechanism.

Uses the authenticator's jid and password attribute for the authentication credentials. If no supported SASL mechanisms are advertized by the receiving party, a failing deferred is returned with a SASLNoAcceptableMechanism exception.

mechanism = (source)

Undocumented

def start(self): (source)
def sendAuth(self, data=None): (source)

Initiate authentication protocol exchange.

If an initial client response is given in data, it will be sent along.

Parametersdatainitial client response. (type: str or None.)
def sendResponse(self, data=b''): (source)

Send response to a challenge.

Parametersdataclient response. (type: bytes.)
def onChallenge(self, element): (source)

Parse challenge and send response from the mechanism.

Parameterselementthe challenge protocol element. (type: domish.Element.)
def onSuccess(self, success): (source)

Clean up observers, reset the XML stream and send a new header.

Parameterssuccessthe success protocol element. For now unused, but could hold additional data. (type: domish.Element)
def onFailure(self, failure): (source)

Clean up observers, parse the failure and errback the deferred.

Parametersfailurethe failure protocol element. Holds details on the error condition. (type: domish.Element)
API Documentation for Twisted, generated by pydoctor 20.12.1 at 2021-02-28 19:53:36.