MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / perform

Method perform

launcher/minecraft/auth/steps/XboxAuthorizationStep.cpp:29–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27}
28
29void XboxAuthorizationStep::perform() {
30 QString xbox_auth_template = R"XXX(
31{
32 "Properties": {
33 "SandboxId": "RETAIL",
34 "UserTokens": [
35 "%1"
36 ]
37 },
38 "RelyingParty": "%2",
39 "TokenType": "JWT"
40}
41)XXX";
42 auto xbox_auth_data = xbox_auth_template.arg(m_data->userToken.token, m_relyingParty);
43// http://xboxlive.com
44 QNetworkRequest request = QNetworkRequest(QUrl("https://xsts.auth.xboxlive.com/xsts/authorize"));
45 request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
46 request.setRawHeader("Accept", "application/json");
47 AuthRequest *requestor = new AuthRequest(this);
48 connect(requestor, &AuthRequest::finished, this, &XboxAuthorizationStep::onRequestDone);
49 requestor->post(request, xbox_auth_data.toUtf8());
50 qDebug() << "Getting authorization token for " << m_relyingParty;
51}
52
53void XboxAuthorizationStep::onRequestDone(
54 QNetworkReply::NetworkError error,

Callers

nothing calls this directly

Calls 2

QUrlClass · 0.85
postMethod · 0.80

Tested by

no test coverage detected