mojang.api.auth.microsoft¶
- mojang.api.auth.microsoft.authenticate_minecraft(userhash: str, xsts_token: str) str ¶
Retrieve the Minecraft access token loging in using Xbox Live
- Parameters:
- Returns:
The minecraft token
- Raises:
XboxLiveInvalidUserHash – if the user hash is invalid
Unauthorized – if the XSTS token is invalid
- Example:
>>> from mojang.account.auth import microsoft >>> ACCESS_TOKEN = "...." # Access token from Microsoft >>> xbl_token, _ = microsoft.authenticate_xbl(ACCESS_TOKEN) >>> xsts_token, userhash = microsoft.authenticate_xsts(xbl_token) >>> mc_access_token = microsoft.authenticate_minecraft(userhash, xsts_token)
- mojang.api.auth.microsoft.authenticate_xbl(auth_token: str) tuple[str, str] ¶
Authenticate with Xbox Live using the Microsoft access token received after the OAuth authentication
- Parameters:
auth_token (str) – The access token
- Returns:
A tuple with the Xbox Live token and user hash
- Raises:
XboxLiveAuthenticationError – if the auth token is invalid