def auth(self, skypeToken):
token = expiry = endpoint = None<EOL>msgsHost = SkypeConnection.API_MSGSHOST<EOL>while not token:<EOL><INDENT>secs = int(time.time())<EOL>hash = self.getMac256Hash(str(secs))<EOL>headers = {"<STR_LIT>": "<STR_LIT>".format(secs, hash),<EOL>"<STR_LIT>": "<STR_LIT>" + skypeToken, "<STR_LIT>": "<STR_LIT>"}<EOL>endpointResp = self.conn("<STR_LIT:POST>", "<STR_LIT>".format(msgsHost), codes=(<NUM_LIT:200>, <NUM_LIT>, <NUM_LIT>),<EOL>headers=headers, json={"<STR_LIT>": "<STR_LIT>"})<EOL>regTokenHead = endpointResp.headers.get("<STR_LIT>")<EOL>locHead = endpointResp.headers.get("<STR_LIT>")<EOL>if locHead:<EOL><INDENT>locParts = re.search(r"<STR_LIT>", locHead).groups()<EOL>if locParts[<NUM_LIT:2>]:<EOL><INDENT>endpoint = SkypeEndpoint(self.conn, locParts[<NUM_LIT:2>].replace("<STR_LIT>", "<STR_LIT:{>").replace("<STR_LIT>", "<STR_LIT:}>"))<EOL><DEDENT>if not locParts[<NUM_LIT:0>] == msgsHost:<EOL><INDENT>msgsHost = locHead.rsplit("<STR_LIT:/>", <NUM_LIT:4> if locParts[<NUM_LIT:2>] else <NUM_LIT:3>)[<NUM_LIT:0>]<EOL>continue<EOL><DEDENT><DEDENT>if regTokenHead:<EOL><INDENT>token = re.search(r"<STR_LIT>", regTokenHead, re.I).group(<NUM_LIT:1>)<EOL>regExpiry = re.search(r"<STR_LIT>", regTokenHead).group(<NUM_LIT:1>)<EOL>expiry = datetime.fromtimestamp(int(regExpiry))<EOL>regEndMatch = re.search(r"<STR_LIT>", regTokenHead)<EOL>if regEndMatch:<EOL><INDENT>endpoint = SkypeEndpoint(self.conn, regEndMatch.group(<NUM_LIT:1>))<EOL><DEDENT><DEDENT>if not endpoint and endpointResp.status_code == <NUM_LIT:200> and endpointResp.json():<EOL><INDENT>endpoint = SkypeEndpoint(self.conn, endpointResp.json()[<NUM_LIT:0>]["<STR_LIT:id>"])<EOL><DEDENT><DEDENT>return token, expiry, msgsHost, endpoint<EOL>
Request a new registration token using a current Skype token.

Args:
    skypeToken (str): existing Skype token

Returns:
    (str, datetime.datetime, str, SkypeEndpoint) tuple: registration token, associated expiry if known,
                                                        resulting endpoint hostname, endpoint if provided

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