Go to the latest version of this document.
search in docstrings

Search bar offers the following options:

- Term presence. The below example searches for documents that must contain “foo”, might contain “bar” and must not contain “baz”: `+foo bar -baz`
- Wildcards. The below example searches for documents with words beginning with “foo”: `foo*`
- Search in specific fields. The following search matches all objects in "twisted.mail" that matches “search”: `+qname:twisted.mail.* +search`

  Possible fields: 'name', 'qname' (fully qualified name), 'docstring', and 'kind'. Last two fields are only applicable if "search in docstrings" is enabled.

- Fuzzy matches. The following search matches all documents that have a word within 1 edit distance of “foo”: `foo~1`

Results provided by Lunr.js

# ``twisted`.`words`.`protocols`.`jabber`.`client`.`BasicAuthenticator``

class documentation

`class BasicAuthenticator(xmlstream.ConnectAuthenticator): (source)`

View In Hierarchy

Authenticates an XmlStream against a Jabber server as a Client.

This only implements non-SASL authentication, per JEP-0078. Additionally, this authenticator provides the ability to perform inline registration, per JEP-0077.

Under normal circumstances, the BasicAuthenticator generates the `xmlstream.STREAM_AUTHD_EVENT` once the stream has authenticated. However, it can also generate other events, such as:

- `INVALID_USER_EVENT` : Authentication failed, due to invalid username
- `AUTH_FAILED_EVENT` : Authentication failed, due to invalid password
- `REGISTER_FAILED_EVENT` : Registration failed

If authentication fails for any reason, you can attempt to register by calling the `registerAccount` method. If the registration succeeds, a `xmlstream.STREAM_AUTHD_EVENT` will be fired. Otherwise, one of the above errors will be generated (again).

Method | `__init__` | Undocumented
Method | `associateWithStream` | Called by the XmlStreamFactory when a connection has been made to the requested peer, and an XmlStream object has been instantiated.
Method | `registerAccount` | Undocumented
Constant | `AUTH_FAILED_EVENT` | See `IQAuthInitializer.AUTH_FAILED_EVENT`.
Constant | `INVALID_USER_EVENT` | See `IQAuthInitializer.INVALID_USER_EVENT`.
Constant | `REGISTER_FAILED_EVENT` | Token to signal that registration failed.
Class Variable | `namespace` | Undocumented
Instance Variable | `jid` | Undocumented
Instance Variable | `password` | Undocumented
Method | `_registerResultEvent` | Undocumented

Inherited from `ConnectAuthenticator`:

Method | `connectionMade` | Called by the XmlStream when the underlying socket connection is in place.
Method | `initializeStream` | Perform stream initialization procedures.
Method | `streamStarted` | Called by the XmlStream when the stream has started.
Instance Variable | `otherHost` | Undocumented

Inherited from `Authenticator` (via `ConnectAuthenticator`):

Instance Variable | `xmlstream` | The XmlStream that needs authentication

def __init__(self, jid, password): (source)
overrides `twisted.words.protocols.jabber.xmlstream.ConnectAuthenticator.__init__`

Undocumented

def associateWithStream(self, xs): (source)
overrides `twisted.words.protocols.jabber.xmlstream.Authenticator.associateWithStream`

Called by the XmlStreamFactory when a connection has been made to the requested peer, and an XmlStream object has been instantiated.

The default implementation just saves a handle to the new XmlStream.

Parameters
xs | Undocumented
xmlstream:`XmlStream` | The XmlStream that will be passing events to this Authenticator.

def registerAccount(self, username=None, password=None): (source)

Undocumented

AUTH_FAILED_EVENT: `str` = (source)

See `IQAuthInitializer.AUTH_FAILED_EVENT`.

Value

    IQAuthInitializer.AUTH_FAILED_EVENT

INVALID_USER_EVENT: `str` = (source)

See `IQAuthInitializer.INVALID_USER_EVENT`.

Value

    IQAuthInitializer.INVALID_USER_EVENT

REGISTER_FAILED_EVENT: `str` = (source)

Token to signal that registration failed.

Value

    '//event/client/basicauth/registerfailed'

namespace: `str` = (source)
overrides `twisted.words.protocols.jabber.xmlstream.ConnectAuthenticator.namespace`

Undocumented

jid = (source)

Undocumented

password = (source)

Undocumented

def _registerResultEvent(self, iq): (source)

Undocumented