Skip to content
This repository was archived by the owner on Jun 11, 2025. It is now read-only.

Commit 54fc6a4

Browse files
committed
Restore behaviour of SkypeConnection.liveLogin()
Expose SOAP as a new method on SkypeConnection instances, and update getSkypeToken() (and therefore the Skype constructor) to use SOAP.
1 parent d79cbe1 commit 54fc6a4

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

skpy/conn.py

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ def setUserPwd(self, user, pwd):
263263
pwd (str): password of the connecting account
264264
"""
265265
def getSkypeToken(self):
266-
self.liveLogin(user, pwd)
266+
self.soapLogin(user, pwd)
267267
self.getSkypeToken = MethodType(getSkypeToken, self)
268268

269269
def setTokenFile(self, path):
@@ -361,6 +361,31 @@ def liveLogin(self, user, pwd):
361361
Returns:
362362
(str, datetime.datetime) tuple: Skype token, and associated expiry if known
363363
364+
Raises:
365+
.SkypeAuthException: if the login request is rejected
366+
.SkypeApiException: if the login form can't be processed
367+
"""
368+
self.tokens["skype"], self.tokenExpiry["skype"] = SkypeLiveAuthProvider(self).auth(user, pwd)
369+
self.getUserId()
370+
self.getRegToken()
371+
372+
def soapLogin(self, user, pwd):
373+
"""
374+
Perform a login with the given email address or Skype username, and its password, using the Microsoft account
375+
SOAP login APIs.
376+
377+
.. note::
378+
Microsoft accounts with two-factor authentication enabled are supported if an application-specific password
379+
is provided. Skype accounts must be linked to a Microsoft account with an email address, otherwise
380+
:class:`.SkypeAuthException` will be raised. See the exception definitions for other possible causes.
381+
382+
Args:
383+
user (str): username or email address of the connecting account
384+
pwd (str): password of the connecting account
385+
386+
Returns:
387+
(str, datetime.datetime) tuple: Skype token, and associated expiry if known
388+
364389
Raises:
365390
.SkypeAuthException: if the login request is rejected
366391
.SkypeApiException: if the login form can't be processed
@@ -390,7 +415,7 @@ def guestLogin(self, url, name):
390415

391416
def getSkypeToken(self):
392417
"""
393-
A wrapper for :meth:`liveLogin` that applies the previously given username and password.
418+
A wrapper for the default login provider that applies the previously given username and password.
394419
395420
Raises:
396421
.SkypeAuthException: if credentials were never provided

0 commit comments

Comments
 (0)