Php Laravel Thujohn Twitter API-代表用户调用该API

Php Laravel Thujohn Twitter API-代表用户调用该API,php,api,twitter,laravel-5,autologin,Php,Api,Twitter,Laravel 5,Autologin,我使用的是框架Laravel5,我使用的是Thujohn Twitter API,在我尝试代表我的用户调用API之前,一切都正常 我想获得有关用户及其令牌的信息,这是我保存到数据库中的一个秘密 首先,我从尚未更新的数据库中获取用户 $user = TwitterUser::where('last_update', '<', new DateTime('today'))->orWhere('last_update', null)->whereNotNull('oauth_toke

我使用的是框架Laravel5,我使用的是Thujohn Twitter API,在我尝试代表我的用户调用API之前,一切都正常

我想获得有关用户及其令牌的信息,这是我保存到数据库中的一个秘密

首先,我从尚未更新的数据库中获取用户

$user = TwitterUser::where('last_update', '<', new DateTime('today'))->orWhere('last_update', null)->whereNotNull('oauth_token')->first();
我无法使其工作,我收到以下错误消息:

[2015-09-01 00:12:28]local.ERROR:exception“exception”和消息“Invalid request token.”位于/home/turpialdesign/tuitherramienta/vendor/thujohn/twitter/src/thujohn/twitter/twitter.php:197


我也有同样的问题。我后来发现我存储了错误的令牌,因此在重新配置时存储了错误的令牌。如果您检查Github repo(),那么您应该存储(稍后使用)的令牌就是之后获得的令牌

$token = Twitter::getAccessToken($oauth_verifier);
因此

在我的例子中,我存储了会话中错误的部分,即

'access_token'  => Session::get('oauth_request_token'),
'token_secret' => Session::get('oauth_request_token_secret')

你有什么收获吗?
'access_token' => $token['oauth_token'],
'token_secret' => $token['oauth_token_secret']
'access_token'  => Session::get('oauth_request_token'),
'token_secret' => Session::get('oauth_request_token_secret')