From 9fac7065a7b439cc499015c02890c83dc5a71198 Mon Sep 17 00:00:00 2001 From: Octol1ttle Date: Tue, 3 Feb 2026 21:26:18 +0500 Subject: [PATCH 1/2] fix(XboxAuthorizationStep): set x-xbl-contract-version Signed-off-by: Octol1ttle --- launcher/minecraft/auth/steps/XboxAuthorizationStep.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/launcher/minecraft/auth/steps/XboxAuthorizationStep.cpp b/launcher/minecraft/auth/steps/XboxAuthorizationStep.cpp index 9c8e94d1f..29c69f255 100644 --- a/launcher/minecraft/auth/steps/XboxAuthorizationStep.cpp +++ b/launcher/minecraft/auth/steps/XboxAuthorizationStep.cpp @@ -40,6 +40,7 @@ void XboxAuthorizationStep::perform() auto headers = QList{ { "Content-Type", "application/json" }, { "Accept", "application/json" }, + { "x-xbl-contract-version", "1" } }; m_response.reset(new QByteArray()); m_request = Net::Upload::makeByteArray(url, m_response.get(), xbox_auth_data.toUtf8()); From 8e992a324cd3584ae65faa26232fa25b76d48ab1 Mon Sep 17 00:00:00 2001 From: Octol1ttle Date: Tue, 3 Feb 2026 21:28:44 +0500 Subject: [PATCH 2/2] change(AuthFlow): remove XboxProfileStep Signed-off-by: Octol1ttle --- launcher/CMakeLists.txt | 2 - launcher/minecraft/auth/AuthFlow.cpp | 2 - .../minecraft/auth/steps/XboxProfileStep.cpp | 66 ------------------- .../minecraft/auth/steps/XboxProfileStep.h | 27 -------- 4 files changed, 97 deletions(-) delete mode 100644 launcher/minecraft/auth/steps/XboxProfileStep.cpp delete mode 100644 launcher/minecraft/auth/steps/XboxProfileStep.h diff --git a/launcher/CMakeLists.txt b/launcher/CMakeLists.txt index 9bf8901fc..837ff7234 100644 --- a/launcher/CMakeLists.txt +++ b/launcher/CMakeLists.txt @@ -247,8 +247,6 @@ set(MINECRAFT_SOURCES minecraft/auth/steps/MSAStep.h minecraft/auth/steps/XboxAuthorizationStep.cpp minecraft/auth/steps/XboxAuthorizationStep.h - minecraft/auth/steps/XboxProfileStep.cpp - minecraft/auth/steps/XboxProfileStep.h minecraft/auth/steps/XboxUserStep.cpp minecraft/auth/steps/XboxUserStep.h diff --git a/launcher/minecraft/auth/AuthFlow.cpp b/launcher/minecraft/auth/AuthFlow.cpp index cea171b33..dcd319824 100644 --- a/launcher/minecraft/auth/AuthFlow.cpp +++ b/launcher/minecraft/auth/AuthFlow.cpp @@ -10,7 +10,6 @@ #include "minecraft/auth/steps/MSAStep.h" #include "minecraft/auth/steps/MinecraftProfileStep.h" #include "minecraft/auth/steps/XboxAuthorizationStep.h" -#include "minecraft/auth/steps/XboxProfileStep.h" #include "minecraft/auth/steps/XboxUserStep.h" #include "tasks/Task.h" @@ -36,7 +35,6 @@ AuthFlow::AuthFlow(AccountData* data, Action action) : Task(), m_data(data) m_steps.append( makeShared(m_data, &m_data->mojangservicesToken, "rp://api.minecraftservices.com/", "Mojang")); m_steps.append(makeShared(m_data)); - m_steps.append(makeShared(m_data)); m_steps.append(makeShared(m_data)); m_steps.append(makeShared(m_data)); m_steps.append(makeShared(m_data)); diff --git a/launcher/minecraft/auth/steps/XboxProfileStep.cpp b/launcher/minecraft/auth/steps/XboxProfileStep.cpp deleted file mode 100644 index a6b3454b0..000000000 --- a/launcher/minecraft/auth/steps/XboxProfileStep.cpp +++ /dev/null @@ -1,66 +0,0 @@ -#include "XboxProfileStep.h" - -#include -#include - -#include "Application.h" -#include "Logging.h" -#include "net/NetUtils.h" -#include "net/RawHeaderProxy.h" - -XboxProfileStep::XboxProfileStep(AccountData* data) : AuthStep(data) {} - -QString XboxProfileStep::describe() -{ - return tr("Fetching Xbox profile."); -} - -void XboxProfileStep::perform() -{ - QUrl url("https://profile.xboxlive.com/users/me/profile/settings"); - QUrlQuery q; - q.addQueryItem("settings", - "GameDisplayName,AppDisplayName,AppDisplayPicRaw,GameDisplayPicRaw," - "PublicGamerpic,ShowUserAsAvatar,Gamerscore,Gamertag,ModernGamertag,ModernGamertagSuffix," - "UniqueModernGamertag,AccountTier,TenureLevel,XboxOneRep," - "PreferredColor,Location,Bio,Watermarks," - "RealName,RealNameOverride,IsQuarantined"); - url.setQuery(q); - auto headers = QList{ - { "Content-Type", "application/json" }, - { "Accept", "application/json" }, - { "x-xbl-contract-version", "3" }, - { "Authorization", QString("XBL3.0 x=%1;%2").arg(m_data->userToken.extra["uhs"].toString(), m_data->xboxApiToken.token).toUtf8() } - }; - - m_response.reset(new QByteArray()); - m_request = Net::Download::makeByteArray(url, m_response.get()); - m_request->addHeaderProxy(std::make_unique(headers)); - - m_task.reset(new NetJob("XboxProfileStep", APPLICATION->network())); - m_task->setAskRetry(false); - m_task->addNetAction(m_request); - - connect(m_task.get(), &Task::finished, this, &XboxProfileStep::onRequestDone); - - m_task->start(); - qDebug() << "Getting Xbox profile..."; -} - -void XboxProfileStep::onRequestDone() -{ - if (m_request->error() != QNetworkReply::NoError) { - qWarning() << "Reply error:" << m_request->error(); - qCDebug(authCredentials()) << *m_response; - if (Net::isApplicationError(m_request->error())) { - emit finished(AccountTaskState::STATE_FAILED_SOFT, tr("Failed to retrieve the Xbox profile: %1").arg(m_request->errorString())); - } else { - emit finished(AccountTaskState::STATE_OFFLINE, tr("Failed to retrieve the Xbox profile: %1").arg(m_request->errorString())); - } - return; - } - - qCDebug(authCredentials()) << "Xbox profile:" << *m_response; - - emit finished(AccountTaskState::STATE_WORKING, tr("Got Xbox profile")); -} diff --git a/launcher/minecraft/auth/steps/XboxProfileStep.h b/launcher/minecraft/auth/steps/XboxProfileStep.h deleted file mode 100644 index d447f7a2b..000000000 --- a/launcher/minecraft/auth/steps/XboxProfileStep.h +++ /dev/null @@ -1,27 +0,0 @@ -#pragma once -#include -#include - -#include "minecraft/auth/AuthStep.h" -#include "net/Download.h" -#include "net/NetJob.h" - -class XboxProfileStep : public AuthStep { - Q_OBJECT - - public: - explicit XboxProfileStep(AccountData* data); - virtual ~XboxProfileStep() noexcept = default; - - void perform() override; - - QString describe() override; - - private slots: - void onRequestDone(); - - private: - std::unique_ptr m_response; - Net::Download::Ptr m_request; - NetJob::Ptr m_task; -};