drmy1050 2015-01-18 01:01
浏览 67
已采纳

Laravel Tumblr OAuth - 无法请求资源

I'm getting the following error:

Screenshot of the error

I'm using artdarek's oauth-4-laravel but there doesn't seem to be much support in the Issues area.

My code is as follows:

public function tumblrLogin()
{
    $oauth_token = Input::get( 'oauth_token' );
    $oauth_verifier = Input::get( 'oauth_verifier' );
    $tumblr = OAuth::consumer('Tumblr', 'http://30daychallenges.net/auth/tumblr/');

    if ( !empty( $oauth_token ) && !empty( $oauth_verifier ) ) 
    {
        $token = $tumblr->retrieveAccessToken('Tumblr');
        $tumblr->requestAccessToken( $oauth_token, $oauth_verifier, $token->getRequestTokenSecret() );

        $result = json_decode( $tumblr->request('user/info'), true );

        dd($result);

    }
    else 
    {
        // get request token
        $token = $tumblr->requestRequestToken();
        // get Authorization Uri sending the request token
        $url = $tumblr->getAuthorizationUri(array('oauth_token' => $token->getRequestToken()));

        return Redirect::to( (string)$url );
    }
}

The error looks like it's coming from

$token = $tumblr->requestRequestToken();

But I can't see why - anyone experienced this error before?

  • 写回答

1条回答 默认 最新

  • dongqu3623 2015-01-20 00:10
    关注

    Oh my. I feel like such an idiot.

    In /app/config/packages/artdarek/oauth-4-laravel/config.php I had the credentials in the array, however the array keys were consumer_key and consumer_secret, as Tumblr's API had suggested.

    The oauth-4-laravel package expects these to be client_id and client_secret uniformly, so this is my bad.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 请问有用MZmine处理 “Waters SYNAPT G2-Si QTOF质谱仪在MSE模式下采集的非靶向数据” 的分析教程吗
  • ¥50 opencv4nodejs 如何安装
  • ¥15 adb push异常 adb: error: 1409-byte write failed: Invalid argument
  • ¥15 nginx反向代理获取ip,java获取真实ip
  • ¥15 eda:门禁系统设计
  • ¥50 如何使用js去调用vscode-js-debugger的方法去调试网页
  • ¥15 376.1电表主站通信协议下发指令全被否认问题
  • ¥15 物体双站RCS和其组成阵列后的双站RCS关系验证
  • ¥15 复杂网络,变滞后传递熵,FDA
  • ¥20 csv格式数据集预处理及模型选择