class BasicAuthenticator(xmlstream.ConnectAuthenticator): (source)
Constructor: BasicAuthenticator(jid, password)
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 usernameAUTH_FAILED_EVENT: Authentication failed, due to invalid passwordREGISTER_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 | associate |
Called by the XmlStreamFactory when a connection has been made to the requested peer, and an XmlStream object has been instantiated. |
| Method | register |
Undocumented |
| Constant | AUTH |
See IQAuthInitializer.AUTH_FAILED_EVENT. |
| Constant | INVALID |
See IQAuthInitializer.INVALID_USER_EVENT. |
| Constant | REGISTER |
Token to signal that registration failed. |
| Class Variable | namespace |
Undocumented |
| Instance Variable | jid |
Undocumented |
| Instance Variable | password |
Undocumented |
| Method | _register |
Undocumented |
Inherited from ConnectAuthenticator:
| Method | connection |
Called by the XmlStream when the underlying socket connection is in place. |
| Method | initialize |
Perform stream initialization procedures. |
| Method | stream |
Called by the XmlStream when the stream has started. |
| Instance Variable | other |
Undocumented |
Inherited from Authenticator (via ConnectAuthenticator):
| Instance Variable | xmlstream |
The XmlStream that needs authentication |
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. |