Not Monitored
Tag not monitored by Microsoft.
39,143 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Why isn't this working for me the first endpoint is returning code 400 with no text/json.
def authenticate_xbox(access_token):
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
body = {
'Properties': {
'AuthMethod': 'RPS',
'SiteName': 'user.auth.xboxlive.com',
'RpsTicket': f'd={access_token}'
},
'RelyingParty': 'http://auth.xboxlive.com',
'TokenType': 'JWT'
}
response = requests.post('https://user.auth.xboxlive.com/user/authenticate', json=body, headers=headers)
if response.status_code != 200:
print(response.status_code)
raise Exception(f'Failed to authenticate with Xbox API: {response.text}')
return response.json()['Token']