【问题标题】:Quickblox REST API Unexpected signature on LaravelLaravel 上的 Quickblox REST API 意外签名
【发布时间】:2015-07-30 20:41:08
【问题描述】:

我从 QuickBlox REST API 收到以下 json 响应:

{
    "base": ["Unexpected signature"]
}

我的签名方法:

private function createSignature($login, $password, $timestamp, $nonce)
{
    $signatureContent = "application_id=" . env('QB_APP_ID') .
        "&auth_key=" . env('QB_APP_KEY') .
        "&nonce=" . $nonce .
        "&timestamp=" . $timestamp .
        "&user[login]=" . $login .
        "&user[password]=" . $password;

    return hash_hmac('sha1', $signatureContent, env('QB_APP_SECRET'));
}

应用程序 ID 和 Auth Key 是正确的。 $signatureContent 值(换行只是为了提高文本可读性):

application_id=24544
&auth_key=6N9bYKT-fKGRQ7q
&nonce=268302610
&timestamp=1438287989
&user[login]=tester1@test.net
&user[password]=qwer1234

当我尝试使用此参数创建会话时收到此响应:

$postBody = http_build_query([
    'application_id' => env('QB_APP_ID'),
    'auth_key' => env('QB_APP_KEY'),
    'timestamp' => $ts, // SAME VALUE ON SIGNATURE: 1438287989
    'nonce' => $nonce, // SAME VALUE ON SIGNATURE: 268302610
    'signature' => $signature,
    'user[login]' => $login,
    'user[password]' => $password
]);

// cURL Request and Response....

我的签名有什么问题?

【问题讨论】:

    标签: php android ios rest quickblox


    【解决方案1】:

    我正在创建一个新的用户注册,所以不需要 user[login] 和 user[password] 参数。登录时需要这些参数。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-08-05
      • 1970-01-01
      • 1970-01-01
      • 2016-04-25
      • 1970-01-01
      • 1970-01-01
      • 2015-09-21
      相关资源
      最近更新 更多