【问题标题】:Twitter OAuth returns 401 invalid request tokenTwitter OAuth 返回 401 无效请求令牌
【发布时间】:2017-03-14 06:43:36
【问题描述】:

我正在使用 Laravel Socialite(特别是 this),突然间,我在返回回调时得到了这个:

Received HTTP status code [401] with message "Invalid request token." when getting token credentials.

它曾经工作得很好。我试过了:

  • 在 Twitter Dev 中删除我的测试/开发应用程序,
  • 重新生成我的应用程序密钥,
  • 确保选中“启用 OAuth”选项,
  • 启用回调锁,

我完全被难住了,因为一切正常,而且看起来应该如此。

【问题讨论】:

    标签: laravel twitter oauth laravel-socialite


    【解决方案1】:

    我修复了同样的错误。 如果您修改和覆盖以下方法,您将工作。

    SocialiteProviders\Manager\OAuth1\Server::getTokenCredentials()

    //$response = $client->post($uri, $headers, $bodyParameters)->send();
    $response = $client->post($uri, [
                    'headers' => $headers,
                    'form_params' => $bodyParameters,
    ]);
    

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-04-10
    • 2013-08-10
    • 2019-02-21
    • 2017-10-16
    • 1970-01-01
    • 2012-06-22
    • 1970-01-01
    相关资源
    最近更新 更多