“无法验证您的身份."- 使用 Twitter OAuth 时出错 [英] "Could not authenticate you." -error when using Twitter OAuth

查看:213
本文介绍了“无法验证您的身份."- 使用 Twitter OAuth 时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Twitter OAuth 构建我的第一个系统,但遇到了一些问题.

I'm building my first system using Twitters OAuth and have some issues.

首先,我为此使用了 Abraham 的 Twitter-class,并且我已经关注了 教程.但是,我在 callback.php 上得到了这些行:

First, I'm using Abraham's Twitter-class for this and I have followed this tutorial. However, I get these lines on my callback.php:

Warning: array_merge() [function.array-merge]: Argument #2 is not an array in C:\xampp\htdocs\twitter\twitterOAuth\OAuth.php on line 301

Warning: strtoupper() expects parameter 1 to be string, array given in C:\xampp\htdocs\twitter\twitterOAuth\OAuth.php on line 373
Oops - an error has occurred.
SimpleXMLElement Object
(
    [request] => /account/verify_credentials.xml
    [error] => Could not authenticate you.
)

这是 Twitter 级别的问题,还是我做错了什么?正如教程所说,我在 config.php 中有我的消费者密钥和消费者秘密,但我应该存储其他东西吗?

Is this problem by Twitter-class, or am I doing something wrong? I have my Consumer Key and Consumer Secret in config.php as tutorial says, but should I store something else?

玛蒂莱恩

推荐答案

Snipe.net 教程适用于较旧版本的 TwitterOAuth.请务必阅读新文档

The Snipe.net tutorial is for an older version of TwitterOAuth. Make sure you read the new documentation

http://github.com/abraham/twitteroauth/blob/master/DOCUMENTATION

总的来说,更新到新版本正在发生变化:

In general updating to the new version is changing:

$content = $to->OAuthRequest('https://twitter.com/account/verify_credentials.xml', array(), 'GET');

到:

$content = $to->get('account/verify_credentials');

这篇关于“无法验证您的身份."- 使用 Twitter OAuth 时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆