xbox.webapi.authentication.token module

Token containers

class xbox.webapi.authentication.token.Token(jwt, date_issued, date_valid)

Bases: object

__init__(jwt, date_issued, date_valid)

Container for authentication tokens obtained from Windows Live / Xbox Live Servers, featuring validity checking.

Parameters:
  • token (str) – The JWT Token
  • date_issued (str/datetime) – The date the token was issued. Just provide the current time if you do not
  • this info. (have) –
  • date_valid (str/datetime) – The date the token expires.
Returns:

Instance of Token

Return type:

Token

classmethod from_dict(node)

Assemble a Token object from a dict, for example from json config file.

Parameters:node (dict) – Token as dict object. Mandatory fields: ‘token’, ‘date_issued’, ‘date_valid’
Returns:Instance of Token
Return type:Token
to_dict()

Convert the Token-object to a dict-object, to use it in json-file for example. :returns: The token formatted as dict. :rtype: dict

is_valid

Check if token is still valid.

Returns:True on success, False otherwise
Return type:bool
class xbox.webapi.authentication.token.AccessToken(jwt, expires_sec)

Bases: xbox.webapi.authentication.token.Token

__init__(jwt, expires_sec)

Container for storing Windows Live Access Token

Subclass of Token

WARNING: Only invoke when creating a FRESH token Don’t use to convert saved token into object :param token: The JWT Access-Token :type token: str :param expires_sec: The expiry-time in seconds :type expires_sec: int

class xbox.webapi.authentication.token.RefreshToken(jwt)

Bases: xbox.webapi.authentication.token.Token

__init__(jwt)

Container for storing Windows Live Refresh Token.

Subclass of Token

WARNING: Only invoke when creating a FRESH token! Don’t use to convert saved token into object Refresh Token usually has a lifetime of 14 days

Parameters:token (str) – The JWT Refresh-Token
class xbox.webapi.authentication.token.UserToken(jwt, date_issued, date_valid)

Bases: xbox.webapi.authentication.token.Token

Container for storing Xbox Live User Token.

Subclass of Token

WARNING: Only invoke when creating a FRESH token! Don’t use to convert saved token into object

class xbox.webapi.authentication.token.DeviceToken(jwt, date_issued, date_valid)

Bases: xbox.webapi.authentication.token.Token

Container for storing Xbox Live Device Token.

Subclass of Token

WARNING: Only invoke when creating a FRESH token! Don’t use to convert saved token into object

class xbox.webapi.authentication.token.TitleToken(jwt, date_issued, date_valid)

Bases: xbox.webapi.authentication.token.Token

Container for storing Xbox Live Title Token.

Subclass of Token

WARNING: Only invoke when creating a FRESH token! Don’t use to convert saved token into object

class xbox.webapi.authentication.token.XSTSToken(jwt, date_issued, date_valid)

Bases: xbox.webapi.authentication.token.Token

Container for storing Xbox Live XSTS Token.

Subclass of Token

WARNING: Only invoke when creating a FRESH token! Don’t use to convert saved token into object