QOAuth2AuthorizationCodeFlow and response
Unsolved
General and Desktop
-
Hello!
I have some class for oauth2. When i launch, it open browser, i allow with terms, then it redirect me to page with auth code.this->oauth = new QOAuth2AuthorizationCodeFlow(this); connect(this->oauth, &QOAuth2AuthorizationCodeFlow::authorizeWithBrowser, &QDesktopServices::openUrl); const QUrl authUri(".../oauth/authorize"); const auto clientId = "..."; const QUrl tokenUri(".../oauth/token"); const auto clientSecret("..."); this->oauth->setAuthorizationUrl(authUri); this->oauth->setClientIdentifier(clientId); this->oauth->setAccessTokenUrl(tokenUri); this->oauth->setClientIdentifierSharedKey(clientSecret); this->oauth->setModifyParametersFunction([](QAbstractOAuth::Stage stage, QVariantMap* parameters) { (*parameters)["redirect_uri"] = QUrl("urn:ietf:wg:oauth:2.0:oob"); if (stage == QAbstractOAuth::Stage::RequestingAuthorization) { //if permament parameters->insert("duration", "permanent"); } }); connect(this->oauth, &QOAuth2AuthorizationCodeFlow::statusChanged, [](QAbstractOAuth::Status status) { qDebug() << "Status accepted"; }); connect(this->oauth, &QOAuth2AuthorizationCodeFlow::granted, [=](){ qDebug() << __FUNCTION__ << __LINE__ << "Access Granted!"; // auto reply = this->oauth->get(whoami); // connect(reply, &QNetworkReply::finished, [reply](){ // qDebug() << "REQUEST FINISHED. Error? " << (reply->error() != QNetworkReply::NoError); // qDebug() << reply->readAll(); // }); }); this->oauth->grant();
But i dont recive any response/callback. Is there any wrong here?