XAL manager¶
Xbox Authentication Library
Authenticate with Windows Live Server and Xbox Live (used by mobile Xbox Apps)
pythonxbox.authentication.xal.log = logging.getLogger('xal.authentication')
module-attribute
¶
pythonxbox.authentication.xal.APP_PARAMS_XBOX_BETA_APP = XalAppParameters(app_id='000000004415494b', title_id='177887386', redirect_uri='ms-xal-000000004415494b://auth')
module-attribute
¶
pythonxbox.authentication.xal.APP_PARAMS_XBOX_APP = XalAppParameters(app_id='000000004c12ae6f', title_id='328178078', redirect_uri='ms-xal-000000004c12ae6f://auth')
module-attribute
¶
pythonxbox.authentication.xal.APP_PARAMS_GAMEPASS = XalAppParameters(app_id='000000004c20a908', title_id='1016898439', redirect_uri='ms-xal-000000004c20a908://auth')
module-attribute
¶
pythonxbox.authentication.xal.APP_PARAMS_GAMEPASS_BETA = XalAppParameters(app_id='000000004c20a908', title_id='1016898439', redirect_uri='ms-xal-public-beta-000000004c20a908://auth')
module-attribute
¶
pythonxbox.authentication.xal.APP_PARAMS_FAMILY_SETTINGS = XalAppParameters(app_id='00000000482C8F49', title_id='1618633878', redirect_uri='https://login.live.com/oauth20_desktop.srf')
module-attribute
¶
pythonxbox.authentication.xal.CLIENT_PARAMS_IOS = XalClientParameters(user_agent='XAL iOS 2021.11.20211021.000', device_type='iOS', client_version='15.6.1', query_display='ios_phone')
module-attribute
¶
pythonxbox.authentication.xal.CLIENT_PARAMS_ANDROID = XalClientParameters(user_agent='XAL Android 2020.07.20200714.000', device_type='Android', client_version='8.0.0', query_display='android_phone')
module-attribute
¶
pythonxbox.authentication.xal.XALManager(session, device_id, app_params, client_params)
¶
Source code in src/pythonxbox/authentication/xal.py
session = session
instance-attribute
¶
device_id = device_id
instance-attribute
¶
app_params = app_params
instance-attribute
¶
client_params = client_params
instance-attribute
¶
cv = CorrelationVector()
instance-attribute
¶
get_title_endpoints(session)
async
staticmethod
¶
Source code in src/pythonxbox/authentication/xal.py
request_device_token()
async
¶
Source code in src/pythonxbox/authentication/xal.py
__oauth20_token_endpoint(json_body)
async
¶
Source code in src/pythonxbox/authentication/xal.py
exchange_code_for_token(authorization_code, code_verifier)
async
¶
Source code in src/pythonxbox/authentication/xal.py
refresh_token(refresh_token_jwt)
async
¶
Source code in src/pythonxbox/authentication/xal.py
request_sisu_authentication(device_token_jwt, code_challenge, state)
async
¶
Request Sisu authentication URL
Response holds authentication URL that needs to be called by the user in webbrowser
Returns:
| Type | Description |
|---|---|
tuple[SisuAuthenticationResponse, str]
|
Tuple of (authentication response, sisu session id) |
Source code in src/pythonxbox/authentication/xal.py
do_sisu_authorization(sisu_session_id, access_token_jwt, device_token_jwt)
async
¶
Sisu authorization
Returns:
| Type | Description |
|---|---|
SisuAuthorizationResponse
|
Response with device-/title-/user-tokens |
Source code in src/pythonxbox/authentication/xal.py
xsts_authorization(device_token_jwt, title_token_jwt, user_token_jwt, relying_party)
async
¶
Request additional XSTS tokens for specific relying parties
Source code in src/pythonxbox/authentication/xal.py
auth_flow(user_input_cb)
async
¶
Does the whole XAL/Sisu authentication flow
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
user_input_cb
|
Callable[[str], str]
|
User callback which takes args: (auth_url: str) and returns the redirect URL (str) |
required |
Returns:
| Type | Description |
|---|---|
SisuAuthorizationResponse
|
Sisu authorization response with all tokens |