PDA

View Full Version : OAuth for Qt



anbu01
22nd February 2016, 17:02
Hi,
I am learning OAuth to implement in my application.I used this (https://github.com/pipacs/o2)step by step documentation to have test app for twitter authentication.Here is the following code:-


ox1 = new OXTwitter(this);

ox1->setClientId("client-id");//Id got from twitter application created.
ox1->setClientSecret("secret-key");//secret key got from application.
ox1->setUsername("user-id");
ox1->setPassword("password");

connect(ox1, SIGNAL(linkedChanged()), this, SLOT(onLinkedChanged()));
connect(ox1, SIGNAL(linkingFailed()), this, SLOT(onLinkingFailed()));
connect(ox1, SIGNAL(linkingSucceeded()), this, SLOT(onLinkingSucceeded()));
connect(ox1, SIGNAL(openBrowser(QUrl)), this, SLOT(onOpenBrowser(QUrl)));
connect(ox1, SIGNAL(closeBrowser()), this, SLOT(onCloseBrowser()));
ox1->link();
But i am getting error as follows:-

OXTwitter::link
O1::onTokenExchangeError: 202 "Error downloading https://api.twitter.com/oauth/access_token - server replied: Forbidden" "<?xml version="1.0" encoding="UTF-8"?><errors><error code="87">Client is not permitted to perform this action</error></errors>"
Login has failed

But the test application i created in twitter has permissions to read and write.So can anyone guide me on this.