コード例 #1
0
ファイル: auth.py プロジェクト: Chicooz/yowsup
class YowsupAuth:
	def __init__(self, connection):
		self.connection = connection
		self.mechanism = AuthMechanism
		self.authenticated = False

		self.username = None
		self.password = None
		self.domain = None
		self.resource = None

		self.supportsReceiptAcks = True
		self.accountKind = None
		self.expireData = None

		self.authCallbacks = []

	def isAuthenticated(self):
		return self.authenticated

	def onAuthenticated(self, callback):
		self.authCallbacks.append(callback)

	def authenticationComplete(self):
		self.authenticated = True
		#should process callbacks

	def authenticationFailed(self):
		print "AUTH FAIL"

	def authenticate(self, username, password, domain, resource):
		print "Connecting to "+Constants.host
		#connection = ConnectionEngine()
		self.connection.connect((Constants.host, Constants.port));

		
		self.mechanism = AuthMechanism(self.connection)
		self.mechanism.setAuthObject(self)

		self.username = username
		self.password = password
		self.domain = domain
		self.resource = resource
		self.jid = "%s@%s"%(self.username,self.domain)
		
	
		
		connection = self.mechanism.login(username, password, domain, resource)
		return connection
コード例 #2
0
ファイル: auth.py プロジェクト: cereal/whatsploit
class YowsupAuth:
	def __init__(self, connection):
		self.connection = connection
		self.mechanism = AuthMechanism
		self.authenticated = False

		self.username = None
		self.password = None
		self.domain = None
		self.resource = None

		self.supportsReceiptAcks = True
		self.accountKind = None
		self.expireData = None

		self.authCallbacks = []

	def isAuthenticated(self):
		return self.authenticated

	def onAuthenticated(self, callback):
		self.authCallbacks.append(callback)

	def authenticationComplete(self):
		self.authenticated = True
		#should process callbacks

	def authenticationFailed(self):
		print "AUTH FAIL"

	def authenticate(self, username, password, domain, resource):
		print "Connecting to "+Constants.host
		#connection = ConnectionEngine()
		self.connection.connect((Constants.host, Constants.port));

		
		self.mechanism = AuthMechanism(self.connection)
		self.mechanism.setAuthObject(self)

		self.username = username
		self.password = password
		self.domain = domain
		self.resource = resource
		self.jid = "%s@%s"%(self.username,self.domain)
		
	
		
		connection = self.mechanism.login(username, password, domain, resource)
		return connection
コード例 #3
0
    def authenticate(self, username, password, domain, resource):
        print "Connecting to " + Constants.host
        #connection = ConnectionEngine()
        self.connection.connect((Constants.host, Constants.port))

        self.mechanism = AuthMechanism(self.connection)
        self.mechanism.setAuthObject(self)

        self.username = username
        self.password = password
        self.domain = domain
        self.resource = resource
        self.jid = "%s@%s" % (self.username, self.domain)

        connection = self.mechanism.login(username, password, domain, resource)
        return connection
コード例 #4
0
ファイル: auth.py プロジェクト: philklc/yowsup
    def authenticate(self, username, password, domain, resource):
        print "Connecting to " + Constants.host
        # connection = ConnectionEngine()
        self.connection.connect((Constants.host, Constants.port))

        self.mechanism = AuthMechanism(self.connection)
        self.mechanism.setAuthObject(self)

        self.username = username
        self.password = password
        self.domain = domain
        self.resource = resource
        self.jid = "%s@%s" % (self.username, self.domain)

        connection = self.mechanism.login(username, password, domain, resource)
        return connection