Skip to content

Commit

Permalink
fix: set x-xbl-contract-version header during xbox auth step
Browse files Browse the repository at this point in the history
Refrencing GDlauncher and ATLauncher code for auth as well as https://learn.microsoft.com/en-us/gaming/gdk/_content/gc/reference/live/rest/additional/httpstandardheaders
it is possible some of microsoft's server's are rejecting our request because of this missing header?

Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
  • Loading branch information
Ryex committed May 1, 2023
1 parent 12f0d51 commit 495103f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions launcher/minecraft/auth/steps/XboxUserStep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ void XboxUserStep::perform() {
QNetworkRequest request = QNetworkRequest(QUrl("https://user.auth.xboxlive.com/user/authenticate"));
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
request.setRawHeader("Accept", "application/json");
// set contract-verison header (prevent err 400 bad-request?)
// https://learn.microsoft.com/en-us/gaming/gdk/_content/gc/reference/live/rest/additional/httpstandardheaders
request.setRawHeader("x-xbl-contract-version", "1");

auto *requestor = new AuthRequest(this);
connect(requestor, &AuthRequest::finished, this, &XboxUserStep::onRequestDone);
requestor->post(request, xbox_auth_data.toUtf8());
Expand Down

0 comments on commit 495103f

Please sign in to comment.