I am trying to get authentification to twitter's API using QOAuth.
my code currently is :
oauthInterface->setConsumerKey(CONSUMER_KEY);
oauthInterface->setConsumerSecret(CONSUMER_SECRET_KEY);
oauthInterface->setRequestTimeout(10000);
QOAuth::ParamMap reply = oauthInterface->requestToken("https://api.twitter.com/oauth/request_token", QOAuth::GET, QOAuth::HMAC_SHA1);
if(oauthInterface->error() == QOAuth::NoError)
{
token = reply.value(QOAuth::tokenParameterName());
tokenSecret = reply.value(QOAuth::tokenSecretParameterName());
qDebug() << "temporary token" << token << tokenSecret;
}
reply = oauthInterface->accessToken("https://api.twitter.com/oauth/access_token",QOAuth::GET, token, tokenSecret, QOAuth::HMAC_SHA1);
if(oauthInterface->error() == QOAuth::NoError)
{
qDebug() << "final token" << reply.value("screen_name") << reply.value(QOAuth::tokenParameterName()) << reply.value(QOAuth::tokenSecretParameterName());
}
else
{
qDebug() << "ERROR" << oauthInterface->error();
}`
And gives me
temporary token "cBhxmmdkYgmghyy02kmfc0VSIuykRCNoQRh2h1r3Yg" "oYF8b2lzPSgDTRku8X4BjjnoVw5dAXXZBXc2R9P8Jk"
ERROR 401
Using QOAuth::POST instead of QOAuth::GET I have the same result
How am I to get access token's using QOAuth ?