Skip to content

Commit

Permalink
Add Live auth method to check if user exists
Browse files Browse the repository at this point in the history
  • Loading branch information
Terrance committed Nov 25, 2016
1 parent 5412226 commit 1db184f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions skpy/conn.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,19 @@ class SkypeLiveAuthProvider(SkypeAuthProvider):
An authentication provider that connects via Microsoft account authentication.
"""

def checkUser(self, user):
"""
Query a username or email address to see if a corresponding Microsoft account exists.
Args:
user (str): username or email address of an account
Returns:
bool: whether the account exists
"""
return not self.conn("POST", "{0}/GetCredentialType.srf".format(SkypeConnection.API_MSACC),
json={"username": user}).json().get("IfExistsResult")

def auth(self, user, pwd):
"""
Obtain connection parameters from the Microsoft account login page, and perform a login with the given email
Expand Down

0 comments on commit 1db184f

Please sign in to comment.