【发布时间】:2016-06-04 06:17:41
【问题描述】:
我正在学习 OAuth 以在我的 Qt 应用程序中实现。我使用 this 一步一步的文档来为 twitter 身份验证测试应用程序。这里是以下代码:-
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();
但我收到以下错误。我已经在 twitter 应用程序中创建了一个测试应用程序并在我的代码中使用了密钥,但我仍然知道这个错误。
OXTwitter::link O1:nTokenExchangeError: 202 "错误下载https://api.twitter.com/oauth/access_token - 服务器回复: Forbidden" "不允许客户端执行此操作 action" 登录失败
【问题讨论】: