Use the username credential instead of jid to enable ANONYMOUS auth.
This commit is contained in:
parent
2c2498b658
commit
0eb009496e
1 changed files with 4 additions and 3 deletions
|
@ -44,15 +44,16 @@ class FeatureMechanisms(BasePlugin):
|
|||
}
|
||||
|
||||
def plugin_init(self):
|
||||
if not self.use_mech and not self.xmpp.requested_jid.user:
|
||||
self.use_mech = 'ANONYMOUS'
|
||||
|
||||
if self.sasl_callback is None:
|
||||
self.sasl_callback = self._default_credentials
|
||||
|
||||
if self.security_callback is None:
|
||||
self.security_callback = self._default_security
|
||||
|
||||
creds = self.sasl_callback(set(['username']), set())
|
||||
if not self.use_mech and not creds['username']:
|
||||
self.use_mech = 'ANONYMOUS'
|
||||
|
||||
self.mech = None
|
||||
self.mech_list = set()
|
||||
self.attempted_mechs = set()
|
||||
|
|
Loading…
Reference in a new issue