[Pablo Mazzini] ask passphrase to user when using non-sasl authentication

This commit is contained in:
Yann Leboulanger 2012-01-07 15:41:53 +01:00
parent 71e6f991e0
commit 82413cafaa
1 changed files with 12 additions and 1 deletions

View File

@ -577,8 +577,19 @@ class NonBlockingNonSASL(PlugIn):
else: else:
log.warn("Secure methods unsupported, performing plain text \ log.warn("Secure methods unsupported, performing plain text \
authentication") authentication")
query.setTagData('password', self.password)
self._method = 'plain' self._method = 'plain'
self._owner._caller.get_password(self._on_password, self._method)
return
resp = self.owner.Dispatcher.SendAndWaitForResponse(iq,
func=self._on_auth)
def _on_password(self, password):
self.password = '' if password is None else password
iq=Iq('set', NS_AUTH)
query = iq.getTag('query')
query.setTagData('username', self.user)
query.setTagData('resource', self.resource)
query.setTagData('password', self.password)
resp = self.owner.Dispatcher.SendAndWaitForResponse(iq, resp = self.owner.Dispatcher.SendAndWaitForResponse(iq,
func=self._on_auth) func=self._on_auth)