Esempio n. 1
0
    def initialize(self):
        if (sasl.NS_XMPP_SASL, 'mechanisms') in self.xmlstream.features:
            inits = [(sasl.SASLInitiatingInitializer, True),
                     (client.BindInitializer, True),
                     (client.SessionInitializer, False)]

            for initClass, required in inits:
                init = initClass(self.xmlstream)
                init.required = required
                self.xmlstream.initializers.append(init)
        elif (client.NS_IQ_AUTH_FEATURE, 'auth') in self.xmlstream.features:
            self.xmlstream.initializers.append(
                    client.IQAuthInitializer(self.xmlstream))
        else:
            raise Exception("No available authentication method found")
Esempio n. 2
0
 def setUp(self):
     super(IQAuthInitializerTest, self).setUp()
     self.init = client.IQAuthInitializer(self.xmlstream)
     self.authenticator.jid = jid.JID('[email protected]/resource')
     self.authenticator.password = '******'
 def setUp(self):
     super().setUp()
     self.init = client.IQAuthInitializer(self.xmlstream)
     self.authenticator.jid = jid.JID("[email protected]/resource")
     self.authenticator.password = "******"