MCPcopy Create free account
hub / github.com/Adaptix-Framework/AdaptixC2 / HttpReqLogin

Function HttpReqLogin

AdaptixClient/Source/Client/Requestor.cpp:51–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49}
50
51bool HttpReqLogin(AuthProfile* profile)
52{
53 QJsonObject dataJson;
54 dataJson["username"] = profile->GetUsername();
55 dataJson["password"] = profile->GetPassword();
56 dataJson["version"] = SMALL_VERSION;
57 QByteArray jsonData = QJsonDocument(dataJson).toJson();
58
59 QString sUrl = profile->GetURL() + "/login";
60 QJsonObject jsonObject = HttpReq(sUrl, jsonData, QString());
61 if (jsonObject.contains("access_token") && jsonObject.contains("refresh_token")) {
62 profile->SetAccessToken( jsonObject["access_token"].toString() );
63 profile->SetRefreshToken( jsonObject["refresh_token"].toString() );
64 return true;
65 }
66 return false;
67}
68
69bool HttpReqJwtUpdate(AuthProfile* profile)
70{

Callers 2

LoginMethod · 0.85
OnReconnectMethod · 0.85

Calls 9

HttpReqFunction · 0.85
GetUsernameMethod · 0.80
GetPasswordMethod · 0.80
GetURLMethod · 0.80
SetAccessTokenMethod · 0.80
SetRefreshTokenMethod · 0.80
QStringClass · 0.50
toJsonMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected