skpy/conn.py
def auth(self, user, pwd):
        """
        Perform a login with the given Skype username and its password.  This emulates a login to Skype for Web on
        ``api.skype.com``.

        Args:
            user (str): username of the connecting account
            pwd (str): password of the connecting account

        Returns:
            (str, datetime.datetime) tuple: Skype token, and associated expiry if known

        Raises:
            .SkypeAuthException: if the login request is rejected
            .SkypeApiException: if the login form can't be processed
        """
        # Wrap up the credentials ready to send.
        pwdHash = base64.b64encode(hashlib.md5((user + "\nskyper\n" + pwd).encode("utf-8")).digest()).decode("utf-8")
        json = self.conn("POST", "{0}/login/skypetoken".format(SkypeConnection.API_USER),
                         json={"username": user, "passwordHash": pwdHash, "scopes": "client"}).json()
        if "skypetoken" not in json:
            raise SkypeAuthException("Couldn't retrieve Skype token from response")
        expiry = None
        if "expiresIn" in json:
            expiry = datetime.fromtimestamp(int(time.time()) + int(json["expiresIn"]))
        return json["skypetoken"], expiry
def auth(self, user, pwd):
        """
        Perform a login with the given Skype username and its password.  This emulates a login to Skype for Web on
        ``api.skype.com``.

        Args:
            user (str): username of the connecting account
            pwd (str): password of the connecting account

        Returns:
            (str, datetime.datetime) tuple: Skype token, and associated expiry if known

        Raises:
            .SkypeAuthException: if the login request is rejected
            .SkypeApiException: if the login form can't be processed
        """
        # Wrap up the credentials ready to send.
        pwdHash = base64.b64encode(hashlib.md5((user + "\nskyper\n" + pwd).encode("utf-8")).digest()).decode("utf-8")
        json = self.conn("POST", "{0}/login/skypetoken".format(SkypeConnection.API_USER),
                         json={"username": user, "passwordHash": pwdHash, "scopes": "client"}).json()
        if "skypetoken" not in json:
            raise SkypeAuthException("Couldn't retrieve Skype token from response")
        expiry = None
        if "expiresIn" in json:
            expiry = datetime.fromtimestamp(int(time.time()) + int(json["expiresIn"]))
        return json["skypetoken"], expiry
Perform a login with the given Skype username and its password.  This emulates a login to Skype for Web on
        ``api.skype.com``.

        Args:
            user (str): username of the connecting account
            pwd (str): password of the connecting account

        Returns:
            (str, datetime.datetime) tuple: Skype token, and associated expiry if known

        Raises:
            .SkypeAuthException: if the login request is rejected
            .SkypeApiException: if the login form can't be processed